metanorma-iho 1.2.4 → 1.2.5

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: 8f5eb510ed29c22fe0e538d682476f4ec2eefacf843ba01f860f733fdcc44ca6
4
- data.tar.gz: 2887dbdb2c9f493c68f4ace92028c1a593eb8b7018a5fdc81451e3e53b164ca4
3
+ metadata.gz: ed0af5445fa8d0826c1c8c156f4eb603a2e11fff5bc71ef3bf6ac130dc7472f3
4
+ data.tar.gz: 268b61813284b9985b669796434316c3e57a16d9068a63d913e573444e820625
5
5
  SHA512:
6
- metadata.gz: ab19a330da77c557ca6e6f71642396c1470d3dbc6fcfd7d7588c0335837175b8da7be13cf0cc6318598e4c536e24a97986594d3bb203bc2ee9126ce0e55639b4
7
- data.tar.gz: 4f92583add78fc0b60f48ba64b7514a22441de0d36d6080f6832dc78a619f9975059d2a867901dae2eeb967d25eb66c2d777eb3a0a7ca11f6f004614b4fcb3d0
6
+ metadata.gz: 720175f5376a0a7f5e88848cd4a2a0a78d9deeedea4047ea9af299a8a3ed0ed6233f61a7779316fa477e0875f2c28683c519ff645c298742e8fca5f5b2886dde
7
+ data.tar.gz: 730413f283d2a11f5fd48565584f0d8cd05218af158ed629230ac8a8e520ffa1aefa4a70082dd97a4d313ef223d33e8116f167d6b78b0e54664221e1b554b9e8
@@ -145,16 +145,6 @@ div.document-stage-band, div.document-type-band {
145
145
  background-color: #333333;
146
146
  }
147
147
 
148
- a.FootnoteRef + a.FootnoteRef::before {
149
- content: ", ";
150
- vertical-align: super;
151
- }
152
-
153
- a.TableFootnoteRef + a.TableFootnoteRef::before {
154
- content: ", ";
155
- vertical-align: super;
156
- }
157
-
158
148
  a.TableFootnoteRef, span.TableFootnoteRef,
159
149
  a.FootnoteRef, span.FootnoteRef {
160
150
  vertical-align: super;
@@ -483,10 +473,6 @@ main {
483
473
  margin: 0 3em 0 6em;
484
474
  }
485
475
 
486
- #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
487
- font-family: {{bodyfont}};
488
- font-weight: 400;
489
- }
490
476
  #toc ul, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul {
491
477
  margin: 0;
492
478
  padding: 0;
@@ -538,6 +524,10 @@ main {
538
524
  color: black;
539
525
  }
540
526
  }
527
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
528
+ font-family: {{bodyfont}};
529
+ font-weight: 400;
530
+ }
541
531
  @media screen and (max-width: 768px) {
542
532
  #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
543
533
  padding: 0 1.5em;
@@ -632,7 +622,6 @@ main {
632
622
  cursor: pointer;
633
623
  padding: 10px 15px 10px 15px;
634
624
  border-radius: 4px;
635
- text-transform: uppercase;
636
625
  }
637
626
  #myBtn:hover {
638
627
  opacity: 1;
@@ -642,6 +631,9 @@ main {
642
631
  display: none;
643
632
  }
644
633
  }
634
+ #myBtn {
635
+ text-transform: uppercase;
636
+ }
645
637
  #myBtn a.anchorjs-link:hover {
646
638
  background: none;
647
639
  color: #05164d;
@@ -666,12 +658,6 @@ main {
666
658
  margin: 0;
667
659
  }
668
660
  }
669
- div.figure {
670
- line-height: 1.6em;
671
- padding: 1.5em;
672
- margin: 2em 0 1em 0;
673
- overflow: auto;
674
- }
675
661
  div.figure .FigureTitle, div.figure .figure-title {
676
662
  font-weight: 700;
677
663
  font-size: 1em;
@@ -684,6 +670,12 @@ div.figure > img, div.figure > svg {
684
670
  max-width: 100%;
685
671
  height: auto;
686
672
  }
673
+ div.figure {
674
+ line-height: 1.6em;
675
+ padding: 1.5em;
676
+ margin: 2em 0 1em 0;
677
+ overflow: auto;
678
+ }
687
679
 
688
680
  table div.figure {
689
681
  padding: 0;
@@ -1030,6 +1022,13 @@ p.NormRef {
1030
1022
  /*
1031
1023
  3.6 Source Code + figures
1032
1024
  */
1025
+ .figure .SourceTitle,
1026
+ pre .SourceTitle,
1027
+ .pseudocode .SourceTitle {
1028
+ font-weight: 700;
1029
+ font-size: 1em;
1030
+ text-align: center;
1031
+ }
1033
1032
  .figure,
1034
1033
  pre,
1035
1034
  .pseudocode {
@@ -1040,13 +1039,6 @@ pre,
1040
1039
  margin: 2em 0 1em 0;
1041
1040
  overflow: auto;
1042
1041
  }
1043
- .figure .SourceTitle,
1044
- pre .SourceTitle,
1045
- .pseudocode .SourceTitle {
1046
- font-weight: 700;
1047
- font-size: 1em;
1048
- text-align: center;
1049
- }
1050
1042
 
1051
1043
  pre {
1052
1044
  font-family: {{monospacefont}};
@@ -1110,12 +1102,14 @@ pre {
1110
1102
  padding: 1.2em;
1111
1103
  margin: 2em 0 1em 0;
1112
1104
  text-align: left;
1113
- color: #424242;
1114
- padding-left: 2.7em;
1115
1105
  }
1116
1106
  .example p {
1117
1107
  margin: 0;
1118
1108
  }
1109
+ .example {
1110
+ color: #424242;
1111
+ padding-left: 2.7em;
1112
+ }
1119
1113
  .example .example-title {
1120
1114
  font-weight: 700;
1121
1115
  text-transform: uppercase;
@@ -340,46 +340,54 @@
340
340
 
341
341
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
342
342
 
343
- <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
343
+ <xsl:variable name="page_sequence_content">
344
+ <xsl:apply-templates/>
345
+ </xsl:variable>
344
346
 
345
- <xsl:attribute name="master-reference">
346
- <xsl:text>document</xsl:text>
347
- <xsl:call-template name="getPageSequenceOrientation"/>
348
- </xsl:attribute>
347
+ <xsl:if test="xalan:nodeset($page_sequence_content)/node()">
349
348
 
350
- <xsl:if test="position() = 1">
351
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
352
- </xsl:if>
349
+ <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
353
350
 
354
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
355
- <xsl:call-template name="insertHeaderFooter">
356
- <xsl:with-param name="title_header" select="$title_header"/>
357
- <xsl:with-param name="docidentifier" select="$docidentifier"/>
358
- <xsl:with-param name="edition" select="$edition"/>
359
- <xsl:with-param name="month_year" select="$month_year"/>
360
- <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
361
- </xsl:call-template>
362
- <fo:flow flow-name="xsl-region-body">
363
- <fo:block-container>
351
+ <xsl:attribute name="master-reference">
352
+ <xsl:text>document</xsl:text>
353
+ <xsl:call-template name="getPageSequenceOrientation"/>
354
+ </xsl:attribute>
355
+
356
+ <xsl:if test="position() = 1">
357
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
358
+ </xsl:if>
364
359
 
365
- <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
360
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
361
+ <xsl:call-template name="insertHeaderFooter">
362
+ <xsl:with-param name="title_header" select="$title_header"/>
363
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
364
+ <xsl:with-param name="edition" select="$edition"/>
365
+ <xsl:with-param name="month_year" select="$month_year"/>
366
+ <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
367
+ </xsl:call-template>
368
+ <fo:flow flow-name="xsl-region-body">
369
+ <fo:block-container>
366
370
 
367
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
368
- <!-- Normative references -->
369
- <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
370
- <!-- Terms and definitions -->
371
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
372
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
373
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
371
+ <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
374
372
 
375
- <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
373
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
374
+ <!-- Normative references -->
375
+ <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
376
+ <!-- Terms and definitions -->
377
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
378
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
379
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
376
380
 
377
- <xsl:apply-templates/>
381
+ <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
378
382
 
379
- <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
380
- </fo:block-container>
381
- </fo:flow>
382
- </fo:page-sequence>
383
+ <!--<xsl:apply-templates /> -->
384
+ <xsl:copy-of select="$page_sequence_content"/>
385
+
386
+ <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
387
+ </fo:block-container>
388
+ </fo:flow>
389
+ </fo:page-sequence>
390
+ </xsl:if>
383
391
  <!-- </xsl:if> -->
384
392
  </xsl:for-each>
385
393
  </xsl:for-each>
@@ -954,9 +962,18 @@
954
962
  </xsl:variable>
955
963
 
956
964
  <xsl:element name="{$element-name}">
957
- <xsl:for-each select="parent::mn:clause">
958
- <xsl:call-template name="setId"/>
959
- </xsl:for-each>
965
+
966
+ <xsl:choose>
967
+ <xsl:when test="@type = 'floating-title' or @type = 'section-title'">
968
+ <xsl:copy-of select="@id"/>
969
+ </xsl:when>
970
+ <xsl:otherwise>
971
+ <xsl:for-each select="parent::mn:clause">
972
+ <xsl:call-template name="setId"/>
973
+ </xsl:for-each>
974
+ </xsl:otherwise>
975
+ </xsl:choose>
976
+
960
977
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
961
978
  <xsl:attribute name="font-weight">bold</xsl:attribute>
962
979
  <xsl:attribute name="space-before">
@@ -1547,6 +1564,7 @@
1547
1564
  <xsl:variable name="en_dash">–</xsl:variable>
1548
1565
  <xsl:variable name="em_dash">—</xsl:variable>
1549
1566
  <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
1567
+ <xsl:variable name="nonbreak_space_em_dash"> —</xsl:variable>
1550
1568
  <xsl:variable name="cr">&#13;</xsl:variable>
1551
1569
  <xsl:variable name="lf">
1552
1570
  </xsl:variable>
@@ -2089,6 +2107,7 @@
2089
2107
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
2090
2108
  <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
2091
2109
  <xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2110
+ <xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2092
2111
  <!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
2093
2112
  <xsl:template match="mn:preferred" mode="update_xml_step1"/>
2094
2113
  <!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
@@ -2103,10 +2122,10 @@
2103
2122
 
2104
2123
  <xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
2105
2124
 
2106
- <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
2125
+ <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
2107
2126
  <xsl:copy>
2108
2127
  <xsl:apply-templates select="@*" mode="update_xml_step1"/>
2109
- <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
2128
+ <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
2110
2129
  <xsl:apply-templates select="node()" mode="update_xml_step1"/>
2111
2130
  </xsl:copy>
2112
2131
  </xsl:template>
@@ -3204,6 +3223,12 @@
3204
3223
  <xsl:template name="refine_sourcecode-style">
3205
3224
  </xsl:template> <!-- refine_sourcecode-style -->
3206
3225
 
3226
+ <xsl:attribute-set name="sourcecode-number-style">
3227
+ </xsl:attribute-set>
3228
+
3229
+ <xsl:template name="refine_sourcecode-number-style">
3230
+ </xsl:template>
3231
+
3207
3232
  <xsl:attribute-set name="sourcecode-name-style">
3208
3233
  <xsl:attribute name="font-size">11pt</xsl:attribute>
3209
3234
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4597,6 +4622,12 @@
4597
4622
  <xsl:template name="refine_term-name-style">
4598
4623
  </xsl:template>
4599
4624
 
4625
+ <xsl:attribute-set name="preferred-style">
4626
+ </xsl:attribute-set> <!-- preferred-style -->
4627
+
4628
+ <xsl:template name="refine_preferred-style">
4629
+ </xsl:template>
4630
+
4600
4631
  <xsl:attribute-set name="preferred-block-style">
4601
4632
  <xsl:attribute name="line-height">1.1</xsl:attribute>
4602
4633
  </xsl:attribute-set> <!-- preferred-block-style -->
@@ -5240,6 +5271,12 @@
5240
5271
  <xsl:call-template name="setBordersTableArray"/>
5241
5272
  </xsl:template> <!-- refine_table-style -->
5242
5273
 
5274
+ <xsl:attribute-set name="table-number-style">
5275
+ </xsl:attribute-set>
5276
+
5277
+ <xsl:template name="refine_table-number-style">
5278
+ </xsl:template>
5279
+
5243
5280
  <xsl:attribute-set name="table-name-style">
5244
5281
  <xsl:attribute name="role">Caption</xsl:attribute>
5245
5282
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -5699,7 +5736,7 @@
5699
5736
 
5700
5737
  </fo:block>
5701
5738
 
5702
- <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
5739
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
5703
5740
  <xsl:if test="$continued = 'true'">
5704
5741
 
5705
5742
  <!-- to prevent the error 'THead element may contain only TR elements' -->
@@ -8839,6 +8876,12 @@
8839
8876
  <xsl:template name="refine_figure-style">
8840
8877
  </xsl:template>
8841
8878
 
8879
+ <xsl:attribute-set name="figure-number-style">
8880
+ </xsl:attribute-set>
8881
+
8882
+ <xsl:template name="refine_figure-number-style">
8883
+ </xsl:template>
8884
+
8842
8885
  <xsl:attribute-set name="figure-name-style">
8843
8886
  <xsl:attribute name="role">Caption</xsl:attribute>
8844
8887
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -12105,10 +12148,32 @@
12105
12148
  <xsl:when test="@level &gt;= 1 and @root = 'preface'">0mm</xsl:when>
12106
12149
  <xsl:when test="@level &gt;= 1 and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
12107
12150
  <xsl:when test="@level &gt;= 1 and not(@type = 'annex')">
12151
+ <!-- for default values, maximum digits for 2nd level is 4, for example 20.19,
12152
+ for 3rd level is 5, for example 2.15.12
12153
+ if not, then increase -->
12154
+ <xsl:variable name="default_value_">
12155
+ <xsl:choose>
12156
+ <xsl:when test="$toc_level = 3">12.9</xsl:when>
12157
+ <xsl:when test="$toc_level &gt; 3">15</xsl:when>
12158
+ <xsl:otherwise>10</xsl:otherwise>
12159
+ </xsl:choose>
12160
+ </xsl:variable>
12161
+ <xsl:variable name="default_value" select="number($default_value_)"/>
12162
+ <xsl:variable name="root-style"><root-style xsl:use-attribute-sets="root-style"/></xsl:variable>
12163
+ <xsl:variable name="font_size" select="normalize-space(translate(xalan:nodeset($root-style)/root-style/@font-size, 'pt', ''))"/>
12164
+ <xsl:variable name="item_section_max">
12165
+ <xsl:choose>
12166
+ <xsl:when test="following-sibling::mnx:item"><xsl:value-of select="following-sibling::mnx:item[last()]/@section"/></xsl:when>
12167
+ <xsl:otherwise><xsl:value-of select="@section"/></xsl:otherwise>
12168
+ </xsl:choose>
12169
+ </xsl:variable>
12170
+ <!-- in em -->
12171
+ <xsl:variable name="text_rt_width_em" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($item_section_max, $font_main, $font_size)"/>
12172
+ <!-- in mm, multiplier 3.175 for Arial em size -->
12173
+ <xsl:variable name="text_rt_width_mm" select="number($text_rt_width_em) div 10 * 3.175 + 2"/>
12108
12174
  <xsl:choose>
12109
- <xsl:when test="$toc_level = 3">12.9mm</xsl:when>
12110
- <xsl:when test="$toc_level &gt; 3">15mm</xsl:when>
12111
- <xsl:otherwise>10mm</xsl:otherwise>
12175
+ <xsl:when test="$text_rt_width_mm &gt; $default_value"><xsl:value-of select="ceiling($text_rt_width_mm) + 1"/>mm</xsl:when>
12176
+ <xsl:otherwise><xsl:value-of select="$default_value"/>mm</xsl:otherwise>
12112
12177
  </xsl:choose>
12113
12178
  </xsl:when>
12114
12179
  <xsl:otherwise>0mm</xsl:otherwise>
@@ -13719,10 +13784,17 @@
13719
13784
  </xsl:choose>
13720
13785
  </xsl:template>
13721
13786
 
13787
+ <xsl:attribute-set name="clause-style">
13788
+
13789
+ </xsl:attribute-set>
13790
+
13791
+ <xsl:template name="refine_clause-style">
13792
+ </xsl:template>
13793
+
13722
13794
  <!-- main sections -->
13723
13795
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
13724
13796
  <xsl:call-template name="setNamedDestination"/>
13725
- <fo:block>
13797
+ <fo:block role="Sect">
13726
13798
  <xsl:call-template name="setId"/>
13727
13799
 
13728
13800
  <xsl:call-template name="sections_element_style"/>
@@ -13846,6 +13918,10 @@
13846
13918
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
13847
13919
  </xsl:template>
13848
13920
 
13921
+ <!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
13922
+ <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
13923
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13924
+
13849
13925
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
13850
13926
  <xsl:template name="insert_basic_link">
13851
13927
  <xsl:param name="element"/>
@@ -340,46 +340,54 @@
340
340
 
341
341
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
342
342
 
343
- <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
343
+ <xsl:variable name="page_sequence_content">
344
+ <xsl:apply-templates/>
345
+ </xsl:variable>
344
346
 
345
- <xsl:attribute name="master-reference">
346
- <xsl:text>document</xsl:text>
347
- <xsl:call-template name="getPageSequenceOrientation"/>
348
- </xsl:attribute>
347
+ <xsl:if test="xalan:nodeset($page_sequence_content)/node()">
349
348
 
350
- <xsl:if test="position() = 1">
351
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
352
- </xsl:if>
349
+ <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
353
350
 
354
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
355
- <xsl:call-template name="insertHeaderFooter">
356
- <xsl:with-param name="title_header" select="$title_header"/>
357
- <xsl:with-param name="docidentifier" select="$docidentifier"/>
358
- <xsl:with-param name="edition" select="$edition"/>
359
- <xsl:with-param name="month_year" select="$month_year"/>
360
- <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
361
- </xsl:call-template>
362
- <fo:flow flow-name="xsl-region-body">
363
- <fo:block-container>
351
+ <xsl:attribute name="master-reference">
352
+ <xsl:text>document</xsl:text>
353
+ <xsl:call-template name="getPageSequenceOrientation"/>
354
+ </xsl:attribute>
355
+
356
+ <xsl:if test="position() = 1">
357
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
358
+ </xsl:if>
364
359
 
365
- <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
360
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
361
+ <xsl:call-template name="insertHeaderFooter">
362
+ <xsl:with-param name="title_header" select="$title_header"/>
363
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
364
+ <xsl:with-param name="edition" select="$edition"/>
365
+ <xsl:with-param name="month_year" select="$month_year"/>
366
+ <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
367
+ </xsl:call-template>
368
+ <fo:flow flow-name="xsl-region-body">
369
+ <fo:block-container>
366
370
 
367
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
368
- <!-- Normative references -->
369
- <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
370
- <!-- Terms and definitions -->
371
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
372
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
373
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
371
+ <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
374
372
 
375
- <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
373
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
374
+ <!-- Normative references -->
375
+ <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
376
+ <!-- Terms and definitions -->
377
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
378
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
379
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
376
380
 
377
- <xsl:apply-templates/>
381
+ <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
378
382
 
379
- <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
380
- </fo:block-container>
381
- </fo:flow>
382
- </fo:page-sequence>
383
+ <!--<xsl:apply-templates /> -->
384
+ <xsl:copy-of select="$page_sequence_content"/>
385
+
386
+ <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
387
+ </fo:block-container>
388
+ </fo:flow>
389
+ </fo:page-sequence>
390
+ </xsl:if>
383
391
  <!-- </xsl:if> -->
384
392
  </xsl:for-each>
385
393
  </xsl:for-each>
@@ -954,9 +962,18 @@
954
962
  </xsl:variable>
955
963
 
956
964
  <xsl:element name="{$element-name}">
957
- <xsl:for-each select="parent::mn:clause">
958
- <xsl:call-template name="setId"/>
959
- </xsl:for-each>
965
+
966
+ <xsl:choose>
967
+ <xsl:when test="@type = 'floating-title' or @type = 'section-title'">
968
+ <xsl:copy-of select="@id"/>
969
+ </xsl:when>
970
+ <xsl:otherwise>
971
+ <xsl:for-each select="parent::mn:clause">
972
+ <xsl:call-template name="setId"/>
973
+ </xsl:for-each>
974
+ </xsl:otherwise>
975
+ </xsl:choose>
976
+
960
977
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
961
978
  <xsl:attribute name="font-weight">bold</xsl:attribute>
962
979
  <xsl:attribute name="space-before">
@@ -1547,6 +1564,7 @@
1547
1564
  <xsl:variable name="en_dash">–</xsl:variable>
1548
1565
  <xsl:variable name="em_dash">—</xsl:variable>
1549
1566
  <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
1567
+ <xsl:variable name="nonbreak_space_em_dash"> —</xsl:variable>
1550
1568
  <xsl:variable name="cr">&#13;</xsl:variable>
1551
1569
  <xsl:variable name="lf">
1552
1570
  </xsl:variable>
@@ -2089,6 +2107,7 @@
2089
2107
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
2090
2108
  <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
2091
2109
  <xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2110
+ <xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2092
2111
  <!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
2093
2112
  <xsl:template match="mn:preferred" mode="update_xml_step1"/>
2094
2113
  <!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
@@ -2103,10 +2122,10 @@
2103
2122
 
2104
2123
  <xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
2105
2124
 
2106
- <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
2125
+ <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
2107
2126
  <xsl:copy>
2108
2127
  <xsl:apply-templates select="@*" mode="update_xml_step1"/>
2109
- <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
2128
+ <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
2110
2129
  <xsl:apply-templates select="node()" mode="update_xml_step1"/>
2111
2130
  </xsl:copy>
2112
2131
  </xsl:template>
@@ -3204,6 +3223,12 @@
3204
3223
  <xsl:template name="refine_sourcecode-style">
3205
3224
  </xsl:template> <!-- refine_sourcecode-style -->
3206
3225
 
3226
+ <xsl:attribute-set name="sourcecode-number-style">
3227
+ </xsl:attribute-set>
3228
+
3229
+ <xsl:template name="refine_sourcecode-number-style">
3230
+ </xsl:template>
3231
+
3207
3232
  <xsl:attribute-set name="sourcecode-name-style">
3208
3233
  <xsl:attribute name="font-size">11pt</xsl:attribute>
3209
3234
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4597,6 +4622,12 @@
4597
4622
  <xsl:template name="refine_term-name-style">
4598
4623
  </xsl:template>
4599
4624
 
4625
+ <xsl:attribute-set name="preferred-style">
4626
+ </xsl:attribute-set> <!-- preferred-style -->
4627
+
4628
+ <xsl:template name="refine_preferred-style">
4629
+ </xsl:template>
4630
+
4600
4631
  <xsl:attribute-set name="preferred-block-style">
4601
4632
  <xsl:attribute name="line-height">1.1</xsl:attribute>
4602
4633
  </xsl:attribute-set> <!-- preferred-block-style -->
@@ -5240,6 +5271,12 @@
5240
5271
  <xsl:call-template name="setBordersTableArray"/>
5241
5272
  </xsl:template> <!-- refine_table-style -->
5242
5273
 
5274
+ <xsl:attribute-set name="table-number-style">
5275
+ </xsl:attribute-set>
5276
+
5277
+ <xsl:template name="refine_table-number-style">
5278
+ </xsl:template>
5279
+
5243
5280
  <xsl:attribute-set name="table-name-style">
5244
5281
  <xsl:attribute name="role">Caption</xsl:attribute>
5245
5282
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -5699,7 +5736,7 @@
5699
5736
 
5700
5737
  </fo:block>
5701
5738
 
5702
- <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
5739
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
5703
5740
  <xsl:if test="$continued = 'true'">
5704
5741
 
5705
5742
  <!-- to prevent the error 'THead element may contain only TR elements' -->
@@ -8839,6 +8876,12 @@
8839
8876
  <xsl:template name="refine_figure-style">
8840
8877
  </xsl:template>
8841
8878
 
8879
+ <xsl:attribute-set name="figure-number-style">
8880
+ </xsl:attribute-set>
8881
+
8882
+ <xsl:template name="refine_figure-number-style">
8883
+ </xsl:template>
8884
+
8842
8885
  <xsl:attribute-set name="figure-name-style">
8843
8886
  <xsl:attribute name="role">Caption</xsl:attribute>
8844
8887
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -12105,10 +12148,32 @@
12105
12148
  <xsl:when test="@level &gt;= 1 and @root = 'preface'">0mm</xsl:when>
12106
12149
  <xsl:when test="@level &gt;= 1 and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
12107
12150
  <xsl:when test="@level &gt;= 1 and not(@type = 'annex')">
12151
+ <!-- for default values, maximum digits for 2nd level is 4, for example 20.19,
12152
+ for 3rd level is 5, for example 2.15.12
12153
+ if not, then increase -->
12154
+ <xsl:variable name="default_value_">
12155
+ <xsl:choose>
12156
+ <xsl:when test="$toc_level = 3">12.9</xsl:when>
12157
+ <xsl:when test="$toc_level &gt; 3">15</xsl:when>
12158
+ <xsl:otherwise>10</xsl:otherwise>
12159
+ </xsl:choose>
12160
+ </xsl:variable>
12161
+ <xsl:variable name="default_value" select="number($default_value_)"/>
12162
+ <xsl:variable name="root-style"><root-style xsl:use-attribute-sets="root-style"/></xsl:variable>
12163
+ <xsl:variable name="font_size" select="normalize-space(translate(xalan:nodeset($root-style)/root-style/@font-size, 'pt', ''))"/>
12164
+ <xsl:variable name="item_section_max">
12165
+ <xsl:choose>
12166
+ <xsl:when test="following-sibling::mnx:item"><xsl:value-of select="following-sibling::mnx:item[last()]/@section"/></xsl:when>
12167
+ <xsl:otherwise><xsl:value-of select="@section"/></xsl:otherwise>
12168
+ </xsl:choose>
12169
+ </xsl:variable>
12170
+ <!-- in em -->
12171
+ <xsl:variable name="text_rt_width_em" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($item_section_max, $font_main, $font_size)"/>
12172
+ <!-- in mm, multiplier 3.175 for Arial em size -->
12173
+ <xsl:variable name="text_rt_width_mm" select="number($text_rt_width_em) div 10 * 3.175 + 2"/>
12108
12174
  <xsl:choose>
12109
- <xsl:when test="$toc_level = 3">12.9mm</xsl:when>
12110
- <xsl:when test="$toc_level &gt; 3">15mm</xsl:when>
12111
- <xsl:otherwise>10mm</xsl:otherwise>
12175
+ <xsl:when test="$text_rt_width_mm &gt; $default_value"><xsl:value-of select="ceiling($text_rt_width_mm) + 1"/>mm</xsl:when>
12176
+ <xsl:otherwise><xsl:value-of select="$default_value"/>mm</xsl:otherwise>
12112
12177
  </xsl:choose>
12113
12178
  </xsl:when>
12114
12179
  <xsl:otherwise>0mm</xsl:otherwise>
@@ -13719,10 +13784,17 @@
13719
13784
  </xsl:choose>
13720
13785
  </xsl:template>
13721
13786
 
13787
+ <xsl:attribute-set name="clause-style">
13788
+
13789
+ </xsl:attribute-set>
13790
+
13791
+ <xsl:template name="refine_clause-style">
13792
+ </xsl:template>
13793
+
13722
13794
  <!-- main sections -->
13723
13795
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
13724
13796
  <xsl:call-template name="setNamedDestination"/>
13725
- <fo:block>
13797
+ <fo:block role="Sect">
13726
13798
  <xsl:call-template name="setId"/>
13727
13799
 
13728
13800
  <xsl:call-template name="sections_element_style"/>
@@ -13846,6 +13918,10 @@
13846
13918
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
13847
13919
  </xsl:template>
13848
13920
 
13921
+ <!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
13922
+ <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
13923
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13924
+
13849
13925
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
13850
13926
  <xsl:template name="insert_basic_link">
13851
13927
  <xsl:param name="element"/>
@@ -45,13 +45,15 @@ module Metanorma
45
45
  super
46
46
  end
47
47
 
48
+ def title_main(node, xml)
49
+ title = node.attr("title") || node.attr("doctitle")
50
+ add_title_xml(xml, title, "en", "title-main")
51
+ end
52
+
48
53
  def title(node, xml)
49
54
  m = full_title_prep(node)
50
55
  full_title(m, xml)
51
- title = node.attr("title")
52
- xml.title **attr_code(type: "title-main") do |t1|
53
- t1 << Metanorma::Utils::asciidoc_sub(title)
54
- end
56
+ title_main(node, xml)
55
57
  %i(appendix annex part supplement).each do |w|
56
58
  typed_title(m, xml, w)
57
59
  end
@@ -61,9 +63,7 @@ module Metanorma
61
63
  metadata[type] or return
62
64
  title = full_title_part(metadata, type, TITLE_COMPONENTS[type][:id],
63
65
  TITLE_COMPONENTS[type][:info])
64
- xml.title **attr_code(type: "title-#{type}") do |t1|
65
- t1 << Metanorma::Utils::asciidoc_sub(title)
66
- end
66
+ add_title_xml(xml, title, "en", "title-#{type}")
67
67
  end
68
68
 
69
69
  TITLE_COMPONENTS = {
@@ -79,9 +79,7 @@ module Metanorma
79
79
  acc << full_title_part(metadata, p, TITLE_COMPONENTS[p][:id],
80
80
  TITLE_COMPONENTS[p][:info])
81
81
  end
82
- xml.title **attr_code(type: "main") do |t1|
83
- t1 << Metanorma::Utils::asciidoc_sub(parts.compact.join(", "))
84
- end
82
+ add_title_xml(xml, parts.compact.join(", "), "en", "main")
85
83
  end
86
84
 
87
85
  TITLE_ID_LABELS = { main: "", annex: "Annex", appendix: "Appendix",
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.2 -->
3
+ <!-- VERSION v2.1.3 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -455,14 +455,7 @@ normative or informative references, some split references into sections organiz
455
455
  </ref>
456
456
  </zeroOrMore>
457
457
  <zeroOrMore>
458
- <ref name="doc_bibitem">
459
- <a:documentation>Bibliographic item cited in the document</a:documentation>
460
- </ref>
461
- <zeroOrMore>
462
- <ref name="note">
463
- <a:documentation>Annotation of the bibliographic item</a:documentation>
464
- </ref>
465
- </zeroOrMore>
458
+ <ref name="ReferenceEntry"/>
466
459
  </zeroOrMore>
467
460
  <zeroOrMore>
468
461
  <ref name="references">
@@ -604,18 +597,21 @@ gives an explicit page orientation</a:documentation>
604
597
  </element>
605
598
  </optional>
606
599
  </define>
607
- </include>
608
- <!-- end overrides -->
609
- <define name="FnAttributes" combine="interleave">
610
- <ref name="RequiredId"/>
611
- <optional>
612
- <attribute name="hiddenref">
613
- <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
600
+ <define name="FnAttributes">
601
+ <ref name="RequiredId"/>
602
+ <optional>
603
+ <attribute name="hiddenref">
604
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
614
605
  This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
615
- <data type="boolean"/>
606
+ <data type="boolean"/>
607
+ </attribute>
608
+ </optional>
609
+ <attribute name="reference">
610
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
616
611
  </attribute>
617
- </optional>
618
- </define>
612
+ </define>
613
+ </include>
614
+ <!-- end overrides -->
619
615
  <define name="TdAttributes" combine="interleave">
620
616
  <ref name="RequiredId"/>
621
617
  <optional>
@@ -853,6 +849,17 @@ titlecase, or lowercase</a:documentation>
853
849
  <value>informative</value>
854
850
  </choice>
855
851
  </define>
852
+ <define name="ReferenceEntry">
853
+ <a:documentation>Entry in bibliography</a:documentation>
854
+ <ref name="doc_bibitem">
855
+ <a:documentation>Bibliographic item cited in the document</a:documentation>
856
+ </ref>
857
+ <zeroOrMore>
858
+ <ref name="note">
859
+ <a:documentation>Annotation of the bibliographic item</a:documentation>
860
+ </ref>
861
+ </zeroOrMore>
862
+ </define>
856
863
  <define name="doc_bibitem">
857
864
  <a:documentation>Standardisation document representation of bibliographic entry</a:documentation>
858
865
  <element name="bibitem">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.2.4".freeze
3
+ VERSION = "1.2.5".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.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-01 00:00:00.000000000 Z
11
+ date: 2025-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic