metanorma-cc 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 067c48b731f5cf4d7eee39be3575ef405638a17df93765dab953314625c4a61d
4
- data.tar.gz: 7a242a32a45832f2c41498130566a6e6420eef5bce0824646424bbc0f94eb4eb
3
+ metadata.gz: 98ab7aa4f5687943c83d50b82a58e6682027dc008fc9c18686e5683aac31b3b7
4
+ data.tar.gz: b5f963de3d1f3d7be280ca90430398d73d1d0035d17b371bcff8e284aa22f6fe
5
5
  SHA512:
6
- metadata.gz: 1f0e3f2a4e79daf8fa9e132c24b602c2efe91a06138d02ba709f330d759335c8a575126545797f3f221df8488b8655405e383d838b41ada33e7e7af7e210a05c
7
- data.tar.gz: 7eef1523357fbf5fc9a8a7feaba3b8e5efa50dd68b35902c8c84337403487ae345c402e67cf6933285a66fcceccd00ecb339c5974a1556ab530e3fc275e2f8c3
6
+ metadata.gz: 2b400e1366cb22a7d8a5d73971f89f76760dfb2cf1cc35c6f92cb9c9ae0b706eff73f509fc42a1198a75ec659052aee94b0d49465d83a26325aabf8dfd9e4b76
7
+ data.tar.gz: 3b6c45837ad977bd364132f025da0b4af6cdea3bef5b9d97904cc37f4922ad80860d63cffc537111ce68865d6dd593647a078971aaa0c177b6e60a356d544432
@@ -12,11 +12,12 @@
12
12
  <xsl:text> – All rights reserved</xsl:text>
13
13
  </xsl:variable>
14
14
 
15
- <xsl:variable name="header">
15
+ <!-- <xsl:variable name="header">
16
16
  <xsl:value-of select="/csd:metanorma/csd:bibdata/csd:docidentifier[@type = 'csd']"/>
17
17
  <xsl:text>:</xsl:text>
18
18
  <xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:from"/>
19
- </xsl:variable>
19
+ </xsl:variable> -->
20
+ <xsl:variable name="header" select="/csd:metanorma/csd:bibdata/csd:docidentifier[@type = 'CalConnect']"/>
20
21
 
21
22
  <xsl:variable name="contents_">
22
23
  <contents>
@@ -166,11 +167,8 @@
166
167
 
167
168
  <!-- Cover Page -->
168
169
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
169
- <fo:static-content flow-name="xsl-footnote-separator">
170
- <fo:block>
171
- <fo:leader leader-pattern="rule" leader-length="30%"/>
172
- </fo:block>
173
- </fo:static-content>
170
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
171
+
174
172
  <fo:static-content flow-name="cover-page-header" font-size="10pt">
175
173
  <fo:block-container height="23.5mm" display-align="before">
176
174
  <fo:block padding-top="12.5mm">
@@ -260,11 +258,7 @@
260
258
  <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
261
259
  </xsl:if>
262
260
 
263
- <fo:static-content flow-name="xsl-footnote-separator">
264
- <fo:block>
265
- <fo:leader leader-pattern="rule" leader-length="30%"/>
266
- </fo:block>
267
- </fo:static-content>
261
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
268
262
  <xsl:call-template name="insertHeaderFooter"/>
269
263
  <fo:flow flow-name="xsl-region-body">
270
264
 
@@ -320,11 +314,7 @@
320
314
  <xsl:attribute name="initial-page-number">1</xsl:attribute>
321
315
  </xsl:if>
322
316
 
323
- <fo:static-content flow-name="xsl-footnote-separator">
324
- <fo:block>
325
- <fo:leader leader-pattern="rule" leader-length="30%"/>
326
- </fo:block>
327
- </fo:static-content>
317
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
328
318
  <xsl:call-template name="insertHeaderFooter"/>
329
319
  <fo:flow flow-name="xsl-region-body">
330
320
  <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
@@ -606,10 +596,6 @@
606
596
  </xsl:if>
607
597
  </xsl:template>
608
598
 
609
- <xsl:template match="csd:p/csd:fn/csd:p">
610
- <xsl:apply-templates/>
611
- </xsl:template>
612
-
613
599
  <xsl:template match="csd:xref" priority="2">
614
600
  <xsl:call-template name="insert_basic_link">
615
601
  <xsl:with-param name="element">
@@ -1472,14 +1458,18 @@
1472
1458
  </xsl:template>
1473
1459
 
1474
1460
  <xsl:attribute-set name="table-fn-number-style">
1461
+ <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
1462
+
1463
+ </xsl:attribute-set> <!-- table-fn-number-style -->
1464
+
1465
+ <xsl:attribute-set name="table-fmt-fn-label-style">
1475
1466
  <xsl:attribute name="font-size">80%</xsl:attribute>
1476
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
1477
1467
 
1478
1468
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1479
1469
 
1480
- </xsl:attribute-set> <!-- table-fn-number-style -->
1470
+ </xsl:attribute-set> <!-- table-fmt-fn-label-style -->
1481
1471
 
1482
- <xsl:template name="refine_table-fn-number-style">
1472
+ <xsl:template name="refine_table-fmt-fn-label-style">
1483
1473
 
1484
1474
  </xsl:template>
1485
1475
 
@@ -1494,11 +1484,18 @@
1494
1484
  </xsl:attribute-set>
1495
1485
 
1496
1486
  <xsl:attribute-set name="figure-fn-number-style">
1497
- <xsl:attribute name="font-size">80%</xsl:attribute>
1498
1487
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1488
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
1489
+
1490
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
1491
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1499
1492
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1500
1493
 
1501
- </xsl:attribute-set>
1494
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
1495
+
1496
+ <xsl:template name="refine_figure-fmt-fn-label-style">
1497
+
1498
+ </xsl:template>
1502
1499
 
1503
1500
  <xsl:attribute-set name="figure-fn-body-style">
1504
1501
  <xsl:attribute name="text-align">justify</xsl:attribute>
@@ -2990,9 +2987,13 @@
2990
2987
 
2991
2988
  <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2992
2989
  <xsl:if test="$isNoteOrFnExist = 'true'">
2993
-
2994
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2995
-
2990
+ <!-- <xsl:choose>
2991
+ <xsl:when test="$namespace = 'plateau'"></xsl:when>
2992
+ <xsl:otherwise>
2993
+
2994
+ </xsl:otherwise>
2995
+ </xsl:choose> -->
2996
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2996
2997
  </xsl:if>
2997
2998
 
2998
2999
  <xsl:choose>
@@ -3039,7 +3040,7 @@
3039
3040
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3040
3041
  </xsl:when>
3041
3042
  <xsl:otherwise>
3042
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3043
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot') and not(local-name() = 'fmt-footnote-container')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3043
3044
  </xsl:otherwise>
3044
3045
  </xsl:choose>
3045
3046
 
@@ -3050,13 +3051,26 @@
3050
3051
 
3051
3052
  <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3052
3053
 
3053
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3054
- <xsl:call-template name="insertTableFooterInSeparateTable">
3055
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
3056
- <xsl:with-param name="colwidths" select="$colwidths"/>
3057
- <xsl:with-param name="colgroup" select="$colgroup"/>
3058
- </xsl:call-template>
3059
- </xsl:for-each>
3054
+ <!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
3055
+
3056
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3057
+ <xsl:call-template name="insertTableFooterInSeparateTable">
3058
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
3059
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3060
+ <xsl:with-param name="colgroup" select="$colgroup"/>
3061
+ </xsl:call-template>
3062
+ </xsl:for-each>
3063
+
3064
+ <!-- https://github.com/metanorma/metanorma-plateau/issues/171
3065
+ <xsl:if test="$namespace = 'plateau'">
3066
+ <xsl:apply-templates select="*[not(local-name()='thead') and not(local-name()='tbody') and not(local-name()='tfoot') and not(local-name()='name')]" />
3067
+ <xsl:for-each select="*[local-name()='tbody']"> - select context to tbody -
3068
+ <xsl:variable name="table_fn_block">
3069
+ <xsl:call-template name="table_fn_display" />
3070
+ </xsl:variable>
3071
+ <xsl:copy-of select="$table_fn_block"/>
3072
+ </xsl:for-each>
3073
+ </xsl:if> -->
3060
3074
 
3061
3075
  <xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark -->
3062
3076
  <fo:block keep-with-previous="always" line-height="0.1">
@@ -3931,6 +3945,17 @@
3931
3945
  <xsl:attribute name="text-align">left</xsl:attribute>
3932
3946
  </xsl:if>
3933
3947
 
3948
+ <xsl:if test="$isGenerateTableIF = 'false'">
3949
+ <xsl:if test="@colspan and *[local-name() = 'note'][@type = 'units']">
3950
+ <xsl:attribute name="text-align">right</xsl:attribute>
3951
+ <xsl:attribute name="border">none</xsl:attribute>
3952
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
3953
+ <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
3954
+ <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
3955
+ <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
3956
+ </xsl:if>
3957
+ </xsl:if>
3958
+
3934
3959
  <fo:block role="SKIP">
3935
3960
 
3936
3961
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -3949,7 +3974,8 @@
3949
3974
  </fo:table-cell>
3950
3975
  </xsl:template> <!-- td -->
3951
3976
 
3952
- <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3977
+ <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
3978
+ <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">
3953
3979
 
3954
3980
  <fo:block xsl:use-attribute-sets="table-note-style">
3955
3981
  <xsl:copy-of select="@id"/>
@@ -3970,65 +3996,54 @@
3970
3996
 
3971
3997
  </xsl:template> <!-- table/note -->
3972
3998
 
3973
- <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
3999
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
3974
4000
  <xsl:apply-templates/>
3975
4001
  </xsl:template>
3976
4002
 
3977
4003
  <!-- ===================== -->
3978
4004
  <!-- Footnotes processing -->
3979
4005
  <!-- ===================== -->
4006
+
4007
+ <!-- document text (not figures, or tables) footnotes -->
4008
+ <xsl:variable name="footnotes_">
4009
+ <xsl:for-each select="//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']"> <!-- commented *[local-name() = 'metanorma']/, because there are fn in figure or table name -->
4010
+ <!-- <xsl:copy-of select="."/> -->
4011
+ <xsl:variable name="update_xml_step1">
4012
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
4013
+ </xsl:variable>
4014
+ <xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
4015
+ </xsl:for-each>
4016
+ </xsl:variable>
4017
+ <xsl:variable name="footnotes" select="xalan:nodeset($footnotes_)"/>
4018
+
3980
4019
  <!--
3981
4020
  <fn reference="1">
3982
4021
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
3983
4022
  </fn>
3984
4023
  -->
3985
- <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
4024
+ <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
4025
+ <!-- fn in text -->
3986
4026
  <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">
3987
4027
 
3988
- <!-- list of footnotes to calculate actual footnotes number -->
4028
+ <!-- list of unique footnotes -->
3989
4029
  <xsl:variable name="p_fn_">
3990
4030
  <xsl:call-template name="get_fn_list"/>
3991
- <!-- <xsl:choose>
3992
- <xsl:when test="$namespace = 'jis'">
3993
- <xsl:call-template name="get_fn_list_for_element"/>
3994
- </xsl:when>
3995
- <xsl:otherwise>
3996
- <xsl:call-template name="get_fn_list"/>
3997
- </xsl:otherwise>
3998
- </xsl:choose> -->
3999
4031
  </xsl:variable>
4000
4032
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4001
4033
 
4002
4034
  <xsl:variable name="gen_id" select="generate-id(.)"/>
4003
- <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
4004
- <xsl:variable name="reference_">
4005
- <xsl:value-of select="@reference"/>
4006
- <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
4007
- </xsl:variable>
4008
- <xsl:variable name="reference" select="normalize-space($reference_)"/>
4035
+
4009
4036
  <!-- fn sequence number in document -->
4010
- <xsl:variable name="current_fn_number">
4011
- <xsl:choose>
4012
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
4013
- <xsl:otherwise>
4014
- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
4015
- </xsl:otherwise>
4016
- </xsl:choose>
4017
- </xsl:variable>
4037
+ <xsl:variable name="current_fn_number" select="@reference"/>
4038
+
4018
4039
  <xsl:variable name="current_fn_number_text">
4019
4040
 
4020
4041
  <xsl:value-of select="$current_fn_number"/>
4021
4042
 
4022
4043
  </xsl:variable>
4023
4044
 
4024
- <xsl:variable name="ref_id">
4025
- <xsl:choose>
4026
- <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
4027
- <xsl:otherwise>
4028
- <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4029
- </xsl:otherwise>
4030
- </xsl:choose>
4031
- </xsl:variable>
4045
+ <xsl:variable name="ref_id" select="@target"/>
4046
+
4032
4047
  <xsl:variable name="footnote_inline">
4033
4048
  <fo:inline role="Reference">
4034
4049
 
@@ -4073,7 +4088,9 @@
4073
4088
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4074
4089
  <xsl:copy-of select="$footnote_inline"/>
4075
4090
  </xsl:when>
4091
+ <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
4076
4092
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
4093
+
4077
4094
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
4078
4095
  <xsl:copy-of select="$footnote_inline"/>
4079
4096
  <fo:footnote-body role="Note">
@@ -4090,7 +4107,10 @@
4090
4107
  <xsl:value-of select="$current_fn_number_text"/>
4091
4108
 
4092
4109
  </fo:inline>
4093
- <xsl:apply-templates/>
4110
+ <!-- <xsl:apply-templates /> -->
4111
+ <!-- <ref_id><xsl:value-of select="$ref_id"/></ref_id>
4112
+ <here><xsl:copy-of select="$footnotes"/></here> -->
4113
+ <xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
4094
4114
  </xsl:variable>
4095
4115
 
4096
4116
  <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
@@ -4144,77 +4164,136 @@
4144
4164
  </xsl:choose>
4145
4165
  </xsl:template>
4146
4166
 
4147
- <xsl:template name="get_fn_list_for_element">
4148
- <xsl:choose>
4149
- <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
4150
- <fn gen_id="{generate-id(.)}">
4151
- <xsl:copy-of select="@*"/>
4152
- <xsl:copy-of select="node()"/>
4153
- </fn>
4154
- </xsl:when>
4155
- <xsl:otherwise>
4156
- <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
4157
- <xsl:variable name="element_id" select="@id"/>
4158
- <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4159
- <!-- copy unique fn -->
4160
- <fn gen_id="{generate-id(.)}">
4161
- <xsl:copy-of select="@*"/>
4162
- <xsl:copy-of select="node()"/>
4163
- </fn>
4164
- </xsl:for-each>
4165
- </xsl:for-each>
4166
- </xsl:otherwise>
4167
- </xsl:choose>
4168
- </xsl:template>
4169
4167
  <!-- ============================ -->
4170
4168
  <!-- table's footnotes rendering -->
4171
4169
  <!-- ============================ -->
4172
- <xsl:template name="table_fn_display">
4173
- <xsl:variable name="references">
4174
4170
 
4171
+ <!-- table/fmt-footnote-container -->
4172
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'fmt-footnote-container']"/>
4173
+
4174
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'fmt-footnote-container']">
4175
+ <xsl:for-each select=".">
4176
+ <xsl:call-template name="table_fn_display"/>
4177
+ </xsl:for-each>
4178
+ </xsl:template>
4179
+
4180
+ <xsl:template name="table_fn_display">
4181
+ <!-- <xsl:variable name="references">
4182
+ <xsl:if test="$namespace = 'bsi'">
4183
+ <xsl:for-each select="..//*[local-name()='fn'][local-name(..) = 'name']">
4184
+ <xsl:call-template name="create_fn" />
4185
+ </xsl:for-each>
4186
+ </xsl:if>
4175
4187
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
4176
- <xsl:call-template name="create_fn"/>
4188
+ <xsl:call-template name="create_fn" />
4177
4189
  </xsl:for-each>
4178
- </xsl:variable>
4179
-
4180
- <xsl:for-each select="xalan:nodeset($references)//fn">
4190
+ </xsl:variable> -->
4191
+ <!-- <xsl:for-each select="xalan:nodeset($references)//fn">
4181
4192
  <xsl:variable name="reference" select="@reference"/>
4182
- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4193
+ <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
4194
+ <xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
4183
4195
 
4184
4196
  <fo:block xsl:use-attribute-sets="table-fn-style">
4197
+ <xsl:copy-of select="@id"/>
4185
4198
  <xsl:call-template name="refine_table-fn-style"/>
4186
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4187
- <xsl:call-template name="refine_table-fn-number-style"/>
4188
4199
 
4189
- <xsl:value-of select="@reference"/>
4190
-
4191
- <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
4192
- <!-- <xsl:if test="$namespace = 'itu'">
4193
- <xsl:text>)</xsl:text>
4194
- </xsl:if> -->
4200
+ <xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
4201
+ <xsl:with-param name="process">true</xsl:with-param>
4202
+ </xsl:apply-templates>
4195
4203
 
4196
- </fo:inline>
4197
4204
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4198
- <xsl:copy-of select="./node()"/>
4205
+ <!-- <xsl:copy-of select="./node()"/> -->
4206
+ <xsl:apply-templates/>
4199
4207
  </fo:inline>
4200
4208
 
4201
4209
  </fo:block>
4202
4210
 
4203
- </xsl:if>
4211
+ <!-- </xsl:if> -->
4204
4212
  </xsl:for-each>
4205
4213
  </xsl:template> <!-- table_fn_display -->
4206
4214
 
4215
+ <!-- fmt-fn-body/fmt-fn-label in text -->
4216
+ <xsl:template match="*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"/>
4217
+
4218
+ <!-- table//fmt-fn-body//fmt-fn-label -->
4219
+ <xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
4220
+ <xsl:param name="process">false</xsl:param>
4221
+ <xsl:if test="$process = 'true'">
4222
+ <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
4223
+
4224
+ <!-- tab is padding-right -->
4225
+ <xsl:apply-templates select=".//*[local-name() = 'tab']">
4226
+ <xsl:with-param name="process">true</xsl:with-param>
4227
+ </xsl:apply-templates>
4228
+
4229
+ <!-- <xsl:if test="$namespace = 'bipm'">
4230
+ <fo:inline font-style="normal">(</fo:inline>
4231
+ </xsl:if> -->
4232
+
4233
+ <!-- <xsl:if test="$namespace = 'plateau'">
4234
+ <xsl:text>※</xsl:text>
4235
+ </xsl:if> -->
4236
+
4237
+ <!-- <xsl:value-of select="@reference"/> -->
4238
+ <!-- <xsl:value-of select="normalize-space()"/> -->
4239
+ <xsl:apply-templates/>
4240
+
4241
+ <!-- <xsl:if test="$namespace = 'bipm'">
4242
+ <fo:inline font-style="normal">)</fo:inline>
4243
+ </xsl:if> -->
4244
+
4245
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
4246
+ <!-- <xsl:if test="$namespace = 'itu'">
4247
+ <xsl:text>)</xsl:text>
4248
+ </xsl:if> -->
4249
+
4250
+ <!-- <xsl:if test="$namespace = 'plateau'">
4251
+ <xsl:text>:</xsl:text>
4252
+ </xsl:if> -->
4253
+
4254
+ </fo:inline>
4255
+ </xsl:if>
4256
+ </xsl:template> <!-- fmt-fn-body//fmt-fn-label -->
4257
+
4258
+ <xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
4259
+ <xsl:param name="process">false</xsl:param>
4260
+ <xsl:if test="$process = 'true'">
4261
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
4262
+
4263
+ </xsl:if>
4264
+ </xsl:template>
4265
+
4266
+ <xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
4267
+ <fo:inline xsl:use-attribute-sets="table-fmt-fn-label-style" role="SKIP">
4268
+ <xsl:call-template name="refine_table-fmt-fn-label-style"/>
4269
+ <xsl:apply-templates/>
4270
+ </fo:inline>
4271
+ </xsl:template>
4272
+
4273
+ <!-- <xsl:template match="*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']"/> -->
4274
+ <!--
4207
4275
  <xsl:template name="create_fn">
4208
4276
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
4209
- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4277
+ <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> - for footnotes in tables -
4210
4278
  <xsl:attribute name="id">
4211
4279
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
4212
4280
  </xsl:attribute>
4213
4281
  </xsl:if>
4214
-
4215
- <xsl:apply-templates/>
4282
+ <xsl:if test="$namespace = 'itu'">
4283
+ <xsl:if test="ancestor::*[local-name()='preface']">
4284
+ <xsl:attribute name="preface">true</xsl:attribute>
4285
+ </xsl:if>
4286
+ </xsl:if>
4287
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
4288
+ <xsl:attribute name="id">
4289
+ <xsl:value-of select="@reference"/>
4290
+ <xsl:text>_</xsl:text>
4291
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
4292
+ </xsl:attribute>
4293
+ </xsl:if>
4294
+ <xsl:apply-templates />
4216
4295
  </fn>
4217
- </xsl:template>
4296
+ </xsl:template> -->
4218
4297
 
4219
4298
  <!-- footnotes for table's name rendering -->
4220
4299
  <xsl:template name="table_name_fn_display">
@@ -4233,123 +4312,171 @@
4233
4312
  <!-- ============================ -->
4234
4313
  <!-- figure's footnotes rendering -->
4235
4314
  <!-- ============================ -->
4236
- <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
4237
4315
 
4238
- <!-- current figure id -->
4239
- <xsl:variable name="figure_id_">
4240
- <xsl:value-of select="@id"/>
4241
- <xsl:if test="not(@id)"><xsl:value-of select="generate-id()"/></xsl:if>
4242
- </xsl:variable>
4243
- <xsl:variable name="figure_id" select="normalize-space($figure_id_)"/>
4316
+ <!-- figure/fmt-footnote-container -->
4317
+ <xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-footnote-container']"/>
4318
+
4319
+ <!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
4320
+ <xsl:template name="figure_fn_display">
4244
4321
 
4245
- <!-- all footnotes relates to the current figure -->
4246
4322
  <xsl:variable name="references">
4247
- <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])][ancestor::*[local-name() = 'figure'][1][@id = $figure_id]]">
4248
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
4249
- <xsl:apply-templates/>
4250
- </fn>
4323
+ <xsl:for-each select="./*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
4324
+ <xsl:variable name="curr_id" select="@id"/>
4325
+ <!-- <curr_id><xsl:value-of select="$curr_id"/></curr_id>
4326
+ <curr><xsl:copy-of select="."/></curr>
4327
+ <ancestor><xsl:copy-of select="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn']]]"/></ancestor> -->
4328
+ <xsl:choose>
4329
+ <!-- skip figure/name/fn -->
4330
+ <xsl:when test="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn'][@target = $curr_id]]]"><!-- skip --></xsl:when>
4331
+ <xsl:otherwise>
4332
+ <xsl:element name="figure" namespace="{$namespace_full}">
4333
+ <xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
4334
+ <xsl:copy-of select="."/>
4335
+ </xsl:element>
4336
+ </xsl:element>
4337
+ </xsl:otherwise>
4338
+ </xsl:choose>
4251
4339
  </xsl:for-each>
4252
4340
  </xsl:variable>
4341
+ <!-- <references><xsl:copy-of select="$references"/></references> -->
4253
4342
 
4254
- <xsl:if test="xalan:nodeset($references)//fn">
4343
+ <xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
4255
4344
 
4256
4345
  <xsl:variable name="key_iso">
4257
4346
 
4258
4347
  </xsl:variable>
4259
4348
 
4260
4349
  <fo:block>
4350
+ <!-- current hierarchy is 'figure' element -->
4351
+ <xsl:variable name="following_dl_colwidths">
4352
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
4353
+ <xsl:variable name="simple-table">
4354
+ <!-- <xsl:variable name="doc_ns">
4355
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
4356
+ </xsl:variable>
4357
+ <xsl:variable name="ns">
4358
+ <xsl:choose>
4359
+ <xsl:when test="normalize-space($doc_ns) != ''">
4360
+ <xsl:value-of select="normalize-space($doc_ns)"/>
4361
+ </xsl:when>
4362
+ <xsl:otherwise>
4363
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
4364
+ </xsl:otherwise>
4365
+ </xsl:choose>
4366
+ </xsl:variable> -->
4261
4367
 
4262
- <!-- current hierarchy is 'figure' element -->
4263
- <xsl:variable name="following_dl_colwidths">
4264
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
4265
- <xsl:variable name="simple-table">
4266
- <!-- <xsl:variable name="doc_ns">
4267
- <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
4268
- </xsl:variable>
4269
- <xsl:variable name="ns">
4270
- <xsl:choose>
4271
- <xsl:when test="normalize-space($doc_ns) != ''">
4272
- <xsl:value-of select="normalize-space($doc_ns)"/>
4273
- </xsl:when>
4274
- <xsl:otherwise>
4275
- <xsl:value-of select="substring-before(name(/*), '-')"/>
4276
- </xsl:otherwise>
4277
- </xsl:choose>
4278
- </xsl:variable> -->
4279
-
4280
- <xsl:for-each select="*[local-name() = 'dl'][1]">
4281
- <tbody>
4282
- <xsl:apply-templates mode="dl"/>
4283
- </tbody>
4284
- </xsl:for-each>
4285
- </xsl:variable>
4286
-
4287
- <xsl:call-template name="calculate-column-widths">
4288
- <xsl:with-param name="cols-count" select="2"/>
4289
- <xsl:with-param name="table" select="$simple-table"/>
4290
- </xsl:call-template>
4291
-
4292
- </xsl:if>
4293
- </xsl:variable>
4294
-
4295
- <xsl:variable name="maxlength_dt">
4296
4368
  <xsl:for-each select="*[local-name() = 'dl'][1]">
4297
- <xsl:call-template name="getMaxLength_dt"/>
4369
+ <tbody>
4370
+ <xsl:apply-templates mode="dl"/>
4371
+ </tbody>
4298
4372
  </xsl:for-each>
4299
4373
  </xsl:variable>
4300
4374
 
4301
- <fo:table width="95%" table-layout="fixed">
4302
- <xsl:if test="normalize-space($key_iso) = 'true'">
4303
- <xsl:attribute name="font-size">10pt</xsl:attribute>
4375
+ <xsl:call-template name="calculate-column-widths">
4376
+ <xsl:with-param name="cols-count" select="2"/>
4377
+ <xsl:with-param name="table" select="$simple-table"/>
4378
+ </xsl:call-template>
4304
4379
 
4305
- </xsl:if>
4306
- <xsl:choose>
4307
- <!-- if there 'dl', then set same columns width -->
4308
- <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
4309
- <xsl:call-template name="setColumnWidth_dl">
4310
- <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
4311
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4312
- </xsl:call-template>
4313
- </xsl:when>
4314
- <xsl:otherwise>
4315
- <fo:table-column column-width="5%"/>
4316
- <fo:table-column column-width="95%"/>
4317
- </xsl:otherwise>
4318
- </xsl:choose>
4319
- <fo:table-body>
4320
- <xsl:for-each select="xalan:nodeset($references)//fn">
4321
- <xsl:variable name="reference" select="@reference"/>
4322
- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4323
- <fo:table-row>
4324
- <fo:table-cell>
4325
- <fo:block>
4326
- <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
4327
- <xsl:value-of select="@reference"/>
4380
+ </xsl:if>
4381
+ </xsl:variable>
4382
+
4383
+ <xsl:variable name="maxlength_dt">
4384
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
4385
+ <xsl:call-template name="getMaxLength_dt"/>
4386
+ </xsl:for-each>
4387
+ </xsl:variable>
4388
+
4389
+ <fo:table width="95%" table-layout="fixed">
4390
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4391
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
4392
+
4393
+ </xsl:if>
4394
+ <xsl:choose>
4395
+ <!-- if there 'dl', then set same columns width -->
4396
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
4397
+ <xsl:call-template name="setColumnWidth_dl">
4398
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
4399
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4400
+ </xsl:call-template>
4401
+ </xsl:when>
4402
+ <xsl:otherwise>
4403
+ <fo:table-column column-width="5%"/>
4404
+ <fo:table-column column-width="95%"/>
4405
+ </xsl:otherwise>
4406
+ </xsl:choose>
4407
+ <fo:table-body>
4408
+ <!-- <xsl:for-each select="xalan:nodeset($references)//fn"> -->
4409
+ <xsl:for-each select="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
4410
+
4411
+ <xsl:variable name="reference" select="@reference"/>
4412
+ <!-- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
4413
+ <fo:table-row>
4414
+ <fo:table-cell>
4415
+ <fo:block>
4416
+
4417
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fmt-fn-label-style">
4418
+ <!-- <xsl:attribute name="padding-right">0mm</xsl:attribute> -->
4419
+ <!-- <xsl:value-of select="@reference"/> -->
4420
+ <xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/>
4328
4421
  </fo:inline>
4329
- </fo:block>
4330
- </fo:table-cell>
4331
- <fo:table-cell>
4332
- <fo:block xsl:use-attribute-sets="figure-fn-body-style">
4333
- <xsl:if test="normalize-space($key_iso) = 'true'">
4334
4422
 
4335
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
4423
+ </fo:block>
4424
+ </fo:table-cell>
4425
+ <fo:table-cell>
4426
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
4427
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4336
4428
 
4337
- </xsl:if>
4338
- <xsl:copy-of select="./node()"/>
4339
- </fo:block>
4340
- </fo:table-cell>
4341
- </fo:table-row>
4342
- </xsl:if>
4343
- </xsl:for-each>
4344
- </fo:table-body>
4345
- </fo:table>
4429
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
4346
4430
 
4431
+ </xsl:if>
4432
+
4433
+ <!-- <xsl:copy-of select="./node()"/> -->
4434
+ <xsl:apply-templates/>
4435
+ </fo:block>
4436
+ </fo:table-cell>
4437
+ </fo:table-row>
4438
+ <!-- </xsl:if> -->
4439
+ </xsl:for-each>
4440
+ </fo:table-body>
4441
+ </fo:table>
4347
4442
  </fo:block>
4348
4443
  </xsl:if>
4349
- </xsl:template> <!-- fn_display_figure -->
4444
+ </xsl:template> <!-- figure_fn_display -->
4445
+
4446
+ <xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
4447
+ <xsl:param name="process">false</xsl:param>
4448
+ <xsl:if test="$process = 'true'">
4449
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
4450
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
4451
+
4452
+ <!-- tab is padding-right -->
4453
+ <xsl:apply-templates select=".//*[local-name() = 'tab']">
4454
+ <xsl:with-param name="process">true</xsl:with-param>
4455
+ </xsl:apply-templates>
4456
+
4457
+ <xsl:apply-templates/>
4458
+
4459
+ </fo:inline>
4460
+ </xsl:if>
4461
+ </xsl:template> <!-- figure//fmt-fn-body//fmt-fn-label -->
4462
+
4463
+ <xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
4464
+ <xsl:param name="process">false</xsl:param>
4465
+ <xsl:if test="$process = 'true'">
4466
+
4467
+ </xsl:if>
4468
+ </xsl:template>
4469
+
4470
+ <xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
4471
+ <fo:inline xsl:use-attribute-sets="figure-fmt-fn-label-style" role="SKIP">
4472
+ <xsl:call-template name="refine_figure-fmt-fn-label-style"/>
4473
+ <xsl:apply-templates/>
4474
+ </fo:inline>
4475
+ </xsl:template>
4350
4476
 
4351
4477
  <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
4352
4478
  <!-- figure's footnote label -->
4479
+ <!-- figure/dl[@key = 'true']/dt/p/sup -->
4353
4480
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
4354
4481
  <xsl:variable name="key_iso">
4355
4482
 
@@ -4358,7 +4485,7 @@
4358
4485
  <xsl:attribute name="font-size">10pt</xsl:attribute>
4359
4486
 
4360
4487
  </xsl:if>
4361
- <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
4488
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
4362
4489
  <!-- <xsl:value-of select="@reference"/> -->
4363
4490
  <xsl:apply-templates/>
4364
4491
  </fo:inline>
@@ -4368,38 +4495,65 @@
4368
4495
  <!-- END: figure's footnotes rendering -->
4369
4496
  <!-- ============================ -->
4370
4497
 
4371
- <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
4498
+ <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
4499
+ <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
4372
4500
  <xsl:template match="*[local-name()='fn']">
4373
4501
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
4374
4502
 
4375
4503
  <xsl:call-template name="refine_fn-reference-style"/>
4376
4504
 
4377
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4378
- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4379
- <xsl:attribute name="internal-destination">
4505
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4506
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
4507
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
4508
+ <!-- <xsl:attribute name="internal-destination">
4380
4509
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
4381
4510
  </xsl:attribute>
4382
4511
  </xsl:if>
4512
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
4513
+ <xsl:attribute name="internal-destination">
4514
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
4515
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
4516
+ </xsl:attribute>
4517
+ </xsl:if> -->
4518
+ <!-- <xsl:if test="$namespace = 'plateau'">
4519
+ <xsl:text>※</xsl:text>
4520
+ </xsl:if> -->
4521
+ <!-- <xsl:value-of select="@reference"/> -->
4383
4522
 
4384
- <xsl:value-of select="@reference"/>
4523
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
4385
4524
 
4525
+ <!-- <xsl:if test="$namespace = 'bsi'">
4526
+ <xsl:text>)</xsl:text>
4527
+ </xsl:if> -->
4386
4528
  <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4387
4529
  <!-- <xsl:if test="$namespace = 'jis'">
4388
4530
  <fo:inline font-weight="normal">)</fo:inline>
4389
4531
  </xsl:if> -->
4390
4532
  </fo:basic-link>
4391
4533
  </fo:inline>
4392
- </xsl:template>
4534
+ </xsl:template> <!-- fn -->
4393
4535
 
4536
+ <!-- fn/text() -->
4394
4537
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4395
4538
  <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4396
4539
  </xsl:template>
4397
4540
 
4398
- <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4541
+ <!-- fn//p fmt-fn-body//p -->
4542
+ <xsl:template match="*[local-name()='fn']//*[local-name()='p'] | *[local-name() = 'fmt-fn-body']//*[local-name()='p']">
4399
4543
  <fo:inline role="P">
4400
4544
  <xsl:apply-templates/>
4401
4545
  </fo:inline>
4402
4546
  </xsl:template>
4547
+
4548
+ <xsl:template name="insertFootnoteSeparatorCommon">
4549
+ <xsl:param name="leader_length">30%</xsl:param>
4550
+ <fo:static-content flow-name="xsl-footnote-separator">
4551
+ <fo:block>
4552
+ <fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
4553
+ </fo:block>
4554
+ </fo:static-content>
4555
+ </xsl:template>
4556
+
4403
4557
  <!-- ===================== -->
4404
4558
  <!-- END Footnotes processing -->
4405
4559
  <!-- ===================== -->
@@ -4676,11 +4830,11 @@
4676
4830
  <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
4677
4831
  <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
4678
4832
 
4679
- <xsl:call-template name="setColumnWidth_dl">
4680
- <xsl:with-param name="colwidths" select="$colwidths"/>
4681
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4682
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
4683
- </xsl:call-template>
4833
+ <xsl:call-template name="setColumnWidth_dl">
4834
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4835
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4836
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
4837
+ </xsl:call-template>
4684
4838
 
4685
4839
  <fo:table-body>
4686
4840
 
@@ -4714,6 +4868,14 @@
4714
4868
 
4715
4869
  </xsl:template> <!-- END: dl -->
4716
4870
 
4871
+ <xsl:template match="@*|node()" mode="dt_clean">
4872
+ <xsl:copy>
4873
+ <xsl:apply-templates select="@*|node()" mode="dt_clean"/>
4874
+ </xsl:copy>
4875
+ </xsl:template>
4876
+
4877
+ <xsl:template match="*[local-name() = 'asciimath']" mode="dt_clean"/>
4878
+
4717
4879
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
4718
4880
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
4719
4881
  <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
@@ -4743,10 +4905,12 @@
4743
4905
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4744
4906
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4745
4907
 
4908
+ <!-- dl/name -->
4746
4909
  <xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
4747
4910
  <xsl:param name="process">false</xsl:param>
4748
4911
  <xsl:if test="$process = 'true'">
4749
4912
  <fo:block xsl:use-attribute-sets="dl-name-style">
4913
+
4750
4914
  <xsl:apply-templates/>
4751
4915
  </fo:block>
4752
4916
  </xsl:if>
@@ -4760,6 +4924,10 @@
4760
4924
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
4761
4925
 
4762
4926
  <xsl:choose>
4927
+ <!-- <xsl:when test="@class = 'formula_dl' and local-name(..) = 'figure'">
4928
+ <fo:table-column column-width="10%"/>
4929
+ <fo:table-column column-width="90%"/>
4930
+ </xsl:when> -->
4763
4931
  <xsl:when test="xalan:nodeset($colwidths)/autolayout">
4764
4932
  <xsl:call-template name="insertTableColumnWidth">
4765
4933
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -6884,6 +7052,27 @@
6884
7052
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6885
7053
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6886
7054
  </xsl:when> -->
7055
+
7056
+ <!-- <xsl:when test="not(starts-with(@target, 'http:') or starts-with(@target, 'https') or starts-with(@target, 'www') or starts-with(@target, 'mailto') or starts-with(@target, 'ftp'))">
7057
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
7058
+ <xsl:variable name="filename">
7059
+ <xsl:call-template name="substring-after-last">
7060
+ <xsl:with-param name="value" select="$target_"/>
7061
+ <xsl:with-param name="delimiter" select="'/'"/>
7062
+ </xsl:call-template>
7063
+ </xsl:variable>
7064
+ <xsl:variable name="target_filepath" select="concat($inputxml_basepath, @target)"/>
7065
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($target_filepath)))"/>
7066
+ <xsl:choose>
7067
+ <xsl:when test="$file_exists = 'true'">
7068
+ <xsl:value-of select="concat('url(embedded-file:', $filename, ')')"/>
7069
+ </xsl:when>
7070
+ <xsl:otherwise>
7071
+ <xsl:value-of select="normalize-space(@target)"/>
7072
+ </xsl:otherwise>
7073
+ </xsl:choose>
7074
+ </xsl:when> -->
7075
+
6887
7076
  <xsl:otherwise>
6888
7077
  <xsl:value-of select="normalize-space(@target)"/>
6889
7078
  </xsl:otherwise>
@@ -7188,7 +7377,7 @@
7188
7377
 
7189
7378
  <xsl:template name="refine_note_block_style">
7190
7379
 
7191
- </xsl:template>
7380
+ </xsl:template> <!-- refine_note_block_style -->
7192
7381
 
7193
7382
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7194
7383
  <xsl:variable name="num"><xsl:number/></xsl:variable>
@@ -7380,10 +7569,21 @@
7380
7569
  </xsl:template>
7381
7570
 
7382
7571
  <xsl:template name="showFigureKey">
7383
- <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7384
- <xsl:call-template name="note"/>
7572
+ <xsl:for-each select="*[(local-name() = 'note' and not(@type = 'units')) or local-name() = 'example']">
7573
+ <xsl:choose>
7574
+ <xsl:when test="local-name() = 'note'">
7575
+ <xsl:call-template name="note"/>
7576
+ </xsl:when>
7577
+ <xsl:when test="local-name() = 'example'">
7578
+ <xsl:call-template name="example"/>
7579
+ </xsl:when>
7580
+ <xsl:otherwise>
7581
+ <xsl:apply-templates select="."/>
7582
+ </xsl:otherwise>
7583
+ </xsl:choose>
7385
7584
  </xsl:for-each>
7386
- <xsl:call-template name="fn_display_figure"/>
7585
+ <!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
7586
+ <xsl:call-template name="figure_fn_display"/>
7387
7587
  </xsl:template>
7388
7588
 
7389
7589
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
@@ -8277,10 +8477,10 @@
8277
8477
  <xsl:when test="@type = 'section-title'">
8278
8478
  <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
8279
8479
  <xsl:text>: </xsl:text>
8280
- <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8480
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
8281
8481
  </xsl:when>
8282
8482
  <xsl:otherwise>
8283
- <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8483
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
8284
8484
  </xsl:otherwise>
8285
8485
  </xsl:choose>
8286
8486
  </xsl:when>
@@ -8611,9 +8811,15 @@
8611
8811
  </xsl:if>
8612
8812
  </xsl:template>
8613
8813
 
8814
+ <!-- figure/fn -->
8614
8815
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
8615
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
8816
+ <!-- figure/note -->
8817
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
8818
+ <!-- figure/example -->
8819
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
8616
8820
 
8821
+ <!-- figure/note[@type = 'units'] -->
8822
+ <!-- image/note[@type = 'units'] -->
8617
8823
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
8618
8824
  <fo:block text-align="right" keep-with-next="always">
8619
8825
  <xsl:apply-templates/>
@@ -8734,6 +8940,7 @@
8734
8940
  </xsl:choose>
8735
8941
  </xsl:template>
8736
8942
 
8943
+ <!-- fn -->
8737
8944
  <xsl:template match="*[local-name() = 'fn']" mode="contents"/>
8738
8945
  <xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/>
8739
8946
 
@@ -9632,7 +9839,7 @@
9632
9839
  text line 1
9633
9840
  text line 2
9634
9841
  -->
9635
- <xsl:template match="*[local-name() = 'example']">
9842
+ <xsl:template match="*[local-name() = 'example']" name="example">
9636
9843
 
9637
9844
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9638
9845
 
@@ -9738,6 +9945,7 @@
9738
9945
 
9739
9946
  </xsl:template>
9740
9947
 
9948
+ <!-- example/name -->
9741
9949
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
9742
9950
  <xsl:param name="fo_element">block</xsl:param>
9743
9951
 
@@ -9763,7 +9971,8 @@
9763
9971
 
9764
9972
  </xsl:template>
9765
9973
 
9766
- <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
9974
+ <!-- table/example/name, table/tfoot//example/name -->
9975
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
9767
9976
  <fo:inline xsl:use-attribute-sets="example-name-style">
9768
9977
 
9769
9978
  <xsl:apply-templates/>
@@ -11402,8 +11611,33 @@
11402
11611
 
11403
11612
  <xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
11404
11613
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
11614
+ <!-- New format: one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
11615
+ <!-- <test><xsl:copy-of select="."/></test> -->
11616
+
11405
11617
  <xsl:variable name="target" select="@target"/>
11618
+
11406
11619
  <xsl:for-each select="*[local-name() = 'tab']">
11620
+
11621
+ <xsl:if test="position() = 1">
11622
+ <!-- first column (data before first `tab`) -->
11623
+ <fo:table-cell>
11624
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
11625
+ <xsl:call-template name="insert_basic_link">
11626
+ <xsl:with-param name="element">
11627
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
11628
+ <xsl:for-each select="preceding-sibling::node()">
11629
+ <xsl:choose>
11630
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
11631
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
11632
+ </xsl:choose>
11633
+ </xsl:for-each>
11634
+ </fo:basic-link>
11635
+ </xsl:with-param>
11636
+ </xsl:call-template>
11637
+ </fo:block>
11638
+ </fo:table-cell>
11639
+ </xsl:if>
11640
+
11407
11641
  <xsl:variable name="current_id" select="generate-id()"/>
11408
11642
  <fo:table-cell>
11409
11643
  <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
@@ -11454,11 +11688,25 @@
11454
11688
 
11455
11689
  <xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
11456
11690
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
11691
+ <!-- New format - one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
11457
11692
  <xsl:for-each select="*[local-name() = 'tab']">
11693
+ <xsl:if test="position() = 1">
11694
+ <td>
11695
+ <xsl:for-each select="preceding-sibling::node()">
11696
+ <xsl:choose>
11697
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
11698
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
11699
+ </xsl:choose>
11700
+ </xsl:for-each>
11701
+ </td>
11702
+ </xsl:if>
11458
11703
  <xsl:variable name="current_id" select="generate-id()"/>
11459
11704
  <td>
11460
11705
  <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
11461
- <xsl:copy-of select="."/>
11706
+ <xsl:choose>
11707
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
11708
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
11709
+ </xsl:choose>
11462
11710
  </xsl:for-each>
11463
11711
  </td>
11464
11712
  </xsl:for-each>
@@ -12856,6 +13104,7 @@
12856
13104
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
12857
13105
  </fn>
12858
13106
  -->
13107
+ <!-- fn in text -->
12859
13108
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
12860
13109
  <xsl:variable name="p_fn_">
12861
13110
  <xsl:call-template name="get_fn_list"/>
@@ -33,6 +33,15 @@
33
33
  </zeroOrMore>
34
34
  </element>
35
35
  </define>
36
+ <define name="fn" combine="interleave">
37
+ <optional>
38
+ <attribute name="hiddenref">
39
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
40
+ This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ </define>
36
45
  <define name="index-primary">
37
46
  <element name="primary">
38
47
  <oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cc
3
- VERSION = "2.6.1".freeze
3
+ VERSION = "2.6.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-04 00:00:00.000000000 Z
11
+ date: 2025-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic