metanorma-iso 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/base_convert.rb +1 -0
- data/lib/isodoc/iso/init.rb +3 -1
- data/lib/isodoc/iso/iso.amendment.xsl +416 -83
- data/lib/isodoc/iso/iso.international-standard.xsl +416 -83
- data/lib/isodoc/iso/presentation_section.rb +1 -1
- data/lib/isodoc/iso/presentation_terms.rb +3 -3
- data/lib/isodoc/iso/presentation_xml_convert.rb +24 -7
- data/lib/isodoc/iso/word_dis_convert.rb +9 -2
- data/lib/isodoc/iso/xref.rb +2 -1
- data/lib/isodoc/iso/xref_section.rb +6 -5
- data/lib/metanorma/iso/basicdoc.rng +14 -8
- data/lib/metanorma/iso/biblio-standoc.rng +37 -7
- data/lib/metanorma/iso/biblio.rng +30 -18
- data/lib/metanorma/iso/front.rb +1 -6
- data/lib/metanorma/iso/isodoc.rng +130 -96
- data/lib/metanorma/iso/isostandard-amd.rng +4 -7
- data/lib/metanorma/iso/isostandard.rng +6 -154
- data/lib/metanorma/iso/relaton-iso.rng +35 -34
- data/lib/metanorma/iso/reqt.rng +7 -6
- data/lib/metanorma/iso/section.rb +9 -2
- data/lib/metanorma/iso/validate.rb +8 -13
- data/lib/metanorma/iso/validate_list.rb +7 -6
- data/lib/metanorma/iso/validate_requirements.rb +9 -6
- data/lib/metanorma/iso/validate_style.rb +12 -11
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +2 -2
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
6
6
|
|
7
|
+
<xsl:key name="kid" match="*" use="@id"/>
|
8
|
+
|
7
9
|
<xsl:key name="attachments" match="iso:eref[java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" use="@bibitemid"/>
|
8
10
|
<xsl:key name="attachments2" match="iso:eref[contains(@bibitemid,'.exp_')]" use="@bibitemid"/>
|
9
11
|
|
@@ -86,14 +88,15 @@
|
|
86
88
|
<xsl:value-of select="$i18n_all_rights_reserved"/>
|
87
89
|
</xsl:variable>
|
88
90
|
|
91
|
+
<xsl:variable name="iso_reference_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
|
92
|
+
<xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
|
93
|
+
|
89
94
|
<xsl:variable name="docidentifier_iso_with_lang_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'])"/>
|
90
|
-
<xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$
|
95
|
+
<xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$iso_reference"/></xsl:if></xsl:variable>
|
91
96
|
|
92
97
|
<xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after($docidentifier_iso_with_lang, '('), ')')"/>
|
93
98
|
<xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
|
94
99
|
|
95
|
-
<xsl:variable name="iso_reference_" select="normalize-space(/iso:metanorma/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
|
96
|
-
<xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
|
97
100
|
<xsl:variable name="anotherNumbers">
|
98
101
|
<xsl:variable name="year_iso_reference" select="concat(':',substring-after($iso_reference,':'))"/>
|
99
102
|
<xsl:for-each select="/iso:metanorma/iso:bibdata/iso:docidentifier[@type != '' and @type != 'ISO' and not(starts-with(@type, 'iso-')) and @type != 'URN']">
|
@@ -155,6 +158,8 @@
|
|
155
158
|
<xsl:variable name="stagename" select="normalize-space(/iso:metanorma/iso:bibdata/iso:ext/iso:stagename)"/>
|
156
159
|
<xsl:variable name="stagename_abbreviation" select="normalize-space(/iso:metanorma/iso:bibdata/iso:ext/iso:stagename/@abbreviation)"/>
|
157
160
|
<xsl:variable name="stagename_localized" select="normalize-space(/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang])"/>
|
161
|
+
<xsl:variable name="stagename_localized_coverpage"><xsl:copy-of select="/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang and @type = 'coverpage']/node()"/></xsl:variable>
|
162
|
+
<xsl:variable name="stagename_localized_firstpage"><xsl:copy-of select="/iso:metanorma/iso:bibdata/iso:status/iso:stage[@language = $lang and @type = 'firstpage']/node()"/></xsl:variable>
|
158
163
|
<xsl:variable name="abbreviation" select="normalize-space(/iso:metanorma/iso:bibdata/iso:status/iso:stage/@abbreviation)"/>
|
159
164
|
<xsl:variable name="abbreviation_uppercased" select="java:toUpperCase(java:java.lang.String.new($abbreviation))"/>
|
160
165
|
|
@@ -1871,17 +1876,9 @@
|
|
1871
1876
|
<xsl:choose>
|
1872
1877
|
<xsl:when test="$stage-abbreviation = 'DIS'"> <!-- or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM' -->
|
1873
1878
|
<xsl:choose>
|
1874
|
-
<xsl:when test="$
|
1875
|
-
<!--
|
1876
|
-
<xsl:
|
1877
|
-
<xsl:value-of select="$linebreak"/>
|
1878
|
-
<xsl:value-of select="substring-after($stagename_localized, ' ')"/>
|
1879
|
-
</xsl:when>
|
1880
|
-
<xsl:when test="contains($stagename, ' ')">
|
1881
|
-
<!-- Draft International Standard to DRAFT -->
|
1882
|
-
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring-before($stagename, ' ')))"/>
|
1883
|
-
<xsl:value-of select="$linebreak"/>
|
1884
|
-
<xsl:value-of select="substring-after($stagename, ' ')"/>
|
1879
|
+
<xsl:when test="normalize-space($stagename_localized_coverpage) != ''">
|
1880
|
+
<!-- DRAFT<br/>International Standard-->
|
1881
|
+
<xsl:apply-templates select="xalan:nodeset($stagename_localized_coverpage)/node()"/>
|
1885
1882
|
</xsl:when>
|
1886
1883
|
<xsl:otherwise>
|
1887
1884
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($stagename))"/>
|
@@ -2177,6 +2174,7 @@
|
|
2177
2174
|
<fo:table-row height="13mm">
|
2178
2175
|
<fo:table-cell number-columns-spanned="2" border-right="{$cover_page_border}" display-align="after" padding-bottom="-1mm" line-height="1.1">>
|
2179
2176
|
<fo:block font-size="10pt">
|
2177
|
+
<!-- Reference number -->
|
2180
2178
|
<xsl:value-of select="$i18n_reference_number"/>
|
2181
2179
|
</fo:block>
|
2182
2180
|
<fo:block font-size="10pt">
|
@@ -3291,7 +3289,7 @@
|
|
3291
3289
|
</xsl:choose>
|
3292
3290
|
</xsl:variable>
|
3293
3291
|
<xsl:variable name="section_length_str" select="string-length(normalize-space(@section))"/>
|
3294
|
-
<xsl:variable name="section_length_mm" select="$section_length_str * 2"/>
|
3292
|
+
<xsl:variable name="section_length_mm" select="$section_length_str * 2.1"/>
|
3295
3293
|
|
3296
3294
|
<!-- refine the distance depends on the section string length -->
|
3297
3295
|
<xsl:attribute name="provisional-distance-between-starts">
|
@@ -3420,7 +3418,20 @@
|
|
3420
3418
|
</xsl:template>
|
3421
3419
|
|
3422
3420
|
<xsl:template match="iso:pagebreak" priority="2">
|
3423
|
-
<xsl:
|
3421
|
+
<xsl:choose>
|
3422
|
+
<xsl:when test="ancestor::*[local-name() = 'annex']">
|
3423
|
+
<xsl:variable name="annex_id" select="ancestor::*[local-name() = 'annex']/@id"/>
|
3424
|
+
<xsl:choose>
|
3425
|
+
<xsl:when test="following::*[ancestor::*[local-name() = 'annex'][@id = $annex_id]]">
|
3426
|
+
<xsl:copy-of select="."/>
|
3427
|
+
</xsl:when>
|
3428
|
+
<xsl:otherwise><!-- skip --></xsl:otherwise>
|
3429
|
+
</xsl:choose>
|
3430
|
+
</xsl:when>
|
3431
|
+
<xsl:otherwise>
|
3432
|
+
<xsl:copy-of select="."/>
|
3433
|
+
</xsl:otherwise>
|
3434
|
+
</xsl:choose>
|
3424
3435
|
</xsl:template>
|
3425
3436
|
|
3426
3437
|
<xsl:template name="insertListOf_Title">
|
@@ -3927,6 +3938,7 @@
|
|
3927
3938
|
</xsl:when>
|
3928
3939
|
<xsl:otherwise>
|
3929
3940
|
<fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always" role="H1">
|
3941
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
3930
3942
|
<xsl:if test="$layoutVersion = '2024'">
|
3931
3943
|
<xsl:attribute name="line-height">1.1</xsl:attribute>
|
3932
3944
|
<!-- <xsl:attribute name="margin-bottom">52pt</xsl:attribute> -->
|
@@ -4044,6 +4056,7 @@
|
|
4044
4056
|
<xsl:when test="(($layoutVersion = '1987' and $doctype = 'technical-report') or ($layoutVersion = '1979' and $doctype = 'addendum')) and parent::iso:foreword"><!-- skip Foreword title --></xsl:when>
|
4045
4057
|
<xsl:when test="$doctype = 'amendment' and not(ancestor::iso:preface)">
|
4046
4058
|
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always" role="H{$level}">
|
4059
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4047
4060
|
<!-- <xsl:if test="$layoutVersion = '2024'">
|
4048
4061
|
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
4049
4062
|
</xsl:if> -->
|
@@ -4153,6 +4166,11 @@
|
|
4153
4166
|
</xsl:otherwise>
|
4154
4167
|
</xsl:choose>
|
4155
4168
|
</xsl:if>
|
4169
|
+
|
4170
|
+
<xsl:if test="@named_dest">
|
4171
|
+
<fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
|
4172
|
+
</xsl:if>
|
4173
|
+
|
4156
4174
|
<xsl:choose>
|
4157
4175
|
<xsl:when test="$layoutVersion = '1951' and ((ancestor::iso:preface and $level = 1) or (parent::iso:introduction and $revision_date_num < 19680101))">
|
4158
4176
|
<xsl:call-template name="add-letter-spacing">
|
@@ -4232,6 +4250,16 @@
|
|
4232
4250
|
</xsl:otherwise>
|
4233
4251
|
</xsl:choose>
|
4234
4252
|
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
4253
|
+
|
4254
|
+
<!-- becaise @id applied above -->
|
4255
|
+
<xsl:if test="$layoutVersion = '1951' or $layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989' or @type = 'floating-title' or @type = 'section-title'">
|
4256
|
+
<xsl:if test="@named_dest">
|
4257
|
+
<fo:inline>
|
4258
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4259
|
+
<xsl:value-of select="$zero_width_space"/>
|
4260
|
+
</fo:inline>
|
4261
|
+
</xsl:if>
|
4262
|
+
</xsl:if>
|
4235
4263
|
</xsl:element>
|
4236
4264
|
|
4237
4265
|
<xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iso:p)">
|
@@ -4260,6 +4288,7 @@
|
|
4260
4288
|
<xsl:call-template name="getId"/>
|
4261
4289
|
</xsl:variable> id="{$id}" -->
|
4262
4290
|
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
|
4291
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4263
4292
|
<!-- <xsl:if test="$layoutVersion = '2024'">
|
4264
4293
|
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
4265
4294
|
</xsl:if> -->
|
@@ -4291,6 +4320,8 @@
|
|
4291
4320
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
4292
4321
|
</xsl:choose>
|
4293
4322
|
</xsl:variable>
|
4323
|
+
|
4324
|
+
<xsl:call-template name="setNamedDestination"/>
|
4294
4325
|
<xsl:element name="{$element-name}">
|
4295
4326
|
|
4296
4327
|
<xsl:call-template name="setBlockAttributes">
|
@@ -4529,6 +4560,7 @@
|
|
4529
4560
|
|
4530
4561
|
<!-- main sections -->
|
4531
4562
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node_iso" priority="3">
|
4563
|
+
<xsl:call-template name="setNamedDestination"/>
|
4532
4564
|
<fo:block>
|
4533
4565
|
<xsl:call-template name="setId"/>
|
4534
4566
|
|
@@ -4548,6 +4580,7 @@
|
|
4548
4580
|
</xsl:template>
|
4549
4581
|
|
4550
4582
|
<xsl:template match="*[local-name() = 'sections' or local-name() = 'annex']//*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause_iso"> <!-- if clause isn't empty -->
|
4583
|
+
<xsl:call-template name="setNamedDestination"/>
|
4551
4584
|
<fo:block>
|
4552
4585
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
4553
4586
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -4878,6 +4911,7 @@
|
|
4878
4911
|
<xsl:when test="$layoutVersion = '2024'">
|
4879
4912
|
<xsl:choose>
|
4880
4913
|
<xsl:when test="$doctype = 'committee-document'"><xsl:value-of select="$doctype_localized"/></xsl:when>
|
4914
|
+
<xsl:when test="normalize-space($stagename_localized_firstpage) != ''"><xsl:apply-templates select="xalan:nodeset($stagename_localized_firstpage)/node()"/></xsl:when>
|
4881
4915
|
<xsl:otherwise><xsl:value-of select="$stagename-header-firstpage"/></xsl:otherwise>
|
4882
4916
|
</xsl:choose>
|
4883
4917
|
</xsl:when>
|
@@ -6421,6 +6455,7 @@
|
|
6421
6455
|
</xsl:template> <!-- refine_table-style -->
|
6422
6456
|
|
6423
6457
|
<xsl:attribute-set name="table-name-style">
|
6458
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
6424
6459
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
6425
6460
|
|
6426
6461
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
@@ -6432,6 +6467,9 @@
|
|
6432
6467
|
|
6433
6468
|
<xsl:template name="refine_table-name-style">
|
6434
6469
|
<xsl:param name="continued"/>
|
6470
|
+
<xsl:if test="$continued = 'true'">
|
6471
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
6472
|
+
</xsl:if>
|
6435
6473
|
|
6436
6474
|
<xsl:if test="$continued = 'true'">
|
6437
6475
|
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
@@ -8223,8 +8261,14 @@
|
|
8223
8261
|
</xsl:choose>
|
8224
8262
|
</xsl:variable>
|
8225
8263
|
|
8264
|
+
<xsl:call-template name="setNamedDestination"/>
|
8265
|
+
|
8226
8266
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
8227
8267
|
|
8268
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
8269
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
8270
|
+
</xsl:for-each>
|
8271
|
+
|
8228
8272
|
<xsl:call-template name="refine_table-container-style">
|
8229
8273
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
8230
8274
|
</xsl:call-template>
|
@@ -8368,7 +8412,7 @@
|
|
8368
8412
|
</xsl:if>
|
8369
8413
|
|
8370
8414
|
</fo:block-container>
|
8371
|
-
</xsl:variable>
|
8415
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
8372
8416
|
|
8373
8417
|
<xsl:variable name="isAdded" select="@added"/>
|
8374
8418
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -8378,7 +8422,7 @@
|
|
8378
8422
|
|
8379
8423
|
<!-- centered table when table name is centered (see table-name-style) -->
|
8380
8424
|
|
8381
|
-
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
|
8425
|
+
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
|
8382
8426
|
|
8383
8427
|
<xsl:if test="$layoutVersion = '1951'">
|
8384
8428
|
<xsl:attribute name="font-size">inherit</xsl:attribute>
|
@@ -8391,9 +8435,9 @@
|
|
8391
8435
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
8392
8436
|
<fo:table-column column-width="{@width}"/>
|
8393
8437
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
8394
|
-
<fo:table-body>
|
8395
|
-
<fo:table-row>
|
8396
|
-
<fo:table-cell column-number="2">
|
8438
|
+
<fo:table-body role="SKIP">
|
8439
|
+
<fo:table-row role="SKIP">
|
8440
|
+
<fo:table-cell column-number="2" role="SKIP">
|
8397
8441
|
<xsl:copy-of select="$table-preamble"/>
|
8398
8442
|
<fo:block role="SKIP">
|
8399
8443
|
<xsl:call-template name="setTrackChangesStyles">
|
@@ -8439,11 +8483,13 @@
|
|
8439
8483
|
|
8440
8484
|
</xsl:template>
|
8441
8485
|
|
8486
|
+
<!-- table/name-->
|
8442
8487
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
8443
8488
|
<xsl:param name="continued"/>
|
8489
|
+
<xsl:param name="cols-count"/>
|
8444
8490
|
<xsl:if test="normalize-space() != ''">
|
8445
8491
|
|
8446
|
-
<fo:block xsl:use-attribute-sets="table-name-style"
|
8492
|
+
<fo:block xsl:use-attribute-sets="table-name-style">
|
8447
8493
|
|
8448
8494
|
<xsl:call-template name="refine_table-name-style">
|
8449
8495
|
<xsl:with-param name="continued" select="$continued"/>
|
@@ -8472,9 +8518,30 @@
|
|
8472
8518
|
|
8473
8519
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
8474
8520
|
<xsl:if test="$continued = 'true'">
|
8475
|
-
|
8476
|
-
|
8477
|
-
|
8521
|
+
|
8522
|
+
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
8523
|
+
|
8524
|
+
<xsl:choose>
|
8525
|
+
<xsl:when test="string(number($cols-count)) != 'NaN'">
|
8526
|
+
<fo:table width="100%" table-layout="fixed" role="SKIP">
|
8527
|
+
<fo:table-body role="SKIP">
|
8528
|
+
<fo:table-row>
|
8529
|
+
<fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
|
8530
|
+
<fo:block text-align="right" role="SKIP">
|
8531
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
8532
|
+
</fo:block>
|
8533
|
+
</fo:table-cell>
|
8534
|
+
</fo:table-row>
|
8535
|
+
</fo:table-body>
|
8536
|
+
</fo:table>
|
8537
|
+
</xsl:when>
|
8538
|
+
<xsl:otherwise>
|
8539
|
+
<fo:block text-align="right">
|
8540
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
8541
|
+
</fo:block>
|
8542
|
+
</xsl:otherwise>
|
8543
|
+
</xsl:choose>
|
8544
|
+
|
8478
8545
|
</xsl:if>
|
8479
8546
|
<!-- </xsl:if> -->
|
8480
8547
|
|
@@ -8871,6 +8938,7 @@
|
|
8871
8938
|
|
8872
8939
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
8873
8940
|
<xsl:with-param name="continued">true</xsl:with-param>
|
8941
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
8874
8942
|
</xsl:apply-templates>
|
8875
8943
|
|
8876
8944
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -8944,7 +9012,7 @@
|
|
8944
9012
|
|
8945
9013
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
8946
9014
|
|
8947
|
-
<fo:table keep-with-previous="always">
|
9015
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
8948
9016
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
8949
9017
|
<xsl:variable name="name" select="local-name()"/>
|
8950
9018
|
<xsl:choose>
|
@@ -8975,9 +9043,9 @@
|
|
8975
9043
|
</xsl:otherwise>
|
8976
9044
|
</xsl:choose>
|
8977
9045
|
|
8978
|
-
<fo:table-body>
|
8979
|
-
<fo:table-row>
|
8980
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
9046
|
+
<fo:table-body role="SKIP">
|
9047
|
+
<fo:table-row role="SKIP">
|
9048
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
8981
9049
|
|
8982
9050
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
8983
9051
|
|
@@ -9051,6 +9119,7 @@
|
|
9051
9119
|
<!-- if there isn't 'thead' and there is a table's title -->
|
9052
9120
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
|
9053
9121
|
<fo:table-header>
|
9122
|
+
|
9054
9123
|
<xsl:call-template name="table-header-title">
|
9055
9124
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
9056
9125
|
</xsl:call-template>
|
@@ -9307,8 +9376,8 @@
|
|
9307
9376
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
9308
9377
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
9309
9378
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
9310
|
-
<xsl:if test="$key = 'color' or
|
9311
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
9379
|
+
<xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
|
9380
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
9312
9381
|
</xsl:if>
|
9313
9382
|
</xsl:for-each>
|
9314
9383
|
</xsl:variable>
|
@@ -9372,6 +9441,7 @@
|
|
9372
9441
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
9373
9442
|
<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">
|
9374
9443
|
|
9444
|
+
<xsl:call-template name="setNamedDestination"/>
|
9375
9445
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
9376
9446
|
<xsl:copy-of select="@id"/>
|
9377
9447
|
|
@@ -9419,6 +9489,7 @@
|
|
9419
9489
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
9420
9490
|
<!-- fn in text -->
|
9421
9491
|
<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">
|
9492
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
9422
9493
|
|
9423
9494
|
<!-- list of unique footnotes -->
|
9424
9495
|
<xsl:variable name="p_fn_">
|
@@ -9497,7 +9568,7 @@
|
|
9497
9568
|
<xsl:copy-of select="$footnote_inline"/>
|
9498
9569
|
</xsl:when>
|
9499
9570
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
9500
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
9571
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
9501
9572
|
|
9502
9573
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
9503
9574
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -9906,39 +9977,51 @@
|
|
9906
9977
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
9907
9978
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
9908
9979
|
<xsl:template match="*[local-name()='fn']">
|
9909
|
-
<
|
9980
|
+
<xsl:variable name="target" select="@target"/>
|
9981
|
+
<xsl:choose>
|
9982
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
9983
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
|
9984
|
+
<xsl:call-template name="fn">
|
9985
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
9986
|
+
</xsl:call-template>
|
9987
|
+
</xsl:when>
|
9988
|
+
<xsl:otherwise>
|
9910
9989
|
|
9911
|
-
|
9990
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
9912
9991
|
|
9913
|
-
|
9914
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
9915
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
9916
|
-
<!-- <xsl:attribute name="internal-destination">
|
9917
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
9918
|
-
</xsl:attribute>
|
9919
|
-
</xsl:if>
|
9920
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
9921
|
-
<xsl:attribute name="internal-destination">
|
9922
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
9923
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
9924
|
-
</xsl:attribute>
|
9925
|
-
</xsl:if> -->
|
9926
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
9927
|
-
<xsl:text>※</xsl:text>
|
9928
|
-
</xsl:if> -->
|
9929
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
9992
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
9930
9993
|
|
9931
|
-
|
9994
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
9995
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
9996
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
9997
|
+
<!-- <xsl:attribute name="internal-destination">
|
9998
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
9999
|
+
</xsl:attribute>
|
10000
|
+
</xsl:if>
|
10001
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
10002
|
+
<xsl:attribute name="internal-destination">
|
10003
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
10004
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
10005
|
+
</xsl:attribute>
|
10006
|
+
</xsl:if> -->
|
10007
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
10008
|
+
<xsl:text>※</xsl:text>
|
10009
|
+
</xsl:if> -->
|
10010
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
9932
10011
|
|
9933
|
-
|
9934
|
-
|
9935
|
-
|
9936
|
-
|
9937
|
-
|
9938
|
-
|
9939
|
-
|
9940
|
-
|
9941
|
-
|
10012
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
10013
|
+
|
10014
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
10015
|
+
<xsl:text>)</xsl:text>
|
10016
|
+
</xsl:if> -->
|
10017
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
10018
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
10019
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
10020
|
+
</xsl:if> -->
|
10021
|
+
</fo:basic-link>
|
10022
|
+
</fo:inline>
|
10023
|
+
</xsl:otherwise>
|
10024
|
+
</xsl:choose>
|
9942
10025
|
</xsl:template> <!-- fn -->
|
9943
10026
|
|
9944
10027
|
<!-- fn/text() -->
|
@@ -9993,6 +10076,10 @@
|
|
9993
10076
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
9994
10077
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
9995
10078
|
|
10079
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
10080
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
10081
|
+
</xsl:if>
|
10082
|
+
|
9996
10083
|
<xsl:call-template name="setBlockSpanAll"/>
|
9997
10084
|
|
9998
10085
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -10294,7 +10381,7 @@
|
|
10294
10381
|
|
10295
10382
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
10296
10383
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
10297
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
10384
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
10298
10385
|
<xsl:call-template name="refine_figure_key_style"/>
|
10299
10386
|
<xsl:apply-templates/>
|
10300
10387
|
</fo:block>
|
@@ -10555,6 +10642,7 @@
|
|
10555
10642
|
|
10556
10643
|
<xsl:call-template name="refine_dt-cell-style"/>
|
10557
10644
|
|
10645
|
+
<xsl:call-template name="setNamedDestination"/>
|
10558
10646
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
10559
10647
|
|
10560
10648
|
<xsl:choose>
|
@@ -10997,7 +11085,7 @@
|
|
10997
11085
|
<!-- ================= -->
|
10998
11086
|
|
10999
11087
|
<!-- highlight text -->
|
11000
|
-
<xsl:template match="*[local-name()='hi']">
|
11088
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
11001
11089
|
<fo:inline background-color="yellow">
|
11002
11090
|
<xsl:apply-templates/>
|
11003
11091
|
</fo:inline>
|
@@ -12676,6 +12764,7 @@
|
|
12676
12764
|
<!-- Appendix processing -->
|
12677
12765
|
<!-- ======================== -->
|
12678
12766
|
<xsl:template match="*[local-name()='appendix']">
|
12767
|
+
<xsl:call-template name="setNamedDestination"/>
|
12679
12768
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
12680
12769
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
12681
12770
|
</fo:block>
|
@@ -12686,13 +12775,14 @@
|
|
12686
12775
|
<xsl:variable name="level">
|
12687
12776
|
<xsl:call-template name="getLevel"/>
|
12688
12777
|
</xsl:variable>
|
12689
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
12778
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
12690
12779
|
</xsl:template>
|
12691
12780
|
<!-- ======================== -->
|
12692
12781
|
<!-- END Appendix processing -->
|
12693
12782
|
<!-- ======================== -->
|
12694
12783
|
|
12695
12784
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
12785
|
+
<xsl:call-template name="setNamedDestination"/>
|
12696
12786
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
12697
12787
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
12698
12788
|
</fo:block>
|
@@ -12722,6 +12812,7 @@
|
|
12722
12812
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
12723
12813
|
<xsl:param name="callout"/>
|
12724
12814
|
<fo:inline id="{@id}">
|
12815
|
+
<xsl:call-template name="setNamedDestination"/>
|
12725
12816
|
<!-- for first p in annotation, put <x> -->
|
12726
12817
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
12727
12818
|
<xsl:apply-templates/>
|
@@ -12770,6 +12861,7 @@
|
|
12770
12861
|
|
12771
12862
|
</xsl:if>
|
12772
12863
|
<fo:block-container margin-left="0mm" role="SKIP">
|
12864
|
+
<xsl:call-template name="setNamedDestination"/>
|
12773
12865
|
<fo:block id="{@id}">
|
12774
12866
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
12775
12867
|
</fo:block>
|
@@ -12815,8 +12907,13 @@
|
|
12815
12907
|
</fo:block>
|
12816
12908
|
</fo:table-cell>
|
12817
12909
|
<fo:table-cell display-align="center">
|
12910
|
+
|
12818
12911
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
12819
12912
|
|
12913
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
12914
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
12915
|
+
</xsl:for-each>
|
12916
|
+
|
12820
12917
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
12821
12918
|
|
12822
12919
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -12851,6 +12948,8 @@
|
|
12851
12948
|
|
12852
12949
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
12853
12950
|
|
12951
|
+
<xsl:call-template name="setNamedDestination"/>
|
12952
|
+
|
12854
12953
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
12855
12954
|
|
12856
12955
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12938,6 +13037,7 @@
|
|
12938
13037
|
</xsl:template>
|
12939
13038
|
|
12940
13039
|
<xsl:template match="*[local-name() = 'termnote']">
|
13040
|
+
<xsl:call-template name="setNamedDestination"/>
|
12941
13041
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
12942
13042
|
|
12943
13043
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -13048,12 +13148,14 @@
|
|
13048
13148
|
|
13049
13149
|
<xsl:template match="*[local-name() = 'terms']">
|
13050
13150
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
13151
|
+
<xsl:call-template name="setNamedDestination"/>
|
13051
13152
|
<fo:block id="{@id}">
|
13052
13153
|
<xsl:apply-templates/>
|
13053
13154
|
</fo:block>
|
13054
13155
|
</xsl:template>
|
13055
13156
|
|
13056
13157
|
<xsl:template match="*[local-name() = 'term']">
|
13158
|
+
<xsl:call-template name="setNamedDestination"/>
|
13057
13159
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
13058
13160
|
|
13059
13161
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -13087,6 +13189,7 @@
|
|
13087
13189
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
13088
13190
|
<xsl:variable name="isAdded" select="@added"/>
|
13089
13191
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
13192
|
+
<xsl:call-template name="setNamedDestination"/>
|
13090
13193
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
13091
13194
|
<xsl:call-template name="refine_figure-block-style"/>
|
13092
13195
|
|
@@ -13103,6 +13206,11 @@
|
|
13103
13206
|
</xsl:variable>
|
13104
13207
|
|
13105
13208
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
13209
|
+
|
13210
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
13211
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
13212
|
+
</xsl:for-each>
|
13213
|
+
|
13106
13214
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
13107
13215
|
</fo:block>
|
13108
13216
|
|
@@ -13135,6 +13243,7 @@
|
|
13135
13243
|
</xsl:template>
|
13136
13244
|
|
13137
13245
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
13246
|
+
<xsl:call-template name="setNamedDestination"/>
|
13138
13247
|
<fo:block id="{@id}">
|
13139
13248
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
13140
13249
|
</fo:block>
|
@@ -13148,6 +13257,7 @@
|
|
13148
13257
|
</xsl:template>
|
13149
13258
|
|
13150
13259
|
<!-- SOURCE: ... -->
|
13260
|
+
<!-- figure/source -->
|
13151
13261
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
13152
13262
|
|
13153
13263
|
<xsl:call-template name="termsource"/>
|
@@ -14073,6 +14183,13 @@
|
|
14073
14183
|
<xsl:apply-templates select="."/>
|
14074
14184
|
</xsl:template>
|
14075
14185
|
|
14186
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
14187
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
14188
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
14189
|
+
<xsl:apply-templates select="."/>
|
14190
|
+
</xsl:if>
|
14191
|
+
</xsl:template>
|
14192
|
+
|
14076
14193
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
14077
14194
|
|
14078
14195
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -14296,7 +14413,8 @@
|
|
14296
14413
|
|
14297
14414
|
<xsl:for-each select="$contents_nodes//tables/table">
|
14298
14415
|
<fo:bookmark internal-destination="{@id}">
|
14299
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
14416
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
14417
|
+
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
14300
14418
|
</fo:bookmark>
|
14301
14419
|
</xsl:for-each>
|
14302
14420
|
</fo:bookmark>
|
@@ -14305,6 +14423,26 @@
|
|
14305
14423
|
</xsl:template> <!-- insertTableBookmarks -->
|
14306
14424
|
<!-- End Bookmarks -->
|
14307
14425
|
|
14426
|
+
<!-- ============================ -->
|
14427
|
+
<!-- mode="bookmark_clean" -->
|
14428
|
+
<!-- ============================ -->
|
14429
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
14430
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
14431
|
+
</xsl:template>
|
14432
|
+
|
14433
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
14434
|
+
<xsl:value-of select="."/>
|
14435
|
+
</xsl:template>
|
14436
|
+
|
14437
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
14438
|
+
<xsl:value-of select="normalize-space(.)"/>
|
14439
|
+
</xsl:template>
|
14440
|
+
|
14441
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
14442
|
+
<!-- ============================ -->
|
14443
|
+
<!-- END: mode="bookmark_clean" -->
|
14444
|
+
<!-- ============================ -->
|
14445
|
+
|
14308
14446
|
<xsl:template name="getLangVersion">
|
14309
14447
|
<xsl:param name="lang"/>
|
14310
14448
|
<xsl:param name="doctype" select="''"/>
|
@@ -14352,6 +14490,7 @@
|
|
14352
14490
|
<xsl:template match="title" mode="bookmark"/>
|
14353
14491
|
<xsl:template match="text()" mode="bookmark"/>
|
14354
14492
|
|
14493
|
+
<!-- figure/name -->
|
14355
14494
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
14356
14495
|
<xsl:if test="normalize-space() != ''">
|
14357
14496
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -15066,6 +15205,7 @@
|
|
15066
15205
|
<!-- permission -->
|
15067
15206
|
<!-- ========== -->
|
15068
15207
|
<xsl:template match="*[local-name() = 'permission']">
|
15208
|
+
<xsl:call-template name="setNamedDestination"/>
|
15069
15209
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
15070
15210
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15071
15211
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15074,10 +15214,12 @@
|
|
15074
15214
|
|
15075
15215
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
15076
15216
|
<xsl:if test="normalize-space() != ''">
|
15077
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15078
|
-
<xsl:apply-templates/>
|
15079
15217
|
|
15080
|
-
|
15218
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15219
|
+
<xsl:apply-templates/>
|
15220
|
+
|
15221
|
+
</fo:block>
|
15222
|
+
|
15081
15223
|
</xsl:if>
|
15082
15224
|
</xsl:template>
|
15083
15225
|
|
@@ -15093,6 +15235,7 @@
|
|
15093
15235
|
<!-- requirement -->
|
15094
15236
|
<!-- ========== -->
|
15095
15237
|
<xsl:template match="*[local-name() = 'requirement']">
|
15238
|
+
<xsl:call-template name="setNamedDestination"/>
|
15096
15239
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
15097
15240
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15098
15241
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -15104,13 +15247,15 @@
|
|
15104
15247
|
|
15105
15248
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
15106
15249
|
<xsl:if test="normalize-space() != ''">
|
15107
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15108
15250
|
|
15109
|
-
|
15251
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15110
15252
|
|
15111
|
-
|
15253
|
+
<xsl:apply-templates/>
|
15254
|
+
|
15255
|
+
<xsl:text>:</xsl:text>
|
15256
|
+
|
15257
|
+
</fo:block>
|
15112
15258
|
|
15113
|
-
</fo:block>
|
15114
15259
|
</xsl:if>
|
15115
15260
|
</xsl:template>
|
15116
15261
|
|
@@ -15139,6 +15284,7 @@
|
|
15139
15284
|
<!-- recommendation -->
|
15140
15285
|
<!-- ========== -->
|
15141
15286
|
<xsl:template match="*[local-name() = 'recommendation']">
|
15287
|
+
<xsl:call-template name="setNamedDestination"/>
|
15142
15288
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
15143
15289
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15144
15290
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15147,10 +15293,12 @@
|
|
15147
15293
|
|
15148
15294
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
15149
15295
|
<xsl:if test="normalize-space() != ''">
|
15150
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15151
|
-
<xsl:apply-templates/>
|
15152
15296
|
|
15153
|
-
|
15297
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15298
|
+
<xsl:apply-templates/>
|
15299
|
+
|
15300
|
+
</fo:block>
|
15301
|
+
|
15154
15302
|
</xsl:if>
|
15155
15303
|
</xsl:template>
|
15156
15304
|
|
@@ -15229,6 +15377,7 @@
|
|
15229
15377
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
15230
15378
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
15231
15379
|
</xsl:if>
|
15380
|
+
<xsl:call-template name="setNamedDestination"/>
|
15232
15381
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
15233
15382
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
15234
15383
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -15338,6 +15487,7 @@
|
|
15338
15487
|
<!-- termexample -->
|
15339
15488
|
<!-- ====== -->
|
15340
15489
|
<xsl:template match="*[local-name() = 'termexample']">
|
15490
|
+
<xsl:call-template name="setNamedDestination"/>
|
15341
15491
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
15342
15492
|
<xsl:call-template name="refine_termexample-style"/>
|
15343
15493
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15392,6 +15542,7 @@
|
|
15392
15542
|
-->
|
15393
15543
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
15394
15544
|
|
15545
|
+
<xsl:call-template name="setNamedDestination"/>
|
15395
15546
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
15396
15547
|
|
15397
15548
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15926,8 +16077,13 @@
|
|
15926
16077
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
15927
16078
|
|
15928
16079
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
16080
|
+
|
15929
16081
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
15930
16082
|
|
16083
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
16084
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
16085
|
+
</xsl:for-each>
|
16086
|
+
|
15931
16087
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
15932
16088
|
</fo:block>
|
15933
16089
|
</xsl:if>
|
@@ -16047,6 +16203,7 @@
|
|
16047
16203
|
<!-- main sections -->
|
16048
16204
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
16049
16205
|
|
16206
|
+
<xsl:call-template name="setNamedDestination"/>
|
16050
16207
|
<fo:block>
|
16051
16208
|
<xsl:call-template name="setId"/>
|
16052
16209
|
|
@@ -16098,6 +16255,7 @@
|
|
16098
16255
|
</xsl:otherwise>
|
16099
16256
|
</xsl:choose>
|
16100
16257
|
|
16258
|
+
<xsl:call-template name="setNamedDestination"/>
|
16101
16259
|
<fo:block>
|
16102
16260
|
<xsl:call-template name="setId"/>
|
16103
16261
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -16126,6 +16284,7 @@
|
|
16126
16284
|
</xsl:template>
|
16127
16285
|
|
16128
16286
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
16287
|
+
<xsl:call-template name="setNamedDestination"/>
|
16129
16288
|
<fo:block>
|
16130
16289
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
16131
16290
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -16148,6 +16307,7 @@
|
|
16148
16307
|
</xsl:template> <!-- refine_clause_style -->
|
16149
16308
|
|
16150
16309
|
<xsl:template match="*[local-name() = 'definitions']">
|
16310
|
+
<xsl:call-template name="setNamedDestination"/>
|
16151
16311
|
<fo:block id="{@id}">
|
16152
16312
|
<xsl:apply-templates/>
|
16153
16313
|
</fo:block>
|
@@ -16163,6 +16323,8 @@
|
|
16163
16323
|
<xsl:otherwise>
|
16164
16324
|
|
16165
16325
|
<fo:block break-after="page"/>
|
16326
|
+
<xsl:call-template name="setNamedDestination"/>
|
16327
|
+
|
16166
16328
|
<fo:block id="{@id}">
|
16167
16329
|
|
16168
16330
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -16234,6 +16396,7 @@
|
|
16234
16396
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
16235
16397
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
16236
16398
|
<!-- <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> -->
|
16399
|
+
<xsl:call-template name="setNamedDestination"/>
|
16237
16400
|
<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>
|
16238
16401
|
<!-- </xsl:if> -->
|
16239
16402
|
</xsl:if>
|
@@ -16340,9 +16503,15 @@
|
|
16340
16503
|
<xsl:when test="local-name(..) = 'ul'">
|
16341
16504
|
<xsl:choose>
|
16342
16505
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
16506
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
16507
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
16343
16508
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
16344
16509
|
</xsl:choose>
|
16345
16510
|
</xsl:when>
|
16511
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
16512
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
16513
|
+
<xsl:value-of select="@label"/>
|
16514
|
+
</xsl:when>
|
16346
16515
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
16347
16516
|
|
16348
16517
|
<xsl:variable name="type" select="../@type"/>
|
@@ -16474,7 +16643,7 @@
|
|
16474
16643
|
|
16475
16644
|
</xsl:otherwise>
|
16476
16645
|
</xsl:choose>
|
16477
|
-
</xsl:template>
|
16646
|
+
</xsl:template> <!-- getListItemFormat -->
|
16478
16647
|
|
16479
16648
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
16480
16649
|
<xsl:param name="indent">0</xsl:param>
|
@@ -16636,6 +16805,11 @@
|
|
16636
16805
|
|
16637
16806
|
<xsl:call-template name="refine_list-item-label-style"/>
|
16638
16807
|
|
16808
|
+
<xsl:if test="local-name(..) = 'ul'">
|
16809
|
+
<xsl:variable name="li_label" select="@label"/>
|
16810
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
16811
|
+
</xsl:if>
|
16812
|
+
|
16639
16813
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
16640
16814
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
16641
16815
|
<xsl:call-template name="append_add-style"/>
|
@@ -16988,6 +17162,7 @@
|
|
16988
17162
|
<!-- Normative references -->
|
16989
17163
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
16990
17164
|
|
17165
|
+
<xsl:call-template name="setNamedDestination"/>
|
16991
17166
|
<fo:block id="{@id}">
|
16992
17167
|
<xsl:apply-templates/>
|
16993
17168
|
|
@@ -17008,6 +17183,7 @@
|
|
17008
17183
|
</xsl:if>
|
17009
17184
|
</xsl:if> -->
|
17010
17185
|
|
17186
|
+
<xsl:call-template name="setNamedDestination"/>
|
17011
17187
|
<fo:block id="{@id}"/>
|
17012
17188
|
|
17013
17189
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -17027,6 +17203,7 @@
|
|
17027
17203
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
17028
17204
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
17029
17205
|
|
17206
|
+
<xsl:call-template name="setNamedDestination"/>
|
17030
17207
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
17031
17208
|
|
17032
17209
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17067,6 +17244,7 @@
|
|
17067
17244
|
<xsl:choose>
|
17068
17245
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
17069
17246
|
<xsl:otherwise>
|
17247
|
+
<xsl:call-template name="setNamedDestination"/>
|
17070
17248
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
17071
17249
|
|
17072
17250
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17724,7 +17902,7 @@
|
|
17724
17902
|
</xsl:template>
|
17725
17903
|
|
17726
17904
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
17727
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
17905
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
17728
17906
|
<xsl:copy>
|
17729
17907
|
<xsl:copy-of select="@*"/>
|
17730
17908
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -17756,28 +17934,56 @@
|
|
17756
17934
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
17757
17935
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
17758
17936
|
|
17759
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17937
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
17760
17938
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17761
17939
|
<xsl:copy-of select="@*"/>
|
17762
17940
|
<xsl:choose>
|
17763
17941
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17764
|
-
<xsl:
|
17942
|
+
<xsl:choose>
|
17943
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17944
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
17945
|
+
</xsl:when>
|
17946
|
+
<xsl:otherwise>
|
17947
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
17948
|
+
</xsl:otherwise>
|
17949
|
+
</xsl:choose>
|
17765
17950
|
</xsl:when>
|
17766
17951
|
<xsl:otherwise>
|
17767
|
-
<xsl:
|
17952
|
+
<xsl:choose>
|
17953
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17954
|
+
<xsl:copy-of select="node()"/>
|
17955
|
+
</xsl:when>
|
17956
|
+
<xsl:otherwise>
|
17957
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
17958
|
+
</xsl:otherwise>
|
17959
|
+
</xsl:choose>
|
17768
17960
|
</xsl:otherwise>
|
17769
17961
|
</xsl:choose>
|
17770
17962
|
</xsl:element>
|
17771
17963
|
</xsl:template>
|
17772
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17964
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
17773
17965
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17774
17966
|
<xsl:copy-of select="@*"/>
|
17775
17967
|
<xsl:choose>
|
17776
17968
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17777
|
-
<xsl:
|
17969
|
+
<xsl:choose>
|
17970
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17971
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
17972
|
+
</xsl:when>
|
17973
|
+
<xsl:otherwise>
|
17974
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
17975
|
+
</xsl:otherwise>
|
17976
|
+
</xsl:choose>
|
17778
17977
|
</xsl:when>
|
17779
17978
|
<xsl:otherwise>
|
17780
|
-
<xsl:
|
17979
|
+
<xsl:choose>
|
17980
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17981
|
+
<xsl:copy-of select="node()"/>
|
17982
|
+
</xsl:when>
|
17983
|
+
<xsl:otherwise>
|
17984
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
17985
|
+
</xsl:otherwise>
|
17986
|
+
</xsl:choose>
|
17781
17987
|
</xsl:otherwise>
|
17782
17988
|
</xsl:choose>
|
17783
17989
|
</xsl:element>
|
@@ -18006,16 +18212,53 @@
|
|
18006
18212
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
18007
18213
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18008
18214
|
<xsl:copy-of select="@*"/>
|
18215
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18216
|
+
|
18009
18217
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18010
18218
|
</xsl:element>
|
18011
18219
|
</xsl:template>
|
18012
18220
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
18013
18221
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18014
18222
|
<xsl:copy-of select="@*"/>
|
18223
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18224
|
+
|
18015
18225
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18016
18226
|
</xsl:element>
|
18017
18227
|
</xsl:template>
|
18018
18228
|
|
18229
|
+
<xsl:template name="addNamedDestinationAttribute">
|
18230
|
+
|
18231
|
+
<xsl:variable name="docnum"><xsl:number level="any" count="*[local-name() = 'metanorma']"/></xsl:variable>
|
18232
|
+
<xsl:variable name="caption_label" select="translate(normalize-space(.//*[local-name() = 'span'][@class = 'fmt-caption-label']), ' ()', '')"/>
|
18233
|
+
|
18234
|
+
<xsl:variable name="named_dest_">
|
18235
|
+
<xsl:choose>
|
18236
|
+
<xsl:when test="count(ancestor::*[local-name() = 'figure']) > 1"/> <!-- prevent id 'a)' -->
|
18237
|
+
<xsl:when test="ancestor::*[local-name() = 'note'] or ancestor::*[local-name() = 'example'] or ancestor::*[local-name() = 'termnote'] or ancestor::*[local-name() = 'termexample']"/>
|
18238
|
+
<xsl:when test="$caption_label = '' and parent::*[local-name() = 'foreword']">Foreword</xsl:when>
|
18239
|
+
<xsl:when test="$caption_label = '' and parent::*[local-name() = 'introduction']">Introduction</xsl:when>
|
18240
|
+
<xsl:when test="$caption_label = ''"/>
|
18241
|
+
<xsl:when test="../@unnumbered = 'true'"/>
|
18242
|
+
<xsl:otherwise>
|
18243
|
+
<xsl:if test="parent::*[local-name() = 'formula']">Formula</xsl:if>
|
18244
|
+
<xsl:value-of select="$caption_label"/>
|
18245
|
+
</xsl:otherwise>
|
18246
|
+
</xsl:choose>
|
18247
|
+
</xsl:variable>
|
18248
|
+
<xsl:variable name="named_dest" select="normalize-space($named_dest_)"/>
|
18249
|
+
<xsl:if test="$named_dest != ''">
|
18250
|
+
<xsl:variable name="named_dest_doc_">
|
18251
|
+
<xsl:value-of select="$named_dest"/>
|
18252
|
+
<xsl:if test="$docnum != '1'">_<xsl:value-of select="$docnum"/></xsl:if>
|
18253
|
+
</xsl:variable>
|
18254
|
+
<xsl:variable name="named_dest_doc" select="normalize-space($named_dest_doc_)"/>
|
18255
|
+
<xsl:if test="not(key('kid', $named_dest_doc))"> <!-- if element with id '$named_dest_doc' doesn't exist in the document -->
|
18256
|
+
<xsl:attribute name="named_dest"><xsl:value-of select="normalize-space($named_dest_doc)"/></xsl:attribute>
|
18257
|
+
</xsl:if>
|
18258
|
+
</xsl:if>
|
18259
|
+
|
18260
|
+
</xsl:template>
|
18261
|
+
|
18019
18262
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
18020
18263
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
18021
18264
|
<xsl:choose>
|
@@ -18025,6 +18268,8 @@
|
|
18025
18268
|
<xsl:otherwise>
|
18026
18269
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18027
18270
|
<xsl:copy-of select="@*"/>
|
18271
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18272
|
+
|
18028
18273
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18029
18274
|
</xsl:element>
|
18030
18275
|
</xsl:otherwise>
|
@@ -18038,12 +18283,24 @@
|
|
18038
18283
|
<xsl:otherwise>
|
18039
18284
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18040
18285
|
<xsl:copy-of select="@*"/>
|
18286
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18287
|
+
|
18041
18288
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18042
18289
|
</xsl:element>
|
18043
18290
|
</xsl:otherwise>
|
18044
18291
|
</xsl:choose>
|
18045
18292
|
</xsl:template>
|
18046
18293
|
|
18294
|
+
<!-- li/fmt-name -->
|
18295
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
18296
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
18297
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
18298
|
+
</xsl:template>
|
18299
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
18300
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
18301
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
18302
|
+
</xsl:template>
|
18303
|
+
|
18047
18304
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
18048
18305
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
18049
18306
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -18981,6 +19238,64 @@
|
|
18981
19238
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
18982
19239
|
</xsl:template>
|
18983
19240
|
|
19241
|
+
<!-- ===================================== -->
|
19242
|
+
<!-- ===================================== -->
|
19243
|
+
<!-- Ruby text (CJK languages) rendering -->
|
19244
|
+
<!-- ===================================== -->
|
19245
|
+
<!-- ===================================== -->
|
19246
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
19247
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
19248
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
19249
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
19250
|
+
</xsl:if>
|
19251
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
19252
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
19253
|
+
<!-- Example: width="2em" -->
|
19254
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
19255
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
19256
|
+
<xsl:variable name="text_width">
|
19257
|
+
<xsl:choose>
|
19258
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
19259
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
19260
|
+
</xsl:choose>
|
19261
|
+
</xsl:variable>
|
19262
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
19263
|
+
|
19264
|
+
<xsl:choose>
|
19265
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
19266
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
19267
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
19268
|
+
</xsl:when>
|
19269
|
+
<xsl:otherwise>
|
19270
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
19271
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
19272
|
+
</xsl:otherwise>
|
19273
|
+
</xsl:choose>
|
19274
|
+
|
19275
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
19276
|
+
</fo:inline-container>
|
19277
|
+
</xsl:template>
|
19278
|
+
|
19279
|
+
<xsl:template match="*[local-name() = 'rb']">
|
19280
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
19281
|
+
</xsl:template>
|
19282
|
+
|
19283
|
+
<xsl:template match="*[local-name() = 'rt']">
|
19284
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
19285
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
19286
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
19287
|
+
</xsl:if>
|
19288
|
+
<xsl:apply-templates/>
|
19289
|
+
</fo:block>
|
19290
|
+
|
19291
|
+
</xsl:template>
|
19292
|
+
|
19293
|
+
<!-- ===================================== -->
|
19294
|
+
<!-- ===================================== -->
|
19295
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
19296
|
+
<!-- ===================================== -->
|
19297
|
+
<!-- ===================================== -->
|
19298
|
+
|
18984
19299
|
<xsl:template name="printEdition">
|
18985
19300
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
18986
19301
|
|
@@ -19561,6 +19876,24 @@
|
|
19561
19876
|
</xsl:attribute>
|
19562
19877
|
</xsl:template>
|
19563
19878
|
|
19879
|
+
<xsl:template name="setIDforNamedDestination">
|
19880
|
+
<xsl:if test="@named_dest">
|
19881
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
19882
|
+
</xsl:if>
|
19883
|
+
</xsl:template>
|
19884
|
+
|
19885
|
+
<xsl:template name="setNamedDestination">
|
19886
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
19887
|
+
<xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
|
19888
|
+
<fox:destination internal-destination="{@id}"/>
|
19889
|
+
</xsl:if>
|
19890
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
19891
|
+
<xsl:if test="@named_dest">
|
19892
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
19893
|
+
</xsl:if>
|
19894
|
+
</xsl:for-each>
|
19895
|
+
</xsl:template>
|
19896
|
+
|
19564
19897
|
<xsl:template name="add-letter-spacing">
|
19565
19898
|
<xsl:param name="text"/>
|
19566
19899
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|