metanorma-csa 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/csa/csa.standard.xsl +338 -67
- data/lib/isodoc/csa/presentation_xml_convert.rb +11 -0
- data/lib/metanorma/csa/basicdoc.rng +14 -8
- data/lib/metanorma/csa/biblio-standoc.rng +37 -7
- data/lib/metanorma/csa/biblio.rng +30 -18
- data/lib/metanorma/csa/csa.rng +1 -61
- data/lib/metanorma/csa/isodoc.rng +130 -96
- data/lib/metanorma/csa/processor.rb +13 -10
- data/lib/metanorma/csa/relaton-csa.rng +0 -16
- data/lib/metanorma/csa/reqt.rng +7 -6
- data/lib/metanorma/csa/version.rb +1 -1
- metadata +2 -2
@@ -1331,12 +1331,16 @@
|
|
1331
1331
|
</xsl:template> <!-- refine_table-style -->
|
1332
1332
|
|
1333
1333
|
<xsl:attribute-set name="table-name-style">
|
1334
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
1334
1335
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1335
1336
|
|
1336
1337
|
</xsl:attribute-set> <!-- table-name-style -->
|
1337
1338
|
|
1338
1339
|
<xsl:template name="refine_table-name-style">
|
1339
1340
|
<xsl:param name="continued"/>
|
1341
|
+
<xsl:if test="$continued = 'true'">
|
1342
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
1343
|
+
</xsl:if>
|
1340
1344
|
|
1341
1345
|
</xsl:template> <!-- refine_table-name-style -->
|
1342
1346
|
|
@@ -2942,8 +2946,14 @@
|
|
2942
2946
|
</xsl:choose>
|
2943
2947
|
</xsl:variable>
|
2944
2948
|
|
2949
|
+
<xsl:call-template name="setNamedDestination"/>
|
2950
|
+
|
2945
2951
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
2946
2952
|
|
2953
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
2954
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
2955
|
+
</xsl:for-each>
|
2956
|
+
|
2947
2957
|
<xsl:call-template name="refine_table-container-style">
|
2948
2958
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
2949
2959
|
</xsl:call-template>
|
@@ -3087,7 +3097,7 @@
|
|
3087
3097
|
</xsl:if>
|
3088
3098
|
|
3089
3099
|
</fo:block-container>
|
3090
|
-
</xsl:variable>
|
3100
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
3091
3101
|
|
3092
3102
|
<xsl:variable name="isAdded" select="@added"/>
|
3093
3103
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -3097,14 +3107,14 @@
|
|
3097
3107
|
|
3098
3108
|
<!-- centered table when table name is centered (see table-name-style) -->
|
3099
3109
|
|
3100
|
-
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
|
3110
|
+
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
|
3101
3111
|
|
3102
3112
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
3103
3113
|
<fo:table-column column-width="{@width}"/>
|
3104
3114
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
3105
|
-
<fo:table-body>
|
3106
|
-
<fo:table-row>
|
3107
|
-
<fo:table-cell column-number="2">
|
3115
|
+
<fo:table-body role="SKIP">
|
3116
|
+
<fo:table-row role="SKIP">
|
3117
|
+
<fo:table-cell column-number="2" role="SKIP">
|
3108
3118
|
<xsl:copy-of select="$table-preamble"/>
|
3109
3119
|
<fo:block role="SKIP">
|
3110
3120
|
<xsl:call-template name="setTrackChangesStyles">
|
@@ -3145,11 +3155,13 @@
|
|
3145
3155
|
|
3146
3156
|
</xsl:template>
|
3147
3157
|
|
3158
|
+
<!-- table/name-->
|
3148
3159
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3149
3160
|
<xsl:param name="continued"/>
|
3161
|
+
<xsl:param name="cols-count"/>
|
3150
3162
|
<xsl:if test="normalize-space() != ''">
|
3151
3163
|
|
3152
|
-
<fo:block xsl:use-attribute-sets="table-name-style"
|
3164
|
+
<fo:block xsl:use-attribute-sets="table-name-style">
|
3153
3165
|
|
3154
3166
|
<xsl:call-template name="refine_table-name-style">
|
3155
3167
|
<xsl:with-param name="continued" select="$continued"/>
|
@@ -3168,9 +3180,30 @@
|
|
3168
3180
|
|
3169
3181
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
3170
3182
|
<xsl:if test="$continued = 'true'">
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3183
|
+
|
3184
|
+
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
3185
|
+
|
3186
|
+
<xsl:choose>
|
3187
|
+
<xsl:when test="string(number($cols-count)) != 'NaN'">
|
3188
|
+
<fo:table width="100%" table-layout="fixed" role="SKIP">
|
3189
|
+
<fo:table-body role="SKIP">
|
3190
|
+
<fo:table-row>
|
3191
|
+
<fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
|
3192
|
+
<fo:block text-align="right" role="SKIP">
|
3193
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3194
|
+
</fo:block>
|
3195
|
+
</fo:table-cell>
|
3196
|
+
</fo:table-row>
|
3197
|
+
</fo:table-body>
|
3198
|
+
</fo:table>
|
3199
|
+
</xsl:when>
|
3200
|
+
<xsl:otherwise>
|
3201
|
+
<fo:block text-align="right">
|
3202
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3203
|
+
</fo:block>
|
3204
|
+
</xsl:otherwise>
|
3205
|
+
</xsl:choose>
|
3206
|
+
|
3174
3207
|
</xsl:if>
|
3175
3208
|
<!-- </xsl:if> -->
|
3176
3209
|
|
@@ -3563,6 +3596,7 @@
|
|
3563
3596
|
|
3564
3597
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
3565
3598
|
<xsl:with-param name="continued">true</xsl:with-param>
|
3599
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3566
3600
|
</xsl:apply-templates>
|
3567
3601
|
|
3568
3602
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -3626,7 +3660,7 @@
|
|
3626
3660
|
|
3627
3661
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
3628
3662
|
|
3629
|
-
<fo:table keep-with-previous="always">
|
3663
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
3630
3664
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
3631
3665
|
<xsl:variable name="name" select="local-name()"/>
|
3632
3666
|
<xsl:choose>
|
@@ -3657,9 +3691,9 @@
|
|
3657
3691
|
</xsl:otherwise>
|
3658
3692
|
</xsl:choose>
|
3659
3693
|
|
3660
|
-
<fo:table-body>
|
3661
|
-
<fo:table-row>
|
3662
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
3694
|
+
<fo:table-body role="SKIP">
|
3695
|
+
<fo:table-row role="SKIP">
|
3696
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
3663
3697
|
|
3664
3698
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
3665
3699
|
|
@@ -3944,8 +3978,8 @@
|
|
3944
3978
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
3945
3979
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
3946
3980
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
3947
|
-
<xsl:if test="$key = 'color' or
|
3948
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
3981
|
+
<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'">
|
3982
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
3949
3983
|
</xsl:if>
|
3950
3984
|
</xsl:for-each>
|
3951
3985
|
</xsl:variable>
|
@@ -4009,6 +4043,7 @@
|
|
4009
4043
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
4010
4044
|
<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">
|
4011
4045
|
|
4046
|
+
<xsl:call-template name="setNamedDestination"/>
|
4012
4047
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
4013
4048
|
<xsl:copy-of select="@id"/>
|
4014
4049
|
|
@@ -4056,6 +4091,7 @@
|
|
4056
4091
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
4057
4092
|
<!-- fn in text -->
|
4058
4093
|
<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">
|
4094
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
4059
4095
|
|
4060
4096
|
<!-- list of unique footnotes -->
|
4061
4097
|
<xsl:variable name="p_fn_">
|
@@ -4121,7 +4157,7 @@
|
|
4121
4157
|
<xsl:copy-of select="$footnote_inline"/>
|
4122
4158
|
</xsl:when>
|
4123
4159
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
4124
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
4160
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
4125
4161
|
|
4126
4162
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
4127
4163
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -4530,39 +4566,51 @@
|
|
4530
4566
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
4531
4567
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
4532
4568
|
<xsl:template match="*[local-name()='fn']">
|
4533
|
-
<
|
4534
|
-
|
4535
|
-
|
4569
|
+
<xsl:variable name="target" select="@target"/>
|
4570
|
+
<xsl:choose>
|
4571
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
4572
|
+
<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]">
|
4573
|
+
<xsl:call-template name="fn">
|
4574
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
4575
|
+
</xsl:call-template>
|
4576
|
+
</xsl:when>
|
4577
|
+
<xsl:otherwise>
|
4536
4578
|
|
4537
|
-
|
4538
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
4539
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
4540
|
-
<!-- <xsl:attribute name="internal-destination">
|
4541
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4542
|
-
</xsl:attribute>
|
4543
|
-
</xsl:if>
|
4544
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4545
|
-
<xsl:attribute name="internal-destination">
|
4546
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
4547
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4548
|
-
</xsl:attribute>
|
4549
|
-
</xsl:if> -->
|
4550
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
4551
|
-
<xsl:text>※</xsl:text>
|
4552
|
-
</xsl:if> -->
|
4553
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
4579
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
4554
4580
|
|
4555
|
-
|
4581
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
4556
4582
|
|
4557
|
-
|
4558
|
-
<
|
4559
|
-
|
4560
|
-
|
4561
|
-
|
4562
|
-
|
4563
|
-
|
4564
|
-
|
4565
|
-
|
4583
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4584
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
4585
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
4586
|
+
<!-- <xsl:attribute name="internal-destination">
|
4587
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4588
|
+
</xsl:attribute>
|
4589
|
+
</xsl:if>
|
4590
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4591
|
+
<xsl:attribute name="internal-destination">
|
4592
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
4593
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4594
|
+
</xsl:attribute>
|
4595
|
+
</xsl:if> -->
|
4596
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
4597
|
+
<xsl:text>※</xsl:text>
|
4598
|
+
</xsl:if> -->
|
4599
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
4600
|
+
|
4601
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
4602
|
+
|
4603
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
4604
|
+
<xsl:text>)</xsl:text>
|
4605
|
+
</xsl:if> -->
|
4606
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
4607
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
4608
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
4609
|
+
</xsl:if> -->
|
4610
|
+
</fo:basic-link>
|
4611
|
+
</fo:inline>
|
4612
|
+
</xsl:otherwise>
|
4613
|
+
</xsl:choose>
|
4566
4614
|
</xsl:template> <!-- fn -->
|
4567
4615
|
|
4568
4616
|
<!-- fn/text() -->
|
@@ -4617,6 +4665,10 @@
|
|
4617
4665
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
4618
4666
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
4619
4667
|
|
4668
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
4669
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
4670
|
+
</xsl:if>
|
4671
|
+
|
4620
4672
|
<xsl:call-template name="setBlockSpanAll"/>
|
4621
4673
|
|
4622
4674
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -4910,7 +4962,7 @@
|
|
4910
4962
|
|
4911
4963
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
4912
4964
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
4913
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
4965
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
4914
4966
|
<xsl:call-template name="refine_figure_key_style"/>
|
4915
4967
|
<xsl:apply-templates/>
|
4916
4968
|
</fo:block>
|
@@ -5161,6 +5213,7 @@
|
|
5161
5213
|
|
5162
5214
|
<xsl:call-template name="refine_dt-cell-style"/>
|
5163
5215
|
|
5216
|
+
<xsl:call-template name="setNamedDestination"/>
|
5164
5217
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
5165
5218
|
|
5166
5219
|
<xsl:choose>
|
@@ -5597,7 +5650,7 @@
|
|
5597
5650
|
<!-- ================= -->
|
5598
5651
|
|
5599
5652
|
<!-- highlight text -->
|
5600
|
-
<xsl:template match="*[local-name()='hi']">
|
5653
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
5601
5654
|
<fo:inline background-color="yellow">
|
5602
5655
|
<xsl:apply-templates/>
|
5603
5656
|
</fo:inline>
|
@@ -7192,6 +7245,7 @@
|
|
7192
7245
|
<!-- Appendix processing -->
|
7193
7246
|
<!-- ======================== -->
|
7194
7247
|
<xsl:template match="*[local-name()='appendix']">
|
7248
|
+
<xsl:call-template name="setNamedDestination"/>
|
7195
7249
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
7196
7250
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
7197
7251
|
</fo:block>
|
@@ -7202,13 +7256,14 @@
|
|
7202
7256
|
<xsl:variable name="level">
|
7203
7257
|
<xsl:call-template name="getLevel"/>
|
7204
7258
|
</xsl:variable>
|
7205
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
7259
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
7206
7260
|
</xsl:template>
|
7207
7261
|
<!-- ======================== -->
|
7208
7262
|
<!-- END Appendix processing -->
|
7209
7263
|
<!-- ======================== -->
|
7210
7264
|
|
7211
7265
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
7266
|
+
<xsl:call-template name="setNamedDestination"/>
|
7212
7267
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
7213
7268
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
7214
7269
|
</fo:block>
|
@@ -7238,6 +7293,7 @@
|
|
7238
7293
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
7239
7294
|
<xsl:param name="callout"/>
|
7240
7295
|
<fo:inline id="{@id}">
|
7296
|
+
<xsl:call-template name="setNamedDestination"/>
|
7241
7297
|
<!-- for first p in annotation, put <x> -->
|
7242
7298
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
7243
7299
|
<xsl:apply-templates/>
|
@@ -7284,6 +7340,7 @@
|
|
7284
7340
|
|
7285
7341
|
</xsl:if>
|
7286
7342
|
<fo:block-container margin-left="0mm" role="SKIP">
|
7343
|
+
<xsl:call-template name="setNamedDestination"/>
|
7287
7344
|
<fo:block id="{@id}">
|
7288
7345
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
7289
7346
|
</fo:block>
|
@@ -7329,8 +7386,13 @@
|
|
7329
7386
|
</fo:block>
|
7330
7387
|
</fo:table-cell>
|
7331
7388
|
<fo:table-cell display-align="center">
|
7389
|
+
|
7332
7390
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
7333
7391
|
|
7392
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
7393
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
7394
|
+
</xsl:for-each>
|
7395
|
+
|
7334
7396
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
7335
7397
|
|
7336
7398
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -7365,6 +7427,8 @@
|
|
7365
7427
|
|
7366
7428
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
7367
7429
|
|
7430
|
+
<xsl:call-template name="setNamedDestination"/>
|
7431
|
+
|
7368
7432
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
7369
7433
|
|
7370
7434
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -7433,6 +7497,7 @@
|
|
7433
7497
|
</xsl:template>
|
7434
7498
|
|
7435
7499
|
<xsl:template match="*[local-name() = 'termnote']">
|
7500
|
+
<xsl:call-template name="setNamedDestination"/>
|
7436
7501
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
7437
7502
|
|
7438
7503
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -7539,12 +7604,14 @@
|
|
7539
7604
|
|
7540
7605
|
<xsl:template match="*[local-name() = 'terms']">
|
7541
7606
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
7607
|
+
<xsl:call-template name="setNamedDestination"/>
|
7542
7608
|
<fo:block id="{@id}">
|
7543
7609
|
<xsl:apply-templates/>
|
7544
7610
|
</fo:block>
|
7545
7611
|
</xsl:template>
|
7546
7612
|
|
7547
7613
|
<xsl:template match="*[local-name() = 'term']">
|
7614
|
+
<xsl:call-template name="setNamedDestination"/>
|
7548
7615
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
7549
7616
|
|
7550
7617
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -7576,6 +7643,7 @@
|
|
7576
7643
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
7577
7644
|
<xsl:variable name="isAdded" select="@added"/>
|
7578
7645
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
7646
|
+
<xsl:call-template name="setNamedDestination"/>
|
7579
7647
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
7580
7648
|
<xsl:call-template name="refine_figure-block-style"/>
|
7581
7649
|
|
@@ -7592,6 +7660,11 @@
|
|
7592
7660
|
</xsl:variable>
|
7593
7661
|
|
7594
7662
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
7663
|
+
|
7664
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
7665
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
7666
|
+
</xsl:for-each>
|
7667
|
+
|
7595
7668
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
7596
7669
|
</fo:block>
|
7597
7670
|
|
@@ -7624,6 +7697,7 @@
|
|
7624
7697
|
</xsl:template>
|
7625
7698
|
|
7626
7699
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
7700
|
+
<xsl:call-template name="setNamedDestination"/>
|
7627
7701
|
<fo:block id="{@id}">
|
7628
7702
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7629
7703
|
</fo:block>
|
@@ -7637,6 +7711,7 @@
|
|
7637
7711
|
</xsl:template>
|
7638
7712
|
|
7639
7713
|
<!-- SOURCE: ... -->
|
7714
|
+
<!-- figure/source -->
|
7640
7715
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
7641
7716
|
|
7642
7717
|
<xsl:call-template name="termsource"/>
|
@@ -8562,6 +8637,13 @@
|
|
8562
8637
|
<xsl:apply-templates select="."/>
|
8563
8638
|
</xsl:template>
|
8564
8639
|
|
8640
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
8641
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
8642
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
8643
|
+
<xsl:apply-templates select="."/>
|
8644
|
+
</xsl:if>
|
8645
|
+
</xsl:template>
|
8646
|
+
|
8565
8647
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
8566
8648
|
|
8567
8649
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -8785,7 +8867,8 @@
|
|
8785
8867
|
|
8786
8868
|
<xsl:for-each select="$contents_nodes//tables/table">
|
8787
8869
|
<fo:bookmark internal-destination="{@id}">
|
8788
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
8870
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
8871
|
+
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
8789
8872
|
</fo:bookmark>
|
8790
8873
|
</xsl:for-each>
|
8791
8874
|
</fo:bookmark>
|
@@ -8794,6 +8877,26 @@
|
|
8794
8877
|
</xsl:template> <!-- insertTableBookmarks -->
|
8795
8878
|
<!-- End Bookmarks -->
|
8796
8879
|
|
8880
|
+
<!-- ============================ -->
|
8881
|
+
<!-- mode="bookmark_clean" -->
|
8882
|
+
<!-- ============================ -->
|
8883
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
8884
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
8885
|
+
</xsl:template>
|
8886
|
+
|
8887
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
8888
|
+
<xsl:value-of select="."/>
|
8889
|
+
</xsl:template>
|
8890
|
+
|
8891
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
8892
|
+
<xsl:value-of select="normalize-space(.)"/>
|
8893
|
+
</xsl:template>
|
8894
|
+
|
8895
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
8896
|
+
<!-- ============================ -->
|
8897
|
+
<!-- END: mode="bookmark_clean" -->
|
8898
|
+
<!-- ============================ -->
|
8899
|
+
|
8797
8900
|
<xsl:template name="getLangVersion">
|
8798
8901
|
<xsl:param name="lang"/>
|
8799
8902
|
<xsl:param name="doctype" select="''"/>
|
@@ -8841,6 +8944,7 @@
|
|
8841
8944
|
<xsl:template match="title" mode="bookmark"/>
|
8842
8945
|
<xsl:template match="text()" mode="bookmark"/>
|
8843
8946
|
|
8947
|
+
<!-- figure/name -->
|
8844
8948
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
8845
8949
|
<xsl:if test="normalize-space() != ''">
|
8846
8950
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -9557,6 +9661,7 @@
|
|
9557
9661
|
<!-- permission -->
|
9558
9662
|
<!-- ========== -->
|
9559
9663
|
<xsl:template match="*[local-name() = 'permission']">
|
9664
|
+
<xsl:call-template name="setNamedDestination"/>
|
9560
9665
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
9561
9666
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
9562
9667
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -9565,10 +9670,12 @@
|
|
9565
9670
|
|
9566
9671
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
9567
9672
|
<xsl:if test="normalize-space() != ''">
|
9568
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
9569
|
-
<xsl:apply-templates/>
|
9570
9673
|
|
9571
|
-
|
9674
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
9675
|
+
<xsl:apply-templates/>
|
9676
|
+
|
9677
|
+
</fo:block>
|
9678
|
+
|
9572
9679
|
</xsl:if>
|
9573
9680
|
</xsl:template>
|
9574
9681
|
|
@@ -9584,6 +9691,7 @@
|
|
9584
9691
|
<!-- requirement -->
|
9585
9692
|
<!-- ========== -->
|
9586
9693
|
<xsl:template match="*[local-name() = 'requirement']">
|
9694
|
+
<xsl:call-template name="setNamedDestination"/>
|
9587
9695
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
9588
9696
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
9589
9697
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -9595,11 +9703,13 @@
|
|
9595
9703
|
|
9596
9704
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
9597
9705
|
<xsl:if test="normalize-space() != ''">
|
9598
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
9599
9706
|
|
9600
|
-
|
9707
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
9708
|
+
|
9709
|
+
<xsl:apply-templates/>
|
9710
|
+
|
9711
|
+
</fo:block>
|
9601
9712
|
|
9602
|
-
</fo:block>
|
9603
9713
|
</xsl:if>
|
9604
9714
|
</xsl:template>
|
9605
9715
|
|
@@ -9628,6 +9738,7 @@
|
|
9628
9738
|
<!-- recommendation -->
|
9629
9739
|
<!-- ========== -->
|
9630
9740
|
<xsl:template match="*[local-name() = 'recommendation']">
|
9741
|
+
<xsl:call-template name="setNamedDestination"/>
|
9631
9742
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
9632
9743
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
9633
9744
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -9636,10 +9747,12 @@
|
|
9636
9747
|
|
9637
9748
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
9638
9749
|
<xsl:if test="normalize-space() != ''">
|
9639
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
9640
|
-
<xsl:apply-templates/>
|
9641
9750
|
|
9642
|
-
|
9751
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
9752
|
+
<xsl:apply-templates/>
|
9753
|
+
|
9754
|
+
</fo:block>
|
9755
|
+
|
9643
9756
|
</xsl:if>
|
9644
9757
|
</xsl:template>
|
9645
9758
|
|
@@ -9718,6 +9831,7 @@
|
|
9718
9831
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
9719
9832
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
9720
9833
|
</xsl:if>
|
9834
|
+
<xsl:call-template name="setNamedDestination"/>
|
9721
9835
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
9722
9836
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
9723
9837
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -9827,6 +9941,7 @@
|
|
9827
9941
|
<!-- termexample -->
|
9828
9942
|
<!-- ====== -->
|
9829
9943
|
<xsl:template match="*[local-name() = 'termexample']">
|
9944
|
+
<xsl:call-template name="setNamedDestination"/>
|
9830
9945
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
9831
9946
|
<xsl:call-template name="refine_termexample-style"/>
|
9832
9947
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -9881,6 +9996,7 @@
|
|
9881
9996
|
-->
|
9882
9997
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
9883
9998
|
|
9999
|
+
<xsl:call-template name="setNamedDestination"/>
|
9884
10000
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
9885
10001
|
|
9886
10002
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -10399,8 +10515,13 @@
|
|
10399
10515
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
10400
10516
|
|
10401
10517
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
10518
|
+
|
10402
10519
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
10403
10520
|
|
10521
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
10522
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
10523
|
+
</xsl:for-each>
|
10524
|
+
|
10404
10525
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
10405
10526
|
</fo:block>
|
10406
10527
|
</xsl:if>
|
@@ -10520,6 +10641,7 @@
|
|
10520
10641
|
<!-- main sections -->
|
10521
10642
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
10522
10643
|
|
10644
|
+
<xsl:call-template name="setNamedDestination"/>
|
10523
10645
|
<fo:block>
|
10524
10646
|
<xsl:call-template name="setId"/>
|
10525
10647
|
|
@@ -10565,6 +10687,7 @@
|
|
10565
10687
|
|
10566
10688
|
<fo:block break-after="page"/>
|
10567
10689
|
|
10690
|
+
<xsl:call-template name="setNamedDestination"/>
|
10568
10691
|
<fo:block>
|
10569
10692
|
<xsl:call-template name="setId"/>
|
10570
10693
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -10593,6 +10716,7 @@
|
|
10593
10716
|
</xsl:template>
|
10594
10717
|
|
10595
10718
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
10719
|
+
<xsl:call-template name="setNamedDestination"/>
|
10596
10720
|
<fo:block>
|
10597
10721
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
10598
10722
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -10615,6 +10739,7 @@
|
|
10615
10739
|
</xsl:template> <!-- refine_clause_style -->
|
10616
10740
|
|
10617
10741
|
<xsl:template match="*[local-name() = 'definitions']">
|
10742
|
+
<xsl:call-template name="setNamedDestination"/>
|
10618
10743
|
<fo:block id="{@id}">
|
10619
10744
|
<xsl:apply-templates/>
|
10620
10745
|
</fo:block>
|
@@ -10630,6 +10755,8 @@
|
|
10630
10755
|
<xsl:otherwise>
|
10631
10756
|
|
10632
10757
|
<fo:block break-after="page"/>
|
10758
|
+
<xsl:call-template name="setNamedDestination"/>
|
10759
|
+
|
10633
10760
|
<fo:block id="{@id}">
|
10634
10761
|
|
10635
10762
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -10701,6 +10828,7 @@
|
|
10701
10828
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
10702
10829
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
10703
10830
|
<!-- <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> -->
|
10831
|
+
<xsl:call-template name="setNamedDestination"/>
|
10704
10832
|
<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>
|
10705
10833
|
<!-- </xsl:if> -->
|
10706
10834
|
</xsl:if>
|
@@ -10802,9 +10930,15 @@
|
|
10802
10930
|
<xsl:when test="local-name(..) = 'ul'">
|
10803
10931
|
<xsl:choose>
|
10804
10932
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
10933
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
10934
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
10805
10935
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
10806
10936
|
</xsl:choose>
|
10807
10937
|
</xsl:when>
|
10938
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
10939
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
10940
|
+
<xsl:value-of select="@label"/>
|
10941
|
+
</xsl:when>
|
10808
10942
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
10809
10943
|
|
10810
10944
|
<xsl:variable name="type" select="../@type"/>
|
@@ -10929,7 +11063,7 @@
|
|
10929
11063
|
|
10930
11064
|
</xsl:otherwise>
|
10931
11065
|
</xsl:choose>
|
10932
|
-
</xsl:template>
|
11066
|
+
</xsl:template> <!-- getListItemFormat -->
|
10933
11067
|
|
10934
11068
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
10935
11069
|
<xsl:param name="indent">0</xsl:param>
|
@@ -11061,6 +11195,11 @@
|
|
11061
11195
|
|
11062
11196
|
<xsl:call-template name="refine_list-item-label-style"/>
|
11063
11197
|
|
11198
|
+
<xsl:if test="local-name(..) = 'ul'">
|
11199
|
+
<xsl:variable name="li_label" select="@label"/>
|
11200
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
11201
|
+
</xsl:if>
|
11202
|
+
|
11064
11203
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
11065
11204
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
11066
11205
|
<xsl:call-template name="append_add-style"/>
|
@@ -11407,6 +11546,7 @@
|
|
11407
11546
|
<!-- Normative references -->
|
11408
11547
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
11409
11548
|
|
11549
|
+
<xsl:call-template name="setNamedDestination"/>
|
11410
11550
|
<fo:block id="{@id}">
|
11411
11551
|
<xsl:apply-templates/>
|
11412
11552
|
|
@@ -11427,6 +11567,7 @@
|
|
11427
11567
|
</xsl:if>
|
11428
11568
|
</xsl:if> -->
|
11429
11569
|
|
11570
|
+
<xsl:call-template name="setNamedDestination"/>
|
11430
11571
|
<fo:block id="{@id}"/>
|
11431
11572
|
|
11432
11573
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -11446,6 +11587,7 @@
|
|
11446
11587
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
11447
11588
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
11448
11589
|
|
11590
|
+
<xsl:call-template name="setNamedDestination"/>
|
11449
11591
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
11450
11592
|
|
11451
11593
|
<xsl:call-template name="processBibitem"/>
|
@@ -11458,6 +11600,7 @@
|
|
11458
11600
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
11459
11601
|
|
11460
11602
|
<!-- start CSA bibitem processing -->
|
11603
|
+
<xsl:call-template name="setNamedDestination"/>
|
11461
11604
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
|
11462
11605
|
<xsl:apply-templates select="*[local-name() = 'biblio-tag']"/>
|
11463
11606
|
<xsl:apply-templates select="csa:formattedref"/>
|
@@ -11470,6 +11613,7 @@
|
|
11470
11613
|
<xsl:choose>
|
11471
11614
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
11472
11615
|
<xsl:otherwise>
|
11616
|
+
<xsl:call-template name="setNamedDestination"/>
|
11473
11617
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
11474
11618
|
|
11475
11619
|
<fo:list-item-label end-indent="label-end()">
|
@@ -11864,6 +12008,7 @@
|
|
11864
12008
|
<xsl:template match="*[local-name() = 'admonition']">
|
11865
12009
|
|
11866
12010
|
<!-- text in the box -->
|
12011
|
+
<xsl:call-template name="setNamedDestination"/>
|
11867
12012
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
|
11868
12013
|
|
11869
12014
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12116,7 +12261,7 @@
|
|
12116
12261
|
</xsl:template>
|
12117
12262
|
|
12118
12263
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12119
|
-
<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">
|
12264
|
+
<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">
|
12120
12265
|
<xsl:copy>
|
12121
12266
|
<xsl:copy-of select="@*"/>
|
12122
12267
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -12148,28 +12293,56 @@
|
|
12148
12293
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
12149
12294
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
12150
12295
|
|
12151
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
12296
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
12152
12297
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
12153
12298
|
<xsl:copy-of select="@*"/>
|
12154
12299
|
<xsl:choose>
|
12155
12300
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
12156
|
-
<xsl:
|
12301
|
+
<xsl:choose>
|
12302
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12303
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
12304
|
+
</xsl:when>
|
12305
|
+
<xsl:otherwise>
|
12306
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
12307
|
+
</xsl:otherwise>
|
12308
|
+
</xsl:choose>
|
12157
12309
|
</xsl:when>
|
12158
12310
|
<xsl:otherwise>
|
12159
|
-
<xsl:
|
12311
|
+
<xsl:choose>
|
12312
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12313
|
+
<xsl:copy-of select="node()"/>
|
12314
|
+
</xsl:when>
|
12315
|
+
<xsl:otherwise>
|
12316
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
12317
|
+
</xsl:otherwise>
|
12318
|
+
</xsl:choose>
|
12160
12319
|
</xsl:otherwise>
|
12161
12320
|
</xsl:choose>
|
12162
12321
|
</xsl:element>
|
12163
12322
|
</xsl:template>
|
12164
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
12323
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
12165
12324
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
12166
12325
|
<xsl:copy-of select="@*"/>
|
12167
12326
|
<xsl:choose>
|
12168
12327
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
12169
|
-
<xsl:
|
12328
|
+
<xsl:choose>
|
12329
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12330
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
12331
|
+
</xsl:when>
|
12332
|
+
<xsl:otherwise>
|
12333
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
12334
|
+
</xsl:otherwise>
|
12335
|
+
</xsl:choose>
|
12170
12336
|
</xsl:when>
|
12171
12337
|
<xsl:otherwise>
|
12172
|
-
<xsl:
|
12338
|
+
<xsl:choose>
|
12339
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12340
|
+
<xsl:copy-of select="node()"/>
|
12341
|
+
</xsl:when>
|
12342
|
+
<xsl:otherwise>
|
12343
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
12344
|
+
</xsl:otherwise>
|
12345
|
+
</xsl:choose>
|
12173
12346
|
</xsl:otherwise>
|
12174
12347
|
</xsl:choose>
|
12175
12348
|
</xsl:element>
|
@@ -12398,16 +12571,24 @@
|
|
12398
12571
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
12399
12572
|
<xsl:element name="title" namespace="{$namespace_full}">
|
12400
12573
|
<xsl:copy-of select="@*"/>
|
12574
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
12575
|
+
|
12401
12576
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12402
12577
|
</xsl:element>
|
12403
12578
|
</xsl:template>
|
12404
12579
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
12405
12580
|
<xsl:element name="title" namespace="{$namespace_full}">
|
12406
12581
|
<xsl:copy-of select="@*"/>
|
12582
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
12583
|
+
|
12407
12584
|
<xsl:apply-templates mode="update_xml_pres"/>
|
12408
12585
|
</xsl:element>
|
12409
12586
|
</xsl:template>
|
12410
12587
|
|
12588
|
+
<xsl:template name="addNamedDestinationAttribute">
|
12589
|
+
|
12590
|
+
</xsl:template>
|
12591
|
+
|
12411
12592
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
12412
12593
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
12413
12594
|
<xsl:choose>
|
@@ -12417,6 +12598,8 @@
|
|
12417
12598
|
<xsl:otherwise>
|
12418
12599
|
<xsl:element name="name" namespace="{$namespace_full}">
|
12419
12600
|
<xsl:copy-of select="@*"/>
|
12601
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
12602
|
+
|
12420
12603
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12421
12604
|
</xsl:element>
|
12422
12605
|
</xsl:otherwise>
|
@@ -12430,12 +12613,24 @@
|
|
12430
12613
|
<xsl:otherwise>
|
12431
12614
|
<xsl:element name="name" namespace="{$namespace_full}">
|
12432
12615
|
<xsl:copy-of select="@*"/>
|
12616
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
12617
|
+
|
12433
12618
|
<xsl:apply-templates mode="update_xml_pres"/>
|
12434
12619
|
</xsl:element>
|
12435
12620
|
</xsl:otherwise>
|
12436
12621
|
</xsl:choose>
|
12437
12622
|
</xsl:template>
|
12438
12623
|
|
12624
|
+
<!-- li/fmt-name -->
|
12625
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
12626
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
12627
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
12628
|
+
</xsl:template>
|
12629
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
12630
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
12631
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
12632
|
+
</xsl:template>
|
12633
|
+
|
12439
12634
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
12440
12635
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
12441
12636
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -13250,6 +13445,64 @@
|
|
13250
13445
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
13251
13446
|
</xsl:template>
|
13252
13447
|
|
13448
|
+
<!-- ===================================== -->
|
13449
|
+
<!-- ===================================== -->
|
13450
|
+
<!-- Ruby text (CJK languages) rendering -->
|
13451
|
+
<!-- ===================================== -->
|
13452
|
+
<!-- ===================================== -->
|
13453
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
13454
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
13455
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
13456
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
13457
|
+
</xsl:if>
|
13458
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
13459
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
13460
|
+
<!-- Example: width="2em" -->
|
13461
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
13462
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
13463
|
+
<xsl:variable name="text_width">
|
13464
|
+
<xsl:choose>
|
13465
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
13466
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
13467
|
+
</xsl:choose>
|
13468
|
+
</xsl:variable>
|
13469
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
13470
|
+
|
13471
|
+
<xsl:choose>
|
13472
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
13473
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
13474
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
13475
|
+
</xsl:when>
|
13476
|
+
<xsl:otherwise>
|
13477
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
13478
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
13479
|
+
</xsl:otherwise>
|
13480
|
+
</xsl:choose>
|
13481
|
+
|
13482
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
13483
|
+
</fo:inline-container>
|
13484
|
+
</xsl:template>
|
13485
|
+
|
13486
|
+
<xsl:template match="*[local-name() = 'rb']">
|
13487
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
13488
|
+
</xsl:template>
|
13489
|
+
|
13490
|
+
<xsl:template match="*[local-name() = 'rt']">
|
13491
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
13492
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
13493
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
13494
|
+
</xsl:if>
|
13495
|
+
<xsl:apply-templates/>
|
13496
|
+
</fo:block>
|
13497
|
+
|
13498
|
+
</xsl:template>
|
13499
|
+
|
13500
|
+
<!-- ===================================== -->
|
13501
|
+
<!-- ===================================== -->
|
13502
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
13503
|
+
<!-- ===================================== -->
|
13504
|
+
<!-- ===================================== -->
|
13505
|
+
|
13253
13506
|
<xsl:template name="printEdition">
|
13254
13507
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
13255
13508
|
|
@@ -13819,6 +14072,24 @@
|
|
13819
14072
|
</xsl:attribute>
|
13820
14073
|
</xsl:template>
|
13821
14074
|
|
14075
|
+
<xsl:template name="setIDforNamedDestination">
|
14076
|
+
<xsl:if test="@named_dest">
|
14077
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
14078
|
+
</xsl:if>
|
14079
|
+
</xsl:template>
|
14080
|
+
|
14081
|
+
<xsl:template name="setNamedDestination">
|
14082
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
14083
|
+
<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'">
|
14084
|
+
<fox:destination internal-destination="{@id}"/>
|
14085
|
+
</xsl:if>
|
14086
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
14087
|
+
<xsl:if test="@named_dest">
|
14088
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
14089
|
+
</xsl:if>
|
14090
|
+
</xsl:for-each>
|
14091
|
+
</xsl:template>
|
14092
|
+
|
13822
14093
|
<xsl:template name="add-letter-spacing">
|
13823
14094
|
<xsl:param name="text"/>
|
13824
14095
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|