metanorma-iso 3.0.4 → 3.0.6
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 +251 -29
- data/lib/isodoc/iso/iso.international-standard.xsl +251 -29
- 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 +6 -1
- 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/isodoc.rng +16 -1
- data/lib/metanorma/iso/isostandard.rng +0 -5
- data/lib/metanorma/iso/section.rb +9 -2
- data/lib/metanorma/iso/validate.rb +2 -4
- data/lib/metanorma/iso/validate_list.rb +7 -6
- 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
|
|
@@ -3287,7 +3289,7 @@
|
|
3287
3289
|
</xsl:choose>
|
3288
3290
|
</xsl:variable>
|
3289
3291
|
<xsl:variable name="section_length_str" select="string-length(normalize-space(@section))"/>
|
3290
|
-
<xsl:variable name="section_length_mm" select="$section_length_str * 2"/>
|
3292
|
+
<xsl:variable name="section_length_mm" select="$section_length_str * 2.1"/>
|
3291
3293
|
|
3292
3294
|
<!-- refine the distance depends on the section string length -->
|
3293
3295
|
<xsl:attribute name="provisional-distance-between-starts">
|
@@ -3416,7 +3418,20 @@
|
|
3416
3418
|
</xsl:template>
|
3417
3419
|
|
3418
3420
|
<xsl:template match="iso:pagebreak" priority="2">
|
3419
|
-
<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>
|
3420
3435
|
</xsl:template>
|
3421
3436
|
|
3422
3437
|
<xsl:template name="insertListOf_Title">
|
@@ -3923,6 +3938,7 @@
|
|
3923
3938
|
</xsl:when>
|
3924
3939
|
<xsl:otherwise>
|
3925
3940
|
<fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always" role="H1">
|
3941
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
3926
3942
|
<xsl:if test="$layoutVersion = '2024'">
|
3927
3943
|
<xsl:attribute name="line-height">1.1</xsl:attribute>
|
3928
3944
|
<!-- <xsl:attribute name="margin-bottom">52pt</xsl:attribute> -->
|
@@ -4040,6 +4056,7 @@
|
|
4040
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>
|
4041
4057
|
<xsl:when test="$doctype = 'amendment' and not(ancestor::iso:preface)">
|
4042
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"/>
|
4043
4060
|
<!-- <xsl:if test="$layoutVersion = '2024'">
|
4044
4061
|
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
4045
4062
|
</xsl:if> -->
|
@@ -4149,6 +4166,9 @@
|
|
4149
4166
|
</xsl:otherwise>
|
4150
4167
|
</xsl:choose>
|
4151
4168
|
</xsl:if>
|
4169
|
+
|
4170
|
+
<xsl:call-template name="setIDforNamedDestinationInline"/>
|
4171
|
+
|
4152
4172
|
<xsl:choose>
|
4153
4173
|
<xsl:when test="$layoutVersion = '1951' and ((ancestor::iso:preface and $level = 1) or (parent::iso:introduction and $revision_date_num < 19680101))">
|
4154
4174
|
<xsl:call-template name="add-letter-spacing">
|
@@ -4228,6 +4248,17 @@
|
|
4228
4248
|
</xsl:otherwise>
|
4229
4249
|
</xsl:choose>
|
4230
4250
|
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
4251
|
+
|
4252
|
+
<!-- because @id from preceding clause applied, see above -->
|
4253
|
+
<!-- <xsl:if test="$layoutVersion = '1951' or $layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989' or
|
4254
|
+
@type = 'floating-title' or @type = 'section-title'">
|
4255
|
+
<xsl:if test="@named_dest">
|
4256
|
+
<fo:inline>
|
4257
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4258
|
+
<xsl:value-of select="$zero_width_space"/>
|
4259
|
+
</fo:inline>
|
4260
|
+
</xsl:if>
|
4261
|
+
</xsl:if> -->
|
4231
4262
|
</xsl:element>
|
4232
4263
|
|
4233
4264
|
<xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iso:p)">
|
@@ -4256,6 +4287,7 @@
|
|
4256
4287
|
<xsl:call-template name="getId"/>
|
4257
4288
|
</xsl:variable> id="{$id}" -->
|
4258
4289
|
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
|
4290
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4259
4291
|
<!-- <xsl:if test="$layoutVersion = '2024'">
|
4260
4292
|
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
4261
4293
|
</xsl:if> -->
|
@@ -4287,6 +4319,8 @@
|
|
4287
4319
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
4288
4320
|
</xsl:choose>
|
4289
4321
|
</xsl:variable>
|
4322
|
+
|
4323
|
+
<xsl:call-template name="setNamedDestination"/>
|
4290
4324
|
<xsl:element name="{$element-name}">
|
4291
4325
|
|
4292
4326
|
<xsl:call-template name="setBlockAttributes">
|
@@ -4525,6 +4559,7 @@
|
|
4525
4559
|
|
4526
4560
|
<!-- main sections -->
|
4527
4561
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node_iso" priority="3">
|
4562
|
+
<xsl:call-template name="setNamedDestination"/>
|
4528
4563
|
<fo:block>
|
4529
4564
|
<xsl:call-template name="setId"/>
|
4530
4565
|
|
@@ -4544,6 +4579,7 @@
|
|
4544
4579
|
</xsl:template>
|
4545
4580
|
|
4546
4581
|
<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 -->
|
4582
|
+
<xsl:call-template name="setNamedDestination"/>
|
4547
4583
|
<fo:block>
|
4548
4584
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
4549
4585
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -8224,8 +8260,14 @@
|
|
8224
8260
|
</xsl:choose>
|
8225
8261
|
</xsl:variable>
|
8226
8262
|
|
8263
|
+
<xsl:call-template name="setNamedDestination"/>
|
8264
|
+
|
8227
8265
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
8228
8266
|
|
8267
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
8268
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
8269
|
+
</xsl:for-each>
|
8270
|
+
|
8229
8271
|
<xsl:call-template name="refine_table-container-style">
|
8230
8272
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
8231
8273
|
</xsl:call-template>
|
@@ -8443,6 +8485,7 @@
|
|
8443
8485
|
<!-- table/name-->
|
8444
8486
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
8445
8487
|
<xsl:param name="continued"/>
|
8488
|
+
<xsl:param name="cols-count"/>
|
8446
8489
|
<xsl:if test="normalize-space() != ''">
|
8447
8490
|
|
8448
8491
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -8474,9 +8517,30 @@
|
|
8474
8517
|
|
8475
8518
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
8476
8519
|
<xsl:if test="$continued = 'true'">
|
8477
|
-
|
8478
|
-
|
8479
|
-
|
8520
|
+
|
8521
|
+
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
8522
|
+
|
8523
|
+
<xsl:choose>
|
8524
|
+
<xsl:when test="string(number($cols-count)) != 'NaN'">
|
8525
|
+
<fo:table width="100%" table-layout="fixed" role="SKIP">
|
8526
|
+
<fo:table-body role="SKIP">
|
8527
|
+
<fo:table-row>
|
8528
|
+
<fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
|
8529
|
+
<fo:block text-align="right" role="SKIP">
|
8530
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
8531
|
+
</fo:block>
|
8532
|
+
</fo:table-cell>
|
8533
|
+
</fo:table-row>
|
8534
|
+
</fo:table-body>
|
8535
|
+
</fo:table>
|
8536
|
+
</xsl:when>
|
8537
|
+
<xsl:otherwise>
|
8538
|
+
<fo:block text-align="right">
|
8539
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
8540
|
+
</fo:block>
|
8541
|
+
</xsl:otherwise>
|
8542
|
+
</xsl:choose>
|
8543
|
+
|
8480
8544
|
</xsl:if>
|
8481
8545
|
<!-- </xsl:if> -->
|
8482
8546
|
|
@@ -8873,6 +8937,7 @@
|
|
8873
8937
|
|
8874
8938
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
8875
8939
|
<xsl:with-param name="continued">true</xsl:with-param>
|
8940
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
8876
8941
|
</xsl:apply-templates>
|
8877
8942
|
|
8878
8943
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -9052,7 +9117,8 @@
|
|
9052
9117
|
|
9053
9118
|
<!-- if there isn't 'thead' and there is a table's title -->
|
9054
9119
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
|
9055
|
-
<fo:table-header
|
9120
|
+
<fo:table-header>
|
9121
|
+
|
9056
9122
|
<xsl:call-template name="table-header-title">
|
9057
9123
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
9058
9124
|
</xsl:call-template>
|
@@ -9309,8 +9375,8 @@
|
|
9309
9375
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
9310
9376
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
9311
9377
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
9312
|
-
<xsl:if test="$key = 'color' or
|
9313
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
9378
|
+
<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'">
|
9379
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
9314
9380
|
</xsl:if>
|
9315
9381
|
</xsl:for-each>
|
9316
9382
|
</xsl:variable>
|
@@ -9374,6 +9440,7 @@
|
|
9374
9440
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
9375
9441
|
<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">
|
9376
9442
|
|
9443
|
+
<xsl:call-template name="setNamedDestination"/>
|
9377
9444
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
9378
9445
|
<xsl:copy-of select="@id"/>
|
9379
9446
|
|
@@ -9912,7 +9979,7 @@
|
|
9912
9979
|
<xsl:variable name="target" select="@target"/>
|
9913
9980
|
<xsl:choose>
|
9914
9981
|
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
9915
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]
|
9982
|
+
<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]">
|
9916
9983
|
<xsl:call-template name="fn">
|
9917
9984
|
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
9918
9985
|
</xsl:call-template>
|
@@ -10008,6 +10075,10 @@
|
|
10008
10075
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
10009
10076
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
10010
10077
|
|
10078
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
10079
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
10080
|
+
</xsl:if>
|
10081
|
+
|
10011
10082
|
<xsl:call-template name="setBlockSpanAll"/>
|
10012
10083
|
|
10013
10084
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -10309,7 +10380,7 @@
|
|
10309
10380
|
|
10310
10381
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
10311
10382
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
10312
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
10383
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
10313
10384
|
<xsl:call-template name="refine_figure_key_style"/>
|
10314
10385
|
<xsl:apply-templates/>
|
10315
10386
|
</fo:block>
|
@@ -10570,6 +10641,7 @@
|
|
10570
10641
|
|
10571
10642
|
<xsl:call-template name="refine_dt-cell-style"/>
|
10572
10643
|
|
10644
|
+
<xsl:call-template name="setNamedDestination"/>
|
10573
10645
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
10574
10646
|
|
10575
10647
|
<xsl:choose>
|
@@ -11012,7 +11084,7 @@
|
|
11012
11084
|
<!-- ================= -->
|
11013
11085
|
|
11014
11086
|
<!-- highlight text -->
|
11015
|
-
<xsl:template match="*[local-name()='hi']">
|
11087
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
11016
11088
|
<fo:inline background-color="yellow">
|
11017
11089
|
<xsl:apply-templates/>
|
11018
11090
|
</fo:inline>
|
@@ -12691,6 +12763,7 @@
|
|
12691
12763
|
<!-- Appendix processing -->
|
12692
12764
|
<!-- ======================== -->
|
12693
12765
|
<xsl:template match="*[local-name()='appendix']">
|
12766
|
+
<xsl:call-template name="setNamedDestination"/>
|
12694
12767
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
12695
12768
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
12696
12769
|
</fo:block>
|
@@ -12701,13 +12774,14 @@
|
|
12701
12774
|
<xsl:variable name="level">
|
12702
12775
|
<xsl:call-template name="getLevel"/>
|
12703
12776
|
</xsl:variable>
|
12704
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
12777
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
12705
12778
|
</xsl:template>
|
12706
12779
|
<!-- ======================== -->
|
12707
12780
|
<!-- END Appendix processing -->
|
12708
12781
|
<!-- ======================== -->
|
12709
12782
|
|
12710
12783
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
12784
|
+
<xsl:call-template name="setNamedDestination"/>
|
12711
12785
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
12712
12786
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
12713
12787
|
</fo:block>
|
@@ -12737,6 +12811,7 @@
|
|
12737
12811
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
12738
12812
|
<xsl:param name="callout"/>
|
12739
12813
|
<fo:inline id="{@id}">
|
12814
|
+
<xsl:call-template name="setNamedDestination"/>
|
12740
12815
|
<!-- for first p in annotation, put <x> -->
|
12741
12816
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
12742
12817
|
<xsl:apply-templates/>
|
@@ -12785,6 +12860,7 @@
|
|
12785
12860
|
|
12786
12861
|
</xsl:if>
|
12787
12862
|
<fo:block-container margin-left="0mm" role="SKIP">
|
12863
|
+
<xsl:call-template name="setNamedDestination"/>
|
12788
12864
|
<fo:block id="{@id}">
|
12789
12865
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
12790
12866
|
</fo:block>
|
@@ -12830,8 +12906,13 @@
|
|
12830
12906
|
</fo:block>
|
12831
12907
|
</fo:table-cell>
|
12832
12908
|
<fo:table-cell display-align="center">
|
12909
|
+
|
12833
12910
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
12834
12911
|
|
12912
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
12913
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
12914
|
+
</xsl:for-each>
|
12915
|
+
|
12835
12916
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
12836
12917
|
|
12837
12918
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -12866,6 +12947,8 @@
|
|
12866
12947
|
|
12867
12948
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
12868
12949
|
|
12950
|
+
<xsl:call-template name="setNamedDestination"/>
|
12951
|
+
|
12869
12952
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
12870
12953
|
|
12871
12954
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12953,6 +13036,7 @@
|
|
12953
13036
|
</xsl:template>
|
12954
13037
|
|
12955
13038
|
<xsl:template match="*[local-name() = 'termnote']">
|
13039
|
+
<xsl:call-template name="setNamedDestination"/>
|
12956
13040
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
12957
13041
|
|
12958
13042
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -13063,12 +13147,14 @@
|
|
13063
13147
|
|
13064
13148
|
<xsl:template match="*[local-name() = 'terms']">
|
13065
13149
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
13150
|
+
<xsl:call-template name="setNamedDestination"/>
|
13066
13151
|
<fo:block id="{@id}">
|
13067
13152
|
<xsl:apply-templates/>
|
13068
13153
|
</fo:block>
|
13069
13154
|
</xsl:template>
|
13070
13155
|
|
13071
13156
|
<xsl:template match="*[local-name() = 'term']">
|
13157
|
+
<xsl:call-template name="setNamedDestination"/>
|
13072
13158
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
13073
13159
|
|
13074
13160
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -13102,6 +13188,7 @@
|
|
13102
13188
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
13103
13189
|
<xsl:variable name="isAdded" select="@added"/>
|
13104
13190
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
13191
|
+
<xsl:call-template name="setNamedDestination"/>
|
13105
13192
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
13106
13193
|
<xsl:call-template name="refine_figure-block-style"/>
|
13107
13194
|
|
@@ -13118,6 +13205,11 @@
|
|
13118
13205
|
</xsl:variable>
|
13119
13206
|
|
13120
13207
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
13208
|
+
|
13209
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
13210
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
13211
|
+
</xsl:for-each>
|
13212
|
+
|
13121
13213
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
13122
13214
|
</fo:block>
|
13123
13215
|
|
@@ -13150,6 +13242,7 @@
|
|
13150
13242
|
</xsl:template>
|
13151
13243
|
|
13152
13244
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
13245
|
+
<xsl:call-template name="setNamedDestination"/>
|
13153
13246
|
<fo:block id="{@id}">
|
13154
13247
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
13155
13248
|
</fo:block>
|
@@ -13163,6 +13256,7 @@
|
|
13163
13256
|
</xsl:template>
|
13164
13257
|
|
13165
13258
|
<!-- SOURCE: ... -->
|
13259
|
+
<!-- figure/source -->
|
13166
13260
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
13167
13261
|
|
13168
13262
|
<xsl:call-template name="termsource"/>
|
@@ -14395,6 +14489,7 @@
|
|
14395
14489
|
<xsl:template match="title" mode="bookmark"/>
|
14396
14490
|
<xsl:template match="text()" mode="bookmark"/>
|
14397
14491
|
|
14492
|
+
<!-- figure/name -->
|
14398
14493
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
14399
14494
|
<xsl:if test="normalize-space() != ''">
|
14400
14495
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -15109,6 +15204,7 @@
|
|
15109
15204
|
<!-- permission -->
|
15110
15205
|
<!-- ========== -->
|
15111
15206
|
<xsl:template match="*[local-name() = 'permission']">
|
15207
|
+
<xsl:call-template name="setNamedDestination"/>
|
15112
15208
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
15113
15209
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15114
15210
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15117,10 +15213,12 @@
|
|
15117
15213
|
|
15118
15214
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
15119
15215
|
<xsl:if test="normalize-space() != ''">
|
15120
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15121
|
-
<xsl:apply-templates/>
|
15122
15216
|
|
15123
|
-
|
15217
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15218
|
+
<xsl:apply-templates/>
|
15219
|
+
|
15220
|
+
</fo:block>
|
15221
|
+
|
15124
15222
|
</xsl:if>
|
15125
15223
|
</xsl:template>
|
15126
15224
|
|
@@ -15136,6 +15234,7 @@
|
|
15136
15234
|
<!-- requirement -->
|
15137
15235
|
<!-- ========== -->
|
15138
15236
|
<xsl:template match="*[local-name() = 'requirement']">
|
15237
|
+
<xsl:call-template name="setNamedDestination"/>
|
15139
15238
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
15140
15239
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15141
15240
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -15147,13 +15246,15 @@
|
|
15147
15246
|
|
15148
15247
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
15149
15248
|
<xsl:if test="normalize-space() != ''">
|
15150
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15151
15249
|
|
15152
|
-
|
15250
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15251
|
+
|
15252
|
+
<xsl:apply-templates/>
|
15153
15253
|
|
15154
|
-
|
15254
|
+
<xsl:text>:</xsl:text>
|
15255
|
+
|
15256
|
+
</fo:block>
|
15155
15257
|
|
15156
|
-
</fo:block>
|
15157
15258
|
</xsl:if>
|
15158
15259
|
</xsl:template>
|
15159
15260
|
|
@@ -15182,6 +15283,7 @@
|
|
15182
15283
|
<!-- recommendation -->
|
15183
15284
|
<!-- ========== -->
|
15184
15285
|
<xsl:template match="*[local-name() = 'recommendation']">
|
15286
|
+
<xsl:call-template name="setNamedDestination"/>
|
15185
15287
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
15186
15288
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15187
15289
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15190,10 +15292,12 @@
|
|
15190
15292
|
|
15191
15293
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
15192
15294
|
<xsl:if test="normalize-space() != ''">
|
15193
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15194
|
-
<xsl:apply-templates/>
|
15195
15295
|
|
15196
|
-
|
15296
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15297
|
+
<xsl:apply-templates/>
|
15298
|
+
|
15299
|
+
</fo:block>
|
15300
|
+
|
15197
15301
|
</xsl:if>
|
15198
15302
|
</xsl:template>
|
15199
15303
|
|
@@ -15272,6 +15376,7 @@
|
|
15272
15376
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
15273
15377
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
15274
15378
|
</xsl:if>
|
15379
|
+
<xsl:call-template name="setNamedDestination"/>
|
15275
15380
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
15276
15381
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
15277
15382
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -15381,6 +15486,7 @@
|
|
15381
15486
|
<!-- termexample -->
|
15382
15487
|
<!-- ====== -->
|
15383
15488
|
<xsl:template match="*[local-name() = 'termexample']">
|
15489
|
+
<xsl:call-template name="setNamedDestination"/>
|
15384
15490
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
15385
15491
|
<xsl:call-template name="refine_termexample-style"/>
|
15386
15492
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15435,6 +15541,7 @@
|
|
15435
15541
|
-->
|
15436
15542
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
15437
15543
|
|
15544
|
+
<xsl:call-template name="setNamedDestination"/>
|
15438
15545
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
15439
15546
|
|
15440
15547
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15969,8 +16076,13 @@
|
|
15969
16076
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
15970
16077
|
|
15971
16078
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
16079
|
+
|
15972
16080
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
15973
16081
|
|
16082
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
16083
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
16084
|
+
</xsl:for-each>
|
16085
|
+
|
15974
16086
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
15975
16087
|
</fo:block>
|
15976
16088
|
</xsl:if>
|
@@ -16090,6 +16202,7 @@
|
|
16090
16202
|
<!-- main sections -->
|
16091
16203
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
16092
16204
|
|
16205
|
+
<xsl:call-template name="setNamedDestination"/>
|
16093
16206
|
<fo:block>
|
16094
16207
|
<xsl:call-template name="setId"/>
|
16095
16208
|
|
@@ -16141,6 +16254,7 @@
|
|
16141
16254
|
</xsl:otherwise>
|
16142
16255
|
</xsl:choose>
|
16143
16256
|
|
16257
|
+
<xsl:call-template name="setNamedDestination"/>
|
16144
16258
|
<fo:block>
|
16145
16259
|
<xsl:call-template name="setId"/>
|
16146
16260
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -16169,6 +16283,7 @@
|
|
16169
16283
|
</xsl:template>
|
16170
16284
|
|
16171
16285
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
16286
|
+
<xsl:call-template name="setNamedDestination"/>
|
16172
16287
|
<fo:block>
|
16173
16288
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
16174
16289
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -16191,6 +16306,7 @@
|
|
16191
16306
|
</xsl:template> <!-- refine_clause_style -->
|
16192
16307
|
|
16193
16308
|
<xsl:template match="*[local-name() = 'definitions']">
|
16309
|
+
<xsl:call-template name="setNamedDestination"/>
|
16194
16310
|
<fo:block id="{@id}">
|
16195
16311
|
<xsl:apply-templates/>
|
16196
16312
|
</fo:block>
|
@@ -16206,6 +16322,8 @@
|
|
16206
16322
|
<xsl:otherwise>
|
16207
16323
|
|
16208
16324
|
<fo:block break-after="page"/>
|
16325
|
+
<xsl:call-template name="setNamedDestination"/>
|
16326
|
+
|
16209
16327
|
<fo:block id="{@id}">
|
16210
16328
|
|
16211
16329
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -16277,6 +16395,7 @@
|
|
16277
16395
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
16278
16396
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
16279
16397
|
<!-- <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> -->
|
16398
|
+
<xsl:call-template name="setNamedDestination"/>
|
16280
16399
|
<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>
|
16281
16400
|
<!-- </xsl:if> -->
|
16282
16401
|
</xsl:if>
|
@@ -17042,6 +17161,7 @@
|
|
17042
17161
|
<!-- Normative references -->
|
17043
17162
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
17044
17163
|
|
17164
|
+
<xsl:call-template name="setNamedDestination"/>
|
17045
17165
|
<fo:block id="{@id}">
|
17046
17166
|
<xsl:apply-templates/>
|
17047
17167
|
|
@@ -17062,6 +17182,7 @@
|
|
17062
17182
|
</xsl:if>
|
17063
17183
|
</xsl:if> -->
|
17064
17184
|
|
17185
|
+
<xsl:call-template name="setNamedDestination"/>
|
17065
17186
|
<fo:block id="{@id}"/>
|
17066
17187
|
|
17067
17188
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -17081,6 +17202,7 @@
|
|
17081
17202
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
17082
17203
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
17083
17204
|
|
17205
|
+
<xsl:call-template name="setNamedDestination"/>
|
17084
17206
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
17085
17207
|
|
17086
17208
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17121,6 +17243,7 @@
|
|
17121
17243
|
<xsl:choose>
|
17122
17244
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
17123
17245
|
<xsl:otherwise>
|
17246
|
+
<xsl:call-template name="setNamedDestination"/>
|
17124
17247
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
17125
17248
|
|
17126
17249
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17778,7 +17901,7 @@
|
|
17778
17901
|
</xsl:template>
|
17779
17902
|
|
17780
17903
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
17781
|
-
<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">
|
17904
|
+
<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">
|
17782
17905
|
<xsl:copy>
|
17783
17906
|
<xsl:copy-of select="@*"/>
|
17784
17907
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -17810,28 +17933,56 @@
|
|
17810
17933
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
17811
17934
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
17812
17935
|
|
17813
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17936
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
17814
17937
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17815
17938
|
<xsl:copy-of select="@*"/>
|
17816
17939
|
<xsl:choose>
|
17817
17940
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17818
|
-
<xsl:
|
17941
|
+
<xsl:choose>
|
17942
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17943
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
17944
|
+
</xsl:when>
|
17945
|
+
<xsl:otherwise>
|
17946
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
17947
|
+
</xsl:otherwise>
|
17948
|
+
</xsl:choose>
|
17819
17949
|
</xsl:when>
|
17820
17950
|
<xsl:otherwise>
|
17821
|
-
<xsl:
|
17951
|
+
<xsl:choose>
|
17952
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17953
|
+
<xsl:copy-of select="node()"/>
|
17954
|
+
</xsl:when>
|
17955
|
+
<xsl:otherwise>
|
17956
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
17957
|
+
</xsl:otherwise>
|
17958
|
+
</xsl:choose>
|
17822
17959
|
</xsl:otherwise>
|
17823
17960
|
</xsl:choose>
|
17824
17961
|
</xsl:element>
|
17825
17962
|
</xsl:template>
|
17826
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17963
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
17827
17964
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17828
17965
|
<xsl:copy-of select="@*"/>
|
17829
17966
|
<xsl:choose>
|
17830
17967
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17831
|
-
<xsl:
|
17968
|
+
<xsl:choose>
|
17969
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17970
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
17971
|
+
</xsl:when>
|
17972
|
+
<xsl:otherwise>
|
17973
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
17974
|
+
</xsl:otherwise>
|
17975
|
+
</xsl:choose>
|
17832
17976
|
</xsl:when>
|
17833
17977
|
<xsl:otherwise>
|
17834
|
-
<xsl:
|
17978
|
+
<xsl:choose>
|
17979
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
17980
|
+
<xsl:copy-of select="node()"/>
|
17981
|
+
</xsl:when>
|
17982
|
+
<xsl:otherwise>
|
17983
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
17984
|
+
</xsl:otherwise>
|
17985
|
+
</xsl:choose>
|
17835
17986
|
</xsl:otherwise>
|
17836
17987
|
</xsl:choose>
|
17837
17988
|
</xsl:element>
|
@@ -18060,16 +18211,59 @@
|
|
18060
18211
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
18061
18212
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18062
18213
|
<xsl:copy-of select="@*"/>
|
18214
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18215
|
+
|
18063
18216
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18064
18217
|
</xsl:element>
|
18065
18218
|
</xsl:template>
|
18066
18219
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
18067
18220
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18068
18221
|
<xsl:copy-of select="@*"/>
|
18222
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18223
|
+
|
18069
18224
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18070
18225
|
</xsl:element>
|
18071
18226
|
</xsl:template>
|
18072
18227
|
|
18228
|
+
<xsl:template name="addNamedDestinationAttribute">
|
18229
|
+
|
18230
|
+
<xsl:variable name="docnum"><xsl:number level="any" count="*[local-name() = 'metanorma']"/></xsl:variable>
|
18231
|
+
<xsl:variable name="caption_label" select="translate(normalize-space(.//*[local-name() = 'span'][@class = 'fmt-caption-label']), ' ()', '')"/>
|
18232
|
+
|
18233
|
+
<xsl:variable name="named_dest_">
|
18234
|
+
<xsl:choose>
|
18235
|
+
<xsl:when test="count(ancestor::*[local-name() = 'figure']) > 1"/> <!-- prevent id 'a)' -->
|
18236
|
+
<xsl:when test="ancestor::*[local-name() = 'note'] or ancestor::*[local-name() = 'example'] or ancestor::*[local-name() = 'termnote'] or ancestor::*[local-name() = 'termexample']"/>
|
18237
|
+
<xsl:when test="$caption_label = '' and parent::*[local-name() = 'foreword']">
|
18238
|
+
<xsl:variable name="foreword_number"><xsl:number count="*[local-name() = 'foreword']" level="any"/></xsl:variable>
|
18239
|
+
<xsl:if test="$foreword_number = 1">Foreword</xsl:if>
|
18240
|
+
</xsl:when>
|
18241
|
+
<xsl:when test="$caption_label = '' and parent::*[local-name() = 'introduction']">
|
18242
|
+
<xsl:variable name="introduction_number"><xsl:number count="*[local-name() = 'introduction']" level="any"/></xsl:variable>
|
18243
|
+
<xsl:if test="$introduction_number = 1">Introduction</xsl:if>
|
18244
|
+
</xsl:when>
|
18245
|
+
<xsl:when test="$caption_label = ''"/>
|
18246
|
+
<xsl:when test="../@unnumbered = 'true'"/>
|
18247
|
+
<xsl:otherwise>
|
18248
|
+
<xsl:if test="parent::*[local-name() = 'formula']">Formula</xsl:if>
|
18249
|
+
<xsl:value-of select="$caption_label"/>
|
18250
|
+
</xsl:otherwise>
|
18251
|
+
</xsl:choose>
|
18252
|
+
</xsl:variable>
|
18253
|
+
<xsl:variable name="named_dest" select="normalize-space($named_dest_)"/>
|
18254
|
+
<xsl:if test="$named_dest != ''">
|
18255
|
+
<xsl:variable name="named_dest_doc_">
|
18256
|
+
<xsl:value-of select="$named_dest"/>
|
18257
|
+
<xsl:if test="$docnum != '1'">_<xsl:value-of select="$docnum"/></xsl:if>
|
18258
|
+
</xsl:variable>
|
18259
|
+
<xsl:variable name="named_dest_doc" select="normalize-space($named_dest_doc_)"/>
|
18260
|
+
<xsl:if test="not(key('kid', $named_dest_doc))"> <!-- if element with id '$named_dest_doc' doesn't exist in the document -->
|
18261
|
+
<xsl:attribute name="named_dest"><xsl:value-of select="normalize-space($named_dest_doc)"/></xsl:attribute>
|
18262
|
+
</xsl:if>
|
18263
|
+
</xsl:if>
|
18264
|
+
|
18265
|
+
</xsl:template>
|
18266
|
+
|
18073
18267
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
18074
18268
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
18075
18269
|
<xsl:choose>
|
@@ -18079,6 +18273,8 @@
|
|
18079
18273
|
<xsl:otherwise>
|
18080
18274
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18081
18275
|
<xsl:copy-of select="@*"/>
|
18276
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18277
|
+
|
18082
18278
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18083
18279
|
</xsl:element>
|
18084
18280
|
</xsl:otherwise>
|
@@ -18092,6 +18288,8 @@
|
|
18092
18288
|
<xsl:otherwise>
|
18093
18289
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18094
18290
|
<xsl:copy-of select="@*"/>
|
18291
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18292
|
+
|
18095
18293
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18096
18294
|
</xsl:element>
|
18097
18295
|
</xsl:otherwise>
|
@@ -19683,6 +19881,30 @@
|
|
19683
19881
|
</xsl:attribute>
|
19684
19882
|
</xsl:template>
|
19685
19883
|
|
19884
|
+
<xsl:template name="setIDforNamedDestination">
|
19885
|
+
<xsl:if test="@named_dest">
|
19886
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
19887
|
+
</xsl:if>
|
19888
|
+
</xsl:template>
|
19889
|
+
|
19890
|
+
<xsl:template name="setIDforNamedDestinationInline">
|
19891
|
+
<xsl:if test="@named_dest">
|
19892
|
+
<fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
|
19893
|
+
</xsl:if>
|
19894
|
+
</xsl:template>
|
19895
|
+
|
19896
|
+
<xsl:template name="setNamedDestination">
|
19897
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
19898
|
+
<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'">
|
19899
|
+
<fox:destination internal-destination="{@id}"/>
|
19900
|
+
</xsl:if>
|
19901
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
19902
|
+
<xsl:if test="@named_dest">
|
19903
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
19904
|
+
</xsl:if>
|
19905
|
+
</xsl:for-each>
|
19906
|
+
</xsl:template>
|
19907
|
+
|
19686
19908
|
<xsl:template name="add-letter-spacing">
|
19687
19909
|
<xsl:param name="text"/>
|
19688
19910
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|