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
@@ -469,7 +469,7 @@
|
|
469
469
|
|
470
470
|
<!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
|
471
471
|
|
472
|
-
<xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:
|
472
|
+
<xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:metanorma" mode="bipm-standard">
|
473
473
|
<xsl:with-param name="curr_docnum" select="$num"/>
|
474
474
|
</xsl:apply-templates>
|
475
475
|
|
@@ -619,6 +619,17 @@
|
|
619
619
|
|
620
620
|
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'fmt-footnote-container']" priority="3" mode="update_xml_pres"/>
|
621
621
|
|
622
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="3" mode="update_xml_pres">
|
623
|
+
<xsl:choose>
|
624
|
+
<!-- no need li labels in BIPM brochure preface -->
|
625
|
+
<xsl:when test="ancestor::*[bipm:preface] and ancestor::bipm:clause[not(@type = 'toc')]"/>
|
626
|
+
<xsl:otherwise>
|
627
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
628
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
629
|
+
</xsl:otherwise>
|
630
|
+
</xsl:choose>
|
631
|
+
</xsl:template>
|
632
|
+
|
622
633
|
<!-- ================================= -->
|
623
634
|
<!-- Flattening xml for fit notes at page sides (margins) -->
|
624
635
|
<!-- ================================= -->
|
@@ -2928,13 +2939,17 @@
|
|
2928
2939
|
<fo:list-item-label end-indent="label-end()">
|
2929
2940
|
<fo:block> <!-- debug: border="0.5pt solid green" -->
|
2930
2941
|
<fo:inline>
|
2931
|
-
|
2932
|
-
<xsl:
|
2942
|
+
<xsl:if test="@list_type = 'ul'">
|
2943
|
+
<xsl:variable name="li_label" select="@label"/>
|
2944
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
2945
|
+
</xsl:if>
|
2946
|
+
|
2933
2947
|
<xsl:copy-of select="@font-size"/>
|
2934
2948
|
<xsl:copy-of select="@baseline-shift"/>
|
2935
2949
|
<xsl:if test="@list_type = 'ul' and ancestor::bipm:note_side">
|
2936
2950
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2937
2951
|
</xsl:if>
|
2952
|
+
|
2938
2953
|
<xsl:value-of select="@label"/>
|
2939
2954
|
</fo:inline>
|
2940
2955
|
</fo:block>
|
@@ -4681,6 +4696,7 @@
|
|
4681
4696
|
</xsl:template> <!-- refine_table-style -->
|
4682
4697
|
|
4683
4698
|
<xsl:attribute-set name="table-name-style">
|
4699
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
4684
4700
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4685
4701
|
|
4686
4702
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4694,6 +4710,9 @@
|
|
4694
4710
|
|
4695
4711
|
<xsl:template name="refine_table-name-style">
|
4696
4712
|
<xsl:param name="continued"/>
|
4713
|
+
<xsl:if test="$continued = 'true'">
|
4714
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
4715
|
+
</xsl:if>
|
4697
4716
|
|
4698
4717
|
</xsl:template> <!-- refine_table-name-style -->
|
4699
4718
|
|
@@ -6358,8 +6377,14 @@
|
|
6358
6377
|
</xsl:choose>
|
6359
6378
|
</xsl:variable>
|
6360
6379
|
|
6380
|
+
<xsl:call-template name="setNamedDestination"/>
|
6381
|
+
|
6361
6382
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
6362
6383
|
|
6384
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
6385
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
6386
|
+
</xsl:for-each>
|
6387
|
+
|
6363
6388
|
<xsl:call-template name="refine_table-container-style">
|
6364
6389
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
6365
6390
|
</xsl:call-template>
|
@@ -6509,7 +6534,7 @@
|
|
6509
6534
|
</xsl:if>
|
6510
6535
|
|
6511
6536
|
</fo:block-container>
|
6512
|
-
</xsl:variable>
|
6537
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
6513
6538
|
|
6514
6539
|
<xsl:variable name="isAdded" select="@added"/>
|
6515
6540
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -6563,8 +6588,10 @@
|
|
6563
6588
|
|
6564
6589
|
</xsl:template>
|
6565
6590
|
|
6591
|
+
<!-- table/name-->
|
6566
6592
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
6567
6593
|
<xsl:param name="continued"/>
|
6594
|
+
<xsl:param name="cols-count"/>
|
6568
6595
|
<xsl:if test="normalize-space() != ''">
|
6569
6596
|
|
6570
6597
|
<fo:list-block xsl:use-attribute-sets="table-name-style">
|
@@ -6989,6 +7016,7 @@
|
|
6989
7016
|
|
6990
7017
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
6991
7018
|
<xsl:with-param name="continued">true</xsl:with-param>
|
7019
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
6992
7020
|
</xsl:apply-templates>
|
6993
7021
|
|
6994
7022
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -7052,7 +7080,7 @@
|
|
7052
7080
|
|
7053
7081
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
7054
7082
|
|
7055
|
-
<fo:table keep-with-previous="always">
|
7083
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
7056
7084
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
7057
7085
|
<xsl:variable name="name" select="local-name()"/>
|
7058
7086
|
<xsl:choose>
|
@@ -7083,9 +7111,9 @@
|
|
7083
7111
|
</xsl:otherwise>
|
7084
7112
|
</xsl:choose>
|
7085
7113
|
|
7086
|
-
<fo:table-body>
|
7087
|
-
<fo:table-row>
|
7088
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
7114
|
+
<fo:table-body role="SKIP">
|
7115
|
+
<fo:table-row role="SKIP">
|
7116
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
7089
7117
|
|
7090
7118
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
7091
7119
|
|
@@ -7387,8 +7415,8 @@
|
|
7387
7415
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
7388
7416
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
7389
7417
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
7390
|
-
<xsl:if test="$key = 'color' or
|
7391
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
7418
|
+
<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'">
|
7419
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
7392
7420
|
</xsl:if>
|
7393
7421
|
</xsl:for-each>
|
7394
7422
|
</xsl:variable>
|
@@ -7461,6 +7489,7 @@
|
|
7461
7489
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
7462
7490
|
<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">
|
7463
7491
|
|
7492
|
+
<xsl:call-template name="setNamedDestination"/>
|
7464
7493
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
7465
7494
|
<xsl:copy-of select="@id"/>
|
7466
7495
|
|
@@ -7512,6 +7541,7 @@
|
|
7512
7541
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
7513
7542
|
<!-- fn in text -->
|
7514
7543
|
<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">
|
7544
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
7515
7545
|
|
7516
7546
|
<!-- list of unique footnotes -->
|
7517
7547
|
<xsl:variable name="p_fn_">
|
@@ -7577,7 +7607,7 @@
|
|
7577
7607
|
<xsl:copy-of select="$footnote_inline"/>
|
7578
7608
|
</xsl:when>
|
7579
7609
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
7580
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
7610
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
7581
7611
|
|
7582
7612
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
7583
7613
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -7988,42 +8018,54 @@
|
|
7988
8018
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
7989
8019
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
7990
8020
|
<xsl:template match="*[local-name()='fn']">
|
7991
|
-
<
|
7992
|
-
|
7993
|
-
|
8021
|
+
<xsl:variable name="target" select="@target"/>
|
8022
|
+
<xsl:choose>
|
8023
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
8024
|
+
<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]">
|
8025
|
+
<xsl:call-template name="fn">
|
8026
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
8027
|
+
</xsl:call-template>
|
8028
|
+
</xsl:when>
|
8029
|
+
<xsl:otherwise>
|
7994
8030
|
|
7995
|
-
|
7996
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
7997
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
7998
|
-
<!-- <xsl:attribute name="internal-destination">
|
7999
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
8000
|
-
</xsl:attribute>
|
8001
|
-
</xsl:if>
|
8002
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
8003
|
-
<xsl:attribute name="internal-destination">
|
8004
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
8005
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
8006
|
-
</xsl:attribute>
|
8007
|
-
</xsl:if> -->
|
8008
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
8009
|
-
<xsl:text>※</xsl:text>
|
8010
|
-
</xsl:if> -->
|
8011
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
8031
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
8012
8032
|
|
8013
|
-
|
8014
|
-
<!-- Example: <fmt-fn-label><sup><span class="fmt-label-delim">(</span>a<span class="fmt-label-delim">)</span></sup></fmt-fn-label> -->
|
8015
|
-
<!-- to <fo:inline font-style="normal">(</fo:inline> ... -->
|
8016
|
-
<xsl:apply-templates select="*[local-name() = 'fmt-fn-label']/node()"/>
|
8033
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
8017
8034
|
|
8018
|
-
|
8019
|
-
<
|
8020
|
-
|
8021
|
-
|
8022
|
-
|
8023
|
-
|
8024
|
-
|
8025
|
-
|
8026
|
-
|
8035
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
8036
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
8037
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
8038
|
+
<!-- <xsl:attribute name="internal-destination">
|
8039
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
8040
|
+
</xsl:attribute>
|
8041
|
+
</xsl:if>
|
8042
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
8043
|
+
<xsl:attribute name="internal-destination">
|
8044
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
8045
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
8046
|
+
</xsl:attribute>
|
8047
|
+
</xsl:if> -->
|
8048
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
8049
|
+
<xsl:text>※</xsl:text>
|
8050
|
+
</xsl:if> -->
|
8051
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
8052
|
+
|
8053
|
+
<fo:inline font-style="normal"> </fo:inline>
|
8054
|
+
<!-- Example: <fmt-fn-label><sup><span class="fmt-label-delim">(</span>a<span class="fmt-label-delim">)</span></sup></fmt-fn-label> -->
|
8055
|
+
<!-- to <fo:inline font-style="normal">(</fo:inline> ... -->
|
8056
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-fn-label']/node()"/>
|
8057
|
+
|
8058
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
8059
|
+
<xsl:text>)</xsl:text>
|
8060
|
+
</xsl:if> -->
|
8061
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
8062
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
8063
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
8064
|
+
</xsl:if> -->
|
8065
|
+
</fo:basic-link>
|
8066
|
+
</fo:inline>
|
8067
|
+
</xsl:otherwise>
|
8068
|
+
</xsl:choose>
|
8027
8069
|
</xsl:template> <!-- fn -->
|
8028
8070
|
|
8029
8071
|
<!-- fn/text() -->
|
@@ -8078,6 +8120,10 @@
|
|
8078
8120
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
8079
8121
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
8080
8122
|
|
8123
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
8124
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
8125
|
+
</xsl:if>
|
8126
|
+
|
8081
8127
|
<xsl:call-template name="setBlockSpanAll"/>
|
8082
8128
|
|
8083
8129
|
<xsl:if test="not(ancestor::*[local-name() = 'li'])">
|
@@ -8372,7 +8418,7 @@
|
|
8372
8418
|
|
8373
8419
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
8374
8420
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
8375
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
8421
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
8376
8422
|
<xsl:call-template name="refine_figure_key_style"/>
|
8377
8423
|
<xsl:apply-templates/>
|
8378
8424
|
</fo:block>
|
@@ -8623,6 +8669,7 @@
|
|
8623
8669
|
|
8624
8670
|
<xsl:call-template name="refine_dt-cell-style"/>
|
8625
8671
|
|
8672
|
+
<xsl:call-template name="setNamedDestination"/>
|
8626
8673
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
8627
8674
|
|
8628
8675
|
<xsl:choose>
|
@@ -9057,7 +9104,7 @@
|
|
9057
9104
|
<!-- ================= -->
|
9058
9105
|
|
9059
9106
|
<!-- highlight text -->
|
9060
|
-
<xsl:template match="*[local-name()='hi']">
|
9107
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
9061
9108
|
<fo:inline background-color="yellow">
|
9062
9109
|
<xsl:apply-templates/>
|
9063
9110
|
</fo:inline>
|
@@ -10684,6 +10731,7 @@
|
|
10684
10731
|
<!-- Appendix processing -->
|
10685
10732
|
<!-- ======================== -->
|
10686
10733
|
<xsl:template match="*[local-name()='appendix']">
|
10734
|
+
<xsl:call-template name="setNamedDestination"/>
|
10687
10735
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
10688
10736
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
10689
10737
|
</fo:block>
|
@@ -10694,13 +10742,14 @@
|
|
10694
10742
|
<xsl:variable name="level">
|
10695
10743
|
<xsl:call-template name="getLevel"/>
|
10696
10744
|
</xsl:variable>
|
10697
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
10745
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
10698
10746
|
</xsl:template>
|
10699
10747
|
<!-- ======================== -->
|
10700
10748
|
<!-- END Appendix processing -->
|
10701
10749
|
<!-- ======================== -->
|
10702
10750
|
|
10703
10751
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
10752
|
+
<xsl:call-template name="setNamedDestination"/>
|
10704
10753
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
10705
10754
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
10706
10755
|
</fo:block>
|
@@ -10730,6 +10779,7 @@
|
|
10730
10779
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
10731
10780
|
<xsl:param name="callout"/>
|
10732
10781
|
<fo:inline id="{@id}">
|
10782
|
+
<xsl:call-template name="setNamedDestination"/>
|
10733
10783
|
<!-- for first p in annotation, put <x> -->
|
10734
10784
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
10735
10785
|
<xsl:apply-templates/>
|
@@ -10776,6 +10826,7 @@
|
|
10776
10826
|
|
10777
10827
|
</xsl:if>
|
10778
10828
|
<fo:block-container margin-left="0mm" role="SKIP">
|
10829
|
+
<xsl:call-template name="setNamedDestination"/>
|
10779
10830
|
<fo:block id="{@id}">
|
10780
10831
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
10781
10832
|
</fo:block>
|
@@ -10821,8 +10872,13 @@
|
|
10821
10872
|
</fo:block>
|
10822
10873
|
</fo:table-cell>
|
10823
10874
|
<fo:table-cell display-align="center">
|
10875
|
+
|
10824
10876
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
10825
10877
|
|
10878
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
10879
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
10880
|
+
</xsl:for-each>
|
10881
|
+
|
10826
10882
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
10827
10883
|
|
10828
10884
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -10857,6 +10913,8 @@
|
|
10857
10913
|
|
10858
10914
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
10859
10915
|
|
10916
|
+
<xsl:call-template name="setNamedDestination"/>
|
10917
|
+
|
10860
10918
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
10861
10919
|
|
10862
10920
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -10928,6 +10986,7 @@
|
|
10928
10986
|
</xsl:template>
|
10929
10987
|
|
10930
10988
|
<xsl:template match="*[local-name() = 'termnote']">
|
10989
|
+
<xsl:call-template name="setNamedDestination"/>
|
10931
10990
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
10932
10991
|
|
10933
10992
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -11048,12 +11107,14 @@
|
|
11048
11107
|
|
11049
11108
|
<xsl:template match="*[local-name() = 'terms']">
|
11050
11109
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
11110
|
+
<xsl:call-template name="setNamedDestination"/>
|
11051
11111
|
<fo:block id="{@id}">
|
11052
11112
|
<xsl:apply-templates/>
|
11053
11113
|
</fo:block>
|
11054
11114
|
</xsl:template>
|
11055
11115
|
|
11056
11116
|
<xsl:template match="*[local-name() = 'term']">
|
11117
|
+
<xsl:call-template name="setNamedDestination"/>
|
11057
11118
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
11058
11119
|
|
11059
11120
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -11085,6 +11146,7 @@
|
|
11085
11146
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
11086
11147
|
<xsl:variable name="isAdded" select="@added"/>
|
11087
11148
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
11149
|
+
<xsl:call-template name="setNamedDestination"/>
|
11088
11150
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
11089
11151
|
<xsl:call-template name="refine_figure-block-style"/>
|
11090
11152
|
|
@@ -11101,6 +11163,11 @@
|
|
11101
11163
|
</xsl:variable>
|
11102
11164
|
|
11103
11165
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
11166
|
+
|
11167
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
11168
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
11169
|
+
</xsl:for-each>
|
11170
|
+
|
11104
11171
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
11105
11172
|
</fo:block>
|
11106
11173
|
|
@@ -11133,6 +11200,7 @@
|
|
11133
11200
|
</xsl:template>
|
11134
11201
|
|
11135
11202
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
11203
|
+
<xsl:call-template name="setNamedDestination"/>
|
11136
11204
|
<fo:block id="{@id}">
|
11137
11205
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
11138
11206
|
</fo:block>
|
@@ -11146,6 +11214,7 @@
|
|
11146
11214
|
</xsl:template>
|
11147
11215
|
|
11148
11216
|
<!-- SOURCE: ... -->
|
11217
|
+
<!-- figure/source -->
|
11149
11218
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
11150
11219
|
|
11151
11220
|
<xsl:call-template name="termsource"/>
|
@@ -12071,6 +12140,13 @@
|
|
12071
12140
|
<xsl:apply-templates select="."/>
|
12072
12141
|
</xsl:template>
|
12073
12142
|
|
12143
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
12144
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
12145
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
12146
|
+
<xsl:apply-templates select="."/>
|
12147
|
+
</xsl:if>
|
12148
|
+
</xsl:template>
|
12149
|
+
|
12074
12150
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
12075
12151
|
|
12076
12152
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -12294,7 +12370,8 @@
|
|
12294
12370
|
|
12295
12371
|
<xsl:for-each select="$contents_nodes//tables/table">
|
12296
12372
|
<fo:bookmark internal-destination="{@id}">
|
12297
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
12373
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
12374
|
+
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
12298
12375
|
</fo:bookmark>
|
12299
12376
|
</xsl:for-each>
|
12300
12377
|
</fo:bookmark>
|
@@ -12303,6 +12380,26 @@
|
|
12303
12380
|
</xsl:template> <!-- insertTableBookmarks -->
|
12304
12381
|
<!-- End Bookmarks -->
|
12305
12382
|
|
12383
|
+
<!-- ============================ -->
|
12384
|
+
<!-- mode="bookmark_clean" -->
|
12385
|
+
<!-- ============================ -->
|
12386
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
12387
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
12388
|
+
</xsl:template>
|
12389
|
+
|
12390
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
12391
|
+
<xsl:value-of select="."/>
|
12392
|
+
</xsl:template>
|
12393
|
+
|
12394
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
12395
|
+
<xsl:value-of select="normalize-space(.)"/>
|
12396
|
+
</xsl:template>
|
12397
|
+
|
12398
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
12399
|
+
<!-- ============================ -->
|
12400
|
+
<!-- END: mode="bookmark_clean" -->
|
12401
|
+
<!-- ============================ -->
|
12402
|
+
|
12306
12403
|
<xsl:template name="getLangVersion">
|
12307
12404
|
<xsl:param name="lang"/>
|
12308
12405
|
<xsl:param name="doctype" select="''"/>
|
@@ -12364,6 +12461,7 @@
|
|
12364
12461
|
<xsl:template match="title" mode="bookmark"/>
|
12365
12462
|
<xsl:template match="text()" mode="bookmark"/>
|
12366
12463
|
|
12464
|
+
<!-- figure/name -->
|
12367
12465
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
12368
12466
|
<xsl:if test="normalize-space() != ''">
|
12369
12467
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -13078,6 +13176,7 @@
|
|
13078
13176
|
<!-- permission -->
|
13079
13177
|
<!-- ========== -->
|
13080
13178
|
<xsl:template match="*[local-name() = 'permission']">
|
13179
|
+
<xsl:call-template name="setNamedDestination"/>
|
13081
13180
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
13082
13181
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
13083
13182
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -13086,10 +13185,12 @@
|
|
13086
13185
|
|
13087
13186
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
13088
13187
|
<xsl:if test="normalize-space() != ''">
|
13089
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
13090
|
-
<xsl:apply-templates/>
|
13091
13188
|
|
13092
|
-
|
13189
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
13190
|
+
<xsl:apply-templates/>
|
13191
|
+
|
13192
|
+
</fo:block>
|
13193
|
+
|
13093
13194
|
</xsl:if>
|
13094
13195
|
</xsl:template>
|
13095
13196
|
|
@@ -13105,6 +13206,7 @@
|
|
13105
13206
|
<!-- requirement -->
|
13106
13207
|
<!-- ========== -->
|
13107
13208
|
<xsl:template match="*[local-name() = 'requirement']">
|
13209
|
+
<xsl:call-template name="setNamedDestination"/>
|
13108
13210
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
13109
13211
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
13110
13212
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -13116,11 +13218,13 @@
|
|
13116
13218
|
|
13117
13219
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
13118
13220
|
<xsl:if test="normalize-space() != ''">
|
13119
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
13120
13221
|
|
13121
|
-
|
13222
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
13223
|
+
|
13224
|
+
<xsl:apply-templates/>
|
13225
|
+
|
13226
|
+
</fo:block>
|
13122
13227
|
|
13123
|
-
</fo:block>
|
13124
13228
|
</xsl:if>
|
13125
13229
|
</xsl:template>
|
13126
13230
|
|
@@ -13149,6 +13253,7 @@
|
|
13149
13253
|
<!-- recommendation -->
|
13150
13254
|
<!-- ========== -->
|
13151
13255
|
<xsl:template match="*[local-name() = 'recommendation']">
|
13256
|
+
<xsl:call-template name="setNamedDestination"/>
|
13152
13257
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
13153
13258
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
13154
13259
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -13157,10 +13262,12 @@
|
|
13157
13262
|
|
13158
13263
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
13159
13264
|
<xsl:if test="normalize-space() != ''">
|
13160
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
13161
|
-
<xsl:apply-templates/>
|
13162
13265
|
|
13163
|
-
|
13266
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
13267
|
+
<xsl:apply-templates/>
|
13268
|
+
|
13269
|
+
</fo:block>
|
13270
|
+
|
13164
13271
|
</xsl:if>
|
13165
13272
|
</xsl:template>
|
13166
13273
|
|
@@ -13239,6 +13346,7 @@
|
|
13239
13346
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
13240
13347
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
13241
13348
|
</xsl:if>
|
13349
|
+
<xsl:call-template name="setNamedDestination"/>
|
13242
13350
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
13243
13351
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
13244
13352
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -13348,6 +13456,7 @@
|
|
13348
13456
|
<!-- termexample -->
|
13349
13457
|
<!-- ====== -->
|
13350
13458
|
<xsl:template match="*[local-name() = 'termexample']">
|
13459
|
+
<xsl:call-template name="setNamedDestination"/>
|
13351
13460
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
13352
13461
|
<xsl:call-template name="refine_termexample-style"/>
|
13353
13462
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -13402,6 +13511,7 @@
|
|
13402
13511
|
-->
|
13403
13512
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
13404
13513
|
|
13514
|
+
<xsl:call-template name="setNamedDestination"/>
|
13405
13515
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
13406
13516
|
|
13407
13517
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -13925,8 +14035,13 @@
|
|
13925
14035
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
13926
14036
|
|
13927
14037
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
14038
|
+
|
13928
14039
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
13929
14040
|
|
14041
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
14042
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
14043
|
+
</xsl:for-each>
|
14044
|
+
|
13930
14045
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
13931
14046
|
</fo:block>
|
13932
14047
|
</xsl:if>
|
@@ -14046,6 +14161,7 @@
|
|
14046
14161
|
<!-- main sections -->
|
14047
14162
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
14048
14163
|
|
14164
|
+
<xsl:call-template name="setNamedDestination"/>
|
14049
14165
|
<fo:block>
|
14050
14166
|
<xsl:call-template name="setId"/>
|
14051
14167
|
|
@@ -14086,6 +14202,7 @@
|
|
14086
14202
|
|
14087
14203
|
<fo:block break-after="page"/>
|
14088
14204
|
|
14205
|
+
<xsl:call-template name="setNamedDestination"/>
|
14089
14206
|
<fo:block>
|
14090
14207
|
<xsl:call-template name="setId"/>
|
14091
14208
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -14114,6 +14231,7 @@
|
|
14114
14231
|
</xsl:template>
|
14115
14232
|
|
14116
14233
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
14234
|
+
<xsl:call-template name="setNamedDestination"/>
|
14117
14235
|
<fo:block>
|
14118
14236
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
14119
14237
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -14138,6 +14256,7 @@
|
|
14138
14256
|
</xsl:template> <!-- refine_clause_style -->
|
14139
14257
|
|
14140
14258
|
<xsl:template match="*[local-name() = 'definitions']">
|
14259
|
+
<xsl:call-template name="setNamedDestination"/>
|
14141
14260
|
<fo:block id="{@id}">
|
14142
14261
|
<xsl:apply-templates/>
|
14143
14262
|
</fo:block>
|
@@ -14153,6 +14272,8 @@
|
|
14153
14272
|
<xsl:otherwise>
|
14154
14273
|
|
14155
14274
|
<fo:block break-after="page"/>
|
14275
|
+
<xsl:call-template name="setNamedDestination"/>
|
14276
|
+
|
14156
14277
|
<fo:block id="{@id}">
|
14157
14278
|
|
14158
14279
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -14224,6 +14345,7 @@
|
|
14224
14345
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
14225
14346
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
14226
14347
|
<!-- <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> -->
|
14348
|
+
<xsl:call-template name="setNamedDestination"/>
|
14227
14349
|
<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>
|
14228
14350
|
<!-- </xsl:if> -->
|
14229
14351
|
</xsl:if>
|
@@ -14325,9 +14447,15 @@
|
|
14325
14447
|
<xsl:when test="local-name(..) = 'ul'">
|
14326
14448
|
<xsl:choose>
|
14327
14449
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
14450
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
14451
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
14328
14452
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
14329
14453
|
</xsl:choose>
|
14330
14454
|
</xsl:when>
|
14455
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
14456
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
14457
|
+
<xsl:value-of select="@label"/>
|
14458
|
+
</xsl:when>
|
14331
14459
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
14332
14460
|
|
14333
14461
|
<xsl:variable name="type" select="../@type"/>
|
@@ -14452,7 +14580,7 @@
|
|
14452
14580
|
|
14453
14581
|
</xsl:otherwise>
|
14454
14582
|
</xsl:choose>
|
14455
|
-
</xsl:template>
|
14583
|
+
</xsl:template> <!-- getListItemFormat -->
|
14456
14584
|
|
14457
14585
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
14458
14586
|
<xsl:param name="indent">0</xsl:param>
|
@@ -14586,6 +14714,11 @@
|
|
14586
14714
|
|
14587
14715
|
<xsl:call-template name="refine_list-item-label-style"/>
|
14588
14716
|
|
14717
|
+
<xsl:if test="local-name(..) = 'ul'">
|
14718
|
+
<xsl:variable name="li_label" select="@label"/>
|
14719
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
14720
|
+
</xsl:if>
|
14721
|
+
|
14589
14722
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
14590
14723
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
14591
14724
|
<xsl:call-template name="append_add-style"/>
|
@@ -14932,6 +15065,7 @@
|
|
14932
15065
|
<!-- Normative references -->
|
14933
15066
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
14934
15067
|
|
15068
|
+
<xsl:call-template name="setNamedDestination"/>
|
14935
15069
|
<fo:block id="{@id}">
|
14936
15070
|
<xsl:apply-templates/>
|
14937
15071
|
|
@@ -14952,6 +15086,7 @@
|
|
14952
15086
|
</xsl:if>
|
14953
15087
|
</xsl:if> -->
|
14954
15088
|
|
15089
|
+
<xsl:call-template name="setNamedDestination"/>
|
14955
15090
|
<fo:block id="{@id}"/>
|
14956
15091
|
|
14957
15092
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -14971,6 +15106,7 @@
|
|
14971
15106
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
14972
15107
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
14973
15108
|
|
15109
|
+
<xsl:call-template name="setNamedDestination"/>
|
14974
15110
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
14975
15111
|
|
14976
15112
|
<xsl:call-template name="processBibitem"/>
|
@@ -14983,6 +15119,7 @@
|
|
14983
15119
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
14984
15120
|
|
14985
15121
|
<!-- start BIPM bibitem processing -->
|
15122
|
+
<xsl:call-template name="setNamedDestination"/>
|
14986
15123
|
<fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
|
14987
15124
|
<fo:list-item>
|
14988
15125
|
<fo:list-item-label end-indent="label-end()">
|
@@ -15011,6 +15148,7 @@
|
|
15011
15148
|
<xsl:choose>
|
15012
15149
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
15013
15150
|
<xsl:otherwise>
|
15151
|
+
<xsl:call-template name="setNamedDestination"/>
|
15014
15152
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
15015
15153
|
|
15016
15154
|
<fo:list-item-label end-indent="label-end()">
|
@@ -15405,6 +15543,7 @@
|
|
15405
15543
|
<xsl:template match="*[local-name() = 'admonition']">
|
15406
15544
|
|
15407
15545
|
<!-- text in the box -->
|
15546
|
+
<xsl:call-template name="setNamedDestination"/>
|
15408
15547
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
|
15409
15548
|
|
15410
15549
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15661,7 +15800,7 @@
|
|
15661
15800
|
</xsl:template>
|
15662
15801
|
|
15663
15802
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
15664
|
-
<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">
|
15803
|
+
<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">
|
15665
15804
|
<xsl:copy>
|
15666
15805
|
<xsl:copy-of select="@*"/>
|
15667
15806
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -15693,28 +15832,56 @@
|
|
15693
15832
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
15694
15833
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
15695
15834
|
|
15696
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
15835
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
15697
15836
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
15698
15837
|
<xsl:copy-of select="@*"/>
|
15699
15838
|
<xsl:choose>
|
15700
15839
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
15701
|
-
<xsl:
|
15840
|
+
<xsl:choose>
|
15841
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
15842
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
15843
|
+
</xsl:when>
|
15844
|
+
<xsl:otherwise>
|
15845
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
15846
|
+
</xsl:otherwise>
|
15847
|
+
</xsl:choose>
|
15702
15848
|
</xsl:when>
|
15703
15849
|
<xsl:otherwise>
|
15704
|
-
<xsl:
|
15850
|
+
<xsl:choose>
|
15851
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
15852
|
+
<xsl:copy-of select="node()"/>
|
15853
|
+
</xsl:when>
|
15854
|
+
<xsl:otherwise>
|
15855
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
15856
|
+
</xsl:otherwise>
|
15857
|
+
</xsl:choose>
|
15705
15858
|
</xsl:otherwise>
|
15706
15859
|
</xsl:choose>
|
15707
15860
|
</xsl:element>
|
15708
15861
|
</xsl:template>
|
15709
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
15862
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
15710
15863
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
15711
15864
|
<xsl:copy-of select="@*"/>
|
15712
15865
|
<xsl:choose>
|
15713
15866
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
15714
|
-
<xsl:
|
15867
|
+
<xsl:choose>
|
15868
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
15869
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
15870
|
+
</xsl:when>
|
15871
|
+
<xsl:otherwise>
|
15872
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
15873
|
+
</xsl:otherwise>
|
15874
|
+
</xsl:choose>
|
15715
15875
|
</xsl:when>
|
15716
15876
|
<xsl:otherwise>
|
15717
|
-
<xsl:
|
15877
|
+
<xsl:choose>
|
15878
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
15879
|
+
<xsl:copy-of select="node()"/>
|
15880
|
+
</xsl:when>
|
15881
|
+
<xsl:otherwise>
|
15882
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
15883
|
+
</xsl:otherwise>
|
15884
|
+
</xsl:choose>
|
15718
15885
|
</xsl:otherwise>
|
15719
15886
|
</xsl:choose>
|
15720
15887
|
</xsl:element>
|
@@ -15943,16 +16110,24 @@
|
|
15943
16110
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
15944
16111
|
<xsl:element name="title" namespace="{$namespace_full}">
|
15945
16112
|
<xsl:copy-of select="@*"/>
|
16113
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
16114
|
+
|
15946
16115
|
<xsl:apply-templates mode="update_xml_step1"/>
|
15947
16116
|
</xsl:element>
|
15948
16117
|
</xsl:template>
|
15949
16118
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
15950
16119
|
<xsl:element name="title" namespace="{$namespace_full}">
|
15951
16120
|
<xsl:copy-of select="@*"/>
|
16121
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
16122
|
+
|
15952
16123
|
<xsl:apply-templates mode="update_xml_pres"/>
|
15953
16124
|
</xsl:element>
|
15954
16125
|
</xsl:template>
|
15955
16126
|
|
16127
|
+
<xsl:template name="addNamedDestinationAttribute">
|
16128
|
+
|
16129
|
+
</xsl:template>
|
16130
|
+
|
15956
16131
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
15957
16132
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
15958
16133
|
<xsl:choose>
|
@@ -15962,6 +16137,8 @@
|
|
15962
16137
|
<xsl:otherwise>
|
15963
16138
|
<xsl:element name="name" namespace="{$namespace_full}">
|
15964
16139
|
<xsl:copy-of select="@*"/>
|
16140
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
16141
|
+
|
15965
16142
|
<xsl:apply-templates mode="update_xml_step1"/>
|
15966
16143
|
</xsl:element>
|
15967
16144
|
</xsl:otherwise>
|
@@ -15975,12 +16152,24 @@
|
|
15975
16152
|
<xsl:otherwise>
|
15976
16153
|
<xsl:element name="name" namespace="{$namespace_full}">
|
15977
16154
|
<xsl:copy-of select="@*"/>
|
16155
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
16156
|
+
|
15978
16157
|
<xsl:apply-templates mode="update_xml_pres"/>
|
15979
16158
|
</xsl:element>
|
15980
16159
|
</xsl:otherwise>
|
15981
16160
|
</xsl:choose>
|
15982
16161
|
</xsl:template>
|
15983
16162
|
|
16163
|
+
<!-- li/fmt-name -->
|
16164
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
16165
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
16166
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
16167
|
+
</xsl:template>
|
16168
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
16169
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
16170
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
16171
|
+
</xsl:template>
|
16172
|
+
|
15984
16173
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
15985
16174
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
15986
16175
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -16795,6 +16984,64 @@
|
|
16795
16984
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
16796
16985
|
</xsl:template>
|
16797
16986
|
|
16987
|
+
<!-- ===================================== -->
|
16988
|
+
<!-- ===================================== -->
|
16989
|
+
<!-- Ruby text (CJK languages) rendering -->
|
16990
|
+
<!-- ===================================== -->
|
16991
|
+
<!-- ===================================== -->
|
16992
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
16993
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
16994
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
16995
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
16996
|
+
</xsl:if>
|
16997
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
16998
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
16999
|
+
<!-- Example: width="2em" -->
|
17000
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
17001
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
17002
|
+
<xsl:variable name="text_width">
|
17003
|
+
<xsl:choose>
|
17004
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
17005
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
17006
|
+
</xsl:choose>
|
17007
|
+
</xsl:variable>
|
17008
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
17009
|
+
|
17010
|
+
<xsl:choose>
|
17011
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
17012
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
17013
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
17014
|
+
</xsl:when>
|
17015
|
+
<xsl:otherwise>
|
17016
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
17017
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
17018
|
+
</xsl:otherwise>
|
17019
|
+
</xsl:choose>
|
17020
|
+
|
17021
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
17022
|
+
</fo:inline-container>
|
17023
|
+
</xsl:template>
|
17024
|
+
|
17025
|
+
<xsl:template match="*[local-name() = 'rb']">
|
17026
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
17027
|
+
</xsl:template>
|
17028
|
+
|
17029
|
+
<xsl:template match="*[local-name() = 'rt']">
|
17030
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
17031
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
17032
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
17033
|
+
</xsl:if>
|
17034
|
+
<xsl:apply-templates/>
|
17035
|
+
</fo:block>
|
17036
|
+
|
17037
|
+
</xsl:template>
|
17038
|
+
|
17039
|
+
<!-- ===================================== -->
|
17040
|
+
<!-- ===================================== -->
|
17041
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
17042
|
+
<!-- ===================================== -->
|
17043
|
+
<!-- ===================================== -->
|
17044
|
+
|
16798
17045
|
<xsl:template name="printEdition">
|
16799
17046
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
16800
17047
|
|
@@ -17371,6 +17618,24 @@
|
|
17371
17618
|
</xsl:attribute>
|
17372
17619
|
</xsl:template>
|
17373
17620
|
|
17621
|
+
<xsl:template name="setIDforNamedDestination">
|
17622
|
+
<xsl:if test="@named_dest">
|
17623
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
17624
|
+
</xsl:if>
|
17625
|
+
</xsl:template>
|
17626
|
+
|
17627
|
+
<xsl:template name="setNamedDestination">
|
17628
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
17629
|
+
<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'">
|
17630
|
+
<fox:destination internal-destination="{@id}"/>
|
17631
|
+
</xsl:if>
|
17632
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
17633
|
+
<xsl:if test="@named_dest">
|
17634
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
17635
|
+
</xsl:if>
|
17636
|
+
</xsl:for-each>
|
17637
|
+
</xsl:template>
|
17638
|
+
|
17374
17639
|
<xsl:template name="add-letter-spacing">
|
17375
17640
|
<xsl:param name="text"/>
|
17376
17641
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|