metanorma-iho 1.3.1 → 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: bd91bca1affde13d0edf0acf7db254eb0f4d45c9d43397ab61f49d4d37b8e2e1
4
- data.tar.gz: 582c1a9da35f75f490dcb0824288a0d04666d9d376f70475857a0ee4f537c5e8
3
+ metadata.gz: feaa81d999397ab1cd7997c850adc7dfbf3892ef9bc3632031d828e2b6e071f5
4
+ data.tar.gz: 0c8ab6720bcaee82f607fe41b4767f7ee50b6210ba198afedbd3c9d65ee3d1f8
5
5
  SHA512:
6
- metadata.gz: f16ef755f1e017093eaf302d14abedf6fb3fe7a3cdb49f4621bcb1c69168f73a41c1e4d44e5dd2042e06b954824fffaf1b401410298620993ef85181959eeb09
7
- data.tar.gz: 229df1ee20916f0d1adbeef3a8f12ea2bdd3d61a0a46b7271928111d0965e043613cf1b70f9818bf5ddf9347a78a2a5ff6f43231532a8bad88aeafbbfc86212c
6
+ metadata.gz: 348c23c9d94093e15a953a452cdea8d4adcf07626542e254d1841bcc1b8afc8db274d5f1293eb977b26a43d71504ba71912621e391933e02fc2ceea344c78fe8
7
+ data.tar.gz: 2fe5491d17065532f96be13ec0218a7d5852f2cc28e79fe7d9cd71a71eccdb4873d762ff93dffcdd13a5aa24563f63348b23f42ee6f2c6abdac1687757520542
@@ -319,6 +319,11 @@ svg {
319
319
  display: block; /* ← removes unwanted inline spacing */
320
320
  }
321
321
 
322
+ /* style dfn by override in flavor */
323
+ dfn {
324
+ font-style: inherit;
325
+ }
326
+
322
327
  #standard-band {
323
328
  background-color: #0AC442;
324
329
  }
@@ -249,7 +249,8 @@
249
249
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
250
250
 
251
251
  <!-- Preface Pages -->
252
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
252
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
253
+ <xsl:call-template name="refine_page-sequence-preface"/>
253
254
 
254
255
  <xsl:attribute name="master-reference">
255
256
  <xsl:text>preface</xsl:text>
@@ -298,12 +299,8 @@
298
299
  <xsl:for-each select=".//mn:page_sequence[mn:foreword or mn:introduction][parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
299
300
 
300
301
  <!-- Preface Pages -->
301
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
302
-
303
- <xsl:attribute name="master-reference">
304
- <xsl:text>preface</xsl:text>
305
- <xsl:call-template name="getPageSequenceOrientation"/>
306
- </xsl:attribute>
302
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
303
+ <xsl:call-template name="refine_page-sequence-preface"/>
307
304
 
308
305
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
309
306
  <xsl:call-template name="insertHeaderFooter">
@@ -334,20 +331,8 @@
334
331
 
335
332
  <xsl:if test="xalan:nodeset($page_sequence_content)/node()">
336
333
 
337
- <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
338
-
339
- <xsl:attribute name="master-reference">
340
- <xsl:text>document</xsl:text>
341
- <xsl:call-template name="getPageSequenceOrientation"/>
342
- </xsl:attribute>
343
-
344
- <xsl:if test="mn:indexsect">
345
- <xsl:attribute name="master-reference">index</xsl:attribute>
346
- </xsl:if>
347
-
348
- <xsl:if test="position() = 1">
349
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
350
- </xsl:if>
334
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
335
+ <xsl:call-template name="refine_page-sequence-main"/>
351
336
 
352
337
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
353
338
  <xsl:call-template name="insertHeaderFooter">
@@ -681,7 +666,7 @@
681
666
  </xsl:call-template>
682
667
  <xsl:apply-templates select="." mode="contents"/>
683
668
  <fo:inline keep-together.within-line="always">
684
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
669
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
685
670
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
686
671
  </fo:inline>
687
672
  </fo:basic-link>
@@ -760,7 +745,7 @@
760
745
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
761
746
  <xsl:apply-templates select="mnx:title"/>
762
747
  <fo:inline keep-together.within-line="always">
763
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
748
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
764
749
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
765
750
  </fo:inline>
766
751
  </fo:basic-link>
@@ -846,6 +831,9 @@
846
831
  <xsl:variable name="title">
847
832
  <xsl:call-template name="getName"/>
848
833
  </xsl:variable>
834
+ <xsl:variable name="variant_title">
835
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
836
+ </xsl:variable>
849
837
 
850
838
  <xsl:variable name="type">
851
839
  <xsl:value-of select="local-name()"/>
@@ -861,7 +849,14 @@
861
849
  <xsl:attribute name="level">1</xsl:attribute>
862
850
  </xsl:if>
863
851
  <mnx:title>
864
- <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>
865
860
  </mnx:title>
866
861
  <xsl:if test="$type != 'indexsect'">
867
862
  <xsl:apply-templates mode="contents"/>
@@ -1489,20 +1484,42 @@
1489
1484
  </xsl:variable>
1490
1485
 
1491
1486
  <xsl:attribute-set name="page-sequence-preface">
1487
+ <xsl:attribute name="master-reference">preface</xsl:attribute>
1492
1488
  <xsl:attribute name="format">i</xsl:attribute>
1493
- </xsl:attribute-set>
1489
+ <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
1490
+ </xsl:attribute-set> <!-- page-sequence-preface -->
1494
1491
 
1495
1492
  <xsl:template name="refine_page-sequence-preface">
1496
1493
  <xsl:param name="layoutVersion"/>
1497
- </xsl:template>
1494
+ <xsl:param name="doctype"/>
1495
+ <xsl:param name="num"/>
1496
+ <xsl:param name="skip_force_page_count">false</xsl:param>
1497
+ <xsl:attribute name="master-reference">
1498
+ <xsl:text>preface</xsl:text>
1499
+ <xsl:call-template name="getPageSequenceOrientation"/>
1500
+ </xsl:attribute>
1501
+ </xsl:template> <!-- refine_page-sequence-preface -->
1498
1502
 
1499
1503
  <xsl:attribute-set name="page-sequence-main">
1500
-
1501
- </xsl:attribute-set>
1504
+ <xsl:attribute name="master-reference">document</xsl:attribute>
1505
+ <xsl:attribute name="format">1</xsl:attribute>
1506
+ <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
1507
+ </xsl:attribute-set> <!-- page-sequence-main -->
1502
1508
 
1503
1509
  <xsl:template name="refine_page-sequence-main">
1504
1510
  <xsl:param name="layoutVersion"/>
1505
- </xsl:template>
1511
+ <xsl:param name="doctype"/>
1512
+ <xsl:attribute name="master-reference">
1513
+ <xsl:text>document</xsl:text>
1514
+ <xsl:call-template name="getPageSequenceOrientation"/>
1515
+ </xsl:attribute>
1516
+ <xsl:if test="mn:indexsect">
1517
+ <xsl:attribute name="master-reference">index</xsl:attribute>
1518
+ </xsl:if>
1519
+ <xsl:if test="position() = 1">
1520
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
1521
+ </xsl:if>
1522
+ </xsl:template> <!-- refine_page-sequence-main -->
1506
1523
 
1507
1524
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
1508
1525
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -1806,7 +1823,24 @@
1806
1823
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
1807
1824
 
1808
1825
  <!-- remove image/emf -->
1809
- <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>
1810
1844
 
1811
1845
  <!-- remove preprocess-xslt -->
1812
1846
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -2034,6 +2068,15 @@
2034
2068
  </xsl:choose>
2035
2069
  </xsl:template>
2036
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
+
2037
2080
  <!-- li/fmt-name -->
2038
2081
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
2039
2082
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -5297,6 +5340,8 @@
5297
5340
  <xsl:param name="margin-side"/>
5298
5341
 
5299
5342
  <xsl:call-template name="setBordersTableArray"/>
5343
+
5344
+ <xsl:call-template name="setNoBordersForTableList"/>
5300
5345
  </xsl:template> <!-- refine_table-style -->
5301
5346
 
5302
5347
  <xsl:attribute-set name="table-number-style">
@@ -5334,12 +5379,16 @@
5334
5379
  <xsl:template name="refine_table-header-row-style">
5335
5380
 
5336
5381
  <xsl:call-template name="setBordersTableArray"/>
5382
+
5383
+ <xsl:call-template name="setNoBordersForTableList"/>
5337
5384
  </xsl:template> <!-- refine_table-header-row-style -->
5338
5385
 
5339
5386
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
5340
5387
  </xsl:attribute-set>
5341
5388
 
5342
5389
  <xsl:template name="refine_table-footer-row-style">
5390
+
5391
+ <xsl:call-template name="setNoBordersForTableList"/>
5343
5392
  </xsl:template> <!-- refine_table-footer-row-style -->
5344
5393
 
5345
5394
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -5349,6 +5398,8 @@
5349
5398
  <xsl:template name="refine_table-body-row-style">
5350
5399
 
5351
5400
  <xsl:call-template name="setBordersTableArray"/>
5401
+
5402
+ <xsl:call-template name="setNoBordersForTableList"/>
5352
5403
  </xsl:template> <!-- refine_table-body-row-style -->
5353
5404
 
5354
5405
  <xsl:attribute-set name="table-header-cell-style">
@@ -5372,6 +5423,16 @@
5372
5423
  </xsl:if>
5373
5424
 
5374
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
+
5375
5436
  </xsl:template> <!-- refine_table-header-cell-style -->
5376
5437
 
5377
5438
  <xsl:attribute-set name="table-cell-style">
@@ -5396,6 +5457,15 @@
5396
5457
 
5397
5458
  <xsl:call-template name="setBordersTableArray"/>
5398
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
+
5399
5469
  </xsl:template> <!-- refine_table-cell-style -->
5400
5470
 
5401
5471
  <xsl:attribute-set name="table-footer-cell-style">
@@ -5407,6 +5477,8 @@
5407
5477
  </xsl:attribute-set> <!-- table-footer-cell-style -->
5408
5478
 
5409
5479
  <xsl:template name="refine_table-footer-cell-style">
5480
+
5481
+ <xsl:call-template name="setNoBordersForTableList"/>
5410
5482
  </xsl:template> <!-- refine_table-footer-cell-style -->
5411
5483
 
5412
5484
  <xsl:attribute-set name="table-note-style">
@@ -5448,6 +5520,16 @@
5448
5520
  <xsl:template name="refine_table-fn-body-style">
5449
5521
  </xsl:template>
5450
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
+
5451
5533
  <!-- ========================== -->
5452
5534
  <!-- END Table styles -->
5453
5535
  <!-- ========================== -->
@@ -11010,6 +11092,10 @@
11010
11092
  </fo:list-item>
11011
11093
  </xsl:template>
11012
11094
 
11095
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
11096
+ <xsl:apply-templates/>
11097
+ </xsl:template>
11098
+
11013
11099
  <!-- ===================================== -->
11014
11100
  <!-- END Lists processing -->
11015
11101
  <!-- ===================================== -->
@@ -12311,6 +12397,7 @@
12311
12397
  </xsl:attribute-set>
12312
12398
 
12313
12399
  <xsl:template name="refine_toc-style">
12400
+ <xsl:copy-of select="@id"/>
12314
12401
  </xsl:template>
12315
12402
 
12316
12403
  <xsl:attribute-set name="toc-title-style">
@@ -12429,13 +12516,13 @@
12429
12516
 
12430
12517
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12431
12518
  <xsl:variable name="nodes_preface_">
12432
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12519
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12433
12520
  <node id="{@id}"/>
12434
12521
  </xsl:for-each>
12435
12522
  </xsl:variable>
12436
12523
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
12437
12524
 
12438
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12525
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12439
12526
  <xsl:sort select="@displayorder" data-type="number"/>
12440
12527
 
12441
12528
  <!-- process Section's title -->
@@ -12448,6 +12535,23 @@
12448
12535
  </xsl:for-each>
12449
12536
  </xsl:template>
12450
12537
 
12538
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
12539
+ <xsl:variable name="title">
12540
+ <xsl:call-template name="getName"/>
12541
+ </xsl:variable>
12542
+ <xsl:variable name="root">
12543
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
12544
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
12545
+ </xsl:variable>
12546
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
12547
+ <mnx:title>
12548
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
12549
+ <xsl:with-param name="element" select="$root"/>
12550
+ </xsl:apply-templates>
12551
+ </mnx:title>
12552
+ </mnx:item>
12553
+ </xsl:template>
12554
+
12451
12555
  <xsl:template name="processMainSectionsDefault_Contents">
12452
12556
 
12453
12557
  <xsl:variable name="nodes_sections_">
@@ -14289,16 +14393,17 @@
14289
14393
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
14290
14394
  <xsl:template name="insert_basic_link">
14291
14395
  <xsl:param name="element"/>
14396
+ <xsl:param name="wrapper">true</xsl:param>
14292
14397
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
14293
14398
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
14294
14399
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
14295
14400
  <xsl:choose>
14296
- <xsl:when test="$internal-destination = 'true'">
14401
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
14297
14402
  <fo:wrapper role="Reference">
14298
14403
  <xsl:copy-of select="$element_node"/>
14299
14404
  </fo:wrapper>
14300
14405
  </xsl:when>
14301
- <xsl:when test="$external-destination = 'true'">
14406
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
14302
14407
  <xsl:copy-of select="$element_node"/>
14303
14408
  </xsl:when>
14304
14409
  <xsl:otherwise>
@@ -249,7 +249,8 @@
249
249
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
250
250
 
251
251
  <!-- Preface Pages -->
252
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
252
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
253
+ <xsl:call-template name="refine_page-sequence-preface"/>
253
254
 
254
255
  <xsl:attribute name="master-reference">
255
256
  <xsl:text>preface</xsl:text>
@@ -298,12 +299,8 @@
298
299
  <xsl:for-each select=".//mn:page_sequence[mn:foreword or mn:introduction][parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
299
300
 
300
301
  <!-- Preface Pages -->
301
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
302
-
303
- <xsl:attribute name="master-reference">
304
- <xsl:text>preface</xsl:text>
305
- <xsl:call-template name="getPageSequenceOrientation"/>
306
- </xsl:attribute>
302
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
303
+ <xsl:call-template name="refine_page-sequence-preface"/>
307
304
 
308
305
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
309
306
  <xsl:call-template name="insertHeaderFooter">
@@ -334,20 +331,8 @@
334
331
 
335
332
  <xsl:if test="xalan:nodeset($page_sequence_content)/node()">
336
333
 
337
- <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
338
-
339
- <xsl:attribute name="master-reference">
340
- <xsl:text>document</xsl:text>
341
- <xsl:call-template name="getPageSequenceOrientation"/>
342
- </xsl:attribute>
343
-
344
- <xsl:if test="mn:indexsect">
345
- <xsl:attribute name="master-reference">index</xsl:attribute>
346
- </xsl:if>
347
-
348
- <xsl:if test="position() = 1">
349
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
350
- </xsl:if>
334
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
335
+ <xsl:call-template name="refine_page-sequence-main"/>
351
336
 
352
337
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
353
338
  <xsl:call-template name="insertHeaderFooter">
@@ -681,7 +666,7 @@
681
666
  </xsl:call-template>
682
667
  <xsl:apply-templates select="." mode="contents"/>
683
668
  <fo:inline keep-together.within-line="always">
684
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
669
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
685
670
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
686
671
  </fo:inline>
687
672
  </fo:basic-link>
@@ -760,7 +745,7 @@
760
745
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
761
746
  <xsl:apply-templates select="mnx:title"/>
762
747
  <fo:inline keep-together.within-line="always">
763
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
748
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
764
749
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
765
750
  </fo:inline>
766
751
  </fo:basic-link>
@@ -846,6 +831,9 @@
846
831
  <xsl:variable name="title">
847
832
  <xsl:call-template name="getName"/>
848
833
  </xsl:variable>
834
+ <xsl:variable name="variant_title">
835
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
836
+ </xsl:variable>
849
837
 
850
838
  <xsl:variable name="type">
851
839
  <xsl:value-of select="local-name()"/>
@@ -861,7 +849,14 @@
861
849
  <xsl:attribute name="level">1</xsl:attribute>
862
850
  </xsl:if>
863
851
  <mnx:title>
864
- <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>
865
860
  </mnx:title>
866
861
  <xsl:if test="$type != 'indexsect'">
867
862
  <xsl:apply-templates mode="contents"/>
@@ -1489,20 +1484,42 @@
1489
1484
  </xsl:variable>
1490
1485
 
1491
1486
  <xsl:attribute-set name="page-sequence-preface">
1487
+ <xsl:attribute name="master-reference">preface</xsl:attribute>
1492
1488
  <xsl:attribute name="format">i</xsl:attribute>
1493
- </xsl:attribute-set>
1489
+ <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
1490
+ </xsl:attribute-set> <!-- page-sequence-preface -->
1494
1491
 
1495
1492
  <xsl:template name="refine_page-sequence-preface">
1496
1493
  <xsl:param name="layoutVersion"/>
1497
- </xsl:template>
1494
+ <xsl:param name="doctype"/>
1495
+ <xsl:param name="num"/>
1496
+ <xsl:param name="skip_force_page_count">false</xsl:param>
1497
+ <xsl:attribute name="master-reference">
1498
+ <xsl:text>preface</xsl:text>
1499
+ <xsl:call-template name="getPageSequenceOrientation"/>
1500
+ </xsl:attribute>
1501
+ </xsl:template> <!-- refine_page-sequence-preface -->
1498
1502
 
1499
1503
  <xsl:attribute-set name="page-sequence-main">
1500
-
1501
- </xsl:attribute-set>
1504
+ <xsl:attribute name="master-reference">document</xsl:attribute>
1505
+ <xsl:attribute name="format">1</xsl:attribute>
1506
+ <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
1507
+ </xsl:attribute-set> <!-- page-sequence-main -->
1502
1508
 
1503
1509
  <xsl:template name="refine_page-sequence-main">
1504
1510
  <xsl:param name="layoutVersion"/>
1505
- </xsl:template>
1511
+ <xsl:param name="doctype"/>
1512
+ <xsl:attribute name="master-reference">
1513
+ <xsl:text>document</xsl:text>
1514
+ <xsl:call-template name="getPageSequenceOrientation"/>
1515
+ </xsl:attribute>
1516
+ <xsl:if test="mn:indexsect">
1517
+ <xsl:attribute name="master-reference">index</xsl:attribute>
1518
+ </xsl:if>
1519
+ <xsl:if test="position() = 1">
1520
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
1521
+ </xsl:if>
1522
+ </xsl:template> <!-- refine_page-sequence-main -->
1506
1523
 
1507
1524
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
1508
1525
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -1806,7 +1823,24 @@
1806
1823
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
1807
1824
 
1808
1825
  <!-- remove image/emf -->
1809
- <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>
1810
1844
 
1811
1845
  <!-- remove preprocess-xslt -->
1812
1846
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -2034,6 +2068,15 @@
2034
2068
  </xsl:choose>
2035
2069
  </xsl:template>
2036
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
+
2037
2080
  <!-- li/fmt-name -->
2038
2081
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
2039
2082
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -5297,6 +5340,8 @@
5297
5340
  <xsl:param name="margin-side"/>
5298
5341
 
5299
5342
  <xsl:call-template name="setBordersTableArray"/>
5343
+
5344
+ <xsl:call-template name="setNoBordersForTableList"/>
5300
5345
  </xsl:template> <!-- refine_table-style -->
5301
5346
 
5302
5347
  <xsl:attribute-set name="table-number-style">
@@ -5334,12 +5379,16 @@
5334
5379
  <xsl:template name="refine_table-header-row-style">
5335
5380
 
5336
5381
  <xsl:call-template name="setBordersTableArray"/>
5382
+
5383
+ <xsl:call-template name="setNoBordersForTableList"/>
5337
5384
  </xsl:template> <!-- refine_table-header-row-style -->
5338
5385
 
5339
5386
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
5340
5387
  </xsl:attribute-set>
5341
5388
 
5342
5389
  <xsl:template name="refine_table-footer-row-style">
5390
+
5391
+ <xsl:call-template name="setNoBordersForTableList"/>
5343
5392
  </xsl:template> <!-- refine_table-footer-row-style -->
5344
5393
 
5345
5394
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -5349,6 +5398,8 @@
5349
5398
  <xsl:template name="refine_table-body-row-style">
5350
5399
 
5351
5400
  <xsl:call-template name="setBordersTableArray"/>
5401
+
5402
+ <xsl:call-template name="setNoBordersForTableList"/>
5352
5403
  </xsl:template> <!-- refine_table-body-row-style -->
5353
5404
 
5354
5405
  <xsl:attribute-set name="table-header-cell-style">
@@ -5372,6 +5423,16 @@
5372
5423
  </xsl:if>
5373
5424
 
5374
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
+
5375
5436
  </xsl:template> <!-- refine_table-header-cell-style -->
5376
5437
 
5377
5438
  <xsl:attribute-set name="table-cell-style">
@@ -5396,6 +5457,15 @@
5396
5457
 
5397
5458
  <xsl:call-template name="setBordersTableArray"/>
5398
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
+
5399
5469
  </xsl:template> <!-- refine_table-cell-style -->
5400
5470
 
5401
5471
  <xsl:attribute-set name="table-footer-cell-style">
@@ -5407,6 +5477,8 @@
5407
5477
  </xsl:attribute-set> <!-- table-footer-cell-style -->
5408
5478
 
5409
5479
  <xsl:template name="refine_table-footer-cell-style">
5480
+
5481
+ <xsl:call-template name="setNoBordersForTableList"/>
5410
5482
  </xsl:template> <!-- refine_table-footer-cell-style -->
5411
5483
 
5412
5484
  <xsl:attribute-set name="table-note-style">
@@ -5448,6 +5520,16 @@
5448
5520
  <xsl:template name="refine_table-fn-body-style">
5449
5521
  </xsl:template>
5450
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
+
5451
5533
  <!-- ========================== -->
5452
5534
  <!-- END Table styles -->
5453
5535
  <!-- ========================== -->
@@ -11010,6 +11092,10 @@
11010
11092
  </fo:list-item>
11011
11093
  </xsl:template>
11012
11094
 
11095
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
11096
+ <xsl:apply-templates/>
11097
+ </xsl:template>
11098
+
11013
11099
  <!-- ===================================== -->
11014
11100
  <!-- END Lists processing -->
11015
11101
  <!-- ===================================== -->
@@ -12311,6 +12397,7 @@
12311
12397
  </xsl:attribute-set>
12312
12398
 
12313
12399
  <xsl:template name="refine_toc-style">
12400
+ <xsl:copy-of select="@id"/>
12314
12401
  </xsl:template>
12315
12402
 
12316
12403
  <xsl:attribute-set name="toc-title-style">
@@ -12429,13 +12516,13 @@
12429
12516
 
12430
12517
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12431
12518
  <xsl:variable name="nodes_preface_">
12432
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12519
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12433
12520
  <node id="{@id}"/>
12434
12521
  </xsl:for-each>
12435
12522
  </xsl:variable>
12436
12523
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
12437
12524
 
12438
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12525
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12439
12526
  <xsl:sort select="@displayorder" data-type="number"/>
12440
12527
 
12441
12528
  <!-- process Section's title -->
@@ -12448,6 +12535,23 @@
12448
12535
  </xsl:for-each>
12449
12536
  </xsl:template>
12450
12537
 
12538
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
12539
+ <xsl:variable name="title">
12540
+ <xsl:call-template name="getName"/>
12541
+ </xsl:variable>
12542
+ <xsl:variable name="root">
12543
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
12544
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
12545
+ </xsl:variable>
12546
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
12547
+ <mnx:title>
12548
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
12549
+ <xsl:with-param name="element" select="$root"/>
12550
+ </xsl:apply-templates>
12551
+ </mnx:title>
12552
+ </mnx:item>
12553
+ </xsl:template>
12554
+
12451
12555
  <xsl:template name="processMainSectionsDefault_Contents">
12452
12556
 
12453
12557
  <xsl:variable name="nodes_sections_">
@@ -14289,16 +14393,17 @@
14289
14393
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
14290
14394
  <xsl:template name="insert_basic_link">
14291
14395
  <xsl:param name="element"/>
14396
+ <xsl:param name="wrapper">true</xsl:param>
14292
14397
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
14293
14398
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
14294
14399
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
14295
14400
  <xsl:choose>
14296
- <xsl:when test="$internal-destination = 'true'">
14401
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
14297
14402
  <fo:wrapper role="Reference">
14298
14403
  <xsl:copy-of select="$element_node"/>
14299
14404
  </fo:wrapper>
14300
14405
  </xsl:when>
14301
- <xsl:when test="$external-destination = 'true'">
14406
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
14302
14407
  <xsl:copy-of select="$element_node"/>
14303
14408
  </xsl:when>
14304
14409
  <xsl:otherwise>
@@ -1939,10 +1939,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1939
1939
  <value>hasAnnotation</value>
1940
1940
  <value>draftOf</value>
1941
1941
  <value>hasDraft</value>
1942
- <value>preliminaryDraftOf</value>
1943
- <value>hasPreliminaryDraft</value>
1944
- <value>revisionDraftOf</value>
1945
- <value>hasRevisionDraft</value>
1942
+ <value>predecessorDraftOf</value>
1943
+ <value>hasPredecessorDraft</value>
1944
+ <value>successorDraftOf</value>
1945
+ <value>hasSuccessorDraft</value>
1946
1946
  <value>editionOf</value>
1947
1947
  <value>hasEdition</value>
1948
1948
  <value>updates</value>
@@ -641,8 +641,85 @@ This is done if the footnote reference is already presented in some other form,
641
641
  </ref>
642
642
  </zeroOrMore>
643
643
  </define>
644
+ <define name="altsource">
645
+ <a:documentation>Alternative file to use as media</a:documentation>
646
+ <element name="altsource">
647
+ <ref name="MediaAttributes"/>
648
+ <optional>
649
+ <attribute name="tag">
650
+ <a:documentation>Comma-delimited tag to indicate when the alternate file is to be used,
651
+ at minimum allows contain `html`, `doc`, `pdf` as the main target formats of Metanorma,
652
+ and `default` for the fallback. The presence of an altsource tagged `default` is required</a:documentation>
653
+ </attribute>
654
+ </optional>
655
+ <optional>
656
+ <attribute name="media">
657
+ <a:documentation>CSS media query to indicate when the alternate file is to be used</a:documentation>
658
+ </attribute>
659
+ </optional>
660
+ </element>
661
+ </define>
662
+ <define name="image">
663
+ <a:documentation>Container for image content</a:documentation>
664
+ <choice>
665
+ <element name="image">
666
+ <ref name="RequiredId"/>
667
+ <ref name="ImageAttributes">
668
+ <a:documentation>When specified along with altsource, ImageAttributes give the default image to be rendered</a:documentation>
669
+ </ref>
670
+ <ref name="ImageBody"/>
671
+ </element>
672
+ <element name="svg">
673
+ <a:documentation>Add svg mark up to image</a:documentation>
674
+ <oneOrMore>
675
+ <choice>
676
+ <text/>
677
+ <ref name="AnyElement"/>
678
+ </choice>
679
+ </oneOrMore>
680
+ </element>
681
+ </choice>
682
+ </define>
683
+ <define name="ImageAttributes">
684
+ <optional>
685
+ <ref name="MediaAttributes">
686
+ <a:documentation>If the image contains altsource, the media attributes are given on each of the altsource elements instead of the root node</a:documentation>
687
+ </ref>
688
+ </optional>
689
+ <ref name="MediaAccessibilityAttributes"/>
690
+ <optional>
691
+ <attribute name="width">
692
+ <a:documentation>Height of image</a:documentation>
693
+ <ref name="ImageSize"/>
694
+ </attribute>
695
+ </optional>
696
+ <optional>
697
+ <attribute name="height">
698
+ <a:documentation>Width of image</a:documentation>
699
+ <ref name="ImageSize"/>
700
+ </attribute>
701
+ </optional>
702
+ </define>
644
703
  </include>
645
704
  <!-- end overrides -->
705
+ <define name="ImageBody">
706
+ <optional>
707
+ <element name="svg">
708
+ <a:documentation>image can contain SVG XML, which is used to access its identifiers within the Metanorma XML</a:documentation>
709
+ <oneOrMore>
710
+ <choice>
711
+ <text/>
712
+ <ref name="AnyElement"/>
713
+ </choice>
714
+ </oneOrMore>
715
+ </element>
716
+ </optional>
717
+ <zeroOrMore>
718
+ <ref name="altsource">
719
+ <a:documentation>Alternative files to use as media</a:documentation>
720
+ </ref>
721
+ </zeroOrMore>
722
+ </define>
646
723
  <define name="key">
647
724
  <a:documentation>Key to a table, figure, or formula</a:documentation>
648
725
  <element name="key">
@@ -930,34 +1007,6 @@ titlecase, or lowercase</a:documentation>
930
1007
  <ref name="ReducedBibliographicItem"/>
931
1008
  </element>
932
1009
  </define>
933
- <define name="image" combine="choice">
934
- <choice>
935
- <element name="image">
936
- <ref name="RequiredId"/>
937
- <ref name="ImageAttributes"/>
938
- <optional>
939
- <element name="svg">
940
- <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
941
- <oneOrMore>
942
- <choice>
943
- <text/>
944
- <ref name="AnyElement"/>
945
- </choice>
946
- </oneOrMore>
947
- </element>
948
- </optional>
949
- </element>
950
- <element name="svg">
951
- <a:documentation>Add svg mark up to image</a:documentation>
952
- <oneOrMore>
953
- <choice>
954
- <text/>
955
- <ref name="AnyElement"/>
956
- </choice>
957
- </oneOrMore>
958
- </element>
959
- </choice>
960
- </define>
961
1010
  <define name="ParagraphFnBody" combine="interleave">
962
1011
  <ref name="BlockSource">
963
1012
  <a:documentation>Bibliographic source for the information in the paragraph
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.3.1".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.1
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-02 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