metanorma-bipm 2.6.4 → 2.6.6
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 +4 -4
- data/lib/isodoc/bipm/bipm.brochure.xsl +330 -65
- data/lib/isodoc/bipm/bipm.guide.xsl +330 -65
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +330 -65
- data/lib/isodoc/bipm/bipm.rapport.xsl +330 -65
- data/lib/isodoc/bipm/jcgm.standard.xsl +340 -67
- data/lib/isodoc/bipm/presentation_blocks.rb +12 -0
- data/lib/metanorma/bipm/basicdoc.rng +14 -8
- data/lib/metanorma/bipm/biblio-standoc.rng +37 -7
- data/lib/metanorma/bipm/biblio.rng +30 -18
- data/lib/metanorma/bipm/bipm.rng +3 -67
- data/lib/metanorma/bipm/converter.rb +2 -2
- data/lib/metanorma/bipm/isodoc.rng +130 -96
- data/lib/metanorma/bipm/relaton-bipm.rng +18 -24
- data/lib/metanorma/bipm/reqt.rng +7 -6
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma.yml +7 -7
- metadata +2 -2
@@ -2617,6 +2617,7 @@
|
|
2617
2617
|
</xsl:template> <!-- refine_table-style -->
|
2618
2618
|
|
2619
2619
|
<xsl:attribute-set name="table-name-style">
|
2620
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
2620
2621
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2621
2622
|
|
2622
2623
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
@@ -2628,6 +2629,9 @@
|
|
2628
2629
|
|
2629
2630
|
<xsl:template name="refine_table-name-style">
|
2630
2631
|
<xsl:param name="continued"/>
|
2632
|
+
<xsl:if test="$continued = 'true'">
|
2633
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
2634
|
+
</xsl:if>
|
2631
2635
|
|
2632
2636
|
</xsl:template> <!-- refine_table-name-style -->
|
2633
2637
|
|
@@ -4285,8 +4289,14 @@
|
|
4285
4289
|
</xsl:choose>
|
4286
4290
|
</xsl:variable>
|
4287
4291
|
|
4292
|
+
<xsl:call-template name="setNamedDestination"/>
|
4293
|
+
|
4288
4294
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
4289
4295
|
|
4296
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
4297
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4298
|
+
</xsl:for-each>
|
4299
|
+
|
4290
4300
|
<xsl:call-template name="refine_table-container-style">
|
4291
4301
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
4292
4302
|
</xsl:call-template>
|
@@ -4430,7 +4440,7 @@
|
|
4430
4440
|
</xsl:if>
|
4431
4441
|
|
4432
4442
|
</fo:block-container>
|
4433
|
-
</xsl:variable>
|
4443
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
4434
4444
|
|
4435
4445
|
<xsl:variable name="isAdded" select="@added"/>
|
4436
4446
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -4440,14 +4450,14 @@
|
|
4440
4450
|
|
4441
4451
|
<!-- centered table when table name is centered (see table-name-style) -->
|
4442
4452
|
|
4443
|
-
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
|
4453
|
+
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
|
4444
4454
|
|
4445
4455
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
4446
4456
|
<fo:table-column column-width="{@width}"/>
|
4447
4457
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
4448
|
-
<fo:table-body>
|
4449
|
-
<fo:table-row>
|
4450
|
-
<fo:table-cell column-number="2">
|
4458
|
+
<fo:table-body role="SKIP">
|
4459
|
+
<fo:table-row role="SKIP">
|
4460
|
+
<fo:table-cell column-number="2" role="SKIP">
|
4451
4461
|
<xsl:copy-of select="$table-preamble"/>
|
4452
4462
|
<fo:block role="SKIP">
|
4453
4463
|
<xsl:call-template name="setTrackChangesStyles">
|
@@ -4488,11 +4498,13 @@
|
|
4488
4498
|
|
4489
4499
|
</xsl:template>
|
4490
4500
|
|
4501
|
+
<!-- table/name-->
|
4491
4502
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
4492
4503
|
<xsl:param name="continued"/>
|
4504
|
+
<xsl:param name="cols-count"/>
|
4493
4505
|
<xsl:if test="normalize-space() != ''">
|
4494
4506
|
|
4495
|
-
<fo:block xsl:use-attribute-sets="table-name-style"
|
4507
|
+
<fo:block xsl:use-attribute-sets="table-name-style">
|
4496
4508
|
|
4497
4509
|
<xsl:call-template name="refine_table-name-style">
|
4498
4510
|
<xsl:with-param name="continued" select="$continued"/>
|
@@ -4513,9 +4525,30 @@
|
|
4513
4525
|
|
4514
4526
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
4515
4527
|
<xsl:if test="$continued = 'true'">
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4528
|
+
|
4529
|
+
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
4530
|
+
|
4531
|
+
<xsl:choose>
|
4532
|
+
<xsl:when test="string(number($cols-count)) != 'NaN'">
|
4533
|
+
<fo:table width="100%" table-layout="fixed" role="SKIP">
|
4534
|
+
<fo:table-body role="SKIP">
|
4535
|
+
<fo:table-row>
|
4536
|
+
<fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
|
4537
|
+
<fo:block text-align="right" role="SKIP">
|
4538
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
4539
|
+
</fo:block>
|
4540
|
+
</fo:table-cell>
|
4541
|
+
</fo:table-row>
|
4542
|
+
</fo:table-body>
|
4543
|
+
</fo:table>
|
4544
|
+
</xsl:when>
|
4545
|
+
<xsl:otherwise>
|
4546
|
+
<fo:block text-align="right">
|
4547
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
4548
|
+
</fo:block>
|
4549
|
+
</xsl:otherwise>
|
4550
|
+
</xsl:choose>
|
4551
|
+
|
4519
4552
|
</xsl:if>
|
4520
4553
|
<!-- </xsl:if> -->
|
4521
4554
|
|
@@ -4912,6 +4945,7 @@
|
|
4912
4945
|
|
4913
4946
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
4914
4947
|
<xsl:with-param name="continued">true</xsl:with-param>
|
4948
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
4915
4949
|
</xsl:apply-templates>
|
4916
4950
|
|
4917
4951
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -4984,7 +5018,7 @@
|
|
4984
5018
|
|
4985
5019
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
4986
5020
|
|
4987
|
-
<fo:table keep-with-previous="always">
|
5021
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
4988
5022
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
4989
5023
|
<xsl:variable name="name" select="local-name()"/>
|
4990
5024
|
<xsl:choose>
|
@@ -5015,9 +5049,9 @@
|
|
5015
5049
|
</xsl:otherwise>
|
5016
5050
|
</xsl:choose>
|
5017
5051
|
|
5018
|
-
<fo:table-body>
|
5019
|
-
<fo:table-row>
|
5020
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
5052
|
+
<fo:table-body role="SKIP">
|
5053
|
+
<fo:table-row role="SKIP">
|
5054
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
5021
5055
|
|
5022
5056
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
5023
5057
|
|
@@ -5091,6 +5125,9 @@
|
|
5091
5125
|
<!-- if there isn't 'thead' and there is a table's title -->
|
5092
5126
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
|
5093
5127
|
<fo:table-header>
|
5128
|
+
|
5129
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
5130
|
+
|
5094
5131
|
<xsl:call-template name="table-header-title">
|
5095
5132
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
5096
5133
|
</xsl:call-template>
|
@@ -5344,8 +5381,8 @@
|
|
5344
5381
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
5345
5382
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
5346
5383
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
5347
|
-
<xsl:if test="$key = 'color' or
|
5348
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
5384
|
+
<xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
|
5385
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
5349
5386
|
</xsl:if>
|
5350
5387
|
</xsl:for-each>
|
5351
5388
|
</xsl:variable>
|
@@ -5409,6 +5446,7 @@
|
|
5409
5446
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
5410
5447
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
|
5411
5448
|
|
5449
|
+
<xsl:call-template name="setNamedDestination"/>
|
5412
5450
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
5413
5451
|
<xsl:copy-of select="@id"/>
|
5414
5452
|
|
@@ -5456,6 +5494,7 @@
|
|
5456
5494
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
5457
5495
|
<!-- fn in text -->
|
5458
5496
|
<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">
|
5497
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
5459
5498
|
|
5460
5499
|
<!-- list of unique footnotes -->
|
5461
5500
|
<xsl:variable name="p_fn_">
|
@@ -5521,7 +5560,7 @@
|
|
5521
5560
|
<xsl:copy-of select="$footnote_inline"/>
|
5522
5561
|
</xsl:when>
|
5523
5562
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
5524
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
5563
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
5525
5564
|
|
5526
5565
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
5527
5566
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -5930,39 +5969,51 @@
|
|
5930
5969
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
5931
5970
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
5932
5971
|
<xsl:template match="*[local-name()='fn']">
|
5933
|
-
<
|
5934
|
-
|
5935
|
-
|
5972
|
+
<xsl:variable name="target" select="@target"/>
|
5973
|
+
<xsl:choose>
|
5974
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
5975
|
+
<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]">
|
5976
|
+
<xsl:call-template name="fn">
|
5977
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
5978
|
+
</xsl:call-template>
|
5979
|
+
</xsl:when>
|
5980
|
+
<xsl:otherwise>
|
5936
5981
|
|
5937
|
-
|
5938
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
5939
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
5940
|
-
<!-- <xsl:attribute name="internal-destination">
|
5941
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
5942
|
-
</xsl:attribute>
|
5943
|
-
</xsl:if>
|
5944
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
5945
|
-
<xsl:attribute name="internal-destination">
|
5946
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
5947
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
5948
|
-
</xsl:attribute>
|
5949
|
-
</xsl:if> -->
|
5950
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
5951
|
-
<xsl:text>※</xsl:text>
|
5952
|
-
</xsl:if> -->
|
5953
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
5982
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
5954
5983
|
|
5955
|
-
|
5984
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
5956
5985
|
|
5957
|
-
|
5958
|
-
<
|
5959
|
-
|
5960
|
-
|
5961
|
-
|
5962
|
-
|
5963
|
-
|
5964
|
-
|
5965
|
-
|
5986
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
5987
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
5988
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
5989
|
+
<!-- <xsl:attribute name="internal-destination">
|
5990
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
5991
|
+
</xsl:attribute>
|
5992
|
+
</xsl:if>
|
5993
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
5994
|
+
<xsl:attribute name="internal-destination">
|
5995
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
5996
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
5997
|
+
</xsl:attribute>
|
5998
|
+
</xsl:if> -->
|
5999
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
6000
|
+
<xsl:text>※</xsl:text>
|
6001
|
+
</xsl:if> -->
|
6002
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
6003
|
+
|
6004
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
6005
|
+
|
6006
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
6007
|
+
<xsl:text>)</xsl:text>
|
6008
|
+
</xsl:if> -->
|
6009
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
6010
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
6011
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
6012
|
+
</xsl:if> -->
|
6013
|
+
</fo:basic-link>
|
6014
|
+
</fo:inline>
|
6015
|
+
</xsl:otherwise>
|
6016
|
+
</xsl:choose>
|
5966
6017
|
</xsl:template> <!-- fn -->
|
5967
6018
|
|
5968
6019
|
<!-- fn/text() -->
|
@@ -6017,6 +6068,10 @@
|
|
6017
6068
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
6018
6069
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
6019
6070
|
|
6071
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
6072
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
6073
|
+
</xsl:if>
|
6074
|
+
|
6020
6075
|
<xsl:call-template name="setBlockSpanAll"/>
|
6021
6076
|
|
6022
6077
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -6314,7 +6369,7 @@
|
|
6314
6369
|
|
6315
6370
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6316
6371
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
6317
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
6372
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
6318
6373
|
<xsl:call-template name="refine_figure_key_style"/>
|
6319
6374
|
<xsl:apply-templates/>
|
6320
6375
|
</fo:block>
|
@@ -6575,6 +6630,7 @@
|
|
6575
6630
|
|
6576
6631
|
<xsl:call-template name="refine_dt-cell-style"/>
|
6577
6632
|
|
6633
|
+
<xsl:call-template name="setNamedDestination"/>
|
6578
6634
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
6579
6635
|
|
6580
6636
|
<xsl:choose>
|
@@ -7012,7 +7068,7 @@
|
|
7012
7068
|
<!-- ================= -->
|
7013
7069
|
|
7014
7070
|
<!-- highlight text -->
|
7015
|
-
<xsl:template match="*[local-name()='hi']">
|
7071
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
7016
7072
|
<fo:inline background-color="yellow">
|
7017
7073
|
<xsl:apply-templates/>
|
7018
7074
|
</fo:inline>
|
@@ -8614,6 +8670,7 @@
|
|
8614
8670
|
<!-- Appendix processing -->
|
8615
8671
|
<!-- ======================== -->
|
8616
8672
|
<xsl:template match="*[local-name()='appendix']">
|
8673
|
+
<xsl:call-template name="setNamedDestination"/>
|
8617
8674
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
8618
8675
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
8619
8676
|
</fo:block>
|
@@ -8624,13 +8681,14 @@
|
|
8624
8681
|
<xsl:variable name="level">
|
8625
8682
|
<xsl:call-template name="getLevel"/>
|
8626
8683
|
</xsl:variable>
|
8627
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
8684
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
8628
8685
|
</xsl:template>
|
8629
8686
|
<!-- ======================== -->
|
8630
8687
|
<!-- END Appendix processing -->
|
8631
8688
|
<!-- ======================== -->
|
8632
8689
|
|
8633
8690
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
8691
|
+
<xsl:call-template name="setNamedDestination"/>
|
8634
8692
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
8635
8693
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
8636
8694
|
</fo:block>
|
@@ -8660,6 +8718,7 @@
|
|
8660
8718
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
8661
8719
|
<xsl:param name="callout"/>
|
8662
8720
|
<fo:inline id="{@id}">
|
8721
|
+
<xsl:call-template name="setNamedDestination"/>
|
8663
8722
|
<!-- for first p in annotation, put <x> -->
|
8664
8723
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
8665
8724
|
<xsl:apply-templates/>
|
@@ -8706,6 +8765,7 @@
|
|
8706
8765
|
|
8707
8766
|
</xsl:if>
|
8708
8767
|
<fo:block-container margin-left="0mm" role="SKIP">
|
8768
|
+
<xsl:call-template name="setNamedDestination"/>
|
8709
8769
|
<fo:block id="{@id}">
|
8710
8770
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
8711
8771
|
</fo:block>
|
@@ -8751,8 +8811,13 @@
|
|
8751
8811
|
</fo:block>
|
8752
8812
|
</fo:table-cell>
|
8753
8813
|
<fo:table-cell display-align="center">
|
8814
|
+
|
8754
8815
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
8755
8816
|
|
8817
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
8818
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
8819
|
+
</xsl:for-each>
|
8820
|
+
|
8756
8821
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
8757
8822
|
|
8758
8823
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -8787,6 +8852,8 @@
|
|
8787
8852
|
|
8788
8853
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
8789
8854
|
|
8855
|
+
<xsl:call-template name="setNamedDestination"/>
|
8856
|
+
|
8790
8857
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
8791
8858
|
|
8792
8859
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -8851,6 +8918,7 @@
|
|
8851
8918
|
</xsl:template>
|
8852
8919
|
|
8853
8920
|
<xsl:template match="*[local-name() = 'termnote']">
|
8921
|
+
<xsl:call-template name="setNamedDestination"/>
|
8854
8922
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
8855
8923
|
|
8856
8924
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -8957,12 +9025,14 @@
|
|
8957
9025
|
|
8958
9026
|
<xsl:template match="*[local-name() = 'terms']">
|
8959
9027
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
9028
|
+
<xsl:call-template name="setNamedDestination"/>
|
8960
9029
|
<fo:block id="{@id}">
|
8961
9030
|
<xsl:apply-templates/>
|
8962
9031
|
</fo:block>
|
8963
9032
|
</xsl:template>
|
8964
9033
|
|
8965
9034
|
<xsl:template match="*[local-name() = 'term']">
|
9035
|
+
<xsl:call-template name="setNamedDestination"/>
|
8966
9036
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
8967
9037
|
|
8968
9038
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -8994,6 +9064,7 @@
|
|
8994
9064
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
8995
9065
|
<xsl:variable name="isAdded" select="@added"/>
|
8996
9066
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
9067
|
+
<xsl:call-template name="setNamedDestination"/>
|
8997
9068
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
8998
9069
|
<xsl:call-template name="refine_figure-block-style"/>
|
8999
9070
|
|
@@ -9010,6 +9081,11 @@
|
|
9010
9081
|
</xsl:variable>
|
9011
9082
|
|
9012
9083
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
9084
|
+
|
9085
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
9086
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
9087
|
+
</xsl:for-each>
|
9088
|
+
|
9013
9089
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
9014
9090
|
</fo:block>
|
9015
9091
|
|
@@ -9042,6 +9118,7 @@
|
|
9042
9118
|
</xsl:template>
|
9043
9119
|
|
9044
9120
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
9121
|
+
<xsl:call-template name="setNamedDestination"/>
|
9045
9122
|
<fo:block id="{@id}">
|
9046
9123
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
9047
9124
|
</fo:block>
|
@@ -9055,6 +9132,7 @@
|
|
9055
9132
|
</xsl:template>
|
9056
9133
|
|
9057
9134
|
<!-- SOURCE: ... -->
|
9135
|
+
<!-- figure/source -->
|
9058
9136
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
9059
9137
|
|
9060
9138
|
<xsl:call-template name="termsource"/>
|
@@ -9980,6 +10058,13 @@
|
|
9980
10058
|
<xsl:apply-templates select="."/>
|
9981
10059
|
</xsl:template>
|
9982
10060
|
|
10061
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
10062
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
10063
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
10064
|
+
<xsl:apply-templates select="."/>
|
10065
|
+
</xsl:if>
|
10066
|
+
</xsl:template>
|
10067
|
+
|
9983
10068
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
9984
10069
|
|
9985
10070
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -10203,7 +10288,8 @@
|
|
10203
10288
|
|
10204
10289
|
<xsl:for-each select="$contents_nodes//tables/table">
|
10205
10290
|
<fo:bookmark internal-destination="{@id}">
|
10206
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
10291
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
10292
|
+
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
10207
10293
|
</fo:bookmark>
|
10208
10294
|
</xsl:for-each>
|
10209
10295
|
</fo:bookmark>
|
@@ -10212,6 +10298,26 @@
|
|
10212
10298
|
</xsl:template> <!-- insertTableBookmarks -->
|
10213
10299
|
<!-- End Bookmarks -->
|
10214
10300
|
|
10301
|
+
<!-- ============================ -->
|
10302
|
+
<!-- mode="bookmark_clean" -->
|
10303
|
+
<!-- ============================ -->
|
10304
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
10305
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
10306
|
+
</xsl:template>
|
10307
|
+
|
10308
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
10309
|
+
<xsl:value-of select="."/>
|
10310
|
+
</xsl:template>
|
10311
|
+
|
10312
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
10313
|
+
<xsl:value-of select="normalize-space(.)"/>
|
10314
|
+
</xsl:template>
|
10315
|
+
|
10316
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
10317
|
+
<!-- ============================ -->
|
10318
|
+
<!-- END: mode="bookmark_clean" -->
|
10319
|
+
<!-- ============================ -->
|
10320
|
+
|
10215
10321
|
<xsl:template name="getLangVersion">
|
10216
10322
|
<xsl:param name="lang"/>
|
10217
10323
|
<xsl:param name="doctype" select="''"/>
|
@@ -10259,6 +10365,7 @@
|
|
10259
10365
|
<xsl:template match="title" mode="bookmark"/>
|
10260
10366
|
<xsl:template match="text()" mode="bookmark"/>
|
10261
10367
|
|
10368
|
+
<!-- figure/name -->
|
10262
10369
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
10263
10370
|
<xsl:if test="normalize-space() != ''">
|
10264
10371
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -10974,6 +11081,7 @@
|
|
10974
11081
|
<!-- permission -->
|
10975
11082
|
<!-- ========== -->
|
10976
11083
|
<xsl:template match="*[local-name() = 'permission']">
|
11084
|
+
<xsl:call-template name="setNamedDestination"/>
|
10977
11085
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
10978
11086
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
10979
11087
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -10982,10 +11090,12 @@
|
|
10982
11090
|
|
10983
11091
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
10984
11092
|
<xsl:if test="normalize-space() != ''">
|
10985
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
10986
|
-
<xsl:apply-templates/>
|
10987
11093
|
|
10988
|
-
|
11094
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
11095
|
+
<xsl:apply-templates/>
|
11096
|
+
|
11097
|
+
</fo:block>
|
11098
|
+
|
10989
11099
|
</xsl:if>
|
10990
11100
|
</xsl:template>
|
10991
11101
|
|
@@ -11001,6 +11111,7 @@
|
|
11001
11111
|
<!-- requirement -->
|
11002
11112
|
<!-- ========== -->
|
11003
11113
|
<xsl:template match="*[local-name() = 'requirement']">
|
11114
|
+
<xsl:call-template name="setNamedDestination"/>
|
11004
11115
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
11005
11116
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
11006
11117
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -11012,11 +11123,13 @@
|
|
11012
11123
|
|
11013
11124
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
11014
11125
|
<xsl:if test="normalize-space() != ''">
|
11015
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
11016
11126
|
|
11017
|
-
|
11127
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
11128
|
+
|
11129
|
+
<xsl:apply-templates/>
|
11130
|
+
|
11131
|
+
</fo:block>
|
11018
11132
|
|
11019
|
-
</fo:block>
|
11020
11133
|
</xsl:if>
|
11021
11134
|
</xsl:template>
|
11022
11135
|
|
@@ -11045,6 +11158,7 @@
|
|
11045
11158
|
<!-- recommendation -->
|
11046
11159
|
<!-- ========== -->
|
11047
11160
|
<xsl:template match="*[local-name() = 'recommendation']">
|
11161
|
+
<xsl:call-template name="setNamedDestination"/>
|
11048
11162
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
11049
11163
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
11050
11164
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -11053,10 +11167,12 @@
|
|
11053
11167
|
|
11054
11168
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
11055
11169
|
<xsl:if test="normalize-space() != ''">
|
11056
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
11057
|
-
<xsl:apply-templates/>
|
11058
11170
|
|
11059
|
-
|
11171
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
11172
|
+
<xsl:apply-templates/>
|
11173
|
+
|
11174
|
+
</fo:block>
|
11175
|
+
|
11060
11176
|
</xsl:if>
|
11061
11177
|
</xsl:template>
|
11062
11178
|
|
@@ -11135,6 +11251,7 @@
|
|
11135
11251
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
11136
11252
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
11137
11253
|
</xsl:if>
|
11254
|
+
<xsl:call-template name="setNamedDestination"/>
|
11138
11255
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11139
11256
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
11140
11257
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -11244,6 +11361,7 @@
|
|
11244
11361
|
<!-- termexample -->
|
11245
11362
|
<!-- ====== -->
|
11246
11363
|
<xsl:template match="*[local-name() = 'termexample']">
|
11364
|
+
<xsl:call-template name="setNamedDestination"/>
|
11247
11365
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
11248
11366
|
<xsl:call-template name="refine_termexample-style"/>
|
11249
11367
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -11298,6 +11416,7 @@
|
|
11298
11416
|
-->
|
11299
11417
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
11300
11418
|
|
11419
|
+
<xsl:call-template name="setNamedDestination"/>
|
11301
11420
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
11302
11421
|
|
11303
11422
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -11823,8 +11942,13 @@
|
|
11823
11942
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
11824
11943
|
|
11825
11944
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
11945
|
+
|
11826
11946
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
11827
11947
|
|
11948
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
11949
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
11950
|
+
</xsl:for-each>
|
11951
|
+
|
11828
11952
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
11829
11953
|
</fo:block>
|
11830
11954
|
</xsl:if>
|
@@ -11944,6 +12068,7 @@
|
|
11944
12068
|
<!-- main sections -->
|
11945
12069
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
11946
12070
|
|
12071
|
+
<xsl:call-template name="setNamedDestination"/>
|
11947
12072
|
<fo:block>
|
11948
12073
|
<xsl:call-template name="setId"/>
|
11949
12074
|
|
@@ -11987,6 +12112,7 @@
|
|
11987
12112
|
|
11988
12113
|
<xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
|
11989
12114
|
|
12115
|
+
<xsl:call-template name="setNamedDestination"/>
|
11990
12116
|
<fo:block>
|
11991
12117
|
<xsl:call-template name="setId"/>
|
11992
12118
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -12015,6 +12141,7 @@
|
|
12015
12141
|
</xsl:template>
|
12016
12142
|
|
12017
12143
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
12144
|
+
<xsl:call-template name="setNamedDestination"/>
|
12018
12145
|
<fo:block>
|
12019
12146
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
12020
12147
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -12041,6 +12168,7 @@
|
|
12041
12168
|
</xsl:template> <!-- refine_clause_style -->
|
12042
12169
|
|
12043
12170
|
<xsl:template match="*[local-name() = 'definitions']">
|
12171
|
+
<xsl:call-template name="setNamedDestination"/>
|
12044
12172
|
<fo:block id="{@id}">
|
12045
12173
|
<xsl:apply-templates/>
|
12046
12174
|
</fo:block>
|
@@ -12056,6 +12184,8 @@
|
|
12056
12184
|
<xsl:otherwise>
|
12057
12185
|
|
12058
12186
|
<fo:block break-after="page"/>
|
12187
|
+
<xsl:call-template name="setNamedDestination"/>
|
12188
|
+
|
12059
12189
|
<fo:block id="{@id}">
|
12060
12190
|
|
12061
12191
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12127,6 +12257,7 @@
|
|
12127
12257
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
12128
12258
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
12129
12259
|
<!-- <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> -->
|
12260
|
+
<xsl:call-template name="setNamedDestination"/>
|
12130
12261
|
<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>
|
12131
12262
|
<!-- </xsl:if> -->
|
12132
12263
|
</xsl:if>
|
@@ -12228,9 +12359,15 @@
|
|
12228
12359
|
<xsl:when test="local-name(..) = 'ul'">
|
12229
12360
|
<xsl:choose>
|
12230
12361
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
12362
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
12363
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
12231
12364
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
12232
12365
|
</xsl:choose>
|
12233
12366
|
</xsl:when>
|
12367
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
12368
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
12369
|
+
<xsl:value-of select="@label"/>
|
12370
|
+
</xsl:when>
|
12234
12371
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
12235
12372
|
|
12236
12373
|
<xsl:variable name="type" select="../@type"/>
|
@@ -12355,7 +12492,7 @@
|
|
12355
12492
|
|
12356
12493
|
</xsl:otherwise>
|
12357
12494
|
</xsl:choose>
|
12358
|
-
</xsl:template>
|
12495
|
+
</xsl:template> <!-- getListItemFormat -->
|
12359
12496
|
|
12360
12497
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
12361
12498
|
<xsl:param name="indent">0</xsl:param>
|
@@ -12487,6 +12624,11 @@
|
|
12487
12624
|
|
12488
12625
|
<xsl:call-template name="refine_list-item-label-style"/>
|
12489
12626
|
|
12627
|
+
<xsl:if test="local-name(..) = 'ul'">
|
12628
|
+
<xsl:variable name="li_label" select="@label"/>
|
12629
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
12630
|
+
</xsl:if>
|
12631
|
+
|
12490
12632
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
12491
12633
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
12492
12634
|
<xsl:call-template name="append_add-style"/>
|
@@ -12833,6 +12975,7 @@
|
|
12833
12975
|
<!-- Normative references -->
|
12834
12976
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
12835
12977
|
|
12978
|
+
<xsl:call-template name="setNamedDestination"/>
|
12836
12979
|
<fo:block id="{@id}">
|
12837
12980
|
<xsl:apply-templates/>
|
12838
12981
|
|
@@ -12853,6 +12996,7 @@
|
|
12853
12996
|
</xsl:if>
|
12854
12997
|
</xsl:if> -->
|
12855
12998
|
|
12999
|
+
<xsl:call-template name="setNamedDestination"/>
|
12856
13000
|
<fo:block id="{@id}"/>
|
12857
13001
|
|
12858
13002
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -12872,6 +13016,7 @@
|
|
12872
13016
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
12873
13017
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
12874
13018
|
|
13019
|
+
<xsl:call-template name="setNamedDestination"/>
|
12875
13020
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
12876
13021
|
|
12877
13022
|
<xsl:call-template name="processBibitem"/>
|
@@ -12885,6 +13030,7 @@
|
|
12885
13030
|
<!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
|
12886
13031
|
$namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
|
12887
13032
|
<!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
|
13033
|
+
<xsl:call-template name="setNamedDestination"/>
|
12888
13034
|
<fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
|
12889
13035
|
|
12890
13036
|
<fo:list-item>
|
@@ -12914,6 +13060,7 @@
|
|
12914
13060
|
<xsl:choose>
|
12915
13061
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
12916
13062
|
<xsl:otherwise>
|
13063
|
+
<xsl:call-template name="setNamedDestination"/>
|
12917
13064
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
12918
13065
|
|
12919
13066
|
<fo:list-item-label end-indent="label-end()">
|
@@ -13573,7 +13720,7 @@
|
|
13573
13720
|
</xsl:template>
|
13574
13721
|
|
13575
13722
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
13576
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
13723
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
13577
13724
|
<xsl:copy>
|
13578
13725
|
<xsl:copy-of select="@*"/>
|
13579
13726
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -13605,28 +13752,56 @@
|
|
13605
13752
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
13606
13753
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
13607
13754
|
|
13608
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
13755
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
13609
13756
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
13610
13757
|
<xsl:copy-of select="@*"/>
|
13611
13758
|
<xsl:choose>
|
13612
13759
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
13613
|
-
<xsl:
|
13760
|
+
<xsl:choose>
|
13761
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
13762
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
13763
|
+
</xsl:when>
|
13764
|
+
<xsl:otherwise>
|
13765
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
13766
|
+
</xsl:otherwise>
|
13767
|
+
</xsl:choose>
|
13614
13768
|
</xsl:when>
|
13615
13769
|
<xsl:otherwise>
|
13616
|
-
<xsl:
|
13770
|
+
<xsl:choose>
|
13771
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
13772
|
+
<xsl:copy-of select="node()"/>
|
13773
|
+
</xsl:when>
|
13774
|
+
<xsl:otherwise>
|
13775
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
13776
|
+
</xsl:otherwise>
|
13777
|
+
</xsl:choose>
|
13617
13778
|
</xsl:otherwise>
|
13618
13779
|
</xsl:choose>
|
13619
13780
|
</xsl:element>
|
13620
13781
|
</xsl:template>
|
13621
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
13782
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
13622
13783
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
13623
13784
|
<xsl:copy-of select="@*"/>
|
13624
13785
|
<xsl:choose>
|
13625
13786
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
13626
|
-
<xsl:
|
13787
|
+
<xsl:choose>
|
13788
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
13789
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
13790
|
+
</xsl:when>
|
13791
|
+
<xsl:otherwise>
|
13792
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
13793
|
+
</xsl:otherwise>
|
13794
|
+
</xsl:choose>
|
13627
13795
|
</xsl:when>
|
13628
13796
|
<xsl:otherwise>
|
13629
|
-
<xsl:
|
13797
|
+
<xsl:choose>
|
13798
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
13799
|
+
<xsl:copy-of select="node()"/>
|
13800
|
+
</xsl:when>
|
13801
|
+
<xsl:otherwise>
|
13802
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
13803
|
+
</xsl:otherwise>
|
13804
|
+
</xsl:choose>
|
13630
13805
|
</xsl:otherwise>
|
13631
13806
|
</xsl:choose>
|
13632
13807
|
</xsl:element>
|
@@ -13855,16 +14030,24 @@
|
|
13855
14030
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
13856
14031
|
<xsl:element name="title" namespace="{$namespace_full}">
|
13857
14032
|
<xsl:copy-of select="@*"/>
|
14033
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
14034
|
+
|
13858
14035
|
<xsl:apply-templates mode="update_xml_step1"/>
|
13859
14036
|
</xsl:element>
|
13860
14037
|
</xsl:template>
|
13861
14038
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
13862
14039
|
<xsl:element name="title" namespace="{$namespace_full}">
|
13863
14040
|
<xsl:copy-of select="@*"/>
|
14041
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
14042
|
+
|
13864
14043
|
<xsl:apply-templates mode="update_xml_pres"/>
|
13865
14044
|
</xsl:element>
|
13866
14045
|
</xsl:template>
|
13867
14046
|
|
14047
|
+
<xsl:template name="addNamedDestinationAttribute">
|
14048
|
+
|
14049
|
+
</xsl:template>
|
14050
|
+
|
13868
14051
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
13869
14052
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
13870
14053
|
<xsl:choose>
|
@@ -13874,6 +14057,8 @@
|
|
13874
14057
|
<xsl:otherwise>
|
13875
14058
|
<xsl:element name="name" namespace="{$namespace_full}">
|
13876
14059
|
<xsl:copy-of select="@*"/>
|
14060
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
14061
|
+
|
13877
14062
|
<xsl:apply-templates mode="update_xml_step1"/>
|
13878
14063
|
</xsl:element>
|
13879
14064
|
</xsl:otherwise>
|
@@ -13887,12 +14072,24 @@
|
|
13887
14072
|
<xsl:otherwise>
|
13888
14073
|
<xsl:element name="name" namespace="{$namespace_full}">
|
13889
14074
|
<xsl:copy-of select="@*"/>
|
14075
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
14076
|
+
|
13890
14077
|
<xsl:apply-templates mode="update_xml_pres"/>
|
13891
14078
|
</xsl:element>
|
13892
14079
|
</xsl:otherwise>
|
13893
14080
|
</xsl:choose>
|
13894
14081
|
</xsl:template>
|
13895
14082
|
|
14083
|
+
<!-- li/fmt-name -->
|
14084
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
14085
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
14086
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
14087
|
+
</xsl:template>
|
14088
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
14089
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
14090
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
14091
|
+
</xsl:template>
|
14092
|
+
|
13896
14093
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
13897
14094
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
13898
14095
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -14707,6 +14904,64 @@
|
|
14707
14904
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
14708
14905
|
</xsl:template>
|
14709
14906
|
|
14907
|
+
<!-- ===================================== -->
|
14908
|
+
<!-- ===================================== -->
|
14909
|
+
<!-- Ruby text (CJK languages) rendering -->
|
14910
|
+
<!-- ===================================== -->
|
14911
|
+
<!-- ===================================== -->
|
14912
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
14913
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
14914
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
14915
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
14916
|
+
</xsl:if>
|
14917
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
14918
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
14919
|
+
<!-- Example: width="2em" -->
|
14920
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
14921
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
14922
|
+
<xsl:variable name="text_width">
|
14923
|
+
<xsl:choose>
|
14924
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
14925
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
14926
|
+
</xsl:choose>
|
14927
|
+
</xsl:variable>
|
14928
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
14929
|
+
|
14930
|
+
<xsl:choose>
|
14931
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
14932
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
14933
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
14934
|
+
</xsl:when>
|
14935
|
+
<xsl:otherwise>
|
14936
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
14937
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
14938
|
+
</xsl:otherwise>
|
14939
|
+
</xsl:choose>
|
14940
|
+
|
14941
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
14942
|
+
</fo:inline-container>
|
14943
|
+
</xsl:template>
|
14944
|
+
|
14945
|
+
<xsl:template match="*[local-name() = 'rb']">
|
14946
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
14947
|
+
</xsl:template>
|
14948
|
+
|
14949
|
+
<xsl:template match="*[local-name() = 'rt']">
|
14950
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
14951
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
14952
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
14953
|
+
</xsl:if>
|
14954
|
+
<xsl:apply-templates/>
|
14955
|
+
</fo:block>
|
14956
|
+
|
14957
|
+
</xsl:template>
|
14958
|
+
|
14959
|
+
<!-- ===================================== -->
|
14960
|
+
<!-- ===================================== -->
|
14961
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
14962
|
+
<!-- ===================================== -->
|
14963
|
+
<!-- ===================================== -->
|
14964
|
+
|
14710
14965
|
<xsl:template name="printEdition">
|
14711
14966
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
14712
14967
|
<xsl:text> </xsl:text>
|
@@ -15274,6 +15529,24 @@
|
|
15274
15529
|
</xsl:attribute>
|
15275
15530
|
</xsl:template>
|
15276
15531
|
|
15532
|
+
<xsl:template name="setIDforNamedDestination">
|
15533
|
+
<xsl:if test="@named_dest">
|
15534
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
15535
|
+
</xsl:if>
|
15536
|
+
</xsl:template>
|
15537
|
+
|
15538
|
+
<xsl:template name="setNamedDestination">
|
15539
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
15540
|
+
<xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
|
15541
|
+
<fox:destination internal-destination="{@id}"/>
|
15542
|
+
</xsl:if>
|
15543
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
15544
|
+
<xsl:if test="@named_dest">
|
15545
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
15546
|
+
</xsl:if>
|
15547
|
+
</xsl:for-each>
|
15548
|
+
</xsl:template>
|
15549
|
+
|
15277
15550
|
<xsl:template name="add-letter-spacing">
|
15278
15551
|
<xsl:param name="text"/>
|
15279
15552
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|