metanorma-iso 2.8.9 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/base_convert.rb +5 -41
- data/lib/isodoc/iso/iso.amendment.xsl +218 -27
- data/lib/isodoc/iso/iso.international-standard.xsl +218 -27
- data/lib/isodoc/iso/presentation_bibdata.rb +1 -1
- data/lib/isodoc/iso/presentation_terms.rb +0 -13
- data/lib/isodoc/iso/presentation_xml_convert.rb +29 -20
- data/lib/isodoc/iso/presentation_xref.rb +2 -0
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/metanorma/iso/front.rb +1 -0
- data/lib/metanorma/iso/front_contributor.rb +1 -3
- data/lib/metanorma/iso/isodoc.rng +1 -1
- data/lib/metanorma/iso/relaton-iso.rng +8 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0941432979465638a050af9a47a277a037c98bcf7ac8fd8dc6f5cdf55fe0f92b'
|
4
|
+
data.tar.gz: 628a80940efddab2c8659dae8aa140839f1b7eb2e4c662a9757410e0048c3e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 322cbf882d1fb24c13c8263ce74d2d1d851763df54a2e27dc864657dbce0d47adf08537420aabb89eb3632ed1e476463e583fd9e52117072e0cf88a95fe666e2
|
7
|
+
data.tar.gz: 9eaa31b78ccfa61cb66a3352493dfcf38e36584a3ef960f7782dab497f77bccfdd750bddf2fbe96f23ac34907c530eced9ec30cd8a999eba08e5f07e964acf34
|
@@ -13,11 +13,6 @@ module IsoDoc
|
|
13
13
|
super
|
14
14
|
end
|
15
15
|
|
16
|
-
def implicit_reference(bib)
|
17
|
-
bib.at(ns("./docidentifier"))&.text == "IEV" and return true
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
16
|
# terms not defined in standoc
|
22
17
|
def error_parse(node, out)
|
23
18
|
case node.name
|
@@ -40,7 +35,7 @@ module IsoDoc
|
|
40
35
|
insert_tab(p, 1)
|
41
36
|
node.first_element_child.children.each { |n| parse(n, p) }
|
42
37
|
end
|
43
|
-
node.element_children[1
|
38
|
+
node.element_children[1..].each { |n| parse(n, div) }
|
44
39
|
end
|
45
40
|
|
46
41
|
def example_parse1(node, div)
|
@@ -83,42 +78,18 @@ module IsoDoc
|
|
83
78
|
end
|
84
79
|
end
|
85
80
|
|
86
|
-
def admonition_parse(node, out)
|
87
|
-
type = node["type"]
|
88
|
-
name = admonition_name(node, type)
|
89
|
-
out.div id: node["id"], class: admonition_class(node) do |div|
|
90
|
-
if node.first_element_child.name == "p"
|
91
|
-
admonition_p_parse(node, div, name)
|
92
|
-
else
|
93
|
-
admonition_parse1(node, div, name)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
81
|
def admonition_class(node)
|
99
82
|
if node["type"] == "editorial" then "zzHelp"
|
100
83
|
else super
|
101
84
|
end
|
102
85
|
end
|
103
86
|
|
104
|
-
def
|
105
|
-
div
|
106
|
-
admonition_name_parse(node, p, name) if name
|
107
|
-
end
|
108
|
-
node.children.each { |n| parse(n, div) unless n.name == "name" }
|
109
|
-
end
|
110
|
-
|
111
|
-
def admonition_p_parse(node, div, name)
|
112
|
-
div.p do |p|
|
113
|
-
admonition_name_parse(node, p, name) if name
|
114
|
-
node.first_element_child.children.each { |n| parse(n, p) }
|
115
|
-
end
|
116
|
-
node.element_children[1..-1].each { |n| parse(n, div) }
|
87
|
+
def admonition_p_parse(node, div)
|
88
|
+
admonition_name_in_first_para(node, div)
|
117
89
|
end
|
118
90
|
|
119
|
-
def
|
120
|
-
|
121
|
-
div << " — "
|
91
|
+
def admonition_name_para_delim(para)
|
92
|
+
para << " "
|
122
93
|
end
|
123
94
|
|
124
95
|
def figure_name_parse(_node, div, name)
|
@@ -154,12 +125,6 @@ module IsoDoc
|
|
154
125
|
super.merge(start: node["start"]).compact
|
155
126
|
end
|
156
127
|
|
157
|
-
def render_identifier(ident)
|
158
|
-
ret = super
|
159
|
-
ret[:sdo] = std_docid_semantic(ret[:sdo])
|
160
|
-
ret
|
161
|
-
end
|
162
|
-
|
163
128
|
def table_parse(node, out)
|
164
129
|
@in_table = true
|
165
130
|
table_title_parse(node, out)
|
@@ -183,7 +148,6 @@ module IsoDoc
|
|
183
148
|
measurement_units(node, out)
|
184
149
|
out.div **figure_attrs(node) do |div|
|
185
150
|
node.children.each do |n|
|
186
|
-
figure_key(out) if n.name == "dl"
|
187
151
|
n.name == "note" && n["type"] == "units" and next
|
188
152
|
parse(n, div) unless n.name == "name"
|
189
153
|
end
|
@@ -3731,6 +3731,21 @@
|
|
3731
3731
|
</xsl:choose>
|
3732
3732
|
</xsl:template>
|
3733
3733
|
|
3734
|
+
<xsl:template match="iso:copyright-statement/iso:clause" priority="3">
|
3735
|
+
<fo:block role="SKIP">
|
3736
|
+
<xsl:if test="@id = 'boilerplate-copyright-default' and ../iso:clause[not(@id = 'boilerplate-copyright-default')]">
|
3737
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
3738
|
+
<xsl:attribute name="border">1pt solid blue</xsl:attribute>
|
3739
|
+
<xsl:attribute name="padding">1mm</xsl:attribute>
|
3740
|
+
</xsl:if>
|
3741
|
+
<xsl:if test="not(@id = 'boilerplate-copyright-default') and preceding-sibling::iso:clause">
|
3742
|
+
<xsl:attribute name="margin-top">5mm</xsl:attribute>
|
3743
|
+
</xsl:if>
|
3744
|
+
<xsl:copy-of select="@id"/>
|
3745
|
+
<xsl:apply-templates/>
|
3746
|
+
</fo:block>
|
3747
|
+
</xsl:template>
|
3748
|
+
|
3734
3749
|
<xsl:template match="iso:copyright-statement//iso:p" priority="2">
|
3735
3750
|
<xsl:choose>
|
3736
3751
|
<xsl:when test="$layoutVersion = '1951'">
|
@@ -3777,7 +3792,7 @@
|
|
3777
3792
|
<xsl:attribute name="margin-left">0.5mm</xsl:attribute>
|
3778
3793
|
<xsl:attribute name="margin-right">0.5mm</xsl:attribute>
|
3779
3794
|
</xsl:if>
|
3780
|
-
<xsl:if test="contains(@id, 'address')">
|
3795
|
+
<xsl:if test="contains(@id, 'address') or contains(normalize-space(), 'Tel:') or contains(normalize-space(), 'Phone:')">
|
3781
3796
|
<xsl:attribute name="margin-left">4.5mm</xsl:attribute>
|
3782
3797
|
</xsl:if>
|
3783
3798
|
<xsl:apply-templates/>
|
@@ -4415,6 +4430,8 @@
|
|
4415
4430
|
</xsl:if>
|
4416
4431
|
</xsl:if>
|
4417
4432
|
|
4433
|
+
<xsl:call-template name="addReviewHelper"/>
|
4434
|
+
|
4418
4435
|
<xsl:call-template name="processElementContent"/>
|
4419
4436
|
</fo:block>
|
4420
4437
|
</xsl:template>
|
@@ -4431,6 +4448,8 @@
|
|
4431
4448
|
|
4432
4449
|
<xsl:call-template name="refine_clause_style"/>
|
4433
4450
|
|
4451
|
+
<xsl:call-template name="addReviewHelper"/>
|
4452
|
+
|
4434
4453
|
<xsl:call-template name="processElementContent"/>
|
4435
4454
|
|
4436
4455
|
</fo:block>
|
@@ -9357,6 +9376,11 @@
|
|
9357
9376
|
|
9358
9377
|
<xsl:value-of select="@reference"/>
|
9359
9378
|
|
9379
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
9380
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
9381
|
+
<xsl:text>)</xsl:text>
|
9382
|
+
</xsl:if> -->
|
9383
|
+
|
9360
9384
|
</fo:inline>
|
9361
9385
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
9362
9386
|
<xsl:copy-of select="./node()"/>
|
@@ -9366,7 +9390,7 @@
|
|
9366
9390
|
|
9367
9391
|
</xsl:if>
|
9368
9392
|
</xsl:for-each>
|
9369
|
-
</xsl:template>
|
9393
|
+
</xsl:template> <!-- table_fn_display -->
|
9370
9394
|
|
9371
9395
|
<xsl:template name="create_fn">
|
9372
9396
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -9394,8 +9418,10 @@
|
|
9394
9418
|
<!-- EMD table's footnotes rendering -->
|
9395
9419
|
<!-- ============================ -->
|
9396
9420
|
|
9421
|
+
<!-- ============================ -->
|
9397
9422
|
<!-- figure's footnotes rendering -->
|
9398
|
-
|
9423
|
+
<!-- ============================ -->
|
9424
|
+
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
9399
9425
|
|
9400
9426
|
<!-- current figure id -->
|
9401
9427
|
<xsl:variable name="figure_id_">
|
@@ -9508,9 +9534,28 @@
|
|
9508
9534
|
|
9509
9535
|
</fo:block>
|
9510
9536
|
</xsl:if>
|
9511
|
-
|
9512
9537
|
</xsl:template> <!-- fn_display_figure -->
|
9513
9538
|
|
9539
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
9540
|
+
<!-- figure's footnote label -->
|
9541
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
|
9542
|
+
<xsl:variable name="key_iso">
|
9543
|
+
true
|
9544
|
+
</xsl:variable>
|
9545
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
9546
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
9547
|
+
|
9548
|
+
</xsl:if>
|
9549
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
9550
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
9551
|
+
<xsl:apply-templates/>
|
9552
|
+
</fo:inline>
|
9553
|
+
</xsl:template>
|
9554
|
+
|
9555
|
+
<!-- ============================ -->
|
9556
|
+
<!-- END: figure's footnotes rendering -->
|
9557
|
+
<!-- ============================ -->
|
9558
|
+
|
9514
9559
|
<!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
|
9515
9560
|
<xsl:template match="*[local-name()='fn']">
|
9516
9561
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
@@ -9526,6 +9571,10 @@
|
|
9526
9571
|
|
9527
9572
|
<xsl:value-of select="@reference"/>
|
9528
9573
|
|
9574
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
9575
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
9576
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
9577
|
+
</xsl:if> -->
|
9529
9578
|
</fo:basic-link>
|
9530
9579
|
</fo:inline>
|
9531
9580
|
</xsl:template>
|
@@ -9656,17 +9705,22 @@
|
|
9656
9705
|
</fo:block>
|
9657
9706
|
</xsl:when> <!-- END: a few components -->
|
9658
9707
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
9659
|
-
|
9708
|
+
<!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
|
9709
|
+
<xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
|
9660
9710
|
|
9661
|
-
|
9711
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
9662
9712
|
|
9663
|
-
|
9664
|
-
|
9665
|
-
|
9666
|
-
|
9667
|
-
|
9668
|
-
|
9669
|
-
|
9713
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
9714
|
+
|
9715
|
+
<xsl:variable name="title-key">
|
9716
|
+
<xsl:call-template name="getLocalizedString">
|
9717
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
9718
|
+
</xsl:call-template>
|
9719
|
+
</xsl:variable>
|
9720
|
+
<xsl:value-of select="$title-key"/>
|
9721
|
+
</fo:block>
|
9722
|
+
|
9723
|
+
</xsl:if>
|
9670
9724
|
</xsl:when> <!-- END: definition list in a figure -->
|
9671
9725
|
</xsl:choose>
|
9672
9726
|
|
@@ -9856,6 +9910,14 @@
|
|
9856
9910
|
|
9857
9911
|
</xsl:template> <!-- END: dl -->
|
9858
9912
|
|
9913
|
+
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
9914
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
9915
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
9916
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
9917
|
+
<xsl:apply-templates/>
|
9918
|
+
</fo:block>
|
9919
|
+
</xsl:template>
|
9920
|
+
|
9859
9921
|
<xsl:template name="refine_dl_formula_where_style">
|
9860
9922
|
|
9861
9923
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -11988,6 +12050,39 @@
|
|
11988
12050
|
</xsl:copy>
|
11989
12051
|
</xsl:template>
|
11990
12052
|
|
12053
|
+
<xsl:template match="@*|node()" mode="mathml_linebreak">
|
12054
|
+
<xsl:copy>
|
12055
|
+
<xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
|
12056
|
+
</xsl:copy>
|
12057
|
+
</xsl:template>
|
12058
|
+
|
12059
|
+
<!-- split math into two math -->
|
12060
|
+
<xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
|
12061
|
+
<xsl:variable name="math_elements_tree_">
|
12062
|
+
<xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
|
12063
|
+
<element pos="{position()}">
|
12064
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
12065
|
+
<xsl:value-of select="name()"/>
|
12066
|
+
</element>
|
12067
|
+
</xsl:for-each>
|
12068
|
+
</xsl:variable>
|
12069
|
+
|
12070
|
+
<xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
|
12071
|
+
|
12072
|
+
<xsl:call-template name="insertClosingElements">
|
12073
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
12074
|
+
</xsl:call-template>
|
12075
|
+
|
12076
|
+
<xsl:element name="br" namespace="{$namespace_full}"/>
|
12077
|
+
|
12078
|
+
<xsl:call-template name="insertOpeningElements">
|
12079
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
12080
|
+
<xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
|
12081
|
+
<xsl:with-param name="add_continue">false</xsl:with-param>
|
12082
|
+
</xsl:call-template>
|
12083
|
+
|
12084
|
+
</xsl:template>
|
12085
|
+
|
11991
12086
|
<!-- Examples:
|
11992
12087
|
<stem type="AsciiMath">x = 1</stem>
|
11993
12088
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -12241,9 +12336,11 @@
|
|
12241
12336
|
</xsl:template>
|
12242
12337
|
|
12243
12338
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
|
12339
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
12244
12340
|
<xsl:if test="normalize-space() != ''">
|
12245
|
-
<xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
|
12246
|
-
</xsl:if>
|
12341
|
+
<xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
|
12342
|
+
</xsl:if> -->
|
12343
|
+
<xsl:apply-templates/>
|
12247
12344
|
</xsl:template>
|
12248
12345
|
|
12249
12346
|
<!-- stem inside formula with name (with formula's number) -->
|
@@ -12422,10 +12519,21 @@
|
|
12422
12519
|
</xsl:when>
|
12423
12520
|
<xsl:otherwise>
|
12424
12521
|
|
12522
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
12523
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
12524
|
+
<xsl:text>—</xsl:text> em dash —
|
12525
|
+
</xsl:if> -->
|
12526
|
+
<!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
|
12527
|
+
<xsl:text>:</xsl:text>
|
12528
|
+
</xsl:if> -->
|
12529
|
+
|
12425
12530
|
<xsl:if test="$layoutVersion = '1987' and . = translate(.,'1234567890','')"> <!-- NOTE without number -->
|
12426
12531
|
<xsl:text> — </xsl:text>
|
12427
12532
|
</xsl:if>
|
12428
12533
|
|
12534
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
|
12535
|
+
<xsl:text> – </xsl:text> en dash –
|
12536
|
+
</xsl:if> -->
|
12429
12537
|
</xsl:otherwise>
|
12430
12538
|
</xsl:choose>
|
12431
12539
|
</xsl:variable>
|
@@ -12444,8 +12552,16 @@
|
|
12444
12552
|
</xsl:when>
|
12445
12553
|
<xsl:otherwise>
|
12446
12554
|
|
12555
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
12556
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
12557
|
+
<xsl:text>—</xsl:text> em dash —
|
12558
|
+
</xsl:if> -->
|
12559
|
+
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
|
12447
12560
|
<xsl:text>:</xsl:text>
|
12448
|
-
|
12561
|
+
</xsl:if> -->
|
12562
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
|
12563
|
+
<xsl:text> – </xsl:text> en dash –
|
12564
|
+
</xsl:if> -->
|
12449
12565
|
</xsl:otherwise>
|
12450
12566
|
</xsl:choose>
|
12451
12567
|
</xsl:variable>
|
@@ -14615,7 +14731,7 @@
|
|
14615
14731
|
<xsl:if test="normalize-space() != ''">
|
14616
14732
|
<fo:inline xsl:use-attribute-sets="termexample-name-style">
|
14617
14733
|
<xsl:call-template name="refine_termexample-name-style"/>
|
14618
|
-
<xsl:apply-templates/>
|
14734
|
+
<xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
|
14619
14735
|
</fo:inline>
|
14620
14736
|
</xsl:if>
|
14621
14737
|
</xsl:template>
|
@@ -14782,7 +14898,7 @@
|
|
14782
14898
|
<xsl:otherwise>
|
14783
14899
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
14784
14900
|
<xsl:call-template name="refine_example-name-style"/>
|
14785
|
-
<xsl:apply-templates/>
|
14901
|
+
<xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
|
14786
14902
|
</fo:inline>
|
14787
14903
|
</xsl:otherwise>
|
14788
14904
|
</xsl:choose>
|
@@ -14974,15 +15090,17 @@
|
|
14974
15090
|
|
14975
15091
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
14976
15092
|
<fo:block role="BlockQuote">
|
14977
|
-
<xsl:apply-templates select="./node()[not(local-name() = 'author') and
|
15093
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
|
14978
15094
|
</fo:block>
|
14979
15095
|
</fo:block-container>
|
14980
15096
|
</fo:block-container>
|
14981
|
-
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
15097
|
+
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
|
14982
15098
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
14983
15099
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
14984
15100
|
<xsl:apply-templates select="*[local-name() = 'author']"/>
|
14985
15101
|
<xsl:apply-templates select="*[local-name() = 'source']"/>
|
15102
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
15103
|
+
<xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
|
14986
15104
|
</fo:block>
|
14987
15105
|
</xsl:if>
|
14988
15106
|
|
@@ -15004,9 +15122,13 @@
|
|
15004
15122
|
</xsl:template>
|
15005
15123
|
|
15006
15124
|
<xsl:template match="*[local-name() = 'author']">
|
15007
|
-
<xsl:
|
15125
|
+
<xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
|
15126
|
+
<xsl:text>— </xsl:text>
|
15127
|
+
</xsl:if>
|
15008
15128
|
<xsl:apply-templates/>
|
15009
15129
|
</xsl:template>
|
15130
|
+
|
15131
|
+
<xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
|
15010
15132
|
<!-- ====== -->
|
15011
15133
|
<!-- ====== -->
|
15012
15134
|
|
@@ -15187,8 +15309,12 @@
|
|
15187
15309
|
</xsl:template>
|
15188
15310
|
|
15189
15311
|
<xsl:template match="*[local-name() = 'domain']">
|
15312
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
15190
15313
|
<fo:inline xsl:use-attribute-sets="domain-style"><<xsl:apply-templates/>></fo:inline>
|
15191
|
-
<xsl:text> </xsl:text>
|
15314
|
+
<xsl:text> </xsl:text> -->
|
15315
|
+
<xsl:if test="not(@hidden = 'true')">
|
15316
|
+
<xsl:apply-templates/>
|
15317
|
+
</xsl:if>
|
15192
15318
|
</xsl:template>
|
15193
15319
|
|
15194
15320
|
<xsl:template match="*[local-name() = 'admitted']">
|
@@ -15236,6 +15362,29 @@
|
|
15236
15362
|
<!-- END definition -->
|
15237
15363
|
<!-- ========== -->
|
15238
15364
|
|
15365
|
+
<xsl:variable name="reviews_">
|
15366
|
+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
15367
|
+
<xsl:copy>
|
15368
|
+
<xsl:copy-of select="@from"/>
|
15369
|
+
<xsl:copy-of select="@id"/>
|
15370
|
+
</xsl:copy>
|
15371
|
+
</xsl:for-each>
|
15372
|
+
</xsl:variable>
|
15373
|
+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
15374
|
+
|
15375
|
+
<xsl:template name="addReviewHelper">
|
15376
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
15377
|
+
<xsl:variable name="curr_id" select="@id"/>
|
15378
|
+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
|
15379
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
15380
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
15381
|
+
</xsl:if>
|
15382
|
+
<!-- <fo:block>
|
15383
|
+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
15384
|
+
<xsl:copy-of select="$reviews"/>
|
15385
|
+
</fo:block> -->
|
15386
|
+
</xsl:template>
|
15387
|
+
|
15239
15388
|
<!-- main sections -->
|
15240
15389
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
15241
15390
|
|
@@ -15244,6 +15393,8 @@
|
|
15244
15393
|
|
15245
15394
|
<xsl:call-template name="sections_element_style"/>
|
15246
15395
|
|
15396
|
+
<xsl:call-template name="addReviewHelper"/>
|
15397
|
+
|
15247
15398
|
<xsl:apply-templates/>
|
15248
15399
|
</fo:block>
|
15249
15400
|
|
@@ -15290,6 +15441,7 @@
|
|
15290
15441
|
|
15291
15442
|
<fo:block>
|
15292
15443
|
<xsl:call-template name="setId"/>
|
15444
|
+
<xsl:call-template name="addReviewHelper"/>
|
15293
15445
|
<xsl:apply-templates/>
|
15294
15446
|
</fo:block>
|
15295
15447
|
</xsl:template>
|
@@ -15326,6 +15478,8 @@
|
|
15326
15478
|
|
15327
15479
|
<xsl:call-template name="refine_clause_style"/>
|
15328
15480
|
|
15481
|
+
<xsl:call-template name="addReviewHelper"/>
|
15482
|
+
|
15329
15483
|
<xsl:apply-templates/>
|
15330
15484
|
</fo:block>
|
15331
15485
|
</xsl:template>
|
@@ -15378,6 +15532,23 @@
|
|
15378
15532
|
|
15379
15533
|
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
15380
15534
|
|
15535
|
+
<xsl:if test="1 = 1">
|
15536
|
+
<xsl:choose>
|
15537
|
+
<!-- if there isn't the attribute '@from', then -->
|
15538
|
+
<xsl:when test="$id_from = ''">
|
15539
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
15540
|
+
</xsl:when>
|
15541
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
15542
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
15543
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
15544
|
+
</xsl:when>
|
15545
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
15546
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
15547
|
+
</xsl:when>
|
15548
|
+
</xsl:choose>
|
15549
|
+
</xsl:if>
|
15550
|
+
|
15551
|
+
<xsl:if test="1 = 2">
|
15381
15552
|
<xsl:choose>
|
15382
15553
|
<!-- if there isn't the attribute '@from', then -->
|
15383
15554
|
<xsl:when test="$id_from = ''">
|
@@ -15391,6 +15562,7 @@
|
|
15391
15562
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
15392
15563
|
</xsl:when>
|
15393
15564
|
</xsl:choose>
|
15565
|
+
</xsl:if>
|
15394
15566
|
|
15395
15567
|
</xsl:template>
|
15396
15568
|
|
@@ -16545,9 +16717,9 @@
|
|
16545
16717
|
</xsl:if>
|
16546
16718
|
|
16547
16719
|
<xsl:if test="@type != 'editorial'">
|
16548
|
-
<xsl:call-template name="displayAdmonitionName"
|
16549
|
-
|
16550
|
-
|
16720
|
+
<xsl:call-template name="displayAdmonitionName"/>
|
16721
|
+
<!-- https://github.com/metanorma/isodoc/issues/614 -->
|
16722
|
+
<!-- <xsl:with-param name="sep"> — </xsl:with-param> -->
|
16551
16723
|
</xsl:if>
|
16552
16724
|
|
16553
16725
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -16805,7 +16977,7 @@
|
|
16805
16977
|
<!-- remove preprocess-xslt -->
|
16806
16978
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
16807
16979
|
|
16808
|
-
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
16980
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
16809
16981
|
<xsl:copy-of select="."/>
|
16810
16982
|
</xsl:template>
|
16811
16983
|
|
@@ -16871,6 +17043,22 @@
|
|
16871
17043
|
</xsl:choose>
|
16872
17044
|
</xsl:template>
|
16873
17045
|
|
17046
|
+
<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
|
17047
|
+
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
|
17048
|
+
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
|
17049
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
|
17050
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
17051
|
+
</xsl:if>
|
17052
|
+
</xsl:template>
|
17053
|
+
|
17054
|
+
<!-- split math by element with @linebreak into maths -->
|
17055
|
+
<xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
|
17056
|
+
<xsl:variable name="maths">
|
17057
|
+
<xsl:apply-templates select="." mode="mathml_linebreak"/>
|
17058
|
+
</xsl:variable>
|
17059
|
+
<xsl:copy-of select="$maths"/>
|
17060
|
+
</xsl:template>
|
17061
|
+
|
16874
17062
|
<!-- =========================================================================== -->
|
16875
17063
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
16876
17064
|
<!-- =========================================================================== -->
|
@@ -16974,6 +17162,8 @@
|
|
16974
17162
|
|
16975
17163
|
<xsl:template name="insertOpeningElements">
|
16976
17164
|
<xsl:param name="tree"/>
|
17165
|
+
<xsl:param name="xmlns"/>
|
17166
|
+
<xsl:param name="add_continue">true</xsl:param>
|
16977
17167
|
<xsl:for-each select="$tree//element">
|
16978
17168
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
16979
17169
|
<xsl:value-of select="."/>
|
@@ -16984,7 +17174,8 @@
|
|
16984
17174
|
<xsl:value-of select="."/>
|
16985
17175
|
<xsl:text>"</xsl:text>
|
16986
17176
|
</xsl:for-each>
|
16987
|
-
<xsl:if test="position() = 1"> continue="true"</xsl:if>
|
17177
|
+
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
17178
|
+
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
16988
17179
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
16989
17180
|
<xsl:if test="$debug = 'true'">
|
16990
17181
|
<xsl:message><<xsl:value-of select="."/>></xsl:message>
|