metanorma-iho 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89f4d78fff78d82fbb04bdc8f23c5cfa59ba4a55b13981bd38345e8a4b20be5c
4
- data.tar.gz: c1ef6f2e6316b4aa97b080d4c5c0fb4d28f2c5b5539b329b732fcd74dcb5363f
3
+ metadata.gz: feaa81d999397ab1cd7997c850adc7dfbf3892ef9bc3632031d828e2b6e071f5
4
+ data.tar.gz: 0c8ab6720bcaee82f607fe41b4767f7ee50b6210ba198afedbd3c9d65ee3d1f8
5
5
  SHA512:
6
- metadata.gz: 3d3a8f209c5355bcb090c191cd3028f32de38992fbe6c84e925cb1060595d674b757fe010c94ca49f8478ebfc444ae3a222619430b553aaeb2ad09bbcee04327
7
- data.tar.gz: 1ff636f8767fc2ce1b8fa9fad81566fe971f03d29b41dbf67193ae905baa1373981af7f67b4f31182255d043f14822d19b935bd64489fa0755ecdd32452d4209
6
+ metadata.gz: 348c23c9d94093e15a953a452cdea8d4adcf07626542e254d1841bcc1b8afc8db274d5f1293eb977b26a43d71504ba71912621e391933e02fc2ceea344c78fe8
7
+ data.tar.gz: 2fe5491d17065532f96be13ec0218a7d5852f2cc28e79fe7d9cd71a71eccdb4873d762ff93dffcdd13a5aa24563f63348b23f42ee6f2c6abdac1687757520542
@@ -831,6 +831,9 @@
831
831
  <xsl:variable name="title">
832
832
  <xsl:call-template name="getName"/>
833
833
  </xsl:variable>
834
+ <xsl:variable name="variant_title">
835
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
836
+ </xsl:variable>
834
837
 
835
838
  <xsl:variable name="type">
836
839
  <xsl:value-of select="local-name()"/>
@@ -846,7 +849,14 @@
846
849
  <xsl:attribute name="level">1</xsl:attribute>
847
850
  </xsl:if>
848
851
  <mnx:title>
849
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
852
+ <xsl:choose>
853
+ <xsl:when test="normalize-space($variant_title) != ''">
854
+ <xsl:apply-templates select="xalan:nodeset($variant_title)" mode="contents_item"/>
855
+ </xsl:when>
856
+ <xsl:otherwise>
857
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
858
+ </xsl:otherwise>
859
+ </xsl:choose>
850
860
  </mnx:title>
851
861
  <xsl:if test="$type != 'indexsect'">
852
862
  <xsl:apply-templates mode="contents"/>
@@ -1813,7 +1823,24 @@
1813
1823
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
1814
1824
 
1815
1825
  <!-- remove image/emf -->
1816
- <xsl:template match="mn:image/mn:emf" mode="update_xml_step1"/>
1826
+ <xsl:template match="mn:image//mn:emf" mode="update_xml_step1"/>
1827
+
1828
+ <!-- https://github.com/metanorma/metanorma/issues/540 -->
1829
+ <xsl:template match="mn:image[mn:altsource]" priority="3" mode="update_xml_step1">
1830
+ <xsl:copy>
1831
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
1832
+ <xsl:choose>
1833
+ <xsl:when test="mn:altsource[contains(@tag, 'pdf')]">
1834
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/@*" mode="update_xml_step1"/>
1835
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/node()" mode="update_xml_step1"/>
1836
+ </xsl:when>
1837
+ <xsl:otherwise>
1838
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/@*" mode="update_xml_step1"/>
1839
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/node()" mode="update_xml_step1"/>
1840
+ </xsl:otherwise>
1841
+ </xsl:choose>
1842
+ </xsl:copy>
1843
+ </xsl:template>
1817
1844
 
1818
1845
  <!-- remove preprocess-xslt -->
1819
1846
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -2041,6 +2068,15 @@
2041
2068
  </xsl:choose>
2042
2069
  </xsl:template>
2043
2070
 
2071
+ <!-- https://github.com/metanorma/metanorma-iso/issues/1535 -->
2072
+ <xsl:template match="mn:ol[mn:fmt-ol]" mode="update_xml_step1">
2073
+ <xsl:apply-templates select="mn:fmt-ol" mode="update_xml_step1"/>
2074
+ </xsl:template>
2075
+
2076
+ <xsl:template match="mn:ul[mn:fmt-ul]" mode="update_xml_step1">
2077
+ <xsl:apply-templates select="mn:fmt-ul" mode="update_xml_step1"/>
2078
+ </xsl:template>
2079
+
2044
2080
  <!-- li/fmt-name -->
2045
2081
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
2046
2082
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -5304,6 +5340,8 @@
5304
5340
  <xsl:param name="margin-side"/>
5305
5341
 
5306
5342
  <xsl:call-template name="setBordersTableArray"/>
5343
+
5344
+ <xsl:call-template name="setNoBordersForTableList"/>
5307
5345
  </xsl:template> <!-- refine_table-style -->
5308
5346
 
5309
5347
  <xsl:attribute-set name="table-number-style">
@@ -5341,12 +5379,16 @@
5341
5379
  <xsl:template name="refine_table-header-row-style">
5342
5380
 
5343
5381
  <xsl:call-template name="setBordersTableArray"/>
5382
+
5383
+ <xsl:call-template name="setNoBordersForTableList"/>
5344
5384
  </xsl:template> <!-- refine_table-header-row-style -->
5345
5385
 
5346
5386
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
5347
5387
  </xsl:attribute-set>
5348
5388
 
5349
5389
  <xsl:template name="refine_table-footer-row-style">
5390
+
5391
+ <xsl:call-template name="setNoBordersForTableList"/>
5350
5392
  </xsl:template> <!-- refine_table-footer-row-style -->
5351
5393
 
5352
5394
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -5356,6 +5398,8 @@
5356
5398
  <xsl:template name="refine_table-body-row-style">
5357
5399
 
5358
5400
  <xsl:call-template name="setBordersTableArray"/>
5401
+
5402
+ <xsl:call-template name="setNoBordersForTableList"/>
5359
5403
  </xsl:template> <!-- refine_table-body-row-style -->
5360
5404
 
5361
5405
  <xsl:attribute-set name="table-header-cell-style">
@@ -5379,6 +5423,16 @@
5379
5423
  </xsl:if>
5380
5424
 
5381
5425
  <xsl:call-template name="setTableCellAttributes"/>
5426
+
5427
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5428
+ <xsl:attribute name="display-align">before</xsl:attribute>
5429
+ <xsl:attribute name="text-align">left</xsl:attribute>
5430
+ <xsl:if test="following-sibling::*">
5431
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5432
+ </xsl:if>
5433
+ <xsl:call-template name="setNoBordersForTableList"/>
5434
+ </xsl:if>
5435
+
5382
5436
  </xsl:template> <!-- refine_table-header-cell-style -->
5383
5437
 
5384
5438
  <xsl:attribute-set name="table-cell-style">
@@ -5403,6 +5457,15 @@
5403
5457
 
5404
5458
  <xsl:call-template name="setBordersTableArray"/>
5405
5459
 
5460
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5461
+ <xsl:attribute name="display-align">before</xsl:attribute>
5462
+ <xsl:attribute name="text-align">left</xsl:attribute>
5463
+ <xsl:if test="following-sibling::*">
5464
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5465
+ </xsl:if>
5466
+ <xsl:call-template name="setNoBordersForTableList"/>
5467
+ </xsl:if>
5468
+
5406
5469
  </xsl:template> <!-- refine_table-cell-style -->
5407
5470
 
5408
5471
  <xsl:attribute-set name="table-footer-cell-style">
@@ -5414,6 +5477,8 @@
5414
5477
  </xsl:attribute-set> <!-- table-footer-cell-style -->
5415
5478
 
5416
5479
  <xsl:template name="refine_table-footer-cell-style">
5480
+
5481
+ <xsl:call-template name="setNoBordersForTableList"/>
5417
5482
  </xsl:template> <!-- refine_table-footer-cell-style -->
5418
5483
 
5419
5484
  <xsl:attribute-set name="table-note-style">
@@ -5455,6 +5520,16 @@
5455
5520
  <xsl:template name="refine_table-fn-body-style">
5456
5521
  </xsl:template>
5457
5522
 
5523
+ <xsl:template name="setNoBordersForTableList">
5524
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5525
+ <xsl:attribute name="border">none</xsl:attribute>
5526
+ <xsl:attribute name="border-top">none</xsl:attribute>
5527
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
5528
+ <xsl:attribute name="border-left">none</xsl:attribute>
5529
+ <xsl:attribute name="border-right">none</xsl:attribute>
5530
+ </xsl:if>
5531
+ </xsl:template>
5532
+
5458
5533
  <!-- ========================== -->
5459
5534
  <!-- END Table styles -->
5460
5535
  <!-- ========================== -->
@@ -11017,6 +11092,10 @@
11017
11092
  </fo:list-item>
11018
11093
  </xsl:template>
11019
11094
 
11095
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
11096
+ <xsl:apply-templates/>
11097
+ </xsl:template>
11098
+
11020
11099
  <!-- ===================================== -->
11021
11100
  <!-- END Lists processing -->
11022
11101
  <!-- ===================================== -->
@@ -831,6 +831,9 @@
831
831
  <xsl:variable name="title">
832
832
  <xsl:call-template name="getName"/>
833
833
  </xsl:variable>
834
+ <xsl:variable name="variant_title">
835
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
836
+ </xsl:variable>
834
837
 
835
838
  <xsl:variable name="type">
836
839
  <xsl:value-of select="local-name()"/>
@@ -846,7 +849,14 @@
846
849
  <xsl:attribute name="level">1</xsl:attribute>
847
850
  </xsl:if>
848
851
  <mnx:title>
849
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
852
+ <xsl:choose>
853
+ <xsl:when test="normalize-space($variant_title) != ''">
854
+ <xsl:apply-templates select="xalan:nodeset($variant_title)" mode="contents_item"/>
855
+ </xsl:when>
856
+ <xsl:otherwise>
857
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
858
+ </xsl:otherwise>
859
+ </xsl:choose>
850
860
  </mnx:title>
851
861
  <xsl:if test="$type != 'indexsect'">
852
862
  <xsl:apply-templates mode="contents"/>
@@ -1813,7 +1823,24 @@
1813
1823
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
1814
1824
 
1815
1825
  <!-- remove image/emf -->
1816
- <xsl:template match="mn:image/mn:emf" mode="update_xml_step1"/>
1826
+ <xsl:template match="mn:image//mn:emf" mode="update_xml_step1"/>
1827
+
1828
+ <!-- https://github.com/metanorma/metanorma/issues/540 -->
1829
+ <xsl:template match="mn:image[mn:altsource]" priority="3" mode="update_xml_step1">
1830
+ <xsl:copy>
1831
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
1832
+ <xsl:choose>
1833
+ <xsl:when test="mn:altsource[contains(@tag, 'pdf')]">
1834
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/@*" mode="update_xml_step1"/>
1835
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/node()" mode="update_xml_step1"/>
1836
+ </xsl:when>
1837
+ <xsl:otherwise>
1838
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/@*" mode="update_xml_step1"/>
1839
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/node()" mode="update_xml_step1"/>
1840
+ </xsl:otherwise>
1841
+ </xsl:choose>
1842
+ </xsl:copy>
1843
+ </xsl:template>
1817
1844
 
1818
1845
  <!-- remove preprocess-xslt -->
1819
1846
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -2041,6 +2068,15 @@
2041
2068
  </xsl:choose>
2042
2069
  </xsl:template>
2043
2070
 
2071
+ <!-- https://github.com/metanorma/metanorma-iso/issues/1535 -->
2072
+ <xsl:template match="mn:ol[mn:fmt-ol]" mode="update_xml_step1">
2073
+ <xsl:apply-templates select="mn:fmt-ol" mode="update_xml_step1"/>
2074
+ </xsl:template>
2075
+
2076
+ <xsl:template match="mn:ul[mn:fmt-ul]" mode="update_xml_step1">
2077
+ <xsl:apply-templates select="mn:fmt-ul" mode="update_xml_step1"/>
2078
+ </xsl:template>
2079
+
2044
2080
  <!-- li/fmt-name -->
2045
2081
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
2046
2082
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -5304,6 +5340,8 @@
5304
5340
  <xsl:param name="margin-side"/>
5305
5341
 
5306
5342
  <xsl:call-template name="setBordersTableArray"/>
5343
+
5344
+ <xsl:call-template name="setNoBordersForTableList"/>
5307
5345
  </xsl:template> <!-- refine_table-style -->
5308
5346
 
5309
5347
  <xsl:attribute-set name="table-number-style">
@@ -5341,12 +5379,16 @@
5341
5379
  <xsl:template name="refine_table-header-row-style">
5342
5380
 
5343
5381
  <xsl:call-template name="setBordersTableArray"/>
5382
+
5383
+ <xsl:call-template name="setNoBordersForTableList"/>
5344
5384
  </xsl:template> <!-- refine_table-header-row-style -->
5345
5385
 
5346
5386
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
5347
5387
  </xsl:attribute-set>
5348
5388
 
5349
5389
  <xsl:template name="refine_table-footer-row-style">
5390
+
5391
+ <xsl:call-template name="setNoBordersForTableList"/>
5350
5392
  </xsl:template> <!-- refine_table-footer-row-style -->
5351
5393
 
5352
5394
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -5356,6 +5398,8 @@
5356
5398
  <xsl:template name="refine_table-body-row-style">
5357
5399
 
5358
5400
  <xsl:call-template name="setBordersTableArray"/>
5401
+
5402
+ <xsl:call-template name="setNoBordersForTableList"/>
5359
5403
  </xsl:template> <!-- refine_table-body-row-style -->
5360
5404
 
5361
5405
  <xsl:attribute-set name="table-header-cell-style">
@@ -5379,6 +5423,16 @@
5379
5423
  </xsl:if>
5380
5424
 
5381
5425
  <xsl:call-template name="setTableCellAttributes"/>
5426
+
5427
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5428
+ <xsl:attribute name="display-align">before</xsl:attribute>
5429
+ <xsl:attribute name="text-align">left</xsl:attribute>
5430
+ <xsl:if test="following-sibling::*">
5431
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5432
+ </xsl:if>
5433
+ <xsl:call-template name="setNoBordersForTableList"/>
5434
+ </xsl:if>
5435
+
5382
5436
  </xsl:template> <!-- refine_table-header-cell-style -->
5383
5437
 
5384
5438
  <xsl:attribute-set name="table-cell-style">
@@ -5403,6 +5457,15 @@
5403
5457
 
5404
5458
  <xsl:call-template name="setBordersTableArray"/>
5405
5459
 
5460
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5461
+ <xsl:attribute name="display-align">before</xsl:attribute>
5462
+ <xsl:attribute name="text-align">left</xsl:attribute>
5463
+ <xsl:if test="following-sibling::*">
5464
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5465
+ </xsl:if>
5466
+ <xsl:call-template name="setNoBordersForTableList"/>
5467
+ </xsl:if>
5468
+
5406
5469
  </xsl:template> <!-- refine_table-cell-style -->
5407
5470
 
5408
5471
  <xsl:attribute-set name="table-footer-cell-style">
@@ -5414,6 +5477,8 @@
5414
5477
  </xsl:attribute-set> <!-- table-footer-cell-style -->
5415
5478
 
5416
5479
  <xsl:template name="refine_table-footer-cell-style">
5480
+
5481
+ <xsl:call-template name="setNoBordersForTableList"/>
5417
5482
  </xsl:template> <!-- refine_table-footer-cell-style -->
5418
5483
 
5419
5484
  <xsl:attribute-set name="table-note-style">
@@ -5455,6 +5520,16 @@
5455
5520
  <xsl:template name="refine_table-fn-body-style">
5456
5521
  </xsl:template>
5457
5522
 
5523
+ <xsl:template name="setNoBordersForTableList">
5524
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5525
+ <xsl:attribute name="border">none</xsl:attribute>
5526
+ <xsl:attribute name="border-top">none</xsl:attribute>
5527
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
5528
+ <xsl:attribute name="border-left">none</xsl:attribute>
5529
+ <xsl:attribute name="border-right">none</xsl:attribute>
5530
+ </xsl:if>
5531
+ </xsl:template>
5532
+
5458
5533
  <!-- ========================== -->
5459
5534
  <!-- END Table styles -->
5460
5535
  <!-- ========================== -->
@@ -11017,6 +11092,10 @@
11017
11092
  </fo:list-item>
11018
11093
  </xsl:template>
11019
11094
 
11095
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
11096
+ <xsl:apply-templates/>
11097
+ </xsl:template>
11098
+
11020
11099
  <!-- ===================================== -->
11021
11100
  <!-- END Lists processing -->
11022
11101
  <!-- ===================================== -->
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.3.2".freeze
3
+ VERSION = "1.3.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-16 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic