metanorma-iso 3.0.4 → 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 +240 -29
- data/lib/isodoc/iso/iso.international-standard.xsl +240 -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,11 @@
|
|
4149
4166
|
</xsl:otherwise>
|
4150
4167
|
</xsl:choose>
|
4151
4168
|
</xsl:if>
|
4169
|
+
|
4170
|
+
<xsl:if test="@named_dest">
|
4171
|
+
<fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
|
4172
|
+
</xsl:if>
|
4173
|
+
|
4152
4174
|
<xsl:choose>
|
4153
4175
|
<xsl:when test="$layoutVersion = '1951' and ((ancestor::iso:preface and $level = 1) or (parent::iso:introduction and $revision_date_num < 19680101))">
|
4154
4176
|
<xsl:call-template name="add-letter-spacing">
|
@@ -4228,6 +4250,16 @@
|
|
4228
4250
|
</xsl:otherwise>
|
4229
4251
|
</xsl:choose>
|
4230
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>
|
4231
4263
|
</xsl:element>
|
4232
4264
|
|
4233
4265
|
<xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iso:p)">
|
@@ -4256,6 +4288,7 @@
|
|
4256
4288
|
<xsl:call-template name="getId"/>
|
4257
4289
|
</xsl:variable> id="{$id}" -->
|
4258
4290
|
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
|
4291
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
4259
4292
|
<!-- <xsl:if test="$layoutVersion = '2024'">
|
4260
4293
|
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
4261
4294
|
</xsl:if> -->
|
@@ -4287,6 +4320,8 @@
|
|
4287
4320
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
4288
4321
|
</xsl:choose>
|
4289
4322
|
</xsl:variable>
|
4323
|
+
|
4324
|
+
<xsl:call-template name="setNamedDestination"/>
|
4290
4325
|
<xsl:element name="{$element-name}">
|
4291
4326
|
|
4292
4327
|
<xsl:call-template name="setBlockAttributes">
|
@@ -4525,6 +4560,7 @@
|
|
4525
4560
|
|
4526
4561
|
<!-- main sections -->
|
4527
4562
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node_iso" priority="3">
|
4563
|
+
<xsl:call-template name="setNamedDestination"/>
|
4528
4564
|
<fo:block>
|
4529
4565
|
<xsl:call-template name="setId"/>
|
4530
4566
|
|
@@ -4544,6 +4580,7 @@
|
|
4544
4580
|
</xsl:template>
|
4545
4581
|
|
4546
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"/>
|
4547
4584
|
<fo:block>
|
4548
4585
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
4549
4586
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -8224,8 +8261,14 @@
|
|
8224
8261
|
</xsl:choose>
|
8225
8262
|
</xsl:variable>
|
8226
8263
|
|
8264
|
+
<xsl:call-template name="setNamedDestination"/>
|
8265
|
+
|
8227
8266
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
8228
8267
|
|
8268
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
8269
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
8270
|
+
</xsl:for-each>
|
8271
|
+
|
8229
8272
|
<xsl:call-template name="refine_table-container-style">
|
8230
8273
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
8231
8274
|
</xsl:call-template>
|
@@ -8443,6 +8486,7 @@
|
|
8443
8486
|
<!-- table/name-->
|
8444
8487
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
8445
8488
|
<xsl:param name="continued"/>
|
8489
|
+
<xsl:param name="cols-count"/>
|
8446
8490
|
<xsl:if test="normalize-space() != ''">
|
8447
8491
|
|
8448
8492
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -8474,9 +8518,30 @@
|
|
8474
8518
|
|
8475
8519
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
8476
8520
|
<xsl:if test="$continued = 'true'">
|
8477
|
-
|
8478
|
-
|
8479
|
-
|
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
|
+
|
8480
8545
|
</xsl:if>
|
8481
8546
|
<!-- </xsl:if> -->
|
8482
8547
|
|
@@ -8873,6 +8938,7 @@
|
|
8873
8938
|
|
8874
8939
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
8875
8940
|
<xsl:with-param name="continued">true</xsl:with-param>
|
8941
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
8876
8942
|
</xsl:apply-templates>
|
8877
8943
|
|
8878
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 -->
|
@@ -9052,7 +9118,8 @@
|
|
9052
9118
|
|
9053
9119
|
<!-- if there isn't 'thead' and there is a table's title -->
|
9054
9120
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
|
9055
|
-
<fo:table-header
|
9121
|
+
<fo:table-header>
|
9122
|
+
|
9056
9123
|
<xsl:call-template name="table-header-title">
|
9057
9124
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
9058
9125
|
</xsl:call-template>
|
@@ -9309,8 +9376,8 @@
|
|
9309
9376
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
9310
9377
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
9311
9378
|
<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>
|
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>
|
9314
9381
|
</xsl:if>
|
9315
9382
|
</xsl:for-each>
|
9316
9383
|
</xsl:variable>
|
@@ -9374,6 +9441,7 @@
|
|
9374
9441
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
9375
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">
|
9376
9443
|
|
9444
|
+
<xsl:call-template name="setNamedDestination"/>
|
9377
9445
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
9378
9446
|
<xsl:copy-of select="@id"/>
|
9379
9447
|
|
@@ -9912,7 +9980,7 @@
|
|
9912
9980
|
<xsl:variable name="target" select="@target"/>
|
9913
9981
|
<xsl:choose>
|
9914
9982
|
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
9915
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]
|
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]">
|
9916
9984
|
<xsl:call-template name="fn">
|
9917
9985
|
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
9918
9986
|
</xsl:call-template>
|
@@ -10008,6 +10076,10 @@
|
|
10008
10076
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
10009
10077
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
10010
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
|
+
|
10011
10083
|
<xsl:call-template name="setBlockSpanAll"/>
|
10012
10084
|
|
10013
10085
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -10309,7 +10381,7 @@
|
|
10309
10381
|
|
10310
10382
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
10311
10383
|
<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">
|
10384
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
10313
10385
|
<xsl:call-template name="refine_figure_key_style"/>
|
10314
10386
|
<xsl:apply-templates/>
|
10315
10387
|
</fo:block>
|
@@ -10570,6 +10642,7 @@
|
|
10570
10642
|
|
10571
10643
|
<xsl:call-template name="refine_dt-cell-style"/>
|
10572
10644
|
|
10645
|
+
<xsl:call-template name="setNamedDestination"/>
|
10573
10646
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
10574
10647
|
|
10575
10648
|
<xsl:choose>
|
@@ -11012,7 +11085,7 @@
|
|
11012
11085
|
<!-- ================= -->
|
11013
11086
|
|
11014
11087
|
<!-- highlight text -->
|
11015
|
-
<xsl:template match="*[local-name()='hi']">
|
11088
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
11016
11089
|
<fo:inline background-color="yellow">
|
11017
11090
|
<xsl:apply-templates/>
|
11018
11091
|
</fo:inline>
|
@@ -12691,6 +12764,7 @@
|
|
12691
12764
|
<!-- Appendix processing -->
|
12692
12765
|
<!-- ======================== -->
|
12693
12766
|
<xsl:template match="*[local-name()='appendix']">
|
12767
|
+
<xsl:call-template name="setNamedDestination"/>
|
12694
12768
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
12695
12769
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
12696
12770
|
</fo:block>
|
@@ -12701,13 +12775,14 @@
|
|
12701
12775
|
<xsl:variable name="level">
|
12702
12776
|
<xsl:call-template name="getLevel"/>
|
12703
12777
|
</xsl:variable>
|
12704
|
-
<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>
|
12705
12779
|
</xsl:template>
|
12706
12780
|
<!-- ======================== -->
|
12707
12781
|
<!-- END Appendix processing -->
|
12708
12782
|
<!-- ======================== -->
|
12709
12783
|
|
12710
12784
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
12785
|
+
<xsl:call-template name="setNamedDestination"/>
|
12711
12786
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
12712
12787
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
12713
12788
|
</fo:block>
|
@@ -12737,6 +12812,7 @@
|
|
12737
12812
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
12738
12813
|
<xsl:param name="callout"/>
|
12739
12814
|
<fo:inline id="{@id}">
|
12815
|
+
<xsl:call-template name="setNamedDestination"/>
|
12740
12816
|
<!-- for first p in annotation, put <x> -->
|
12741
12817
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
12742
12818
|
<xsl:apply-templates/>
|
@@ -12785,6 +12861,7 @@
|
|
12785
12861
|
|
12786
12862
|
</xsl:if>
|
12787
12863
|
<fo:block-container margin-left="0mm" role="SKIP">
|
12864
|
+
<xsl:call-template name="setNamedDestination"/>
|
12788
12865
|
<fo:block id="{@id}">
|
12789
12866
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
12790
12867
|
</fo:block>
|
@@ -12830,8 +12907,13 @@
|
|
12830
12907
|
</fo:block>
|
12831
12908
|
</fo:table-cell>
|
12832
12909
|
<fo:table-cell display-align="center">
|
12910
|
+
|
12833
12911
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
12834
12912
|
|
12913
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
12914
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
12915
|
+
</xsl:for-each>
|
12916
|
+
|
12835
12917
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
12836
12918
|
|
12837
12919
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -12866,6 +12948,8 @@
|
|
12866
12948
|
|
12867
12949
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
12868
12950
|
|
12951
|
+
<xsl:call-template name="setNamedDestination"/>
|
12952
|
+
|
12869
12953
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
12870
12954
|
|
12871
12955
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12953,6 +13037,7 @@
|
|
12953
13037
|
</xsl:template>
|
12954
13038
|
|
12955
13039
|
<xsl:template match="*[local-name() = 'termnote']">
|
13040
|
+
<xsl:call-template name="setNamedDestination"/>
|
12956
13041
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
12957
13042
|
|
12958
13043
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -13063,12 +13148,14 @@
|
|
13063
13148
|
|
13064
13149
|
<xsl:template match="*[local-name() = 'terms']">
|
13065
13150
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
13151
|
+
<xsl:call-template name="setNamedDestination"/>
|
13066
13152
|
<fo:block id="{@id}">
|
13067
13153
|
<xsl:apply-templates/>
|
13068
13154
|
</fo:block>
|
13069
13155
|
</xsl:template>
|
13070
13156
|
|
13071
13157
|
<xsl:template match="*[local-name() = 'term']">
|
13158
|
+
<xsl:call-template name="setNamedDestination"/>
|
13072
13159
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
13073
13160
|
|
13074
13161
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -13102,6 +13189,7 @@
|
|
13102
13189
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
13103
13190
|
<xsl:variable name="isAdded" select="@added"/>
|
13104
13191
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
13192
|
+
<xsl:call-template name="setNamedDestination"/>
|
13105
13193
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
13106
13194
|
<xsl:call-template name="refine_figure-block-style"/>
|
13107
13195
|
|
@@ -13118,6 +13206,11 @@
|
|
13118
13206
|
</xsl:variable>
|
13119
13207
|
|
13120
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
|
+
|
13121
13214
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
13122
13215
|
</fo:block>
|
13123
13216
|
|
@@ -13150,6 +13243,7 @@
|
|
13150
13243
|
</xsl:template>
|
13151
13244
|
|
13152
13245
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
13246
|
+
<xsl:call-template name="setNamedDestination"/>
|
13153
13247
|
<fo:block id="{@id}">
|
13154
13248
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
13155
13249
|
</fo:block>
|
@@ -13163,6 +13257,7 @@
|
|
13163
13257
|
</xsl:template>
|
13164
13258
|
|
13165
13259
|
<!-- SOURCE: ... -->
|
13260
|
+
<!-- figure/source -->
|
13166
13261
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
13167
13262
|
|
13168
13263
|
<xsl:call-template name="termsource"/>
|
@@ -14395,6 +14490,7 @@
|
|
14395
14490
|
<xsl:template match="title" mode="bookmark"/>
|
14396
14491
|
<xsl:template match="text()" mode="bookmark"/>
|
14397
14492
|
|
14493
|
+
<!-- figure/name -->
|
14398
14494
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
14399
14495
|
<xsl:if test="normalize-space() != ''">
|
14400
14496
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -15109,6 +15205,7 @@
|
|
15109
15205
|
<!-- permission -->
|
15110
15206
|
<!-- ========== -->
|
15111
15207
|
<xsl:template match="*[local-name() = 'permission']">
|
15208
|
+
<xsl:call-template name="setNamedDestination"/>
|
15112
15209
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
15113
15210
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15114
15211
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15117,10 +15214,12 @@
|
|
15117
15214
|
|
15118
15215
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
15119
15216
|
<xsl:if test="normalize-space() != ''">
|
15120
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15121
|
-
<xsl:apply-templates/>
|
15122
15217
|
|
15123
|
-
|
15218
|
+
<fo:block xsl:use-attribute-sets="permission-name-style">
|
15219
|
+
<xsl:apply-templates/>
|
15220
|
+
|
15221
|
+
</fo:block>
|
15222
|
+
|
15124
15223
|
</xsl:if>
|
15125
15224
|
</xsl:template>
|
15126
15225
|
|
@@ -15136,6 +15235,7 @@
|
|
15136
15235
|
<!-- requirement -->
|
15137
15236
|
<!-- ========== -->
|
15138
15237
|
<xsl:template match="*[local-name() = 'requirement']">
|
15238
|
+
<xsl:call-template name="setNamedDestination"/>
|
15139
15239
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
15140
15240
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15141
15241
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -15147,13 +15247,15 @@
|
|
15147
15247
|
|
15148
15248
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
15149
15249
|
<xsl:if test="normalize-space() != ''">
|
15150
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15151
15250
|
|
15152
|
-
|
15251
|
+
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
15153
15252
|
|
15154
|
-
|
15253
|
+
<xsl:apply-templates/>
|
15254
|
+
|
15255
|
+
<xsl:text>:</xsl:text>
|
15256
|
+
|
15257
|
+
</fo:block>
|
15155
15258
|
|
15156
|
-
</fo:block>
|
15157
15259
|
</xsl:if>
|
15158
15260
|
</xsl:template>
|
15159
15261
|
|
@@ -15182,6 +15284,7 @@
|
|
15182
15284
|
<!-- recommendation -->
|
15183
15285
|
<!-- ========== -->
|
15184
15286
|
<xsl:template match="*[local-name() = 'recommendation']">
|
15287
|
+
<xsl:call-template name="setNamedDestination"/>
|
15185
15288
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
15186
15289
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
15187
15290
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -15190,10 +15293,12 @@
|
|
15190
15293
|
|
15191
15294
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
15192
15295
|
<xsl:if test="normalize-space() != ''">
|
15193
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15194
|
-
<xsl:apply-templates/>
|
15195
15296
|
|
15196
|
-
|
15297
|
+
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
15298
|
+
<xsl:apply-templates/>
|
15299
|
+
|
15300
|
+
</fo:block>
|
15301
|
+
|
15197
15302
|
</xsl:if>
|
15198
15303
|
</xsl:template>
|
15199
15304
|
|
@@ -15272,6 +15377,7 @@
|
|
15272
15377
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
15273
15378
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
15274
15379
|
</xsl:if>
|
15380
|
+
<xsl:call-template name="setNamedDestination"/>
|
15275
15381
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
15276
15382
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
15277
15383
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -15381,6 +15487,7 @@
|
|
15381
15487
|
<!-- termexample -->
|
15382
15488
|
<!-- ====== -->
|
15383
15489
|
<xsl:template match="*[local-name() = 'termexample']">
|
15490
|
+
<xsl:call-template name="setNamedDestination"/>
|
15384
15491
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
15385
15492
|
<xsl:call-template name="refine_termexample-style"/>
|
15386
15493
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15435,6 +15542,7 @@
|
|
15435
15542
|
-->
|
15436
15543
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
15437
15544
|
|
15545
|
+
<xsl:call-template name="setNamedDestination"/>
|
15438
15546
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
15439
15547
|
|
15440
15548
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -15969,8 +16077,13 @@
|
|
15969
16077
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
15970
16078
|
|
15971
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
|
+
|
15972
16081
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
15973
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
|
+
|
15974
16087
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
15975
16088
|
</fo:block>
|
15976
16089
|
</xsl:if>
|
@@ -16090,6 +16203,7 @@
|
|
16090
16203
|
<!-- main sections -->
|
16091
16204
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
16092
16205
|
|
16206
|
+
<xsl:call-template name="setNamedDestination"/>
|
16093
16207
|
<fo:block>
|
16094
16208
|
<xsl:call-template name="setId"/>
|
16095
16209
|
|
@@ -16141,6 +16255,7 @@
|
|
16141
16255
|
</xsl:otherwise>
|
16142
16256
|
</xsl:choose>
|
16143
16257
|
|
16258
|
+
<xsl:call-template name="setNamedDestination"/>
|
16144
16259
|
<fo:block>
|
16145
16260
|
<xsl:call-template name="setId"/>
|
16146
16261
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -16169,6 +16284,7 @@
|
|
16169
16284
|
</xsl:template>
|
16170
16285
|
|
16171
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"/>
|
16172
16288
|
<fo:block>
|
16173
16289
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
16174
16290
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -16191,6 +16307,7 @@
|
|
16191
16307
|
</xsl:template> <!-- refine_clause_style -->
|
16192
16308
|
|
16193
16309
|
<xsl:template match="*[local-name() = 'definitions']">
|
16310
|
+
<xsl:call-template name="setNamedDestination"/>
|
16194
16311
|
<fo:block id="{@id}">
|
16195
16312
|
<xsl:apply-templates/>
|
16196
16313
|
</fo:block>
|
@@ -16206,6 +16323,8 @@
|
|
16206
16323
|
<xsl:otherwise>
|
16207
16324
|
|
16208
16325
|
<fo:block break-after="page"/>
|
16326
|
+
<xsl:call-template name="setNamedDestination"/>
|
16327
|
+
|
16209
16328
|
<fo:block id="{@id}">
|
16210
16329
|
|
16211
16330
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -16277,6 +16396,7 @@
|
|
16277
16396
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
16278
16397
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
16279
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"/>
|
16280
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>
|
16281
16401
|
<!-- </xsl:if> -->
|
16282
16402
|
</xsl:if>
|
@@ -17042,6 +17162,7 @@
|
|
17042
17162
|
<!-- Normative references -->
|
17043
17163
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
17044
17164
|
|
17165
|
+
<xsl:call-template name="setNamedDestination"/>
|
17045
17166
|
<fo:block id="{@id}">
|
17046
17167
|
<xsl:apply-templates/>
|
17047
17168
|
|
@@ -17062,6 +17183,7 @@
|
|
17062
17183
|
</xsl:if>
|
17063
17184
|
</xsl:if> -->
|
17064
17185
|
|
17186
|
+
<xsl:call-template name="setNamedDestination"/>
|
17065
17187
|
<fo:block id="{@id}"/>
|
17066
17188
|
|
17067
17189
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -17081,6 +17203,7 @@
|
|
17081
17203
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
17082
17204
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
17083
17205
|
|
17206
|
+
<xsl:call-template name="setNamedDestination"/>
|
17084
17207
|
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
|
17085
17208
|
|
17086
17209
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17121,6 +17244,7 @@
|
|
17121
17244
|
<xsl:choose>
|
17122
17245
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
17123
17246
|
<xsl:otherwise>
|
17247
|
+
<xsl:call-template name="setNamedDestination"/>
|
17124
17248
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
17125
17249
|
|
17126
17250
|
<xsl:if test="$layoutVersion = '2024'">
|
@@ -17778,7 +17902,7 @@
|
|
17778
17902
|
</xsl:template>
|
17779
17903
|
|
17780
17904
|
<!-- 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">
|
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">
|
17782
17906
|
<xsl:copy>
|
17783
17907
|
<xsl:copy-of select="@*"/>
|
17784
17908
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -17810,28 +17934,56 @@
|
|
17810
17934
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
17811
17935
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
17812
17936
|
|
17813
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17937
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
17814
17938
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17815
17939
|
<xsl:copy-of select="@*"/>
|
17816
17940
|
<xsl:choose>
|
17817
17941
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17818
|
-
<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>
|
17819
17950
|
</xsl:when>
|
17820
17951
|
<xsl:otherwise>
|
17821
|
-
<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>
|
17822
17960
|
</xsl:otherwise>
|
17823
17961
|
</xsl:choose>
|
17824
17962
|
</xsl:element>
|
17825
17963
|
</xsl:template>
|
17826
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
17964
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
17827
17965
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
17828
17966
|
<xsl:copy-of select="@*"/>
|
17829
17967
|
<xsl:choose>
|
17830
17968
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
17831
|
-
<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>
|
17832
17977
|
</xsl:when>
|
17833
17978
|
<xsl:otherwise>
|
17834
|
-
<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>
|
17835
17987
|
</xsl:otherwise>
|
17836
17988
|
</xsl:choose>
|
17837
17989
|
</xsl:element>
|
@@ -18060,16 +18212,53 @@
|
|
18060
18212
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
18061
18213
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18062
18214
|
<xsl:copy-of select="@*"/>
|
18215
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18216
|
+
|
18063
18217
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18064
18218
|
</xsl:element>
|
18065
18219
|
</xsl:template>
|
18066
18220
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
18067
18221
|
<xsl:element name="title" namespace="{$namespace_full}">
|
18068
18222
|
<xsl:copy-of select="@*"/>
|
18223
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18224
|
+
|
18069
18225
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18070
18226
|
</xsl:element>
|
18071
18227
|
</xsl:template>
|
18072
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
|
+
|
18073
18262
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
18074
18263
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
18075
18264
|
<xsl:choose>
|
@@ -18079,6 +18268,8 @@
|
|
18079
18268
|
<xsl:otherwise>
|
18080
18269
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18081
18270
|
<xsl:copy-of select="@*"/>
|
18271
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18272
|
+
|
18082
18273
|
<xsl:apply-templates mode="update_xml_step1"/>
|
18083
18274
|
</xsl:element>
|
18084
18275
|
</xsl:otherwise>
|
@@ -18092,6 +18283,8 @@
|
|
18092
18283
|
<xsl:otherwise>
|
18093
18284
|
<xsl:element name="name" namespace="{$namespace_full}">
|
18094
18285
|
<xsl:copy-of select="@*"/>
|
18286
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
18287
|
+
|
18095
18288
|
<xsl:apply-templates mode="update_xml_pres"/>
|
18096
18289
|
</xsl:element>
|
18097
18290
|
</xsl:otherwise>
|
@@ -19683,6 +19876,24 @@
|
|
19683
19876
|
</xsl:attribute>
|
19684
19877
|
</xsl:template>
|
19685
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
|
+
|
19686
19897
|
<xsl:template name="add-letter-spacing">
|
19687
19898
|
<xsl:param name="text"/>
|
19688
19899
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|