metanorma-iho 1.1.1 → 1.1.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 +4 -4
- data/lib/isodoc/iho/iho.specification.xsl +480 -233
- data/lib/isodoc/iho/iho.standard.xsl +480 -233
- data/lib/metanorma/iho/isodoc.rng +9 -0
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
@@ -141,6 +141,12 @@
|
|
141
141
|
<xsl:call-template name="updateXML"/>
|
142
142
|
</xsl:variable>
|
143
143
|
|
144
|
+
<xsl:if test="$debug = 'true'">
|
145
|
+
<redirect:write file="updated_xml.xml">
|
146
|
+
<xsl:copy-of select="$updated_xml"/>
|
147
|
+
</redirect:write>
|
148
|
+
</xsl:if>
|
149
|
+
|
144
150
|
<xsl:for-each select="xalan:nodeset($updated_xml)/*">
|
145
151
|
|
146
152
|
<!-- =========================== -->
|
@@ -258,12 +264,6 @@
|
|
258
264
|
<xsl:call-template name="processPrefaceAndMainSectionsIHO_items"/>
|
259
265
|
</xsl:variable>
|
260
266
|
|
261
|
-
<xsl:if test="$debug = 'true'">
|
262
|
-
<redirect:write file="updated_xml_with_pages.xml">
|
263
|
-
<xsl:copy-of select="$updated_xml_with_pages"/>
|
264
|
-
</redirect:write>
|
265
|
-
</xsl:if>
|
266
|
-
|
267
267
|
<xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
|
268
268
|
|
269
269
|
<xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
|
@@ -276,11 +276,7 @@
|
|
276
276
|
<xsl:call-template name="getPageSequenceOrientation"/>
|
277
277
|
</xsl:attribute>
|
278
278
|
|
279
|
-
<
|
280
|
-
<fo:block>
|
281
|
-
<fo:leader leader-pattern="rule" leader-length="30%"/>
|
282
|
-
</fo:block>
|
283
|
-
</fo:static-content>
|
279
|
+
<xsl:call-template name="insertFootnoteSeparatorCommon"/>
|
284
280
|
<xsl:call-template name="insertHeaderFooter">
|
285
281
|
<xsl:with-param name="font-weight">normal</xsl:with-param>
|
286
282
|
</xsl:call-template>
|
@@ -322,11 +318,7 @@
|
|
322
318
|
<xsl:call-template name="getPageSequenceOrientation"/>
|
323
319
|
</xsl:attribute>
|
324
320
|
|
325
|
-
<
|
326
|
-
<fo:block>
|
327
|
-
<fo:leader leader-pattern="rule" leader-length="30%"/>
|
328
|
-
</fo:block>
|
329
|
-
</fo:static-content>
|
321
|
+
<xsl:call-template name="insertFootnoteSeparatorCommon"/>
|
330
322
|
<xsl:call-template name="insertHeaderFooter">
|
331
323
|
<xsl:with-param name="font-weight">normal</xsl:with-param>
|
332
324
|
</xsl:call-template>
|
@@ -355,11 +347,7 @@
|
|
355
347
|
<xsl:attribute name="initial-page-number">1</xsl:attribute>
|
356
348
|
</xsl:if>
|
357
349
|
|
358
|
-
<
|
359
|
-
<fo:block>
|
360
|
-
<fo:leader leader-pattern="rule" leader-length="30%"/>
|
361
|
-
</fo:block>
|
362
|
-
</fo:static-content>
|
350
|
+
<xsl:call-template name="insertFootnoteSeparatorCommon"/>
|
363
351
|
<xsl:call-template name="insertHeaderFooter"/>
|
364
352
|
<fo:flow flow-name="xsl-region-body">
|
365
353
|
<fo:block-container>
|
@@ -859,10 +847,6 @@
|
|
859
847
|
</xsl:if>
|
860
848
|
</xsl:template>
|
861
849
|
|
862
|
-
<xsl:template match="iho:p/iho:fn/iho:p">
|
863
|
-
<xsl:apply-templates/>
|
864
|
-
</xsl:template>
|
865
|
-
|
866
850
|
<!-- note in list item -->
|
867
851
|
<!-- <xsl:template match="iho:ul//iho:note | iho:ol//iho:note" priority="2">
|
868
852
|
<fo:block id="{@id}">
|
@@ -1818,14 +1802,18 @@
|
|
1818
1802
|
</xsl:template>
|
1819
1803
|
|
1820
1804
|
<xsl:attribute-set name="table-fn-number-style">
|
1805
|
+
<!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
|
1806
|
+
|
1807
|
+
</xsl:attribute-set> <!-- table-fn-number-style -->
|
1808
|
+
|
1809
|
+
<xsl:attribute-set name="table-fmt-fn-label-style">
|
1821
1810
|
<xsl:attribute name="font-size">80%</xsl:attribute>
|
1822
|
-
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
1823
1811
|
|
1824
1812
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1825
1813
|
|
1826
|
-
</xsl:attribute-set> <!-- table-fn-
|
1814
|
+
</xsl:attribute-set> <!-- table-fmt-fn-label-style -->
|
1827
1815
|
|
1828
|
-
<xsl:template name="refine_table-fn-
|
1816
|
+
<xsl:template name="refine_table-fmt-fn-label-style">
|
1829
1817
|
|
1830
1818
|
</xsl:template>
|
1831
1819
|
|
@@ -1840,11 +1828,18 @@
|
|
1840
1828
|
</xsl:attribute-set>
|
1841
1829
|
|
1842
1830
|
<xsl:attribute-set name="figure-fn-number-style">
|
1843
|
-
<xsl:attribute name="font-size">80%</xsl:attribute>
|
1844
1831
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
1832
|
+
</xsl:attribute-set> <!-- figure-fn-number-style -->
|
1833
|
+
|
1834
|
+
<xsl:attribute-set name="figure-fmt-fn-label-style">
|
1835
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
1845
1836
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1846
1837
|
|
1847
|
-
</xsl:attribute-set>
|
1838
|
+
</xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
|
1839
|
+
|
1840
|
+
<xsl:template name="refine_figure-fmt-fn-label-style">
|
1841
|
+
|
1842
|
+
</xsl:template>
|
1848
1843
|
|
1849
1844
|
<xsl:attribute-set name="figure-fn-body-style">
|
1850
1845
|
<xsl:attribute name="text-align">justify</xsl:attribute>
|
@@ -3359,9 +3354,13 @@
|
|
3359
3354
|
|
3360
3355
|
<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']"/>
|
3361
3356
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3357
|
+
<!-- <xsl:choose>
|
3358
|
+
<xsl:when test="$namespace = 'plateau'"></xsl:when>
|
3359
|
+
<xsl:otherwise>
|
3360
|
+
|
3361
|
+
</xsl:otherwise>
|
3362
|
+
</xsl:choose> -->
|
3363
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
|
3365
3364
|
</xsl:if>
|
3366
3365
|
|
3367
3366
|
<xsl:choose>
|
@@ -3408,7 +3407,7 @@
|
|
3408
3407
|
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
3409
3408
|
</xsl:when>
|
3410
3409
|
<xsl:otherwise>
|
3411
|
-
<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 -->
|
3410
|
+
<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 -->
|
3412
3411
|
</xsl:otherwise>
|
3413
3412
|
</xsl:choose>
|
3414
3413
|
|
@@ -3419,13 +3418,26 @@
|
|
3419
3418
|
|
3420
3419
|
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
3421
3420
|
|
3422
|
-
|
3423
|
-
|
3424
|
-
|
3425
|
-
|
3426
|
-
|
3427
|
-
|
3428
|
-
|
3421
|
+
<!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
|
3422
|
+
|
3423
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
3424
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
3425
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
3426
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
3427
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
3428
|
+
</xsl:call-template>
|
3429
|
+
</xsl:for-each>
|
3430
|
+
|
3431
|
+
<!-- https://github.com/metanorma/metanorma-plateau/issues/171
|
3432
|
+
<xsl:if test="$namespace = 'plateau'">
|
3433
|
+
<xsl:apply-templates select="*[not(local-name()='thead') and not(local-name()='tbody') and not(local-name()='tfoot') and not(local-name()='name')]" />
|
3434
|
+
<xsl:for-each select="*[local-name()='tbody']"> - select context to tbody -
|
3435
|
+
<xsl:variable name="table_fn_block">
|
3436
|
+
<xsl:call-template name="table_fn_display" />
|
3437
|
+
</xsl:variable>
|
3438
|
+
<xsl:copy-of select="$table_fn_block"/>
|
3439
|
+
</xsl:for-each>
|
3440
|
+
</xsl:if> -->
|
3429
3441
|
|
3430
3442
|
<xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark -->
|
3431
3443
|
<fo:block keep-with-previous="always" line-height="0.1">
|
@@ -4300,6 +4312,17 @@
|
|
4300
4312
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
4301
4313
|
</xsl:if>
|
4302
4314
|
|
4315
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
4316
|
+
<xsl:if test="@colspan and *[local-name() = 'note'][@type = 'units']">
|
4317
|
+
<xsl:attribute name="text-align">right</xsl:attribute>
|
4318
|
+
<xsl:attribute name="border">none</xsl:attribute>
|
4319
|
+
<xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
|
4320
|
+
<xsl:attribute name="border-top">1pt solid white</xsl:attribute>
|
4321
|
+
<xsl:attribute name="border-left">1pt solid white</xsl:attribute>
|
4322
|
+
<xsl:attribute name="border-right">1pt solid white</xsl:attribute>
|
4323
|
+
</xsl:if>
|
4324
|
+
</xsl:if>
|
4325
|
+
|
4303
4326
|
<fo:block role="SKIP">
|
4304
4327
|
|
4305
4328
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
@@ -4318,7 +4341,8 @@
|
|
4318
4341
|
</fo:table-cell>
|
4319
4342
|
</xsl:template> <!-- td -->
|
4320
4343
|
|
4321
|
-
|
4344
|
+
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
4345
|
+
<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">
|
4322
4346
|
|
4323
4347
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
4324
4348
|
<xsl:copy-of select="@id"/>
|
@@ -4339,65 +4363,54 @@
|
|
4339
4363
|
|
4340
4364
|
</xsl:template> <!-- table/note -->
|
4341
4365
|
|
4342
|
-
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
|
4366
|
+
<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">
|
4343
4367
|
<xsl:apply-templates/>
|
4344
4368
|
</xsl:template>
|
4345
4369
|
|
4346
4370
|
<!-- ===================== -->
|
4347
4371
|
<!-- Footnotes processing -->
|
4348
4372
|
<!-- ===================== -->
|
4373
|
+
|
4374
|
+
<!-- document text (not figures, or tables) footnotes -->
|
4375
|
+
<xsl:variable name="footnotes_">
|
4376
|
+
<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 -->
|
4377
|
+
<!-- <xsl:copy-of select="."/> -->
|
4378
|
+
<xsl:variable name="update_xml_step1">
|
4379
|
+
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
4380
|
+
</xsl:variable>
|
4381
|
+
<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
|
4382
|
+
</xsl:for-each>
|
4383
|
+
</xsl:variable>
|
4384
|
+
<xsl:variable name="footnotes" select="xalan:nodeset($footnotes_)"/>
|
4385
|
+
|
4349
4386
|
<!--
|
4350
4387
|
<fn reference="1">
|
4351
4388
|
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
4352
4389
|
</fn>
|
4353
4390
|
-->
|
4354
|
-
<!-- footnotes in text (title, bibliography, main body, table's, figure's names
|
4391
|
+
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
4392
|
+
<!-- fn in text -->
|
4355
4393
|
<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">
|
4356
4394
|
|
4357
|
-
<!-- list of
|
4395
|
+
<!-- list of unique footnotes -->
|
4358
4396
|
<xsl:variable name="p_fn_">
|
4359
4397
|
<xsl:call-template name="get_fn_list"/>
|
4360
|
-
<!-- <xsl:choose>
|
4361
|
-
<xsl:when test="$namespace = 'jis'">
|
4362
|
-
<xsl:call-template name="get_fn_list_for_element"/>
|
4363
|
-
</xsl:when>
|
4364
|
-
<xsl:otherwise>
|
4365
|
-
<xsl:call-template name="get_fn_list"/>
|
4366
|
-
</xsl:otherwise>
|
4367
|
-
</xsl:choose> -->
|
4368
4398
|
</xsl:variable>
|
4369
4399
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
4370
4400
|
|
4371
4401
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
4372
|
-
|
4373
|
-
<xsl:variable name="reference_">
|
4374
|
-
<xsl:value-of select="@reference"/>
|
4375
|
-
<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
|
4376
|
-
</xsl:variable>
|
4377
|
-
<xsl:variable name="reference" select="normalize-space($reference_)"/>
|
4402
|
+
|
4378
4403
|
<!-- fn sequence number in document -->
|
4379
|
-
<xsl:variable name="current_fn_number"
|
4380
|
-
|
4381
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
4382
|
-
<xsl:otherwise>
|
4383
|
-
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
4384
|
-
</xsl:otherwise>
|
4385
|
-
</xsl:choose>
|
4386
|
-
</xsl:variable>
|
4404
|
+
<xsl:variable name="current_fn_number" select="@reference"/>
|
4405
|
+
|
4387
4406
|
<xsl:variable name="current_fn_number_text">
|
4388
4407
|
|
4389
4408
|
<xsl:value-of select="$current_fn_number"/>
|
4390
4409
|
|
4391
4410
|
</xsl:variable>
|
4392
4411
|
|
4393
|
-
<xsl:variable name="ref_id"
|
4394
|
-
|
4395
|
-
<xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
|
4396
|
-
<xsl:otherwise>
|
4397
|
-
<xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
4398
|
-
</xsl:otherwise>
|
4399
|
-
</xsl:choose>
|
4400
|
-
</xsl:variable>
|
4412
|
+
<xsl:variable name="ref_id" select="@target"/>
|
4413
|
+
|
4401
4414
|
<xsl:variable name="footnote_inline">
|
4402
4415
|
<fo:inline role="Reference">
|
4403
4416
|
|
@@ -4442,7 +4455,9 @@
|
|
4442
4455
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
4443
4456
|
<xsl:copy-of select="$footnote_inline"/>
|
4444
4457
|
</xsl:when>
|
4458
|
+
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
4445
4459
|
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
4460
|
+
|
4446
4461
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
4447
4462
|
<xsl:copy-of select="$footnote_inline"/>
|
4448
4463
|
<fo:footnote-body role="Note">
|
@@ -4459,7 +4474,10 @@
|
|
4459
4474
|
<xsl:value-of select="$current_fn_number_text"/>
|
4460
4475
|
|
4461
4476
|
</fo:inline>
|
4462
|
-
<xsl:apply-templates/>
|
4477
|
+
<!-- <xsl:apply-templates /> -->
|
4478
|
+
<!-- <ref_id><xsl:value-of select="$ref_id"/></ref_id>
|
4479
|
+
<here><xsl:copy-of select="$footnotes"/></here> -->
|
4480
|
+
<xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
|
4463
4481
|
</xsl:variable>
|
4464
4482
|
|
4465
4483
|
<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
|
@@ -4513,77 +4531,136 @@
|
|
4513
4531
|
</xsl:choose>
|
4514
4532
|
</xsl:template>
|
4515
4533
|
|
4516
|
-
<xsl:template name="get_fn_list_for_element">
|
4517
|
-
<xsl:choose>
|
4518
|
-
<xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
|
4519
|
-
<fn gen_id="{generate-id(.)}">
|
4520
|
-
<xsl:copy-of select="@*"/>
|
4521
|
-
<xsl:copy-of select="node()"/>
|
4522
|
-
</fn>
|
4523
|
-
</xsl:when>
|
4524
|
-
<xsl:otherwise>
|
4525
|
-
<xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
|
4526
|
-
<xsl:variable name="element_id" select="@id"/>
|
4527
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
4528
|
-
<!-- copy unique fn -->
|
4529
|
-
<fn gen_id="{generate-id(.)}">
|
4530
|
-
<xsl:copy-of select="@*"/>
|
4531
|
-
<xsl:copy-of select="node()"/>
|
4532
|
-
</fn>
|
4533
|
-
</xsl:for-each>
|
4534
|
-
</xsl:for-each>
|
4535
|
-
</xsl:otherwise>
|
4536
|
-
</xsl:choose>
|
4537
|
-
</xsl:template>
|
4538
4534
|
<!-- ============================ -->
|
4539
4535
|
<!-- table's footnotes rendering -->
|
4540
4536
|
<!-- ============================ -->
|
4541
|
-
<xsl:template name="table_fn_display">
|
4542
|
-
<xsl:variable name="references">
|
4543
4537
|
|
4538
|
+
<!-- table/fmt-footnote-container -->
|
4539
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'fmt-footnote-container']"/>
|
4540
|
+
|
4541
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'fmt-footnote-container']">
|
4542
|
+
<xsl:for-each select=".">
|
4543
|
+
<xsl:call-template name="table_fn_display"/>
|
4544
|
+
</xsl:for-each>
|
4545
|
+
</xsl:template>
|
4546
|
+
|
4547
|
+
<xsl:template name="table_fn_display">
|
4548
|
+
<!-- <xsl:variable name="references">
|
4549
|
+
<xsl:if test="$namespace = 'bsi'">
|
4550
|
+
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) = 'name']">
|
4551
|
+
<xsl:call-template name="create_fn" />
|
4552
|
+
</xsl:for-each>
|
4553
|
+
</xsl:if>
|
4544
4554
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
4545
|
-
<xsl:call-template name="create_fn"/>
|
4555
|
+
<xsl:call-template name="create_fn" />
|
4546
4556
|
</xsl:for-each>
|
4547
|
-
</xsl:variable>
|
4548
|
-
|
4549
|
-
<xsl:for-each select="xalan:nodeset($references)//fn">
|
4557
|
+
</xsl:variable> -->
|
4558
|
+
<!-- <xsl:for-each select="xalan:nodeset($references)//fn">
|
4550
4559
|
<xsl:variable name="reference" select="@reference"/>
|
4551
|
-
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
4560
|
+
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
|
4561
|
+
<xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
|
4552
4562
|
|
4553
4563
|
<fo:block xsl:use-attribute-sets="table-fn-style">
|
4564
|
+
<xsl:copy-of select="@id"/>
|
4554
4565
|
<xsl:call-template name="refine_table-fn-style"/>
|
4555
|
-
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
|
4556
|
-
<xsl:call-template name="refine_table-fn-number-style"/>
|
4557
4566
|
|
4558
|
-
|
4559
|
-
|
4560
|
-
|
4561
|
-
<!-- <xsl:if test="$namespace = 'itu'">
|
4562
|
-
<xsl:text>)</xsl:text>
|
4563
|
-
</xsl:if> -->
|
4567
|
+
<xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
|
4568
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
4569
|
+
</xsl:apply-templates>
|
4564
4570
|
|
4565
|
-
</fo:inline>
|
4566
4571
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
4567
|
-
<xsl:copy-of select="./node()"/>
|
4572
|
+
<!-- <xsl:copy-of select="./node()"/> -->
|
4573
|
+
<xsl:apply-templates/>
|
4568
4574
|
</fo:inline>
|
4569
4575
|
|
4570
4576
|
</fo:block>
|
4571
4577
|
|
4572
|
-
</xsl:if>
|
4578
|
+
<!-- </xsl:if> -->
|
4573
4579
|
</xsl:for-each>
|
4574
4580
|
</xsl:template> <!-- table_fn_display -->
|
4575
4581
|
|
4582
|
+
<!-- fmt-fn-body/fmt-fn-label in text -->
|
4583
|
+
<xsl:template match="*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"/>
|
4584
|
+
|
4585
|
+
<!-- table//fmt-fn-body//fmt-fn-label -->
|
4586
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
|
4587
|
+
<xsl:param name="process">false</xsl:param>
|
4588
|
+
<xsl:if test="$process = 'true'">
|
4589
|
+
<fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
|
4590
|
+
|
4591
|
+
<!-- tab is padding-right -->
|
4592
|
+
<xsl:apply-templates select=".//*[local-name() = 'tab']">
|
4593
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
4594
|
+
</xsl:apply-templates>
|
4595
|
+
|
4596
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
4597
|
+
<fo:inline font-style="normal">(</fo:inline>
|
4598
|
+
</xsl:if> -->
|
4599
|
+
|
4600
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
4601
|
+
<xsl:text>※</xsl:text>
|
4602
|
+
</xsl:if> -->
|
4603
|
+
|
4604
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
4605
|
+
<!-- <xsl:value-of select="normalize-space()"/> -->
|
4606
|
+
<xsl:apply-templates/>
|
4607
|
+
|
4608
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
4609
|
+
<fo:inline font-style="normal">)</fo:inline>
|
4610
|
+
</xsl:if> -->
|
4611
|
+
|
4612
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
4613
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
4614
|
+
<xsl:text>)</xsl:text>
|
4615
|
+
</xsl:if> -->
|
4616
|
+
|
4617
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
4618
|
+
<xsl:text>:</xsl:text>
|
4619
|
+
</xsl:if> -->
|
4620
|
+
|
4621
|
+
</fo:inline>
|
4622
|
+
</xsl:if>
|
4623
|
+
</xsl:template> <!-- fmt-fn-body//fmt-fn-label -->
|
4624
|
+
|
4625
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
|
4626
|
+
<xsl:param name="process">false</xsl:param>
|
4627
|
+
<xsl:if test="$process = 'true'">
|
4628
|
+
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
4629
|
+
|
4630
|
+
</xsl:if>
|
4631
|
+
</xsl:template>
|
4632
|
+
|
4633
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
|
4634
|
+
<fo:inline xsl:use-attribute-sets="table-fmt-fn-label-style" role="SKIP">
|
4635
|
+
<xsl:call-template name="refine_table-fmt-fn-label-style"/>
|
4636
|
+
<xsl:apply-templates/>
|
4637
|
+
</fo:inline>
|
4638
|
+
</xsl:template>
|
4639
|
+
|
4640
|
+
<!-- <xsl:template match="*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']"/> -->
|
4641
|
+
<!--
|
4576
4642
|
<xsl:template name="create_fn">
|
4577
4643
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
4578
|
-
<xsl:if test="ancestor::*[local-name()='table'][1]/@id">
|
4644
|
+
<xsl:if test="ancestor::*[local-name()='table'][1]/@id"> - for footnotes in tables -
|
4579
4645
|
<xsl:attribute name="id">
|
4580
4646
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4581
4647
|
</xsl:attribute>
|
4582
4648
|
</xsl:if>
|
4583
|
-
|
4584
|
-
|
4649
|
+
<xsl:if test="$namespace = 'itu'">
|
4650
|
+
<xsl:if test="ancestor::*[local-name()='preface']">
|
4651
|
+
<xsl:attribute name="preface">true</xsl:attribute>
|
4652
|
+
</xsl:if>
|
4653
|
+
</xsl:if>
|
4654
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4655
|
+
<xsl:attribute name="id">
|
4656
|
+
<xsl:value-of select="@reference"/>
|
4657
|
+
<xsl:text>_</xsl:text>
|
4658
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4659
|
+
</xsl:attribute>
|
4660
|
+
</xsl:if>
|
4661
|
+
<xsl:apply-templates />
|
4585
4662
|
</fn>
|
4586
|
-
</xsl:template>
|
4663
|
+
</xsl:template> -->
|
4587
4664
|
|
4588
4665
|
<!-- footnotes for table's name rendering -->
|
4589
4666
|
<xsl:template name="table_name_fn_display">
|
@@ -4602,123 +4679,171 @@
|
|
4602
4679
|
<!-- ============================ -->
|
4603
4680
|
<!-- figure's footnotes rendering -->
|
4604
4681
|
<!-- ============================ -->
|
4605
|
-
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
4606
4682
|
|
4607
|
-
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4611
|
-
|
4612
|
-
<xsl:variable name="figure_id" select="normalize-space($figure_id_)"/>
|
4683
|
+
<!-- figure/fmt-footnote-container -->
|
4684
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-footnote-container']"/>
|
4685
|
+
|
4686
|
+
<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
|
4687
|
+
<xsl:template name="figure_fn_display">
|
4613
4688
|
|
4614
|
-
<!-- all footnotes relates to the current figure -->
|
4615
4689
|
<xsl:variable name="references">
|
4616
|
-
<xsl:for-each select="
|
4617
|
-
<
|
4618
|
-
|
4619
|
-
|
4690
|
+
<xsl:for-each select="./*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
|
4691
|
+
<xsl:variable name="curr_id" select="@id"/>
|
4692
|
+
<!-- <curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
4693
|
+
<curr><xsl:copy-of select="."/></curr>
|
4694
|
+
<ancestor><xsl:copy-of select="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn']]]"/></ancestor> -->
|
4695
|
+
<xsl:choose>
|
4696
|
+
<!-- skip figure/name/fn -->
|
4697
|
+
<xsl:when test="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn'][@target = $curr_id]]]"><!-- skip --></xsl:when>
|
4698
|
+
<xsl:otherwise>
|
4699
|
+
<xsl:element name="figure" namespace="{$namespace_full}">
|
4700
|
+
<xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
|
4701
|
+
<xsl:copy-of select="."/>
|
4702
|
+
</xsl:element>
|
4703
|
+
</xsl:element>
|
4704
|
+
</xsl:otherwise>
|
4705
|
+
</xsl:choose>
|
4620
4706
|
</xsl:for-each>
|
4621
4707
|
</xsl:variable>
|
4708
|
+
<!-- <references><xsl:copy-of select="$references"/></references> -->
|
4622
4709
|
|
4623
|
-
<xsl:if test="xalan:nodeset($references)
|
4710
|
+
<xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
|
4624
4711
|
|
4625
4712
|
<xsl:variable name="key_iso">
|
4626
4713
|
|
4627
4714
|
</xsl:variable>
|
4628
4715
|
|
4629
4716
|
<fo:block>
|
4717
|
+
<!-- current hierarchy is 'figure' element -->
|
4718
|
+
<xsl:variable name="following_dl_colwidths">
|
4719
|
+
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
4720
|
+
<xsl:variable name="simple-table">
|
4721
|
+
<!-- <xsl:variable name="doc_ns">
|
4722
|
+
<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
|
4723
|
+
</xsl:variable>
|
4724
|
+
<xsl:variable name="ns">
|
4725
|
+
<xsl:choose>
|
4726
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
4727
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
4728
|
+
</xsl:when>
|
4729
|
+
<xsl:otherwise>
|
4730
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
4731
|
+
</xsl:otherwise>
|
4732
|
+
</xsl:choose>
|
4733
|
+
</xsl:variable> -->
|
4630
4734
|
|
4631
|
-
<!-- current hierarchy is 'figure' element -->
|
4632
|
-
<xsl:variable name="following_dl_colwidths">
|
4633
|
-
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
4634
|
-
<xsl:variable name="simple-table">
|
4635
|
-
<!-- <xsl:variable name="doc_ns">
|
4636
|
-
<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
|
4637
|
-
</xsl:variable>
|
4638
|
-
<xsl:variable name="ns">
|
4639
|
-
<xsl:choose>
|
4640
|
-
<xsl:when test="normalize-space($doc_ns) != ''">
|
4641
|
-
<xsl:value-of select="normalize-space($doc_ns)"/>
|
4642
|
-
</xsl:when>
|
4643
|
-
<xsl:otherwise>
|
4644
|
-
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
4645
|
-
</xsl:otherwise>
|
4646
|
-
</xsl:choose>
|
4647
|
-
</xsl:variable> -->
|
4648
|
-
|
4649
|
-
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
4650
|
-
<tbody>
|
4651
|
-
<xsl:apply-templates mode="dl"/>
|
4652
|
-
</tbody>
|
4653
|
-
</xsl:for-each>
|
4654
|
-
</xsl:variable>
|
4655
|
-
|
4656
|
-
<xsl:call-template name="calculate-column-widths">
|
4657
|
-
<xsl:with-param name="cols-count" select="2"/>
|
4658
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
4659
|
-
</xsl:call-template>
|
4660
|
-
|
4661
|
-
</xsl:if>
|
4662
|
-
</xsl:variable>
|
4663
|
-
|
4664
|
-
<xsl:variable name="maxlength_dt">
|
4665
4735
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
4666
|
-
<
|
4736
|
+
<tbody>
|
4737
|
+
<xsl:apply-templates mode="dl"/>
|
4738
|
+
</tbody>
|
4667
4739
|
</xsl:for-each>
|
4668
4740
|
</xsl:variable>
|
4669
4741
|
|
4670
|
-
<
|
4671
|
-
<xsl:
|
4672
|
-
|
4742
|
+
<xsl:call-template name="calculate-column-widths">
|
4743
|
+
<xsl:with-param name="cols-count" select="2"/>
|
4744
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
4745
|
+
</xsl:call-template>
|
4673
4746
|
|
4674
|
-
|
4675
|
-
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4679
|
-
|
4680
|
-
|
4681
|
-
|
4682
|
-
|
4683
|
-
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4687
|
-
|
4688
|
-
|
4689
|
-
|
4690
|
-
|
4691
|
-
|
4692
|
-
|
4693
|
-
|
4694
|
-
|
4695
|
-
|
4696
|
-
|
4747
|
+
</xsl:if>
|
4748
|
+
</xsl:variable>
|
4749
|
+
|
4750
|
+
<xsl:variable name="maxlength_dt">
|
4751
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
4752
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
4753
|
+
</xsl:for-each>
|
4754
|
+
</xsl:variable>
|
4755
|
+
|
4756
|
+
<fo:table width="95%" table-layout="fixed">
|
4757
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
4758
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
4759
|
+
|
4760
|
+
</xsl:if>
|
4761
|
+
<xsl:choose>
|
4762
|
+
<!-- if there 'dl', then set same columns width -->
|
4763
|
+
<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
|
4764
|
+
<xsl:call-template name="setColumnWidth_dl">
|
4765
|
+
<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
|
4766
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
4767
|
+
</xsl:call-template>
|
4768
|
+
</xsl:when>
|
4769
|
+
<xsl:otherwise>
|
4770
|
+
<fo:table-column column-width="5%"/>
|
4771
|
+
<fo:table-column column-width="95%"/>
|
4772
|
+
</xsl:otherwise>
|
4773
|
+
</xsl:choose>
|
4774
|
+
<fo:table-body>
|
4775
|
+
<!-- <xsl:for-each select="xalan:nodeset($references)//fn"> -->
|
4776
|
+
<xsl:for-each select="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
|
4777
|
+
|
4778
|
+
<xsl:variable name="reference" select="@reference"/>
|
4779
|
+
<!-- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
|
4780
|
+
<fo:table-row>
|
4781
|
+
<fo:table-cell>
|
4782
|
+
<fo:block>
|
4783
|
+
|
4784
|
+
<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fmt-fn-label-style">
|
4785
|
+
<!-- <xsl:attribute name="padding-right">0mm</xsl:attribute> -->
|
4786
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
4787
|
+
<xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/>
|
4697
4788
|
</fo:inline>
|
4698
|
-
</fo:block>
|
4699
|
-
</fo:table-cell>
|
4700
|
-
<fo:table-cell>
|
4701
|
-
<fo:block xsl:use-attribute-sets="figure-fn-body-style">
|
4702
|
-
<xsl:if test="normalize-space($key_iso) = 'true'">
|
4703
4789
|
|
4704
|
-
|
4790
|
+
</fo:block>
|
4791
|
+
</fo:table-cell>
|
4792
|
+
<fo:table-cell>
|
4793
|
+
<fo:block xsl:use-attribute-sets="figure-fn-body-style">
|
4794
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
4705
4795
|
|
4706
|
-
|
4707
|
-
|
4708
|
-
|
4709
|
-
</fo:table-cell>
|
4710
|
-
</fo:table-row>
|
4711
|
-
</xsl:if>
|
4712
|
-
</xsl:for-each>
|
4713
|
-
</fo:table-body>
|
4714
|
-
</fo:table>
|
4796
|
+
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
4797
|
+
|
4798
|
+
</xsl:if>
|
4715
4799
|
|
4800
|
+
<!-- <xsl:copy-of select="./node()"/> -->
|
4801
|
+
<xsl:apply-templates/>
|
4802
|
+
</fo:block>
|
4803
|
+
</fo:table-cell>
|
4804
|
+
</fo:table-row>
|
4805
|
+
<!-- </xsl:if> -->
|
4806
|
+
</xsl:for-each>
|
4807
|
+
</fo:table-body>
|
4808
|
+
</fo:table>
|
4716
4809
|
</fo:block>
|
4717
4810
|
</xsl:if>
|
4718
|
-
</xsl:template> <!--
|
4811
|
+
</xsl:template> <!-- figure_fn_display -->
|
4812
|
+
|
4813
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
|
4814
|
+
<xsl:param name="process">false</xsl:param>
|
4815
|
+
<xsl:if test="$process = 'true'">
|
4816
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
|
4817
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
4818
|
+
|
4819
|
+
<!-- tab is padding-right -->
|
4820
|
+
<xsl:apply-templates select=".//*[local-name() = 'tab']">
|
4821
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
4822
|
+
</xsl:apply-templates>
|
4823
|
+
|
4824
|
+
<xsl:apply-templates/>
|
4825
|
+
|
4826
|
+
</fo:inline>
|
4827
|
+
</xsl:if>
|
4828
|
+
</xsl:template> <!-- figure//fmt-fn-body//fmt-fn-label -->
|
4829
|
+
|
4830
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
|
4831
|
+
<xsl:param name="process">false</xsl:param>
|
4832
|
+
<xsl:if test="$process = 'true'">
|
4833
|
+
|
4834
|
+
</xsl:if>
|
4835
|
+
</xsl:template>
|
4836
|
+
|
4837
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
|
4838
|
+
<fo:inline xsl:use-attribute-sets="figure-fmt-fn-label-style" role="SKIP">
|
4839
|
+
<xsl:call-template name="refine_figure-fmt-fn-label-style"/>
|
4840
|
+
<xsl:apply-templates/>
|
4841
|
+
</fo:inline>
|
4842
|
+
</xsl:template>
|
4719
4843
|
|
4720
4844
|
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
4721
4845
|
<!-- figure's footnote label -->
|
4846
|
+
<!-- figure/dl[@key = 'true']/dt/p/sup -->
|
4722
4847
|
<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">
|
4723
4848
|
<xsl:variable name="key_iso">
|
4724
4849
|
|
@@ -4727,7 +4852,7 @@
|
|
4727
4852
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
4728
4853
|
|
4729
4854
|
</xsl:if>
|
4730
|
-
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
4855
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
|
4731
4856
|
<!-- <xsl:value-of select="@reference"/> -->
|
4732
4857
|
<xsl:apply-templates/>
|
4733
4858
|
</fo:inline>
|
@@ -4737,38 +4862,65 @@
|
|
4737
4862
|
<!-- END: figure's footnotes rendering -->
|
4738
4863
|
<!-- ============================ -->
|
4739
4864
|
|
4740
|
-
<!-- fn reference in the
|
4865
|
+
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
4866
|
+
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
4741
4867
|
<xsl:template match="*[local-name()='fn']">
|
4742
4868
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
4743
4869
|
|
4744
4870
|
<xsl:call-template name="refine_fn-reference-style"/>
|
4745
4871
|
|
4746
|
-
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4747
|
-
|
4748
|
-
|
4872
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4873
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
4874
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
4875
|
+
<!-- <xsl:attribute name="internal-destination">
|
4749
4876
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4750
4877
|
</xsl:attribute>
|
4751
4878
|
</xsl:if>
|
4879
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4880
|
+
<xsl:attribute name="internal-destination">
|
4881
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
4882
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4883
|
+
</xsl:attribute>
|
4884
|
+
</xsl:if> -->
|
4885
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
4886
|
+
<xsl:text>※</xsl:text>
|
4887
|
+
</xsl:if> -->
|
4888
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
4752
4889
|
|
4753
|
-
|
4890
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
4754
4891
|
|
4892
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
4893
|
+
<xsl:text>)</xsl:text>
|
4894
|
+
</xsl:if> -->
|
4755
4895
|
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
4756
4896
|
<!-- <xsl:if test="$namespace = 'jis'">
|
4757
4897
|
<fo:inline font-weight="normal">)</fo:inline>
|
4758
4898
|
</xsl:if> -->
|
4759
4899
|
</fo:basic-link>
|
4760
4900
|
</fo:inline>
|
4761
|
-
</xsl:template>
|
4901
|
+
</xsl:template> <!-- fn -->
|
4762
4902
|
|
4903
|
+
<!-- fn/text() -->
|
4763
4904
|
<xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
4764
4905
|
<fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
|
4765
4906
|
</xsl:template>
|
4766
4907
|
|
4767
|
-
|
4908
|
+
<!-- fn//p fmt-fn-body//p -->
|
4909
|
+
<xsl:template match="*[local-name()='fn']//*[local-name()='p'] | *[local-name() = 'fmt-fn-body']//*[local-name()='p']">
|
4768
4910
|
<fo:inline role="P">
|
4769
4911
|
<xsl:apply-templates/>
|
4770
4912
|
</fo:inline>
|
4771
4913
|
</xsl:template>
|
4914
|
+
|
4915
|
+
<xsl:template name="insertFootnoteSeparatorCommon">
|
4916
|
+
<xsl:param name="leader_length">30%</xsl:param>
|
4917
|
+
<fo:static-content flow-name="xsl-footnote-separator">
|
4918
|
+
<fo:block>
|
4919
|
+
<fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
|
4920
|
+
</fo:block>
|
4921
|
+
</fo:static-content>
|
4922
|
+
</xsl:template>
|
4923
|
+
|
4772
4924
|
<!-- ===================== -->
|
4773
4925
|
<!-- END Footnotes processing -->
|
4774
4926
|
<!-- ===================== -->
|
@@ -5047,11 +5199,11 @@
|
|
5047
5199
|
<xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
|
5048
5200
|
<!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
|
5049
5201
|
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5202
|
+
<xsl:call-template name="setColumnWidth_dl">
|
5203
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
5204
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
5205
|
+
<xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
|
5206
|
+
</xsl:call-template>
|
5055
5207
|
|
5056
5208
|
<fo:table-body>
|
5057
5209
|
|
@@ -5085,6 +5237,14 @@
|
|
5085
5237
|
|
5086
5238
|
</xsl:template> <!-- END: dl -->
|
5087
5239
|
|
5240
|
+
<xsl:template match="@*|node()" mode="dt_clean">
|
5241
|
+
<xsl:copy>
|
5242
|
+
<xsl:apply-templates select="@*|node()" mode="dt_clean"/>
|
5243
|
+
</xsl:copy>
|
5244
|
+
</xsl:template>
|
5245
|
+
|
5246
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="dt_clean"/>
|
5247
|
+
|
5088
5248
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
5089
5249
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
5090
5250
|
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
@@ -5118,10 +5278,12 @@
|
|
5118
5278
|
<!-- ignore 'p' with 'where' in formula, before 'dl' -->
|
5119
5279
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
|
5120
5280
|
|
5281
|
+
<!-- dl/name -->
|
5121
5282
|
<xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
|
5122
5283
|
<xsl:param name="process">false</xsl:param>
|
5123
5284
|
<xsl:if test="$process = 'true'">
|
5124
5285
|
<fo:block xsl:use-attribute-sets="dl-name-style">
|
5286
|
+
|
5125
5287
|
<xsl:apply-templates/>
|
5126
5288
|
</fo:block>
|
5127
5289
|
</xsl:if>
|
@@ -5135,6 +5297,10 @@
|
|
5135
5297
|
<!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
|
5136
5298
|
|
5137
5299
|
<xsl:choose>
|
5300
|
+
<!-- <xsl:when test="@class = 'formula_dl' and local-name(..) = 'figure'">
|
5301
|
+
<fo:table-column column-width="10%"/>
|
5302
|
+
<fo:table-column column-width="90%"/>
|
5303
|
+
</xsl:when> -->
|
5138
5304
|
<xsl:when test="xalan:nodeset($colwidths)/autolayout">
|
5139
5305
|
<xsl:call-template name="insertTableColumnWidth">
|
5140
5306
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
@@ -7328,6 +7494,27 @@
|
|
7328
7494
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
7329
7495
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
7330
7496
|
</xsl:when> -->
|
7497
|
+
|
7498
|
+
<!-- <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'))">
|
7499
|
+
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
7500
|
+
<xsl:variable name="filename">
|
7501
|
+
<xsl:call-template name="substring-after-last">
|
7502
|
+
<xsl:with-param name="value" select="$target_"/>
|
7503
|
+
<xsl:with-param name="delimiter" select="'/'"/>
|
7504
|
+
</xsl:call-template>
|
7505
|
+
</xsl:variable>
|
7506
|
+
<xsl:variable name="target_filepath" select="concat($inputxml_basepath, @target)"/>
|
7507
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($target_filepath)))"/>
|
7508
|
+
<xsl:choose>
|
7509
|
+
<xsl:when test="$file_exists = 'true'">
|
7510
|
+
<xsl:value-of select="concat('url(embedded-file:', $filename, ')')"/>
|
7511
|
+
</xsl:when>
|
7512
|
+
<xsl:otherwise>
|
7513
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
7514
|
+
</xsl:otherwise>
|
7515
|
+
</xsl:choose>
|
7516
|
+
</xsl:when> -->
|
7517
|
+
|
7331
7518
|
<xsl:otherwise>
|
7332
7519
|
<xsl:value-of select="normalize-space(@target)"/>
|
7333
7520
|
</xsl:otherwise>
|
@@ -7632,7 +7819,7 @@
|
|
7632
7819
|
|
7633
7820
|
<xsl:template name="refine_note_block_style">
|
7634
7821
|
|
7635
|
-
</xsl:template>
|
7822
|
+
</xsl:template> <!-- refine_note_block_style -->
|
7636
7823
|
|
7637
7824
|
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
|
7638
7825
|
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
@@ -7824,10 +8011,21 @@
|
|
7824
8011
|
</xsl:template>
|
7825
8012
|
|
7826
8013
|
<xsl:template name="showFigureKey">
|
7827
|
-
<xsl:for-each select="*[local-name() = 'note'
|
7828
|
-
<xsl:
|
8014
|
+
<xsl:for-each select="*[(local-name() = 'note' and not(@type = 'units')) or local-name() = 'example']">
|
8015
|
+
<xsl:choose>
|
8016
|
+
<xsl:when test="local-name() = 'note'">
|
8017
|
+
<xsl:call-template name="note"/>
|
8018
|
+
</xsl:when>
|
8019
|
+
<xsl:when test="local-name() = 'example'">
|
8020
|
+
<xsl:call-template name="example"/>
|
8021
|
+
</xsl:when>
|
8022
|
+
<xsl:otherwise>
|
8023
|
+
<xsl:apply-templates select="."/>
|
8024
|
+
</xsl:otherwise>
|
8025
|
+
</xsl:choose>
|
7829
8026
|
</xsl:for-each>
|
7830
|
-
|
8027
|
+
<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
|
8028
|
+
<xsl:call-template name="figure_fn_display"/>
|
7831
8029
|
</xsl:template>
|
7832
8030
|
|
7833
8031
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
@@ -8721,10 +8919,10 @@
|
|
8721
8919
|
<xsl:when test="@type = 'section-title'">
|
8722
8920
|
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
8723
8921
|
<xsl:text>: </xsl:text>
|
8724
|
-
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
8922
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
|
8725
8923
|
</xsl:when>
|
8726
8924
|
<xsl:otherwise>
|
8727
|
-
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
8925
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
|
8728
8926
|
</xsl:otherwise>
|
8729
8927
|
</xsl:choose>
|
8730
8928
|
</xsl:when>
|
@@ -9055,9 +9253,15 @@
|
|
9055
9253
|
</xsl:if>
|
9056
9254
|
</xsl:template>
|
9057
9255
|
|
9256
|
+
<!-- figure/fn -->
|
9058
9257
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
|
9059
|
-
|
9258
|
+
<!-- figure/note -->
|
9259
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
|
9260
|
+
<!-- figure/example -->
|
9261
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
|
9060
9262
|
|
9263
|
+
<!-- figure/note[@type = 'units'] -->
|
9264
|
+
<!-- image/note[@type = 'units'] -->
|
9061
9265
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
|
9062
9266
|
<fo:block text-align="right" keep-with-next="always">
|
9063
9267
|
<xsl:apply-templates/>
|
@@ -9178,6 +9382,7 @@
|
|
9178
9382
|
</xsl:choose>
|
9179
9383
|
</xsl:template>
|
9180
9384
|
|
9385
|
+
<!-- fn -->
|
9181
9386
|
<xsl:template match="*[local-name() = 'fn']" mode="contents"/>
|
9182
9387
|
<xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/>
|
9183
9388
|
|
@@ -10074,7 +10279,7 @@
|
|
10074
10279
|
text line 1
|
10075
10280
|
text line 2
|
10076
10281
|
-->
|
10077
|
-
<xsl:template match="*[local-name() = 'example']">
|
10282
|
+
<xsl:template match="*[local-name() = 'example']" name="example">
|
10078
10283
|
|
10079
10284
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
10080
10285
|
|
@@ -10180,6 +10385,7 @@
|
|
10180
10385
|
|
10181
10386
|
</xsl:template>
|
10182
10387
|
|
10388
|
+
<!-- example/name -->
|
10183
10389
|
<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
10184
10390
|
<xsl:param name="fo_element">block</xsl:param>
|
10185
10391
|
|
@@ -10205,7 +10411,8 @@
|
|
10205
10411
|
|
10206
10412
|
</xsl:template>
|
10207
10413
|
|
10208
|
-
|
10414
|
+
<!-- table/example/name, table/tfoot//example/name -->
|
10415
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
|
10209
10416
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
10210
10417
|
|
10211
10418
|
<xsl:apply-templates/>
|
@@ -11842,8 +12049,33 @@
|
|
11842
12049
|
|
11843
12050
|
<xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
|
11844
12051
|
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
12052
|
+
<!-- New format: one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
12053
|
+
<!-- <test><xsl:copy-of select="."/></test> -->
|
12054
|
+
|
11845
12055
|
<xsl:variable name="target" select="@target"/>
|
12056
|
+
|
11846
12057
|
<xsl:for-each select="*[local-name() = 'tab']">
|
12058
|
+
|
12059
|
+
<xsl:if test="position() = 1">
|
12060
|
+
<!-- first column (data before first `tab`) -->
|
12061
|
+
<fo:table-cell>
|
12062
|
+
<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
|
12063
|
+
<xsl:call-template name="insert_basic_link">
|
12064
|
+
<xsl:with-param name="element">
|
12065
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
12066
|
+
<xsl:for-each select="preceding-sibling::node()">
|
12067
|
+
<xsl:choose>
|
12068
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
12069
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
12070
|
+
</xsl:choose>
|
12071
|
+
</xsl:for-each>
|
12072
|
+
</fo:basic-link>
|
12073
|
+
</xsl:with-param>
|
12074
|
+
</xsl:call-template>
|
12075
|
+
</fo:block>
|
12076
|
+
</fo:table-cell>
|
12077
|
+
</xsl:if>
|
12078
|
+
|
11847
12079
|
<xsl:variable name="current_id" select="generate-id()"/>
|
11848
12080
|
<fo:table-cell>
|
11849
12081
|
<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
|
@@ -11894,11 +12126,25 @@
|
|
11894
12126
|
|
11895
12127
|
<xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
|
11896
12128
|
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
12129
|
+
<!-- New format - one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
11897
12130
|
<xsl:for-each select="*[local-name() = 'tab']">
|
12131
|
+
<xsl:if test="position() = 1">
|
12132
|
+
<td>
|
12133
|
+
<xsl:for-each select="preceding-sibling::node()">
|
12134
|
+
<xsl:choose>
|
12135
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
12136
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
|
12137
|
+
</xsl:choose>
|
12138
|
+
</xsl:for-each>
|
12139
|
+
</td>
|
12140
|
+
</xsl:if>
|
11898
12141
|
<xsl:variable name="current_id" select="generate-id()"/>
|
11899
12142
|
<td>
|
11900
12143
|
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
11901
|
-
<xsl:
|
12144
|
+
<xsl:choose>
|
12145
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
12146
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
|
12147
|
+
</xsl:choose>
|
11902
12148
|
</xsl:for-each>
|
11903
12149
|
</td>
|
11904
12150
|
</xsl:for-each>
|
@@ -13289,6 +13535,7 @@
|
|
13289
13535
|
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
13290
13536
|
</fn>
|
13291
13537
|
-->
|
13538
|
+
<!-- fn in text -->
|
13292
13539
|
<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">
|
13293
13540
|
<xsl:variable name="p_fn_">
|
13294
13541
|
<xsl:call-template name="get_fn_list"/>
|