metanorma-plateau 1.0.0 → 1.0.2

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.
@@ -2685,6 +2685,7 @@
2685
2685
  </xsl:template> <!-- refine_table-style -->
2686
2686
 
2687
2687
  <xsl:attribute-set name="table-name-style">
2688
+ <xsl:attribute name="role">Caption</xsl:attribute>
2688
2689
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2689
2690
 
2690
2691
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2696,6 +2697,9 @@
2696
2697
 
2697
2698
  <xsl:template name="refine_table-name-style">
2698
2699
  <xsl:param name="continued"/>
2700
+ <xsl:if test="$continued = 'true'">
2701
+ <xsl:attribute name="role">SKIP</xsl:attribute>
2702
+ </xsl:if>
2699
2703
 
2700
2704
  <xsl:if test="$doctype = 'technical-report'">
2701
2705
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -2853,11 +2857,6 @@
2853
2857
 
2854
2858
  <xsl:template name="refine_table-fmt-fn-label-style">
2855
2859
 
2856
- <xsl:attribute name="font-size">60%</xsl:attribute>
2857
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2858
- <xsl:attribute name="padding-right">2mm</xsl:attribute>
2859
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2860
-
2861
2860
  </xsl:template>
2862
2861
 
2863
2862
  <xsl:attribute-set name="fn-container-body-style">
@@ -4470,7 +4469,7 @@
4470
4469
  </xsl:if>
4471
4470
 
4472
4471
  </fo:block-container>
4473
- </xsl:variable>
4472
+ </xsl:variable> <!-- END: variable name="table" -->
4474
4473
 
4475
4474
  <xsl:variable name="isAdded" select="@added"/>
4476
4475
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4480,14 +4479,14 @@
4480
4479
 
4481
4480
  <!-- centered table when table name is centered (see table-name-style) -->
4482
4481
 
4483
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
4482
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
4484
4483
 
4485
4484
  <fo:table-column column-width="proportional-column-width(1)"/>
4486
4485
  <fo:table-column column-width="{@width}"/>
4487
4486
  <fo:table-column column-width="proportional-column-width(1)"/>
4488
- <fo:table-body>
4489
- <fo:table-row>
4490
- <fo:table-cell column-number="2">
4487
+ <fo:table-body role="SKIP">
4488
+ <fo:table-row role="SKIP">
4489
+ <fo:table-cell column-number="2" role="SKIP">
4491
4490
  <xsl:copy-of select="$table-preamble"/>
4492
4491
  <fo:block role="SKIP">
4493
4492
  <xsl:call-template name="setTrackChangesStyles">
@@ -4528,11 +4527,12 @@
4528
4527
 
4529
4528
  </xsl:template>
4530
4529
 
4530
+ <!-- table/name-->
4531
4531
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
4532
4532
  <xsl:param name="continued"/>
4533
4533
  <xsl:if test="normalize-space() != ''">
4534
4534
 
4535
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
4535
+ <fo:block xsl:use-attribute-sets="table-name-style">
4536
4536
 
4537
4537
  <xsl:call-template name="refine_table-name-style">
4538
4538
  <xsl:with-param name="continued" select="$continued"/>
@@ -5009,7 +5009,7 @@
5009
5009
 
5010
5010
  <xsl:variable name="tableWithNotesAndFootnotes">
5011
5011
 
5012
- <fo:table keep-with-previous="always">
5012
+ <fo:table keep-with-previous="always" role="SKIP">
5013
5013
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
5014
5014
  <xsl:variable name="name" select="local-name()"/>
5015
5015
  <xsl:choose>
@@ -5040,9 +5040,9 @@
5040
5040
  </xsl:otherwise>
5041
5041
  </xsl:choose>
5042
5042
 
5043
- <fo:table-body>
5044
- <fo:table-row>
5045
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
5043
+ <fo:table-body role="SKIP">
5044
+ <fo:table-row role="SKIP">
5045
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
5046
5046
 
5047
5047
  <xsl:call-template name="refine_table-footer-cell-style"/>
5048
5048
 
@@ -5054,14 +5054,11 @@
5054
5054
 
5055
5055
  <!-- except gb and bsi -->
5056
5056
 
5057
- <!-- https://github.com/metanorma/metanorma-plateau/issues/171 : the order is: definition list, text paragraphs, EXAMPLEs, NOTEs, footnotes, then source at the end -->
5058
- <xsl:apply-templates select="../*[local-name()='dl']"/>
5059
5057
  <xsl:apply-templates select="../*[local-name()='p']"/>
5060
- <xsl:apply-templates select="../*[local-name()='example']"/>
5058
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
5061
5059
  <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
5062
- <!-- <xsl:copy-of select="$table_fn_block"/> -->
5060
+ <xsl:apply-templates select="../*[local-name()='example']"/>
5063
5061
  <xsl:apply-templates select="../*[local-name()='source']"/>
5064
- <!-- renders in tfoot -->
5065
5062
 
5066
5063
  <xsl:variable name="isDisplayRowSeparator">
5067
5064
 
@@ -5247,6 +5244,8 @@
5247
5244
 
5248
5245
  <xsl:template name="setTableRowAttributes">
5249
5246
 
5247
+ <xsl:call-template name="setColors"/>
5248
+
5250
5249
  </xsl:template> <!-- setTableRowAttributes -->
5251
5250
  <!-- ===================== -->
5252
5251
  <!-- END Table's row processing -->
@@ -5298,6 +5297,7 @@
5298
5297
  </xsl:attribute>
5299
5298
  </xsl:if>
5300
5299
  <xsl:call-template name="display-align"/>
5300
+ <xsl:call-template name="setColors"/>
5301
5301
  </xsl:template>
5302
5302
 
5303
5303
  <xsl:template name="display-align">
@@ -5313,6 +5313,29 @@
5313
5313
  </xsl:if>
5314
5314
  </xsl:template>
5315
5315
 
5316
+ <xsl:template name="setColors">
5317
+ <xsl:variable name="styles__">
5318
+ <xsl:call-template name="split">
5319
+ <xsl:with-param name="pText" select="concat(@style,';')"/>
5320
+ <xsl:with-param name="sep" select="';'"/>
5321
+ </xsl:call-template>
5322
+ </xsl:variable>
5323
+ <xsl:variable name="quot">"</xsl:variable>
5324
+ <xsl:variable name="styles_">
5325
+ <xsl:for-each select="xalan:nodeset($styles__)/item">
5326
+ <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5327
+ <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5328
+ <xsl:if test="$key = 'color' or $key = 'background-color'">
5329
+ <style name="{$key}"><xsl:value-of select="$value"/></style>
5330
+ </xsl:if>
5331
+ </xsl:for-each>
5332
+ </xsl:variable>
5333
+ <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
5334
+ <xsl:for-each select="$styles/style">
5335
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
5336
+ </xsl:for-each>
5337
+ </xsl:template>
5338
+
5316
5339
  <!-- cell in table body, footer -->
5317
5340
  <xsl:template match="*[local-name()='td']" name="td">
5318
5341
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
@@ -5324,12 +5347,12 @@
5324
5347
 
5325
5348
  <xsl:call-template name="refine_table-cell-style"/>
5326
5349
 
5350
+ <xsl:call-template name="setTableCellAttributes"/>
5351
+
5327
5352
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
5328
5353
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
5329
5354
  </xsl:if>
5330
5355
 
5331
- <xsl:call-template name="setTableCellAttributes"/>
5332
-
5333
5356
  <xsl:if test="$isGenerateTableIF = 'true'">
5334
5357
  <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
5335
5358
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -5414,6 +5437,7 @@
5414
5437
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
5415
5438
  <!-- fn in text -->
5416
5439
  <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">
5440
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
5417
5441
 
5418
5442
  <!-- list of unique footnotes -->
5419
5443
  <xsl:variable name="p_fn_">
@@ -5479,7 +5503,7 @@
5479
5503
  <xsl:copy-of select="$footnote_inline"/>
5480
5504
  </xsl:when>
5481
5505
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
5482
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
5506
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
5483
5507
 
5484
5508
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
5485
5509
  <xsl:copy-of select="$footnote_inline"/>
@@ -5897,39 +5921,51 @@
5897
5921
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
5898
5922
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
5899
5923
  <xsl:template match="*[local-name()='fn']">
5900
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
5901
-
5902
- <xsl:call-template name="refine_fn-reference-style"/>
5924
+ <xsl:variable name="target" select="@target"/>
5925
+ <xsl:choose>
5926
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
5927
+ <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]">
5928
+ <xsl:call-template name="fn">
5929
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
5930
+ </xsl:call-template>
5931
+ </xsl:when>
5932
+ <xsl:otherwise>
5903
5933
 
5904
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5905
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
5906
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
5907
- <!-- <xsl:attribute name="internal-destination">
5908
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
5909
- </xsl:attribute>
5910
- </xsl:if>
5911
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
5912
- <xsl:attribute name="internal-destination">
5913
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
5914
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
5915
- </xsl:attribute>
5916
- </xsl:if> -->
5917
- <!-- <xsl:if test="$namespace = 'plateau'">
5918
- <xsl:text>※</xsl:text>
5919
- </xsl:if> -->
5920
- <!-- <xsl:value-of select="@reference"/> -->
5934
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
5921
5935
 
5922
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5936
+ <xsl:call-template name="refine_fn-reference-style"/>
5923
5937
 
5924
- <!-- <xsl:if test="$namespace = 'bsi'">
5925
- <xsl:text>)</xsl:text>
5926
- </xsl:if> -->
5927
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
5928
- <!-- <xsl:if test="$namespace = 'jis'">
5929
- <fo:inline font-weight="normal">)</fo:inline>
5930
- </xsl:if> -->
5931
- </fo:basic-link>
5932
- </fo:inline>
5938
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5939
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
5940
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
5941
+ <!-- <xsl:attribute name="internal-destination">
5942
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
5943
+ </xsl:attribute>
5944
+ </xsl:if>
5945
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
5946
+ <xsl:attribute name="internal-destination">
5947
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
5948
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
5949
+ </xsl:attribute>
5950
+ </xsl:if> -->
5951
+ <!-- <xsl:if test="$namespace = 'plateau'">
5952
+ <xsl:text>※</xsl:text>
5953
+ </xsl:if> -->
5954
+ <!-- <xsl:value-of select="@reference"/> -->
5955
+
5956
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5957
+
5958
+ <!-- <xsl:if test="$namespace = 'bsi'">
5959
+ <xsl:text>)</xsl:text>
5960
+ </xsl:if> -->
5961
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
5962
+ <!-- <xsl:if test="$namespace = 'jis'">
5963
+ <fo:inline font-weight="normal">)</fo:inline>
5964
+ </xsl:if> -->
5965
+ </fo:basic-link>
5966
+ </fo:inline>
5967
+ </xsl:otherwise>
5968
+ </xsl:choose>
5933
5969
  </xsl:template> <!-- fn -->
5934
5970
 
5935
5971
  <!-- fn/text() -->
@@ -7160,7 +7196,7 @@
7160
7196
  <xsl:choose>
7161
7197
  <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
7162
7198
  <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
7163
- <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
7199
+ <fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
7164
7200
  </xsl:when>
7165
7201
  <xsl:otherwise>
7166
7202
  <xsl:apply-templates/>
@@ -7168,7 +7204,7 @@
7168
7204
  </xsl:choose>
7169
7205
  </xsl:template>
7170
7206
  <xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
7171
- <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
7207
+ <fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:value-of select="."/></fo:inline>
7172
7208
  </xsl:template>
7173
7209
 
7174
7210
  <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
@@ -8208,24 +8244,26 @@
8208
8244
  <xsl:apply-templates select="." mode="mathml"/>
8209
8245
  </xsl:variable>
8210
8246
 
8211
- <fo:instream-foreign-object fox:alt-text="Math">
8247
+ <fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
8212
8248
 
8213
8249
  <xsl:call-template name="refine_mathml_insteam_object_style"/>
8214
8250
 
8215
- <!-- put MathML in Actual Text -->
8216
- <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
8217
- <xsl:attribute name="fox:actual-text">
8218
- <xsl:value-of select="$mathml_content"/>
8219
- </xsl:attribute>
8220
-
8221
- <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
8222
- <xsl:if test="normalize-space($asciimath_text_) != ''">
8223
- <!-- put Mathin Alternate Text -->
8224
- <xsl:attribute name="fox:alt-text">
8225
- <xsl:value-of select="$asciimath_text_"/>
8251
+ <xsl:if test="$isGenerateTableIF = 'false'">
8252
+ <!-- put MathML in Actual Text -->
8253
+ <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
8254
+ <xsl:attribute name="fox:actual-text">
8255
+ <xsl:value-of select="$mathml_content"/>
8226
8256
  </xsl:attribute>
8257
+
8258
+ <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
8259
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
8260
+ <!-- put Mathin Alternate Text -->
8261
+ <xsl:attribute name="fox:alt-text">
8262
+ <xsl:value-of select="$asciimath_text_"/>
8263
+ </xsl:attribute>
8264
+ </xsl:if>
8265
+ <!-- </xsl:if> -->
8227
8266
  </xsl:if>
8228
- <!-- </xsl:if> -->
8229
8267
 
8230
8268
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
8231
8269
 
@@ -9965,6 +10003,13 @@
9965
10003
  <xsl:apply-templates select="."/>
9966
10004
  </xsl:template>
9967
10005
 
10006
+ <!-- prevent missing stem for table and figures in ToC -->
10007
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
10008
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
10009
+ <xsl:apply-templates select="."/>
10010
+ </xsl:if>
10011
+ </xsl:template>
10012
+
9968
10013
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
9969
10014
 
9970
10015
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -9985,6 +10030,8 @@
9985
10030
  <xsl:template match="*[local-name() = 'origin']" mode="contents"/>
9986
10031
  <xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
9987
10032
 
10033
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="contents" priority="3"/>
10034
+
9988
10035
  <xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
9989
10036
  <xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
9990
10037
  <xsl:apply-templates mode="bookmarks"/>
@@ -10006,6 +10053,8 @@
10006
10053
  <xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
10007
10054
  <xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
10008
10055
 
10056
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="bookmarks" priority="3"/>
10057
+
10009
10058
  <!-- Bookmarks -->
10010
10059
  <xsl:template name="addBookmarks">
10011
10060
  <xsl:param name="contents"/>
@@ -10184,7 +10233,8 @@
10184
10233
 
10185
10234
  <xsl:for-each select="$contents_nodes//tables/table">
10186
10235
  <fo:bookmark internal-destination="{@id}">
10187
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
10236
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
10237
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
10188
10238
  </fo:bookmark>
10189
10239
  </xsl:for-each>
10190
10240
  </fo:bookmark>
@@ -10193,6 +10243,26 @@
10193
10243
  </xsl:template> <!-- insertTableBookmarks -->
10194
10244
  <!-- End Bookmarks -->
10195
10245
 
10246
+ <!-- ============================ -->
10247
+ <!-- mode="bookmark_clean" -->
10248
+ <!-- ============================ -->
10249
+ <xsl:template match="node()" mode="bookmark_clean">
10250
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
10251
+ </xsl:template>
10252
+
10253
+ <xsl:template match="text()" mode="bookmark_clean">
10254
+ <xsl:value-of select="."/>
10255
+ </xsl:template>
10256
+
10257
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
10258
+ <xsl:value-of select="normalize-space(.)"/>
10259
+ </xsl:template>
10260
+
10261
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
10262
+ <!-- ============================ -->
10263
+ <!-- END: mode="bookmark_clean" -->
10264
+ <!-- ============================ -->
10265
+
10196
10266
  <xsl:template name="getLangVersion">
10197
10267
  <xsl:param name="lang"/>
10198
10268
  <xsl:param name="doctype" select="''"/>
@@ -11874,21 +11944,32 @@
11874
11944
  <!-- ========== -->
11875
11945
 
11876
11946
  <xsl:variable name="reviews_">
11877
- <xsl:for-each select="//*[local-name() = 'review'][@from]">
11947
+ <xsl:for-each select="//*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])][@from]">
11878
11948
  <xsl:copy>
11879
11949
  <xsl:copy-of select="@from"/>
11880
11950
  <xsl:copy-of select="@id"/>
11881
11951
  </xsl:copy>
11882
11952
  </xsl:for-each>
11953
+ <xsl:for-each select="//*[local-name() = 'fmt-review-start'][@source]">
11954
+ <xsl:copy>
11955
+ <xsl:copy-of select="@source"/>
11956
+ <xsl:copy-of select="@id"/>
11957
+ </xsl:copy>
11958
+ </xsl:for-each>
11883
11959
  </xsl:variable>
11884
11960
  <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
11885
11961
 
11886
11962
  <xsl:template name="addReviewHelper">
11887
- <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
11888
- <xsl:variable name="curr_id" select="@id"/>
11889
- <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
11890
- <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
11891
- <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11963
+ <xsl:if test="$isGenerateTableIF = 'false'">
11964
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
11965
+ <xsl:variable name="curr_id" select="@id"/>
11966
+ <!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
11967
+ <xsl:for-each select="$reviews//*[local-name() = 'review'][@from = $curr_id]"> <!-- $reviews//*[local-name() = 'fmt-review-start'][@source = $curr_id] -->
11968
+ <xsl:variable name="review_id" select="normalize-space(@id)"/>
11969
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
11970
+ <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11971
+ </xsl:if>
11972
+ </xsl:for-each>
11892
11973
  </xsl:if>
11893
11974
  <!-- <fo:block>
11894
11975
  <curr_id><xsl:value-of select="$curr_id"/></curr_id>
@@ -12025,14 +12106,61 @@
12025
12106
 
12026
12107
  </xsl:template>
12027
12108
 
12028
- <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12109
+ <!-- document text (not figures, or tables) footnotes -->
12110
+ <xsl:variable name="reviews_container_">
12111
+ <xsl:for-each select="//*[local-name() = 'review-container']/*[local-name() = 'fmt-review-body']">
12112
+ <xsl:variable name="update_xml_step1">
12113
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
12114
+ </xsl:variable>
12115
+ <xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
12116
+ </xsl:for-each>
12117
+ </xsl:variable>
12118
+ <xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
12119
+
12120
+ <xsl:template match="*[local-name() = 'review-container']"/>
12121
+
12122
+ <!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
12123
+ <xsl:template match="*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12124
+ <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
12125
+ <xsl:if test="$isGenerateTableIF = 'false'">
12126
+ <xsl:choose>
12127
+ <!-- if there isn't the attribute '@from', then -->
12128
+ <xsl:when test="$id_from = ''">
12129
+ <fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12130
+ </xsl:when>
12131
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
12132
+ <xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
12133
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12134
+ </xsl:when>
12135
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
12136
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12137
+ </xsl:when>
12138
+ </xsl:choose>
12139
+ </xsl:if>
12140
+ </xsl:template>
12141
+
12142
+ <!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
12143
+ <xsl:template match="*[local-name() = 'fmt-review-start']" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12029
12144
  <!-- comment 2019-11-29 -->
12030
12145
  <!-- <fo:block font-weight="bold">Review:</fo:block>
12031
12146
  <xsl:apply-templates /> -->
12032
12147
 
12033
- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
12148
+ <xsl:variable name="id_from" select="normalize-space(current()/@source)"/>
12034
12149
 
12035
- <xsl:if test="1 = 1">
12150
+ <xsl:variable name="source" select="normalize-space(@source)"/>
12151
+
12152
+ <xsl:if test="$isGenerateTableIF = 'false'">
12153
+ <!-- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> -->
12154
+
12155
+ <!-- <xsl:if test="@source = @end"> -->
12156
+ <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
12157
+ following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
12158
+ <!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
12159
+ <fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12160
+ <!-- </xsl:if> -->
12161
+ </xsl:if>
12162
+
12163
+ <xsl:if test="1 = 2">
12036
12164
  <xsl:choose>
12037
12165
  <!-- if there isn't the attribute '@from', then -->
12038
12166
  <xsl:when test="$id_from = ''">
@@ -12040,10 +12168,10 @@
12040
12168
  </xsl:when>
12041
12169
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
12042
12170
  <xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
12043
- <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12171
+ <fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12044
12172
  </xsl:when>
12045
12173
  <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
12046
- <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12174
+ <fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12047
12175
  </xsl:when>
12048
12176
  </xsl:choose>
12049
12177
  </xsl:if>
@@ -12079,40 +12207,35 @@
12079
12207
  <!-- ===================================== -->
12080
12208
  <xsl:variable name="ul_labels_">
12081
12209
 
12082
- <xsl:choose>
12083
- <xsl:when test="$doctype = 'technical-report'">
12084
- <label level="1" font-size="130%" line-height="1.2">・</label> <!-- Katakana Middle Dot -->
12085
- <label level="2">→</label> <!-- will be replaced in the template 'li' -->
12086
- <label level="3">☆</label> <!-- will be replaced in the template 'li' -->
12087
- </xsl:when>
12088
- <xsl:otherwise>
12089
- <label level="1" font-size="130%" line-height="1.2">・</label> <!-- Katakana Middle Dot -->
12090
- <label level="2">-</label> <!-- full-width hyphen minus -->
12091
- <label level="3" font-size="130%" line-height="1.2">・</label>
12092
- </xsl:otherwise>
12093
- </xsl:choose>
12210
+ <label level="1">-</label> <!-- full-width hyphen minus -->
12211
+ <label level="2" font-size="130%" line-height="1.2">・</label> <!-- Katakana Middle Dot -->
12094
12212
 
12095
12213
  </xsl:variable>
12096
12214
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
12097
12215
 
12098
12216
  <xsl:template name="setULLabel">
12099
12217
  <xsl:variable name="list_level__">
12100
- <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
12218
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul'])"/>
12101
12219
  </xsl:variable>
12102
12220
  <xsl:variable name="list_level_" select="number($list_level__)"/>
12103
12221
  <xsl:variable name="list_level">
12104
12222
  <xsl:choose>
12105
12223
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
12106
- <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
12224
+ <xsl:when test="$ul_labels/label[@level = 3]"><xsl:value-of select="$list_level_ mod 3"/></xsl:when>
12225
+ <xsl:when test="$list_level_ mod 2 = 0">2</xsl:when>
12226
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 2"/></xsl:otherwise>
12107
12227
  </xsl:choose>
12108
12228
  </xsl:variable>
12109
12229
  <xsl:choose>
12110
12230
  <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
12111
12231
  <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
12112
12232
  </xsl:when>
12113
- <xsl:when test="$list_level mod 3 = 0">
12233
+ <xsl:when test="$list_level mod 3 = 0 and $ul_labels/label[@level = 3]">
12114
12234
  <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
12115
12235
  </xsl:when>
12236
+ <xsl:when test="$list_level mod 3 = 0">
12237
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
12238
+ </xsl:when>
12116
12239
  <xsl:when test="$list_level mod 2 = 0">
12117
12240
  <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
12118
12241
  </xsl:when>
@@ -12133,9 +12256,15 @@
12133
12256
  <xsl:when test="local-name(..) = 'ul'">
12134
12257
  <xsl:choose>
12135
12258
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
12259
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
12260
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
12136
12261
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
12137
12262
  </xsl:choose>
12138
12263
  </xsl:when>
12264
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
12265
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
12266
+ <xsl:value-of select="@label"/>
12267
+ </xsl:when>
12139
12268
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
12140
12269
 
12141
12270
  <xsl:variable name="type" select="../@type"/>
@@ -12260,7 +12389,7 @@
12260
12389
 
12261
12390
  </xsl:otherwise>
12262
12391
  </xsl:choose>
12263
- </xsl:template>
12392
+ </xsl:template> <!-- getListItemFormat -->
12264
12393
 
12265
12394
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
12266
12395
  <xsl:param name="indent">0</xsl:param>
@@ -12399,6 +12528,11 @@
12399
12528
 
12400
12529
  <xsl:call-template name="refine_list-item-label-style"/>
12401
12530
 
12531
+ <xsl:if test="local-name(..) = 'ul'">
12532
+ <xsl:variable name="li_label" select="@label"/>
12533
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
12534
+ </xsl:if>
12535
+
12402
12536
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
12403
12537
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
12404
12538
  <xsl:call-template name="append_add-style"/>
@@ -12664,10 +12798,22 @@
12664
12798
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/>
12665
12799
 
12666
12800
  <xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
12667
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12668
- <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
12669
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12670
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12801
+ <xsl:variable name="bookmark_id" select="@id"/>
12802
+ <xsl:choose>
12803
+ <!-- Example:
12804
+ <fmt-review-start id="_7ef81cf7-3f6c-4ed4-9c1f-1ba092052bbd" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" end="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/>
12805
+ <bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
12806
+ <fmt-review-end id="_f336a8d0-08a8-4b7f-a1aa-b04688ed40c1" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" start="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/> -->
12807
+ <xsl:when test="1 = 2 and preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]">
12808
+ <!-- skip here, see the template 'fmt-review-start' -->
12809
+ </xsl:when>
12810
+ <xsl:otherwise>
12811
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12812
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12813
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12814
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12815
+ </xsl:otherwise>
12816
+ </xsl:choose>
12671
12817
  </xsl:template>
12672
12818
  <!-- =================== -->
12673
12819
  <!-- End of Index processing -->
@@ -13785,6 +13931,16 @@
13785
13931
  </xsl:choose>
13786
13932
  </xsl:template>
13787
13933
 
13934
+ <!-- li/fmt-name -->
13935
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
13936
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
13937
+ <xsl:attribute name="full">true</xsl:attribute>
13938
+ </xsl:template>
13939
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
13940
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
13941
+ <xsl:attribute name="full">true</xsl:attribute>
13942
+ </xsl:template>
13943
+
13788
13944
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
13789
13945
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
13790
13946
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -14014,6 +14170,9 @@
14014
14170
  <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
14015
14171
  <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
14016
14172
 
14173
+ <xsl:template match="*[local-name() = 'review-container']" mode="update_xml_step1"/>
14174
+ <xsl:template match="*[local-name() = 'review-container']" mode="update_xml_pres"/>
14175
+
14017
14176
  <!-- END: update new Presentation XML -->
14018
14177
 
14019
14178
  <!-- =========================================================================== -->
@@ -14703,6 +14862,64 @@
14703
14862
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
14704
14863
  </xsl:template>
14705
14864
 
14865
+ <!-- ===================================== -->
14866
+ <!-- ===================================== -->
14867
+ <!-- Ruby text (CJK languages) rendering -->
14868
+ <!-- ===================================== -->
14869
+ <!-- ===================================== -->
14870
+ <xsl:template match="*[local-name() = 'ruby']">
14871
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
14872
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
14873
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14874
+ </xsl:if>
14875
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
14876
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
14877
+ <!-- Example: width="2em" -->
14878
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14879
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14880
+ <xsl:variable name="text_width">
14881
+ <xsl:choose>
14882
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14883
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14884
+ </xsl:choose>
14885
+ </xsl:variable>
14886
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14887
+
14888
+ <xsl:choose>
14889
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
14890
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
14891
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
14892
+ </xsl:when>
14893
+ <xsl:otherwise>
14894
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
14895
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
14896
+ </xsl:otherwise>
14897
+ </xsl:choose>
14898
+
14899
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
14900
+ </fo:inline-container>
14901
+ </xsl:template>
14902
+
14903
+ <xsl:template match="*[local-name() = 'rb']">
14904
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
14905
+ </xsl:template>
14906
+
14907
+ <xsl:template match="*[local-name() = 'rt']">
14908
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
14909
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
14910
+ <xsl:attribute name="space-before">0em</xsl:attribute>
14911
+ </xsl:if>
14912
+ <xsl:apply-templates/>
14913
+ </fo:block>
14914
+
14915
+ </xsl:template>
14916
+
14917
+ <!-- ===================================== -->
14918
+ <!-- ===================================== -->
14919
+ <!-- END: Ruby text (CJK languages) rendering -->
14920
+ <!-- ===================================== -->
14921
+ <!-- ===================================== -->
14922
+
14706
14923
  <xsl:template name="printEdition">
14707
14924
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
14708
14925