metanorma-bipm 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/base_convert.rb +4 -0
- data/lib/isodoc/bipm/bipm.brochure.xsl +673 -295
- data/lib/isodoc/bipm/bipm.guide.xsl +673 -295
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +673 -295
- data/lib/isodoc/bipm/bipm.rapport.xsl +673 -295
- data/lib/isodoc/bipm/html/htmlstyle.css +7 -0
- data/lib/isodoc/bipm/jcgm.standard.xsl +618 -256
- data/lib/isodoc/bipm/presentation_xml_convert.rb +99 -23
- data/lib/metanorma/bipm/basicdoc.rng +34 -27
- data/lib/metanorma/bipm/isodoc.rng +37 -1
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +2 -2
@@ -801,16 +801,6 @@
|
|
801
801
|
</xsl:if>
|
802
802
|
</xsl:template>
|
803
803
|
|
804
|
-
<xsl:template match="*[local-name()='p']/*[local-name()='fn']/*[local-name()='p']">
|
805
|
-
<xsl:apply-templates/>
|
806
|
-
</xsl:template>
|
807
|
-
|
808
|
-
<xsl:template match="jcgm:fn/jcgm:p">
|
809
|
-
<fo:block>
|
810
|
-
<xsl:apply-templates/>
|
811
|
-
</fo:block>
|
812
|
-
</xsl:template>
|
813
|
-
|
814
804
|
<!-- for two-columns layout -->
|
815
805
|
|
816
806
|
<xsl:template match="*[local-name()='ul'][not(*)] | *[local-name()='ol'][not(*)]" priority="2"/>
|
@@ -1023,11 +1013,9 @@
|
|
1023
1013
|
|
1024
1014
|
<xsl:template name="insertHeaderFooter">
|
1025
1015
|
<xsl:param name="isDraft"/>
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
</fo:block>
|
1030
|
-
</fo:static-content>
|
1016
|
+
|
1017
|
+
<xsl:call-template name="insertFootnoteSeparatorCommon"/>
|
1018
|
+
|
1031
1019
|
<fo:static-content flow-name="header-even-jcgm" role="artifact">
|
1032
1020
|
<xsl:call-template name="insertDraftWatermark">
|
1033
1021
|
<xsl:with-param name="isDraft" select="$isDraft"/>
|
@@ -2787,14 +2775,18 @@
|
|
2787
2775
|
</xsl:template>
|
2788
2776
|
|
2789
2777
|
<xsl:attribute-set name="table-fn-number-style">
|
2778
|
+
<!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
|
2779
|
+
|
2780
|
+
</xsl:attribute-set> <!-- table-fn-number-style -->
|
2781
|
+
|
2782
|
+
<xsl:attribute-set name="table-fmt-fn-label-style">
|
2790
2783
|
<xsl:attribute name="font-size">80%</xsl:attribute>
|
2791
|
-
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
2792
2784
|
|
2793
2785
|
<xsl:attribute name="alignment-baseline">hanging</xsl:attribute>
|
2794
2786
|
|
2795
|
-
</xsl:attribute-set> <!-- table-fn-
|
2787
|
+
</xsl:attribute-set> <!-- table-fmt-fn-label-style -->
|
2796
2788
|
|
2797
|
-
<xsl:template name="refine_table-fn-
|
2789
|
+
<xsl:template name="refine_table-fmt-fn-label-style">
|
2798
2790
|
|
2799
2791
|
</xsl:template>
|
2800
2792
|
|
@@ -2809,11 +2801,18 @@
|
|
2809
2801
|
</xsl:attribute-set>
|
2810
2802
|
|
2811
2803
|
<xsl:attribute-set name="figure-fn-number-style">
|
2812
|
-
<xsl:attribute name="font-size">80%</xsl:attribute>
|
2813
2804
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
2805
|
+
</xsl:attribute-set> <!-- figure-fn-number-style -->
|
2806
|
+
|
2807
|
+
<xsl:attribute-set name="figure-fmt-fn-label-style">
|
2808
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
2814
2809
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
2815
2810
|
|
2816
|
-
</xsl:attribute-set>
|
2811
|
+
</xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
|
2812
|
+
|
2813
|
+
<xsl:template name="refine_figure-fmt-fn-label-style">
|
2814
|
+
|
2815
|
+
</xsl:template>
|
2817
2816
|
|
2818
2817
|
<xsl:attribute-set name="figure-fn-body-style">
|
2819
2818
|
<xsl:attribute name="text-align">justify</xsl:attribute>
|
@@ -4337,9 +4336,13 @@
|
|
4337
4336
|
|
4338
4337
|
<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']"/>
|
4339
4338
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
4340
|
-
|
4341
|
-
|
4342
|
-
|
4339
|
+
<!-- <xsl:choose>
|
4340
|
+
<xsl:when test="$namespace = 'plateau'"></xsl:when>
|
4341
|
+
<xsl:otherwise>
|
4342
|
+
|
4343
|
+
</xsl:otherwise>
|
4344
|
+
</xsl:choose> -->
|
4345
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
|
4343
4346
|
</xsl:if>
|
4344
4347
|
|
4345
4348
|
<xsl:choose>
|
@@ -4386,7 +4389,7 @@
|
|
4386
4389
|
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
4387
4390
|
</xsl:when>
|
4388
4391
|
<xsl:otherwise>
|
4389
|
-
<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 -->
|
4392
|
+
<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 -->
|
4390
4393
|
</xsl:otherwise>
|
4391
4394
|
</xsl:choose>
|
4392
4395
|
|
@@ -4397,13 +4400,26 @@
|
|
4397
4400
|
|
4398
4401
|
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
4399
4402
|
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4403
|
+
<!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
|
4404
|
+
|
4405
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
4406
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
4407
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
4408
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
4409
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
4410
|
+
</xsl:call-template>
|
4411
|
+
</xsl:for-each>
|
4412
|
+
|
4413
|
+
<!-- https://github.com/metanorma/metanorma-plateau/issues/171
|
4414
|
+
<xsl:if test="$namespace = 'plateau'">
|
4415
|
+
<xsl:apply-templates select="*[not(local-name()='thead') and not(local-name()='tbody') and not(local-name()='tfoot') and not(local-name()='name')]" />
|
4416
|
+
<xsl:for-each select="*[local-name()='tbody']"> - select context to tbody -
|
4417
|
+
<xsl:variable name="table_fn_block">
|
4418
|
+
<xsl:call-template name="table_fn_display" />
|
4419
|
+
</xsl:variable>
|
4420
|
+
<xsl:copy-of select="$table_fn_block"/>
|
4421
|
+
</xsl:for-each>
|
4422
|
+
</xsl:if> -->
|
4407
4423
|
|
4408
4424
|
<xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark -->
|
4409
4425
|
<fo:block keep-with-previous="always" line-height="0.1">
|
@@ -5096,6 +5112,7 @@
|
|
5096
5112
|
<xsl:with-param name="key">continued</xsl:with-param>
|
5097
5113
|
</xsl:call-template>
|
5098
5114
|
</xsl:variable>
|
5115
|
+
|
5099
5116
|
<xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
|
5100
5117
|
<xsl:variable name="title_continued">
|
5101
5118
|
<xsl:value-of select="$title_continued_in_parenthesis"/>
|
@@ -5246,6 +5263,8 @@
|
|
5246
5263
|
|
5247
5264
|
<xsl:template name="setTableRowAttributes">
|
5248
5265
|
|
5266
|
+
<xsl:call-template name="setColors"/>
|
5267
|
+
|
5249
5268
|
</xsl:template> <!-- setTableRowAttributes -->
|
5250
5269
|
<!-- ===================== -->
|
5251
5270
|
<!-- END Table's row processing -->
|
@@ -5297,6 +5316,7 @@
|
|
5297
5316
|
</xsl:attribute>
|
5298
5317
|
</xsl:if>
|
5299
5318
|
<xsl:call-template name="display-align"/>
|
5319
|
+
<xsl:call-template name="setColors"/>
|
5300
5320
|
</xsl:template>
|
5301
5321
|
|
5302
5322
|
<xsl:template name="display-align">
|
@@ -5312,6 +5332,29 @@
|
|
5312
5332
|
</xsl:if>
|
5313
5333
|
</xsl:template>
|
5314
5334
|
|
5335
|
+
<xsl:template name="setColors">
|
5336
|
+
<xsl:variable name="styles__">
|
5337
|
+
<xsl:call-template name="split">
|
5338
|
+
<xsl:with-param name="pText" select="concat(@style,';')"/>
|
5339
|
+
<xsl:with-param name="sep" select="';'"/>
|
5340
|
+
</xsl:call-template>
|
5341
|
+
</xsl:variable>
|
5342
|
+
<xsl:variable name="quot">"</xsl:variable>
|
5343
|
+
<xsl:variable name="styles_">
|
5344
|
+
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
5345
|
+
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
5346
|
+
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
5347
|
+
<xsl:if test="$key = 'color' or $key = 'background-color'">
|
5348
|
+
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
5349
|
+
</xsl:if>
|
5350
|
+
</xsl:for-each>
|
5351
|
+
</xsl:variable>
|
5352
|
+
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
|
5353
|
+
<xsl:for-each select="$styles/style">
|
5354
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
5355
|
+
</xsl:for-each>
|
5356
|
+
</xsl:template>
|
5357
|
+
|
5315
5358
|
<!-- cell in table body, footer -->
|
5316
5359
|
<xsl:template match="*[local-name()='td']" name="td">
|
5317
5360
|
<fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
|
@@ -5323,17 +5366,28 @@
|
|
5323
5366
|
|
5324
5367
|
<xsl:call-template name="refine_table-cell-style"/>
|
5325
5368
|
|
5369
|
+
<xsl:call-template name="setTableCellAttributes"/>
|
5370
|
+
|
5326
5371
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
5327
5372
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
5328
5373
|
</xsl:if>
|
5329
5374
|
|
5330
|
-
<xsl:call-template name="setTableCellAttributes"/>
|
5331
|
-
|
5332
5375
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
5333
5376
|
<xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
|
5334
5377
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
5335
5378
|
</xsl:if>
|
5336
5379
|
|
5380
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
5381
|
+
<xsl:if test="@colspan and *[local-name() = 'note'][@type = 'units']">
|
5382
|
+
<xsl:attribute name="text-align">right</xsl:attribute>
|
5383
|
+
<xsl:attribute name="border">none</xsl:attribute>
|
5384
|
+
<xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
|
5385
|
+
<xsl:attribute name="border-top">1pt solid white</xsl:attribute>
|
5386
|
+
<xsl:attribute name="border-left">1pt solid white</xsl:attribute>
|
5387
|
+
<xsl:attribute name="border-right">1pt solid white</xsl:attribute>
|
5388
|
+
</xsl:if>
|
5389
|
+
</xsl:if>
|
5390
|
+
|
5337
5391
|
<fo:block role="SKIP">
|
5338
5392
|
|
5339
5393
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
@@ -5352,7 +5406,8 @@
|
|
5352
5406
|
</fo:table-cell>
|
5353
5407
|
</xsl:template> <!-- td -->
|
5354
5408
|
|
5355
|
-
|
5409
|
+
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
5410
|
+
<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">
|
5356
5411
|
|
5357
5412
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
5358
5413
|
<xsl:copy-of select="@id"/>
|
@@ -5373,65 +5428,54 @@
|
|
5373
5428
|
|
5374
5429
|
</xsl:template> <!-- table/note -->
|
5375
5430
|
|
5376
|
-
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
|
5431
|
+
<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">
|
5377
5432
|
<xsl:apply-templates/>
|
5378
5433
|
</xsl:template>
|
5379
5434
|
|
5380
5435
|
<!-- ===================== -->
|
5381
5436
|
<!-- Footnotes processing -->
|
5382
5437
|
<!-- ===================== -->
|
5438
|
+
|
5439
|
+
<!-- document text (not figures, or tables) footnotes -->
|
5440
|
+
<xsl:variable name="footnotes_">
|
5441
|
+
<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 -->
|
5442
|
+
<!-- <xsl:copy-of select="."/> -->
|
5443
|
+
<xsl:variable name="update_xml_step1">
|
5444
|
+
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
5445
|
+
</xsl:variable>
|
5446
|
+
<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
|
5447
|
+
</xsl:for-each>
|
5448
|
+
</xsl:variable>
|
5449
|
+
<xsl:variable name="footnotes" select="xalan:nodeset($footnotes_)"/>
|
5450
|
+
|
5383
5451
|
<!--
|
5384
5452
|
<fn reference="1">
|
5385
5453
|
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
5386
5454
|
</fn>
|
5387
5455
|
-->
|
5388
|
-
<!-- footnotes in text (title, bibliography, main body, table's, figure's names
|
5456
|
+
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
5457
|
+
<!-- fn in text -->
|
5389
5458
|
<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">
|
5390
5459
|
|
5391
|
-
<!-- list of
|
5460
|
+
<!-- list of unique footnotes -->
|
5392
5461
|
<xsl:variable name="p_fn_">
|
5393
5462
|
<xsl:call-template name="get_fn_list"/>
|
5394
|
-
<!-- <xsl:choose>
|
5395
|
-
<xsl:when test="$namespace = 'jis'">
|
5396
|
-
<xsl:call-template name="get_fn_list_for_element"/>
|
5397
|
-
</xsl:when>
|
5398
|
-
<xsl:otherwise>
|
5399
|
-
<xsl:call-template name="get_fn_list"/>
|
5400
|
-
</xsl:otherwise>
|
5401
|
-
</xsl:choose> -->
|
5402
5463
|
</xsl:variable>
|
5403
5464
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
5404
5465
|
|
5405
5466
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
5406
|
-
|
5407
|
-
<xsl:variable name="reference_">
|
5408
|
-
<xsl:value-of select="@reference"/>
|
5409
|
-
<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
|
5410
|
-
</xsl:variable>
|
5411
|
-
<xsl:variable name="reference" select="normalize-space($reference_)"/>
|
5467
|
+
|
5412
5468
|
<!-- fn sequence number in document -->
|
5413
|
-
<xsl:variable name="current_fn_number"
|
5414
|
-
|
5415
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
5416
|
-
<xsl:otherwise>
|
5417
|
-
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
5418
|
-
</xsl:otherwise>
|
5419
|
-
</xsl:choose>
|
5420
|
-
</xsl:variable>
|
5469
|
+
<xsl:variable name="current_fn_number" select="@reference"/>
|
5470
|
+
|
5421
5471
|
<xsl:variable name="current_fn_number_text">
|
5422
5472
|
|
5423
5473
|
<xsl:value-of select="$current_fn_number"/>
|
5424
5474
|
|
5425
5475
|
</xsl:variable>
|
5426
5476
|
|
5427
|
-
<xsl:variable name="ref_id"
|
5428
|
-
|
5429
|
-
<xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
|
5430
|
-
<xsl:otherwise>
|
5431
|
-
<xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
5432
|
-
</xsl:otherwise>
|
5433
|
-
</xsl:choose>
|
5434
|
-
</xsl:variable>
|
5477
|
+
<xsl:variable name="ref_id" select="@target"/>
|
5478
|
+
|
5435
5479
|
<xsl:variable name="footnote_inline">
|
5436
5480
|
<fo:inline role="Reference">
|
5437
5481
|
|
@@ -5476,7 +5520,9 @@
|
|
5476
5520
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
5477
5521
|
<xsl:copy-of select="$footnote_inline"/>
|
5478
5522
|
</xsl:when>
|
5523
|
+
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
5479
5524
|
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
5525
|
+
|
5480
5526
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
5481
5527
|
<xsl:copy-of select="$footnote_inline"/>
|
5482
5528
|
<fo:footnote-body role="Note">
|
@@ -5493,7 +5539,10 @@
|
|
5493
5539
|
<xsl:value-of select="$current_fn_number_text"/>
|
5494
5540
|
|
5495
5541
|
</fo:inline>
|
5496
|
-
<xsl:apply-templates/>
|
5542
|
+
<!-- <xsl:apply-templates /> -->
|
5543
|
+
<!-- <ref_id><xsl:value-of select="$ref_id"/></ref_id>
|
5544
|
+
<here><xsl:copy-of select="$footnotes"/></here> -->
|
5545
|
+
<xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
|
5497
5546
|
</xsl:variable>
|
5498
5547
|
|
5499
5548
|
<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
|
@@ -5547,77 +5596,136 @@
|
|
5547
5596
|
</xsl:choose>
|
5548
5597
|
</xsl:template>
|
5549
5598
|
|
5550
|
-
<xsl:template name="get_fn_list_for_element">
|
5551
|
-
<xsl:choose>
|
5552
|
-
<xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
|
5553
|
-
<fn gen_id="{generate-id(.)}">
|
5554
|
-
<xsl:copy-of select="@*"/>
|
5555
|
-
<xsl:copy-of select="node()"/>
|
5556
|
-
</fn>
|
5557
|
-
</xsl:when>
|
5558
|
-
<xsl:otherwise>
|
5559
|
-
<xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
|
5560
|
-
<xsl:variable name="element_id" select="@id"/>
|
5561
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
5562
|
-
<!-- copy unique fn -->
|
5563
|
-
<fn gen_id="{generate-id(.)}">
|
5564
|
-
<xsl:copy-of select="@*"/>
|
5565
|
-
<xsl:copy-of select="node()"/>
|
5566
|
-
</fn>
|
5567
|
-
</xsl:for-each>
|
5568
|
-
</xsl:for-each>
|
5569
|
-
</xsl:otherwise>
|
5570
|
-
</xsl:choose>
|
5571
|
-
</xsl:template>
|
5572
5599
|
<!-- ============================ -->
|
5573
5600
|
<!-- table's footnotes rendering -->
|
5574
5601
|
<!-- ============================ -->
|
5575
|
-
<xsl:template name="table_fn_display">
|
5576
|
-
<xsl:variable name="references">
|
5577
5602
|
|
5603
|
+
<!-- table/fmt-footnote-container -->
|
5604
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'fmt-footnote-container']"/>
|
5605
|
+
|
5606
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'fmt-footnote-container']">
|
5607
|
+
<xsl:for-each select=".">
|
5608
|
+
<xsl:call-template name="table_fn_display"/>
|
5609
|
+
</xsl:for-each>
|
5610
|
+
</xsl:template>
|
5611
|
+
|
5612
|
+
<xsl:template name="table_fn_display">
|
5613
|
+
<!-- <xsl:variable name="references">
|
5614
|
+
<xsl:if test="$namespace = 'bsi'">
|
5615
|
+
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) = 'name']">
|
5616
|
+
<xsl:call-template name="create_fn" />
|
5617
|
+
</xsl:for-each>
|
5618
|
+
</xsl:if>
|
5578
5619
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
5579
|
-
<xsl:call-template name="create_fn"/>
|
5620
|
+
<xsl:call-template name="create_fn" />
|
5580
5621
|
</xsl:for-each>
|
5581
|
-
</xsl:variable>
|
5582
|
-
|
5583
|
-
<xsl:for-each select="xalan:nodeset($references)//fn">
|
5622
|
+
</xsl:variable> -->
|
5623
|
+
<!-- <xsl:for-each select="xalan:nodeset($references)//fn">
|
5584
5624
|
<xsl:variable name="reference" select="@reference"/>
|
5585
|
-
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
5625
|
+
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
|
5626
|
+
<xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
|
5586
5627
|
|
5587
5628
|
<fo:block xsl:use-attribute-sets="table-fn-style">
|
5629
|
+
<xsl:copy-of select="@id"/>
|
5588
5630
|
<xsl:call-template name="refine_table-fn-style"/>
|
5589
|
-
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
|
5590
|
-
<xsl:call-template name="refine_table-fn-number-style"/>
|
5591
|
-
|
5592
|
-
<xsl:value-of select="@reference"/>
|
5593
5631
|
|
5594
|
-
|
5595
|
-
|
5596
|
-
|
5597
|
-
</xsl:if> -->
|
5632
|
+
<xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
|
5633
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5634
|
+
</xsl:apply-templates>
|
5598
5635
|
|
5599
|
-
</fo:inline>
|
5600
5636
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
5601
|
-
<xsl:copy-of select="./node()"/>
|
5637
|
+
<!-- <xsl:copy-of select="./node()"/> -->
|
5638
|
+
<xsl:apply-templates/>
|
5602
5639
|
</fo:inline>
|
5603
5640
|
|
5604
5641
|
</fo:block>
|
5605
5642
|
|
5606
|
-
</xsl:if>
|
5643
|
+
<!-- </xsl:if> -->
|
5607
5644
|
</xsl:for-each>
|
5608
5645
|
</xsl:template> <!-- table_fn_display -->
|
5609
5646
|
|
5647
|
+
<!-- fmt-fn-body/fmt-fn-label in text -->
|
5648
|
+
<xsl:template match="*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"/>
|
5649
|
+
|
5650
|
+
<!-- table//fmt-fn-body//fmt-fn-label -->
|
5651
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
|
5652
|
+
<xsl:param name="process">false</xsl:param>
|
5653
|
+
<xsl:if test="$process = 'true'">
|
5654
|
+
<fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
|
5655
|
+
|
5656
|
+
<!-- tab is padding-right -->
|
5657
|
+
<xsl:apply-templates select=".//*[local-name() = 'tab']">
|
5658
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5659
|
+
</xsl:apply-templates>
|
5660
|
+
|
5661
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
5662
|
+
<fo:inline font-style="normal">(</fo:inline>
|
5663
|
+
</xsl:if> -->
|
5664
|
+
|
5665
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
5666
|
+
<xsl:text>※</xsl:text>
|
5667
|
+
</xsl:if> -->
|
5668
|
+
|
5669
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
5670
|
+
<!-- <xsl:value-of select="normalize-space()"/> -->
|
5671
|
+
<xsl:apply-templates/>
|
5672
|
+
|
5673
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
5674
|
+
<fo:inline font-style="normal">)</fo:inline>
|
5675
|
+
</xsl:if> -->
|
5676
|
+
|
5677
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
5678
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
5679
|
+
<xsl:text>)</xsl:text>
|
5680
|
+
</xsl:if> -->
|
5681
|
+
|
5682
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
5683
|
+
<xsl:text>:</xsl:text>
|
5684
|
+
</xsl:if> -->
|
5685
|
+
|
5686
|
+
</fo:inline>
|
5687
|
+
</xsl:if>
|
5688
|
+
</xsl:template> <!-- fmt-fn-body//fmt-fn-label -->
|
5689
|
+
|
5690
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
|
5691
|
+
<xsl:param name="process">false</xsl:param>
|
5692
|
+
<xsl:if test="$process = 'true'">
|
5693
|
+
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
5694
|
+
|
5695
|
+
</xsl:if>
|
5696
|
+
</xsl:template>
|
5697
|
+
|
5698
|
+
<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
|
5699
|
+
<fo:inline xsl:use-attribute-sets="table-fmt-fn-label-style" role="SKIP">
|
5700
|
+
<xsl:call-template name="refine_table-fmt-fn-label-style"/>
|
5701
|
+
<xsl:apply-templates/>
|
5702
|
+
</fo:inline>
|
5703
|
+
</xsl:template>
|
5704
|
+
|
5705
|
+
<!-- <xsl:template match="*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']"/> -->
|
5706
|
+
<!--
|
5610
5707
|
<xsl:template name="create_fn">
|
5611
5708
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
5612
|
-
<xsl:if test="ancestor::*[local-name()='table'][1]/@id">
|
5709
|
+
<xsl:if test="ancestor::*[local-name()='table'][1]/@id"> - for footnotes in tables -
|
5613
5710
|
<xsl:attribute name="id">
|
5614
5711
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
5615
5712
|
</xsl:attribute>
|
5616
5713
|
</xsl:if>
|
5617
|
-
|
5618
|
-
|
5714
|
+
<xsl:if test="$namespace = 'itu'">
|
5715
|
+
<xsl:if test="ancestor::*[local-name()='preface']">
|
5716
|
+
<xsl:attribute name="preface">true</xsl:attribute>
|
5717
|
+
</xsl:if>
|
5718
|
+
</xsl:if>
|
5719
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
5720
|
+
<xsl:attribute name="id">
|
5721
|
+
<xsl:value-of select="@reference"/>
|
5722
|
+
<xsl:text>_</xsl:text>
|
5723
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
5724
|
+
</xsl:attribute>
|
5725
|
+
</xsl:if>
|
5726
|
+
<xsl:apply-templates />
|
5619
5727
|
</fn>
|
5620
|
-
</xsl:template>
|
5728
|
+
</xsl:template> -->
|
5621
5729
|
|
5622
5730
|
<!-- footnotes for table's name rendering -->
|
5623
5731
|
<xsl:template name="table_name_fn_display">
|
@@ -5636,123 +5744,171 @@
|
|
5636
5744
|
<!-- ============================ -->
|
5637
5745
|
<!-- figure's footnotes rendering -->
|
5638
5746
|
<!-- ============================ -->
|
5639
|
-
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
5640
5747
|
|
5641
|
-
|
5642
|
-
|
5643
|
-
|
5644
|
-
|
5645
|
-
|
5646
|
-
<xsl:variable name="figure_id" select="normalize-space($figure_id_)"/>
|
5748
|
+
<!-- figure/fmt-footnote-container -->
|
5749
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-footnote-container']"/>
|
5750
|
+
|
5751
|
+
<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
|
5752
|
+
<xsl:template name="figure_fn_display">
|
5647
5753
|
|
5648
|
-
<!-- all footnotes relates to the current figure -->
|
5649
5754
|
<xsl:variable name="references">
|
5650
|
-
<xsl:for-each select="
|
5651
|
-
<
|
5652
|
-
|
5653
|
-
|
5755
|
+
<xsl:for-each select="./*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
|
5756
|
+
<xsl:variable name="curr_id" select="@id"/>
|
5757
|
+
<!-- <curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
5758
|
+
<curr><xsl:copy-of select="."/></curr>
|
5759
|
+
<ancestor><xsl:copy-of select="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn']]]"/></ancestor> -->
|
5760
|
+
<xsl:choose>
|
5761
|
+
<!-- skip figure/name/fn -->
|
5762
|
+
<xsl:when test="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn'][@target = $curr_id]]]"><!-- skip --></xsl:when>
|
5763
|
+
<xsl:otherwise>
|
5764
|
+
<xsl:element name="figure" namespace="{$namespace_full}">
|
5765
|
+
<xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
|
5766
|
+
<xsl:copy-of select="."/>
|
5767
|
+
</xsl:element>
|
5768
|
+
</xsl:element>
|
5769
|
+
</xsl:otherwise>
|
5770
|
+
</xsl:choose>
|
5654
5771
|
</xsl:for-each>
|
5655
5772
|
</xsl:variable>
|
5773
|
+
<!-- <references><xsl:copy-of select="$references"/></references> -->
|
5656
5774
|
|
5657
|
-
<xsl:if test="xalan:nodeset($references)
|
5775
|
+
<xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
|
5658
5776
|
|
5659
5777
|
<xsl:variable name="key_iso">
|
5660
5778
|
true
|
5661
5779
|
</xsl:variable>
|
5662
5780
|
|
5663
5781
|
<fo:block>
|
5782
|
+
<!-- current hierarchy is 'figure' element -->
|
5783
|
+
<xsl:variable name="following_dl_colwidths">
|
5784
|
+
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
5785
|
+
<xsl:variable name="simple-table">
|
5786
|
+
<!-- <xsl:variable name="doc_ns">
|
5787
|
+
<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
|
5788
|
+
</xsl:variable>
|
5789
|
+
<xsl:variable name="ns">
|
5790
|
+
<xsl:choose>
|
5791
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
5792
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
5793
|
+
</xsl:when>
|
5794
|
+
<xsl:otherwise>
|
5795
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
5796
|
+
</xsl:otherwise>
|
5797
|
+
</xsl:choose>
|
5798
|
+
</xsl:variable> -->
|
5664
5799
|
|
5665
|
-
|
5666
|
-
|
5667
|
-
|
5668
|
-
|
5669
|
-
|
5670
|
-
|
5671
|
-
</xsl:variable>
|
5672
|
-
<xsl:variable name="ns">
|
5673
|
-
<xsl:choose>
|
5674
|
-
<xsl:when test="normalize-space($doc_ns) != ''">
|
5675
|
-
<xsl:value-of select="normalize-space($doc_ns)"/>
|
5676
|
-
</xsl:when>
|
5677
|
-
<xsl:otherwise>
|
5678
|
-
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
5679
|
-
</xsl:otherwise>
|
5680
|
-
</xsl:choose>
|
5681
|
-
</xsl:variable> -->
|
5800
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
5801
|
+
<tbody>
|
5802
|
+
<xsl:apply-templates mode="dl"/>
|
5803
|
+
</tbody>
|
5804
|
+
</xsl:for-each>
|
5805
|
+
</xsl:variable>
|
5682
5806
|
|
5683
|
-
|
5684
|
-
|
5685
|
-
|
5686
|
-
|
5687
|
-
</xsl:for-each>
|
5688
|
-
</xsl:variable>
|
5807
|
+
<xsl:call-template name="calculate-column-widths">
|
5808
|
+
<xsl:with-param name="cols-count" select="2"/>
|
5809
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
5810
|
+
</xsl:call-template>
|
5689
5811
|
|
5690
|
-
|
5691
|
-
|
5692
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
5693
|
-
</xsl:call-template>
|
5812
|
+
</xsl:if>
|
5813
|
+
</xsl:variable>
|
5694
5814
|
|
5695
|
-
|
5696
|
-
|
5815
|
+
<xsl:variable name="maxlength_dt">
|
5816
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
5817
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
5818
|
+
</xsl:for-each>
|
5819
|
+
</xsl:variable>
|
5697
5820
|
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
</xsl:for-each>
|
5702
|
-
</xsl:variable>
|
5821
|
+
<fo:table width="95%" table-layout="fixed">
|
5822
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
5823
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
5703
5824
|
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5825
|
+
</xsl:if>
|
5826
|
+
<xsl:choose>
|
5827
|
+
<!-- if there 'dl', then set same columns width -->
|
5828
|
+
<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
|
5829
|
+
<xsl:call-template name="setColumnWidth_dl">
|
5830
|
+
<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
|
5831
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
5832
|
+
</xsl:call-template>
|
5833
|
+
</xsl:when>
|
5834
|
+
<xsl:otherwise>
|
5835
|
+
<fo:table-column column-width="5%"/>
|
5836
|
+
<fo:table-column column-width="95%"/>
|
5837
|
+
</xsl:otherwise>
|
5838
|
+
</xsl:choose>
|
5839
|
+
<fo:table-body>
|
5840
|
+
<!-- <xsl:for-each select="xalan:nodeset($references)//fn"> -->
|
5841
|
+
<xsl:for-each select="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
|
5707
5842
|
|
5708
|
-
|
5709
|
-
<xsl:
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
<fo:table-column column-width="5%"/>
|
5719
|
-
<fo:table-column column-width="95%"/>
|
5720
|
-
</xsl:otherwise>
|
5721
|
-
</xsl:choose>
|
5722
|
-
<fo:table-body>
|
5723
|
-
<xsl:for-each select="xalan:nodeset($references)//fn">
|
5724
|
-
<xsl:variable name="reference" select="@reference"/>
|
5725
|
-
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
5726
|
-
<fo:table-row>
|
5727
|
-
<fo:table-cell>
|
5728
|
-
<fo:block>
|
5729
|
-
<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
|
5730
|
-
<xsl:value-of select="@reference"/>
|
5843
|
+
<xsl:variable name="reference" select="@reference"/>
|
5844
|
+
<!-- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
|
5845
|
+
<fo:table-row>
|
5846
|
+
<fo:table-cell>
|
5847
|
+
<fo:block>
|
5848
|
+
|
5849
|
+
<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fmt-fn-label-style">
|
5850
|
+
<!-- <xsl:attribute name="padding-right">0mm</xsl:attribute> -->
|
5851
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
5852
|
+
<xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/>
|
5731
5853
|
</fo:inline>
|
5732
|
-
</fo:block>
|
5733
|
-
</fo:table-cell>
|
5734
|
-
<fo:table-cell>
|
5735
|
-
<fo:block xsl:use-attribute-sets="figure-fn-body-style">
|
5736
|
-
<xsl:if test="normalize-space($key_iso) = 'true'">
|
5737
5854
|
|
5738
|
-
|
5855
|
+
</fo:block>
|
5856
|
+
</fo:table-cell>
|
5857
|
+
<fo:table-cell>
|
5858
|
+
<fo:block xsl:use-attribute-sets="figure-fn-body-style">
|
5859
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
5860
|
+
|
5861
|
+
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
5739
5862
|
|
5740
|
-
|
5741
|
-
<xsl:copy-of select="./node()"/>
|
5742
|
-
</fo:block>
|
5743
|
-
</fo:table-cell>
|
5744
|
-
</fo:table-row>
|
5745
|
-
</xsl:if>
|
5746
|
-
</xsl:for-each>
|
5747
|
-
</fo:table-body>
|
5748
|
-
</fo:table>
|
5863
|
+
</xsl:if>
|
5749
5864
|
|
5865
|
+
<!-- <xsl:copy-of select="./node()"/> -->
|
5866
|
+
<xsl:apply-templates/>
|
5867
|
+
</fo:block>
|
5868
|
+
</fo:table-cell>
|
5869
|
+
</fo:table-row>
|
5870
|
+
<!-- </xsl:if> -->
|
5871
|
+
</xsl:for-each>
|
5872
|
+
</fo:table-body>
|
5873
|
+
</fo:table>
|
5750
5874
|
</fo:block>
|
5751
5875
|
</xsl:if>
|
5752
|
-
</xsl:template> <!--
|
5876
|
+
</xsl:template> <!-- figure_fn_display -->
|
5877
|
+
|
5878
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
|
5879
|
+
<xsl:param name="process">false</xsl:param>
|
5880
|
+
<xsl:if test="$process = 'true'">
|
5881
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
|
5882
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
5883
|
+
|
5884
|
+
<!-- tab is padding-right -->
|
5885
|
+
<xsl:apply-templates select=".//*[local-name() = 'tab']">
|
5886
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5887
|
+
</xsl:apply-templates>
|
5888
|
+
|
5889
|
+
<xsl:apply-templates/>
|
5890
|
+
|
5891
|
+
</fo:inline>
|
5892
|
+
</xsl:if>
|
5893
|
+
</xsl:template> <!-- figure//fmt-fn-body//fmt-fn-label -->
|
5894
|
+
|
5895
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
|
5896
|
+
<xsl:param name="process">false</xsl:param>
|
5897
|
+
<xsl:if test="$process = 'true'">
|
5898
|
+
|
5899
|
+
</xsl:if>
|
5900
|
+
</xsl:template>
|
5901
|
+
|
5902
|
+
<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
|
5903
|
+
<fo:inline xsl:use-attribute-sets="figure-fmt-fn-label-style" role="SKIP">
|
5904
|
+
<xsl:call-template name="refine_figure-fmt-fn-label-style"/>
|
5905
|
+
<xsl:apply-templates/>
|
5906
|
+
</fo:inline>
|
5907
|
+
</xsl:template>
|
5753
5908
|
|
5754
5909
|
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
5755
5910
|
<!-- figure's footnote label -->
|
5911
|
+
<!-- figure/dl[@key = 'true']/dt/p/sup -->
|
5756
5912
|
<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">
|
5757
5913
|
<xsl:variable name="key_iso">
|
5758
5914
|
true
|
@@ -5761,7 +5917,7 @@
|
|
5761
5917
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
5762
5918
|
|
5763
5919
|
</xsl:if>
|
5764
|
-
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
5920
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
|
5765
5921
|
<!-- <xsl:value-of select="@reference"/> -->
|
5766
5922
|
<xsl:apply-templates/>
|
5767
5923
|
</fo:inline>
|
@@ -5771,38 +5927,65 @@
|
|
5771
5927
|
<!-- END: figure's footnotes rendering -->
|
5772
5928
|
<!-- ============================ -->
|
5773
5929
|
|
5774
|
-
<!-- fn reference in the
|
5930
|
+
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
5931
|
+
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
5775
5932
|
<xsl:template match="*[local-name()='fn']">
|
5776
5933
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
5777
5934
|
|
5778
5935
|
<xsl:call-template name="refine_fn-reference-style"/>
|
5779
5936
|
|
5780
|
-
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
5781
|
-
|
5782
|
-
|
5937
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
5938
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
5939
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
5940
|
+
<!-- <xsl:attribute name="internal-destination">
|
5783
5941
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
5784
5942
|
</xsl:attribute>
|
5785
5943
|
</xsl:if>
|
5944
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
5945
|
+
<xsl:attribute name="internal-destination">
|
5946
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
5947
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
5948
|
+
</xsl:attribute>
|
5949
|
+
</xsl:if> -->
|
5950
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
5951
|
+
<xsl:text>※</xsl:text>
|
5952
|
+
</xsl:if> -->
|
5953
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
5786
5954
|
|
5787
|
-
|
5955
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
5788
5956
|
|
5957
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
5958
|
+
<xsl:text>)</xsl:text>
|
5959
|
+
</xsl:if> -->
|
5789
5960
|
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
5790
5961
|
<!-- <xsl:if test="$namespace = 'jis'">
|
5791
5962
|
<fo:inline font-weight="normal">)</fo:inline>
|
5792
5963
|
</xsl:if> -->
|
5793
5964
|
</fo:basic-link>
|
5794
5965
|
</fo:inline>
|
5795
|
-
</xsl:template>
|
5966
|
+
</xsl:template> <!-- fn -->
|
5796
5967
|
|
5968
|
+
<!-- fn/text() -->
|
5797
5969
|
<xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
5798
5970
|
<fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
|
5799
5971
|
</xsl:template>
|
5800
5972
|
|
5801
|
-
|
5973
|
+
<!-- fn//p fmt-fn-body//p -->
|
5974
|
+
<xsl:template match="*[local-name()='fn']//*[local-name()='p'] | *[local-name() = 'fmt-fn-body']//*[local-name()='p']">
|
5802
5975
|
<fo:inline role="P">
|
5803
5976
|
<xsl:apply-templates/>
|
5804
5977
|
</fo:inline>
|
5805
5978
|
</xsl:template>
|
5979
|
+
|
5980
|
+
<xsl:template name="insertFootnoteSeparatorCommon">
|
5981
|
+
<xsl:param name="leader_length">30%</xsl:param>
|
5982
|
+
<fo:static-content flow-name="xsl-footnote-separator">
|
5983
|
+
<fo:block>
|
5984
|
+
<fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
|
5985
|
+
</fo:block>
|
5986
|
+
</fo:static-content>
|
5987
|
+
</xsl:template>
|
5988
|
+
|
5806
5989
|
<!-- ===================== -->
|
5807
5990
|
<!-- END Footnotes processing -->
|
5808
5991
|
<!-- ===================== -->
|
@@ -6083,11 +6266,11 @@
|
|
6083
6266
|
<xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
|
6084
6267
|
<!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
|
6085
6268
|
|
6086
|
-
|
6087
|
-
|
6088
|
-
|
6089
|
-
|
6090
|
-
|
6269
|
+
<xsl:call-template name="setColumnWidth_dl">
|
6270
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
6271
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
6272
|
+
<xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
|
6273
|
+
</xsl:call-template>
|
6091
6274
|
|
6092
6275
|
<fo:table-body>
|
6093
6276
|
|
@@ -6121,6 +6304,14 @@
|
|
6121
6304
|
|
6122
6305
|
</xsl:template> <!-- END: dl -->
|
6123
6306
|
|
6307
|
+
<xsl:template match="@*|node()" mode="dt_clean">
|
6308
|
+
<xsl:copy>
|
6309
|
+
<xsl:apply-templates select="@*|node()" mode="dt_clean"/>
|
6310
|
+
</xsl:copy>
|
6311
|
+
</xsl:template>
|
6312
|
+
|
6313
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="dt_clean"/>
|
6314
|
+
|
6124
6315
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6125
6316
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
6126
6317
|
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
@@ -6160,10 +6351,12 @@
|
|
6160
6351
|
<!-- ignore 'p' with 'where' in formula, before 'dl' -->
|
6161
6352
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
|
6162
6353
|
|
6354
|
+
<!-- dl/name -->
|
6163
6355
|
<xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
|
6164
6356
|
<xsl:param name="process">false</xsl:param>
|
6165
6357
|
<xsl:if test="$process = 'true'">
|
6166
6358
|
<fo:block xsl:use-attribute-sets="dl-name-style">
|
6359
|
+
|
6167
6360
|
<xsl:apply-templates/>
|
6168
6361
|
</fo:block>
|
6169
6362
|
</xsl:if>
|
@@ -6177,6 +6370,10 @@
|
|
6177
6370
|
<!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
|
6178
6371
|
|
6179
6372
|
<xsl:choose>
|
6373
|
+
<!-- <xsl:when test="@class = 'formula_dl' and local-name(..) = 'figure'">
|
6374
|
+
<fo:table-column column-width="10%"/>
|
6375
|
+
<fo:table-column column-width="90%"/>
|
6376
|
+
</xsl:when> -->
|
6180
6377
|
<xsl:when test="xalan:nodeset($colwidths)/autolayout">
|
6181
6378
|
<xsl:call-template name="insertTableColumnWidth">
|
6182
6379
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
@@ -6973,7 +7170,7 @@
|
|
6973
7170
|
<xsl:choose>
|
6974
7171
|
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
6975
7172
|
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
6976
|
-
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
7173
|
+
<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
|
6977
7174
|
</xsl:when>
|
6978
7175
|
<xsl:otherwise>
|
6979
7176
|
<xsl:apply-templates/>
|
@@ -6981,7 +7178,7 @@
|
|
6981
7178
|
</xsl:choose>
|
6982
7179
|
</xsl:template>
|
6983
7180
|
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
6984
|
-
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
7181
|
+
<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:value-of select="."/></fo:inline>
|
6985
7182
|
</xsl:template>
|
6986
7183
|
|
6987
7184
|
<xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
|
@@ -8021,24 +8218,26 @@
|
|
8021
8218
|
<xsl:apply-templates select="." mode="mathml"/>
|
8022
8219
|
</xsl:variable>
|
8023
8220
|
|
8024
|
-
<fo:instream-foreign-object fox:alt-text="Math">
|
8221
|
+
<fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
|
8025
8222
|
|
8026
8223
|
<xsl:call-template name="refine_mathml_insteam_object_style"/>
|
8027
8224
|
|
8028
|
-
|
8029
|
-
|
8030
|
-
|
8031
|
-
<xsl:
|
8032
|
-
|
8033
|
-
|
8034
|
-
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
8035
|
-
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
8036
|
-
<!-- put Mathin Alternate Text -->
|
8037
|
-
<xsl:attribute name="fox:alt-text">
|
8038
|
-
<xsl:value-of select="$asciimath_text_"/>
|
8225
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
8226
|
+
<!-- put MathML in Actual Text -->
|
8227
|
+
<!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
|
8228
|
+
<xsl:attribute name="fox:actual-text">
|
8229
|
+
<xsl:value-of select="$mathml_content"/>
|
8039
8230
|
</xsl:attribute>
|
8231
|
+
|
8232
|
+
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
8233
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
8234
|
+
<!-- put Mathin Alternate Text -->
|
8235
|
+
<xsl:attribute name="fox:alt-text">
|
8236
|
+
<xsl:value-of select="$asciimath_text_"/>
|
8237
|
+
</xsl:attribute>
|
8238
|
+
</xsl:if>
|
8239
|
+
<!-- </xsl:if> -->
|
8040
8240
|
</xsl:if>
|
8041
|
-
<!-- </xsl:if> -->
|
8042
8241
|
|
8043
8242
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
8044
8243
|
|
@@ -8308,6 +8507,27 @@
|
|
8308
8507
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8309
8508
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8310
8509
|
</xsl:when> -->
|
8510
|
+
|
8511
|
+
<!-- <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'))">
|
8512
|
+
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8513
|
+
<xsl:variable name="filename">
|
8514
|
+
<xsl:call-template name="substring-after-last">
|
8515
|
+
<xsl:with-param name="value" select="$target_"/>
|
8516
|
+
<xsl:with-param name="delimiter" select="'/'"/>
|
8517
|
+
</xsl:call-template>
|
8518
|
+
</xsl:variable>
|
8519
|
+
<xsl:variable name="target_filepath" select="concat($inputxml_basepath, @target)"/>
|
8520
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($target_filepath)))"/>
|
8521
|
+
<xsl:choose>
|
8522
|
+
<xsl:when test="$file_exists = 'true'">
|
8523
|
+
<xsl:value-of select="concat('url(embedded-file:', $filename, ')')"/>
|
8524
|
+
</xsl:when>
|
8525
|
+
<xsl:otherwise>
|
8526
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
8527
|
+
</xsl:otherwise>
|
8528
|
+
</xsl:choose>
|
8529
|
+
</xsl:when> -->
|
8530
|
+
|
8311
8531
|
<xsl:otherwise>
|
8312
8532
|
<xsl:value-of select="normalize-space(@target)"/>
|
8313
8533
|
</xsl:otherwise>
|
@@ -8612,7 +8832,7 @@
|
|
8612
8832
|
|
8613
8833
|
<xsl:template name="refine_note_block_style">
|
8614
8834
|
|
8615
|
-
</xsl:template>
|
8835
|
+
</xsl:template> <!-- refine_note_block_style -->
|
8616
8836
|
|
8617
8837
|
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
|
8618
8838
|
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
@@ -8804,10 +9024,21 @@
|
|
8804
9024
|
</xsl:template>
|
8805
9025
|
|
8806
9026
|
<xsl:template name="showFigureKey">
|
8807
|
-
<xsl:for-each select="*[local-name() = 'note'
|
8808
|
-
<xsl:
|
9027
|
+
<xsl:for-each select="*[(local-name() = 'note' and not(@type = 'units')) or local-name() = 'example']">
|
9028
|
+
<xsl:choose>
|
9029
|
+
<xsl:when test="local-name() = 'note'">
|
9030
|
+
<xsl:call-template name="note"/>
|
9031
|
+
</xsl:when>
|
9032
|
+
<xsl:when test="local-name() = 'example'">
|
9033
|
+
<xsl:call-template name="example"/>
|
9034
|
+
</xsl:when>
|
9035
|
+
<xsl:otherwise>
|
9036
|
+
<xsl:apply-templates select="."/>
|
9037
|
+
</xsl:otherwise>
|
9038
|
+
</xsl:choose>
|
8809
9039
|
</xsl:for-each>
|
8810
|
-
|
9040
|
+
<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
|
9041
|
+
<xsl:call-template name="figure_fn_display"/>
|
8811
9042
|
</xsl:template>
|
8812
9043
|
|
8813
9044
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
@@ -9701,10 +9932,10 @@
|
|
9701
9932
|
<xsl:when test="@type = 'section-title'">
|
9702
9933
|
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
9703
9934
|
<xsl:text>: </xsl:text>
|
9704
|
-
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
9935
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
|
9705
9936
|
</xsl:when>
|
9706
9937
|
<xsl:otherwise>
|
9707
|
-
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
9938
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
|
9708
9939
|
</xsl:otherwise>
|
9709
9940
|
</xsl:choose>
|
9710
9941
|
</xsl:when>
|
@@ -9769,6 +10000,8 @@
|
|
9769
10000
|
<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
|
9770
10001
|
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
|
9771
10002
|
|
10003
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="contents" priority="3"/>
|
10004
|
+
|
9772
10005
|
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
|
9773
10006
|
<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
|
9774
10007
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -9790,6 +10023,8 @@
|
|
9790
10023
|
<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
|
9791
10024
|
<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
|
9792
10025
|
|
10026
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="bookmarks" priority="3"/>
|
10027
|
+
|
9793
10028
|
<!-- Bookmarks -->
|
9794
10029
|
<xsl:template name="addBookmarks">
|
9795
10030
|
<xsl:param name="contents"/>
|
@@ -10035,9 +10270,15 @@
|
|
10035
10270
|
</xsl:if>
|
10036
10271
|
</xsl:template>
|
10037
10272
|
|
10273
|
+
<!-- figure/fn -->
|
10038
10274
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
|
10039
|
-
|
10275
|
+
<!-- figure/note -->
|
10276
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
|
10277
|
+
<!-- figure/example -->
|
10278
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
|
10040
10279
|
|
10280
|
+
<!-- figure/note[@type = 'units'] -->
|
10281
|
+
<!-- image/note[@type = 'units'] -->
|
10041
10282
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
|
10042
10283
|
<fo:block text-align="right" keep-with-next="always">
|
10043
10284
|
<xsl:apply-templates/>
|
@@ -10158,6 +10399,7 @@
|
|
10158
10399
|
</xsl:choose>
|
10159
10400
|
</xsl:template>
|
10160
10401
|
|
10402
|
+
<!-- fn -->
|
10161
10403
|
<xsl:template match="*[local-name() = 'fn']" mode="contents"/>
|
10162
10404
|
<xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/>
|
10163
10405
|
|
@@ -11054,7 +11296,7 @@
|
|
11054
11296
|
text line 1
|
11055
11297
|
text line 2
|
11056
11298
|
-->
|
11057
|
-
<xsl:template match="*[local-name() = 'example']">
|
11299
|
+
<xsl:template match="*[local-name() = 'example']" name="example">
|
11058
11300
|
|
11059
11301
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
11060
11302
|
|
@@ -11160,6 +11402,7 @@
|
|
11160
11402
|
|
11161
11403
|
</xsl:template>
|
11162
11404
|
|
11405
|
+
<!-- example/name -->
|
11163
11406
|
<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
11164
11407
|
<xsl:param name="fo_element">block</xsl:param>
|
11165
11408
|
|
@@ -11185,7 +11428,8 @@
|
|
11185
11428
|
|
11186
11429
|
</xsl:template>
|
11187
11430
|
|
11188
|
-
|
11431
|
+
<!-- table/example/name, table/tfoot//example/name -->
|
11432
|
+
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
|
11189
11433
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
11190
11434
|
|
11191
11435
|
<xsl:apply-templates/>
|
@@ -11664,21 +11908,32 @@
|
|
11664
11908
|
<!-- ========== -->
|
11665
11909
|
|
11666
11910
|
<xsl:variable name="reviews_">
|
11667
|
-
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
11911
|
+
<xsl:for-each select="//*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])][@from]">
|
11668
11912
|
<xsl:copy>
|
11669
11913
|
<xsl:copy-of select="@from"/>
|
11670
11914
|
<xsl:copy-of select="@id"/>
|
11671
11915
|
</xsl:copy>
|
11672
11916
|
</xsl:for-each>
|
11917
|
+
<xsl:for-each select="//*[local-name() = 'fmt-review-start'][@source]">
|
11918
|
+
<xsl:copy>
|
11919
|
+
<xsl:copy-of select="@source"/>
|
11920
|
+
<xsl:copy-of select="@id"/>
|
11921
|
+
</xsl:copy>
|
11922
|
+
</xsl:for-each>
|
11673
11923
|
</xsl:variable>
|
11674
11924
|
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
11675
11925
|
|
11676
11926
|
<xsl:template name="addReviewHelper">
|
11677
|
-
|
11678
|
-
|
11679
|
-
|
11680
|
-
|
11681
|
-
<
|
11927
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
11928
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
11929
|
+
<xsl:variable name="curr_id" select="@id"/>
|
11930
|
+
<!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
|
11931
|
+
<xsl:for-each select="$reviews//*[local-name() = 'review'][@from = $curr_id]"> <!-- $reviews//*[local-name() = 'fmt-review-start'][@source = $curr_id] -->
|
11932
|
+
<xsl:variable name="review_id" select="normalize-space(@id)"/>
|
11933
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
11934
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11935
|
+
</xsl:if>
|
11936
|
+
</xsl:for-each>
|
11682
11937
|
</xsl:if>
|
11683
11938
|
<!-- <fo:block>
|
11684
11939
|
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
@@ -11822,14 +12077,61 @@
|
|
11822
12077
|
|
11823
12078
|
</xsl:template>
|
11824
12079
|
|
11825
|
-
|
12080
|
+
<!-- document text (not figures, or tables) footnotes -->
|
12081
|
+
<xsl:variable name="reviews_container_">
|
12082
|
+
<xsl:for-each select="//*[local-name() = 'review-container']/*[local-name() = 'fmt-review-body']">
|
12083
|
+
<xsl:variable name="update_xml_step1">
|
12084
|
+
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
12085
|
+
</xsl:variable>
|
12086
|
+
<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
|
12087
|
+
</xsl:for-each>
|
12088
|
+
</xsl:variable>
|
12089
|
+
<xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
|
12090
|
+
|
12091
|
+
<xsl:template match="*[local-name() = 'review-container']"/>
|
12092
|
+
|
12093
|
+
<!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
|
12094
|
+
<xsl:template match="*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
|
12095
|
+
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
12096
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
12097
|
+
<xsl:choose>
|
12098
|
+
<!-- if there isn't the attribute '@from', then -->
|
12099
|
+
<xsl:when test="$id_from = ''">
|
12100
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12101
|
+
</xsl:when>
|
12102
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
12103
|
+
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
12104
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12105
|
+
</xsl:when>
|
12106
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
12107
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12108
|
+
</xsl:when>
|
12109
|
+
</xsl:choose>
|
12110
|
+
</xsl:if>
|
12111
|
+
</xsl:template>
|
12112
|
+
|
12113
|
+
<!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
|
12114
|
+
<xsl:template match="*[local-name() = 'fmt-review-start']" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
|
11826
12115
|
<!-- comment 2019-11-29 -->
|
11827
12116
|
<!-- <fo:block font-weight="bold">Review:</fo:block>
|
11828
12117
|
<xsl:apply-templates /> -->
|
11829
12118
|
|
11830
|
-
<xsl:variable name="id_from" select="normalize-space(current()/@
|
12119
|
+
<xsl:variable name="id_from" select="normalize-space(current()/@source)"/>
|
11831
12120
|
|
11832
|
-
<xsl:
|
12121
|
+
<xsl:variable name="source" select="normalize-space(@source)"/>
|
12122
|
+
|
12123
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
12124
|
+
<!-- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> -->
|
12125
|
+
|
12126
|
+
<!-- <xsl:if test="@source = @end"> -->
|
12127
|
+
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
12128
|
+
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
12129
|
+
<!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
|
12130
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12131
|
+
<!-- </xsl:if> -->
|
12132
|
+
</xsl:if>
|
12133
|
+
|
12134
|
+
<xsl:if test="1 = 2">
|
11833
12135
|
<xsl:choose>
|
11834
12136
|
<!-- if there isn't the attribute '@from', then -->
|
11835
12137
|
<xsl:when test="$id_from = ''">
|
@@ -11837,10 +12139,10 @@
|
|
11837
12139
|
</xsl:when>
|
11838
12140
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
11839
12141
|
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
11840
|
-
<fo:block id="{
|
12142
|
+
<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11841
12143
|
</xsl:when>
|
11842
12144
|
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
11843
|
-
<fo:block id="{
|
12145
|
+
<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11844
12146
|
</xsl:when>
|
11845
12147
|
</xsl:choose>
|
11846
12148
|
</xsl:if>
|
@@ -11891,16 +12193,21 @@
|
|
11891
12193
|
<xsl:variable name="list_level">
|
11892
12194
|
<xsl:choose>
|
11893
12195
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
11894
|
-
<xsl:
|
12196
|
+
<xsl:when test="$ul_labels/label[@level = 3]"><xsl:value-of select="$list_level_ mod 3"/></xsl:when>
|
12197
|
+
<xsl:when test="$list_level_ mod 2 = 0">2</xsl:when>
|
12198
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 2"/></xsl:otherwise>
|
11895
12199
|
</xsl:choose>
|
11896
12200
|
</xsl:variable>
|
11897
12201
|
<xsl:choose>
|
11898
12202
|
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
11899
12203
|
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
11900
12204
|
</xsl:when>
|
11901
|
-
<xsl:when test="$list_level mod 3 = 0">
|
12205
|
+
<xsl:when test="$list_level mod 3 = 0 and $ul_labels/label[@level = 3]">
|
11902
12206
|
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
11903
12207
|
</xsl:when>
|
12208
|
+
<xsl:when test="$list_level mod 3 = 0">
|
12209
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
12210
|
+
</xsl:when>
|
11904
12211
|
<xsl:when test="$list_level mod 2 = 0">
|
11905
12212
|
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
11906
12213
|
</xsl:when>
|
@@ -12443,10 +12750,22 @@
|
|
12443
12750
|
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/>
|
12444
12751
|
|
12445
12752
|
<xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
12446
|
-
|
12447
|
-
<
|
12448
|
-
|
12449
|
-
|
12753
|
+
<xsl:variable name="bookmark_id" select="@id"/>
|
12754
|
+
<xsl:choose>
|
12755
|
+
<!-- Example:
|
12756
|
+
<fmt-review-start id="_7ef81cf7-3f6c-4ed4-9c1f-1ba092052bbd" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" end="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/>
|
12757
|
+
<bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
|
12758
|
+
<fmt-review-end id="_f336a8d0-08a8-4b7f-a1aa-b04688ed40c1" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" start="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/> -->
|
12759
|
+
<xsl:when test="1 = 2 and preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]">
|
12760
|
+
<!-- skip here, see the template 'fmt-review-start' -->
|
12761
|
+
</xsl:when>
|
12762
|
+
<xsl:otherwise>
|
12763
|
+
<!-- <fo:inline id="{@id}" font-size="1pt"/> -->
|
12764
|
+
<fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
|
12765
|
+
<!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
|
12766
|
+
<xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
|
12767
|
+
</xsl:otherwise>
|
12768
|
+
</xsl:choose>
|
12450
12769
|
</xsl:template>
|
12451
12770
|
<!-- =================== -->
|
12452
12771
|
<!-- End of Index processing -->
|
@@ -12833,8 +13152,33 @@
|
|
12833
13152
|
|
12834
13153
|
<xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
|
12835
13154
|
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
13155
|
+
<!-- New format: one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
13156
|
+
<!-- <test><xsl:copy-of select="."/></test> -->
|
13157
|
+
|
12836
13158
|
<xsl:variable name="target" select="@target"/>
|
13159
|
+
|
12837
13160
|
<xsl:for-each select="*[local-name() = 'tab']">
|
13161
|
+
|
13162
|
+
<xsl:if test="position() = 1">
|
13163
|
+
<!-- first column (data before first `tab`) -->
|
13164
|
+
<fo:table-cell>
|
13165
|
+
<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
|
13166
|
+
<xsl:call-template name="insert_basic_link">
|
13167
|
+
<xsl:with-param name="element">
|
13168
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
13169
|
+
<xsl:for-each select="preceding-sibling::node()">
|
13170
|
+
<xsl:choose>
|
13171
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
13172
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
13173
|
+
</xsl:choose>
|
13174
|
+
</xsl:for-each>
|
13175
|
+
</fo:basic-link>
|
13176
|
+
</xsl:with-param>
|
13177
|
+
</xsl:call-template>
|
13178
|
+
</fo:block>
|
13179
|
+
</fo:table-cell>
|
13180
|
+
</xsl:if>
|
13181
|
+
|
12838
13182
|
<xsl:variable name="current_id" select="generate-id()"/>
|
12839
13183
|
<fo:table-cell>
|
12840
13184
|
<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
|
@@ -12885,11 +13229,25 @@
|
|
12885
13229
|
|
12886
13230
|
<xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
|
12887
13231
|
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
13232
|
+
<!-- New format - one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
12888
13233
|
<xsl:for-each select="*[local-name() = 'tab']">
|
13234
|
+
<xsl:if test="position() = 1">
|
13235
|
+
<td>
|
13236
|
+
<xsl:for-each select="preceding-sibling::node()">
|
13237
|
+
<xsl:choose>
|
13238
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
13239
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
|
13240
|
+
</xsl:choose>
|
13241
|
+
</xsl:for-each>
|
13242
|
+
</td>
|
13243
|
+
</xsl:if>
|
12889
13244
|
<xsl:variable name="current_id" select="generate-id()"/>
|
12890
13245
|
<td>
|
12891
13246
|
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
12892
|
-
<xsl:
|
13247
|
+
<xsl:choose>
|
13248
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
13249
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
|
13250
|
+
</xsl:choose>
|
12893
13251
|
</xsl:for-each>
|
12894
13252
|
</td>
|
12895
13253
|
</xsl:for-each>
|
@@ -13764,6 +14122,9 @@
|
|
13764
14122
|
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
|
13765
14123
|
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
|
13766
14124
|
|
14125
|
+
<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_step1"/>
|
14126
|
+
<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_pres"/>
|
14127
|
+
|
13767
14128
|
<!-- END: update new Presentation XML -->
|
13768
14129
|
|
13769
14130
|
<!-- =========================================================================== -->
|
@@ -14287,6 +14648,7 @@
|
|
14287
14648
|
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
14288
14649
|
</fn>
|
14289
14650
|
-->
|
14651
|
+
<!-- fn in text -->
|
14290
14652
|
<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">
|
14291
14653
|
<xsl:variable name="p_fn_">
|
14292
14654
|
<xsl:call-template name="get_fn_list"/>
|