metanorma-iso 3.0.3 → 3.0.4

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: e6e303c8954c03b483677a25488720d9352c26c2d4d83c89a95b5e7d255e6cd5
4
- data.tar.gz: 7bebdf7e905466d24f65e3a182f6a8eb59cfe468351d6b4418c4e4188d8c5ae2
3
+ metadata.gz: 841d716c30272146e799a94f74bd04898176e496c70902ba1b615d46aff94401
4
+ data.tar.gz: e49b38349e65a63e9dfdfd8c2f1e432eb653c118962bddc4c53456255f44820b
5
5
  SHA512:
6
- metadata.gz: aa12f20780057b111a15bd057cad65c4c76c42ef26c81994ac86c3708675fdb37258fd606227b213c8b80882be77e474cfcfbf0c39e093ba4b9fa099298ba7de
7
- data.tar.gz: 58fcb4a8e10dc33fe6e911eb272c2bc1e49f2ca3d52e8fd3bbb75117d26e6e775bad3bdb19ecf7737e2c271fba1b635661512064988ecccf127ca97d328e0596
6
+ metadata.gz: be3d41b48a1101e7f09d4f6a1750c11b6800100929e551d140a571f33d53b063599db8769fd3db87fd730c0cf505e1e469156f00c41efd8f721d8b80a36269e9
7
+ data.tar.gz: 75c5c07e6a0c5c4034cbd9596b50483ffc819dffb80eabe64b27a813d7b56b17e28d50c4431c3974193b2fdb3299e481412d80a354eaf9f4005080d73b2c8ef9
@@ -86,14 +86,15 @@
86
86
  <xsl:value-of select="$i18n_all_rights_reserved"/>
87
87
  </xsl:variable>
88
88
 
89
+ <xsl:variable name="iso_reference_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
90
+ <xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
91
+
89
92
  <xsl:variable name="docidentifier_iso_with_lang_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'])"/>
90
- <xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
93
+ <xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$iso_reference"/></xsl:if></xsl:variable>
91
94
 
92
95
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after($docidentifier_iso_with_lang, '('), ')')"/>
93
96
  <xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
94
97
 
95
- <xsl:variable name="iso_reference_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
96
- <xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
97
98
  <xsl:variable name="anotherNumbers">
98
99
  <xsl:variable name="year_iso_reference" select="concat(':',substring-after($iso_reference,':'))"/>
99
100
  <xsl:for-each select="/iso:metanorma/iso:bibdata/iso:docidentifier[@type != '' and @type != 'ISO' and not(starts-with(@type, 'iso-')) and @type != 'URN']">
@@ -155,6 +156,8 @@
155
156
  <xsl:variable name="stagename" select="normalize-space(/iso:metanorma/iso:bibdata/iso:ext/iso:stagename)"/>
156
157
  <xsl:variable name="stagename_abbreviation" select="normalize-space(/iso:metanorma/iso:bibdata/iso:ext/iso:stagename/@abbreviation)"/>
157
158
  <xsl:variable name="stagename_localized" select="normalize-space(/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang])"/>
159
+ <xsl:variable name="stagename_localized_coverpage"><xsl:copy-of select="/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang and @type = 'coverpage']/node()"/></xsl:variable>
160
+ <xsl:variable name="stagename_localized_firstpage"><xsl:copy-of select="/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang and @type = 'firstpage']/node()"/></xsl:variable>
158
161
  <xsl:variable name="abbreviation" select="normalize-space(/iso:metanorma/iso:bibdata/iso:status/iso:stage/@abbreviation)"/>
159
162
  <xsl:variable name="abbreviation_uppercased" select="java:toUpperCase(java:java.lang.String.new($abbreviation))"/>
160
163
 
@@ -1871,17 +1874,9 @@
1871
1874
  <xsl:choose>
1872
1875
  <xsl:when test="$stage-abbreviation = 'DIS'"> <!-- or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM' -->
1873
1876
  <xsl:choose>
1874
- <xsl:when test="$stagename_localized != '' and contains($stagename_localized, ' ')">
1875
- <!-- Draft International Standard to DRAFT -->
1876
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring-before($stagename_localized, ' ')))"/>
1877
- <xsl:value-of select="$linebreak"/>
1878
- <xsl:value-of select="substring-after($stagename_localized, ' ')"/>
1879
- </xsl:when>
1880
- <xsl:when test="contains($stagename, ' ')">
1881
- <!-- Draft International Standard to DRAFT -->
1882
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring-before($stagename, ' ')))"/>
1883
- <xsl:value-of select="$linebreak"/>
1884
- <xsl:value-of select="substring-after($stagename, ' ')"/>
1877
+ <xsl:when test="normalize-space($stagename_localized_coverpage) != ''">
1878
+ <!-- DRAFT<br/>International Standard-->
1879
+ <xsl:apply-templates select="xalan:nodeset($stagename_localized_coverpage)/node()"/>
1885
1880
  </xsl:when>
1886
1881
  <xsl:otherwise>
1887
1882
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($stagename))"/>
@@ -2177,6 +2172,7 @@
2177
2172
  <fo:table-row height="13mm">
2178
2173
  <fo:table-cell number-columns-spanned="2" border-right="{$cover_page_border}" display-align="after" padding-bottom="-1mm" line-height="1.1">&gt;
2179
2174
  <fo:block font-size="10pt">
2175
+ <!-- Reference number -->
2180
2176
  <xsl:value-of select="$i18n_reference_number"/>
2181
2177
  </fo:block>
2182
2178
  <fo:block font-size="10pt">
@@ -4878,6 +4874,7 @@
4878
4874
  <xsl:when test="$layoutVersion = '2024'">
4879
4875
  <xsl:choose>
4880
4876
  <xsl:when test="$doctype = 'committee-document'"><xsl:value-of select="$doctype_localized"/></xsl:when>
4877
+ <xsl:when test="normalize-space($stagename_localized_firstpage) != ''"><xsl:apply-templates select="xalan:nodeset($stagename_localized_firstpage)/node()"/></xsl:when>
4881
4878
  <xsl:otherwise><xsl:value-of select="$stagename-header-firstpage"/></xsl:otherwise>
4882
4879
  </xsl:choose>
4883
4880
  </xsl:when>
@@ -6421,6 +6418,7 @@
6421
6418
  </xsl:template> <!-- refine_table-style -->
6422
6419
 
6423
6420
  <xsl:attribute-set name="table-name-style">
6421
+ <xsl:attribute name="role">Caption</xsl:attribute>
6424
6422
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
6425
6423
 
6426
6424
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -6432,6 +6430,9 @@
6432
6430
 
6433
6431
  <xsl:template name="refine_table-name-style">
6434
6432
  <xsl:param name="continued"/>
6433
+ <xsl:if test="$continued = 'true'">
6434
+ <xsl:attribute name="role">SKIP</xsl:attribute>
6435
+ </xsl:if>
6435
6436
 
6436
6437
  <xsl:if test="$continued = 'true'">
6437
6438
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
@@ -8368,7 +8369,7 @@
8368
8369
  </xsl:if>
8369
8370
 
8370
8371
  </fo:block-container>
8371
- </xsl:variable>
8372
+ </xsl:variable> <!-- END: variable name="table" -->
8372
8373
 
8373
8374
  <xsl:variable name="isAdded" select="@added"/>
8374
8375
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -8378,7 +8379,7 @@
8378
8379
 
8379
8380
  <!-- centered table when table name is centered (see table-name-style) -->
8380
8381
 
8381
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
8382
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
8382
8383
 
8383
8384
  <xsl:if test="$layoutVersion = '1951'">
8384
8385
  <xsl:attribute name="font-size">inherit</xsl:attribute>
@@ -8391,9 +8392,9 @@
8391
8392
  <fo:table-column column-width="proportional-column-width(1)"/>
8392
8393
  <fo:table-column column-width="{@width}"/>
8393
8394
  <fo:table-column column-width="proportional-column-width(1)"/>
8394
- <fo:table-body>
8395
- <fo:table-row>
8396
- <fo:table-cell column-number="2">
8395
+ <fo:table-body role="SKIP">
8396
+ <fo:table-row role="SKIP">
8397
+ <fo:table-cell column-number="2" role="SKIP">
8397
8398
  <xsl:copy-of select="$table-preamble"/>
8398
8399
  <fo:block role="SKIP">
8399
8400
  <xsl:call-template name="setTrackChangesStyles">
@@ -8439,11 +8440,12 @@
8439
8440
 
8440
8441
  </xsl:template>
8441
8442
 
8443
+ <!-- table/name-->
8442
8444
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
8443
8445
  <xsl:param name="continued"/>
8444
8446
  <xsl:if test="normalize-space() != ''">
8445
8447
 
8446
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
8448
+ <fo:block xsl:use-attribute-sets="table-name-style">
8447
8449
 
8448
8450
  <xsl:call-template name="refine_table-name-style">
8449
8451
  <xsl:with-param name="continued" select="$continued"/>
@@ -8944,7 +8946,7 @@
8944
8946
 
8945
8947
  <xsl:variable name="tableWithNotesAndFootnotes">
8946
8948
 
8947
- <fo:table keep-with-previous="always">
8949
+ <fo:table keep-with-previous="always" role="SKIP">
8948
8950
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
8949
8951
  <xsl:variable name="name" select="local-name()"/>
8950
8952
  <xsl:choose>
@@ -8975,9 +8977,9 @@
8975
8977
  </xsl:otherwise>
8976
8978
  </xsl:choose>
8977
8979
 
8978
- <fo:table-body>
8979
- <fo:table-row>
8980
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
8980
+ <fo:table-body role="SKIP">
8981
+ <fo:table-row role="SKIP">
8982
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
8981
8983
 
8982
8984
  <xsl:call-template name="refine_table-footer-cell-style"/>
8983
8985
 
@@ -9050,7 +9052,7 @@
9050
9052
 
9051
9053
  <!-- if there isn't 'thead' and there is a table's title -->
9052
9054
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
9053
- <fo:table-header>
9055
+ <fo:table-header role="Caption">
9054
9056
  <xsl:call-template name="table-header-title">
9055
9057
  <xsl:with-param name="cols-count" select="$cols-count"/>
9056
9058
  </xsl:call-template>
@@ -9419,6 +9421,7 @@
9419
9421
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
9420
9422
  <!-- fn in text -->
9421
9423
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
9424
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
9422
9425
 
9423
9426
  <!-- list of unique footnotes -->
9424
9427
  <xsl:variable name="p_fn_">
@@ -9497,7 +9500,7 @@
9497
9500
  <xsl:copy-of select="$footnote_inline"/>
9498
9501
  </xsl:when>
9499
9502
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
9500
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
9503
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
9501
9504
 
9502
9505
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
9503
9506
  <xsl:copy-of select="$footnote_inline"/>
@@ -9906,39 +9909,51 @@
9906
9909
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
9907
9910
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
9908
9911
  <xsl:template match="*[local-name()='fn']">
9909
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
9912
+ <xsl:variable name="target" select="@target"/>
9913
+ <xsl:choose>
9914
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
9915
+ <xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
9916
+ <xsl:call-template name="fn">
9917
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
9918
+ </xsl:call-template>
9919
+ </xsl:when>
9920
+ <xsl:otherwise>
9910
9921
 
9911
- <xsl:call-template name="refine_fn-reference-style"/>
9922
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
9912
9923
 
9913
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
9914
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
9915
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
9916
- <!-- <xsl:attribute name="internal-destination">
9917
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
9918
- </xsl:attribute>
9919
- </xsl:if>
9920
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
9921
- <xsl:attribute name="internal-destination">
9922
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
9923
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
9924
- </xsl:attribute>
9925
- </xsl:if> -->
9926
- <!-- <xsl:if test="$namespace = 'plateau'">
9927
- <xsl:text>※</xsl:text>
9928
- </xsl:if> -->
9929
- <!-- <xsl:value-of select="@reference"/> -->
9924
+ <xsl:call-template name="refine_fn-reference-style"/>
9930
9925
 
9931
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
9926
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
9927
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
9928
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
9929
+ <!-- <xsl:attribute name="internal-destination">
9930
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
9931
+ </xsl:attribute>
9932
+ </xsl:if>
9933
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
9934
+ <xsl:attribute name="internal-destination">
9935
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
9936
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
9937
+ </xsl:attribute>
9938
+ </xsl:if> -->
9939
+ <!-- <xsl:if test="$namespace = 'plateau'">
9940
+ <xsl:text>※</xsl:text>
9941
+ </xsl:if> -->
9942
+ <!-- <xsl:value-of select="@reference"/> -->
9932
9943
 
9933
- <!-- <xsl:if test="$namespace = 'bsi'">
9934
- <xsl:text>)</xsl:text>
9935
- </xsl:if> -->
9936
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
9937
- <!-- <xsl:if test="$namespace = 'jis'">
9938
- <fo:inline font-weight="normal">)</fo:inline>
9939
- </xsl:if> -->
9940
- </fo:basic-link>
9941
- </fo:inline>
9944
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
9945
+
9946
+ <!-- <xsl:if test="$namespace = 'bsi'">
9947
+ <xsl:text>)</xsl:text>
9948
+ </xsl:if> -->
9949
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
9950
+ <!-- <xsl:if test="$namespace = 'jis'">
9951
+ <fo:inline font-weight="normal">)</fo:inline>
9952
+ </xsl:if> -->
9953
+ </fo:basic-link>
9954
+ </fo:inline>
9955
+ </xsl:otherwise>
9956
+ </xsl:choose>
9942
9957
  </xsl:template> <!-- fn -->
9943
9958
 
9944
9959
  <!-- fn/text() -->
@@ -14073,6 +14088,13 @@
14073
14088
  <xsl:apply-templates select="."/>
14074
14089
  </xsl:template>
14075
14090
 
14091
+ <!-- prevent missing stem for table and figures in ToC -->
14092
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
14093
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
14094
+ <xsl:apply-templates select="."/>
14095
+ </xsl:if>
14096
+ </xsl:template>
14097
+
14076
14098
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
14077
14099
 
14078
14100
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -14296,7 +14318,8 @@
14296
14318
 
14297
14319
  <xsl:for-each select="$contents_nodes//tables/table">
14298
14320
  <fo:bookmark internal-destination="{@id}">
14299
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
14321
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
14322
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
14300
14323
  </fo:bookmark>
14301
14324
  </xsl:for-each>
14302
14325
  </fo:bookmark>
@@ -14305,6 +14328,26 @@
14305
14328
  </xsl:template> <!-- insertTableBookmarks -->
14306
14329
  <!-- End Bookmarks -->
14307
14330
 
14331
+ <!-- ============================ -->
14332
+ <!-- mode="bookmark_clean" -->
14333
+ <!-- ============================ -->
14334
+ <xsl:template match="node()" mode="bookmark_clean">
14335
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
14336
+ </xsl:template>
14337
+
14338
+ <xsl:template match="text()" mode="bookmark_clean">
14339
+ <xsl:value-of select="."/>
14340
+ </xsl:template>
14341
+
14342
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
14343
+ <xsl:value-of select="normalize-space(.)"/>
14344
+ </xsl:template>
14345
+
14346
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
14347
+ <!-- ============================ -->
14348
+ <!-- END: mode="bookmark_clean" -->
14349
+ <!-- ============================ -->
14350
+
14308
14351
  <xsl:template name="getLangVersion">
14309
14352
  <xsl:param name="lang"/>
14310
14353
  <xsl:param name="doctype" select="''"/>
@@ -16340,9 +16383,15 @@
16340
16383
  <xsl:when test="local-name(..) = 'ul'">
16341
16384
  <xsl:choose>
16342
16385
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
16386
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
16387
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
16343
16388
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
16344
16389
  </xsl:choose>
16345
16390
  </xsl:when>
16391
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
16392
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
16393
+ <xsl:value-of select="@label"/>
16394
+ </xsl:when>
16346
16395
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
16347
16396
 
16348
16397
  <xsl:variable name="type" select="../@type"/>
@@ -16474,7 +16523,7 @@
16474
16523
 
16475
16524
  </xsl:otherwise>
16476
16525
  </xsl:choose>
16477
- </xsl:template>
16526
+ </xsl:template> <!-- getListItemFormat -->
16478
16527
 
16479
16528
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
16480
16529
  <xsl:param name="indent">0</xsl:param>
@@ -16636,6 +16685,11 @@
16636
16685
 
16637
16686
  <xsl:call-template name="refine_list-item-label-style"/>
16638
16687
 
16688
+ <xsl:if test="local-name(..) = 'ul'">
16689
+ <xsl:variable name="li_label" select="@label"/>
16690
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
16691
+ </xsl:if>
16692
+
16639
16693
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
16640
16694
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
16641
16695
  <xsl:call-template name="append_add-style"/>
@@ -18044,6 +18098,16 @@
18044
18098
  </xsl:choose>
18045
18099
  </xsl:template>
18046
18100
 
18101
+ <!-- li/fmt-name -->
18102
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
18103
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
18104
+ <xsl:attribute name="full">true</xsl:attribute>
18105
+ </xsl:template>
18106
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
18107
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
18108
+ <xsl:attribute name="full">true</xsl:attribute>
18109
+ </xsl:template>
18110
+
18047
18111
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
18048
18112
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
18049
18113
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -18981,6 +19045,64 @@
18981
19045
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
18982
19046
  </xsl:template>
18983
19047
 
19048
+ <!-- ===================================== -->
19049
+ <!-- ===================================== -->
19050
+ <!-- Ruby text (CJK languages) rendering -->
19051
+ <!-- ===================================== -->
19052
+ <!-- ===================================== -->
19053
+ <xsl:template match="*[local-name() = 'ruby']">
19054
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
19055
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
19056
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
19057
+ </xsl:if>
19058
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
19059
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
19060
+ <!-- Example: width="2em" -->
19061
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
19062
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
19063
+ <xsl:variable name="text_width">
19064
+ <xsl:choose>
19065
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
19066
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
19067
+ </xsl:choose>
19068
+ </xsl:variable>
19069
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
19070
+
19071
+ <xsl:choose>
19072
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
19073
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
19074
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
19075
+ </xsl:when>
19076
+ <xsl:otherwise>
19077
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
19078
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
19079
+ </xsl:otherwise>
19080
+ </xsl:choose>
19081
+
19082
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
19083
+ </fo:inline-container>
19084
+ </xsl:template>
19085
+
19086
+ <xsl:template match="*[local-name() = 'rb']">
19087
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
19088
+ </xsl:template>
19089
+
19090
+ <xsl:template match="*[local-name() = 'rt']">
19091
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
19092
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
19093
+ <xsl:attribute name="space-before">0em</xsl:attribute>
19094
+ </xsl:if>
19095
+ <xsl:apply-templates/>
19096
+ </fo:block>
19097
+
19098
+ </xsl:template>
19099
+
19100
+ <!-- ===================================== -->
19101
+ <!-- ===================================== -->
19102
+ <!-- END: Ruby text (CJK languages) rendering -->
19103
+ <!-- ===================================== -->
19104
+ <!-- ===================================== -->
19105
+
18984
19106
  <xsl:template name="printEdition">
18985
19107
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
18986
19108