metanorma-itu 2.5.6 → 2.5.8
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/itu/base_convert.rb +2 -22
- data/lib/isodoc/itu/cleanup.rb +1 -1
- data/lib/isodoc/itu/itu.implementers-guide.xsl +246 -48
- data/lib/isodoc/itu/itu.in-force.xsl +246 -48
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +246 -48
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +246 -48
- data/lib/isodoc/itu/itu.recommendation.xsl +246 -48
- data/lib/isodoc/itu/itu.resolution.xsl +246 -48
- data/lib/isodoc/itu/itu.service-publication.xsl +246 -48
- data/lib/isodoc/itu/itu.technical-paper.xsl +246 -48
- data/lib/isodoc/itu/itu.technical-report.xsl +246 -48
- data/lib/isodoc/itu/presentation_ref.rb +29 -2
- data/lib/isodoc/itu/presentation_xml_convert.rb +57 -19
- data/lib/isodoc/itu/ref.rb +4 -32
- data/lib/isodoc/itu/terms.rb +1 -14
- data/lib/isodoc/itu/word_cleanup.rb +2 -2
- data/lib/isodoc/itu/word_convert.rb +1 -1
- data/lib/isodoc/itu/xref.rb +0 -6
- data/lib/metanorma/itu/isodoc.rng +1 -1
- data/lib/metanorma/itu/version.rb +1 -1
- data/lib/nokogiri/xml.rb +10 -0
- data/metanorma-itu.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8909beb4719bf31b9c0b76ddb06988f67e91dd0a5e7c49ca14017f9de203c9c9
|
|
4
|
+
data.tar.gz: 70a5bbf71297beb02ae879a0fadf2abef6969c0c612132c9840fbdbac2b4158f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 515dae7b7a649197009f7d37d1c8eeb1f1c13022fdd021a4e5eac5ec3e2bca4dee9adb4502bcc942998783473e86cba96e5d4ac997d93aed0ecbe9037ae846f3
|
|
7
|
+
data.tar.gz: d1fa2804a6a16b6f55e3ea7affcd57d1f0dc728b0c45ee2a3dd74c8817881240b9f27d612157749c96f02f321218aea018ced98b907cac13044a2bd6e0cae993
|
|
@@ -37,13 +37,8 @@ module IsoDoc
|
|
|
37
37
|
""
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def note_delim
|
|
41
|
-
" – "
|
|
42
|
-
end
|
|
43
|
-
|
|
44
40
|
def para_class(node)
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
node["class"] == "supertitle" and return "supertitle"
|
|
47
42
|
super
|
|
48
43
|
end
|
|
49
44
|
|
|
@@ -59,21 +54,11 @@ module IsoDoc
|
|
|
59
54
|
ol_style(type)
|
|
60
55
|
end
|
|
61
56
|
|
|
62
|
-
def annex_name(
|
|
57
|
+
def annex_name(_annex, name, div)
|
|
63
58
|
r_a = @meta.get[:doctype_original] == "recommendation-annex"
|
|
64
59
|
div.h1 class: r_a ? "RecommendationAnnex" : "Annex" do |t|
|
|
65
60
|
name&.children&.each { |c2| parse(c2, t) }
|
|
66
61
|
end
|
|
67
|
-
@meta.get[:doctype_original] == "resolution" or
|
|
68
|
-
annex_obligation_subtitle(annex, div)
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def annex_obligation_subtitle(annex, div)
|
|
72
|
-
info = annex["obligation"] == "informative"
|
|
73
|
-
div.p class: "annex_obligation" do |p|
|
|
74
|
-
p << (info ? @i18n.inform_annex : @i18n.norm_annex)
|
|
75
|
-
.sub("%", @meta.get[:doctype] || "")
|
|
76
|
-
end
|
|
77
62
|
end
|
|
78
63
|
|
|
79
64
|
def annex(node, out)
|
|
@@ -102,7 +87,6 @@ module IsoDoc
|
|
|
102
87
|
div.p do |p|
|
|
103
88
|
name and p.span class: "note_label" do |s|
|
|
104
89
|
name.children.each { |n| parse(n, s) }
|
|
105
|
-
s << note_delim
|
|
106
90
|
end
|
|
107
91
|
node.first_element_child.children.each { |n| parse(n, p) }
|
|
108
92
|
end
|
|
@@ -119,10 +103,6 @@ module IsoDoc
|
|
|
119
103
|
node.children.each { |n| parse(n, div) }
|
|
120
104
|
end
|
|
121
105
|
|
|
122
|
-
def table_footnote_reference_format(node)
|
|
123
|
-
node.content += ")"
|
|
124
|
-
end
|
|
125
|
-
|
|
126
106
|
def note_parse(node, out)
|
|
127
107
|
node["type"] == "title-footnote" and return
|
|
128
108
|
super
|
data/lib/isodoc/itu/cleanup.rb
CHANGED
|
@@ -25,7 +25,7 @@ module IsoDoc
|
|
|
25
25
|
def term_cleanup1(docxml)
|
|
26
26
|
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
|
27
27
|
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
|
28
|
-
d.
|
|
28
|
+
d.add_first_child "<b>#{h2.children.to_xml}</b> "
|
|
29
29
|
d["id"] = h2["id"]
|
|
30
30
|
h2.remove
|
|
31
31
|
end
|
|
@@ -1938,6 +1938,7 @@
|
|
|
1938
1938
|
</xsl:choose>
|
|
1939
1939
|
<fo:block>
|
|
1940
1940
|
<xsl:call-template name="setId"/>
|
|
1941
|
+
<xsl:call-template name="addReviewHelper"/>
|
|
1941
1942
|
<xsl:apply-templates/>
|
|
1942
1943
|
</fo:block>
|
|
1943
1944
|
</xsl:template>
|
|
@@ -2073,19 +2074,25 @@
|
|
|
2073
2074
|
</fo:block>
|
|
2074
2075
|
<xsl:if test="$doctype != 'resolution'">
|
|
2075
2076
|
<fo:block font-size="12pt" font-weight="normal" margin-top="6pt">
|
|
2076
|
-
<xsl:choose>
|
|
2077
|
+
<!-- <xsl:choose>
|
|
2077
2078
|
<xsl:when test="parent::*[@obligation = 'informative']">
|
|
2078
2079
|
<xsl:text>(This appendix does not form an integral part of this Recommendation.)</xsl:text>
|
|
2079
2080
|
</xsl:when>
|
|
2080
2081
|
<xsl:otherwise>
|
|
2081
2082
|
<xsl:text>(This annex forms an integral part of this Recommendation.)</xsl:text>
|
|
2082
2083
|
</xsl:otherwise>
|
|
2083
|
-
</xsl:choose>
|
|
2084
|
+
</xsl:choose> -->
|
|
2085
|
+
<!-- Added for https://github.com/metanorma/isodoc/issues/614 -->
|
|
2086
|
+
<xsl:apply-templates select="following-sibling::itu:p[not(preceding-sibling::itu:clause)][starts-with(normalize-space(), '(')]/node()"/>
|
|
2084
2087
|
</fo:block>
|
|
2085
2088
|
</xsl:if>
|
|
2086
2089
|
</fo:block>
|
|
2087
2090
|
</xsl:template>
|
|
2088
2091
|
|
|
2092
|
+
<!-- Added for https://github.com/metanorma/isodoc/issues/614 -->
|
|
2093
|
+
<!-- renders in the annex/title template -->
|
|
2094
|
+
<xsl:template match="itu:annex/itu:p[preceding-sibling::*[1][self::itu:title or self::itu:variant-title]][starts-with(normalize-space(), '(')]" priority="3"/>
|
|
2095
|
+
|
|
2089
2096
|
<!-- Bibliography -->
|
|
2090
2097
|
<xsl:template match="itu:references[not(@normative='true')]/itu:title">
|
|
2091
2098
|
<fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt" role="H1">
|
|
@@ -2225,32 +2232,50 @@
|
|
|
2225
2232
|
<xsl:call-template name="setStyle_preferred"/>
|
|
2226
2233
|
<xsl:apply-templates/>
|
|
2227
2234
|
</fo:inline>
|
|
2228
|
-
<xsl:if test="../itu:termsource
|
|
2229
|
-
|
|
2235
|
+
<xsl:if test="../itu:termsource">
|
|
2236
|
+
<!-- https://github.com/metanorma/isodoc/issues/614 -->
|
|
2237
|
+
<!-- <xsl:text>: </xsl:text> -->
|
|
2238
|
+
<xsl:text> </xsl:text>
|
|
2230
2239
|
<xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
|
|
2231
2240
|
<xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
|
|
2232
2241
|
<xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
|
|
2233
2242
|
|
|
2234
|
-
<xsl:
|
|
2235
|
-
<xsl:
|
|
2236
|
-
<
|
|
2237
|
-
<xsl:
|
|
2238
|
-
<
|
|
2239
|
-
<xsl:
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2243
|
+
<xsl:choose>
|
|
2244
|
+
<xsl:when test="$origin_text != '' or $citeas != ''">
|
|
2245
|
+
<xsl:call-template name="insert_basic_link">
|
|
2246
|
+
<xsl:with-param name="element">
|
|
2247
|
+
<fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
|
|
2248
|
+
<xsl:choose>
|
|
2249
|
+
<xsl:when test="$origin_text != ''">
|
|
2250
|
+
<xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
|
|
2251
|
+
</xsl:when>
|
|
2252
|
+
<!-- https://github.com/metanorma/isodoc/issues/614 -->
|
|
2253
|
+
<!-- <xsl:when test="contains($citeas, '[')">
|
|
2254
|
+
<xsl:text> </xsl:text><xsl:value-of select="$citeas"/>disable-output-escaping="yes"
|
|
2255
|
+
</xsl:when>
|
|
2256
|
+
<xsl:otherwise>
|
|
2257
|
+
<xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
|
|
2258
|
+
</xsl:otherwise> -->
|
|
2259
|
+
<xsl:otherwise>
|
|
2260
|
+
<xsl:text> </xsl:text><xsl:value-of select="$citeas"/>
|
|
2261
|
+
</xsl:otherwise>
|
|
2262
|
+
</xsl:choose>
|
|
2263
|
+
</fo:basic-link>
|
|
2264
|
+
</xsl:with-param>
|
|
2265
|
+
</xsl:call-template>
|
|
2266
|
+
</xsl:when>
|
|
2267
|
+
<xsl:otherwise>
|
|
2268
|
+
<xsl:apply-templates select="../itu:termsource">
|
|
2269
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
|
2270
|
+
</xsl:apply-templates>
|
|
2271
|
+
</xsl:otherwise>
|
|
2272
|
+
</xsl:choose>
|
|
2251
2273
|
</xsl:if>
|
|
2252
2274
|
<xsl:if test="following-sibling::itu:definition/node()">
|
|
2253
|
-
<xsl:
|
|
2275
|
+
<xsl:if test="../itu:termsource">
|
|
2276
|
+
<xsl:text>:</xsl:text>
|
|
2277
|
+
</xsl:if>
|
|
2278
|
+
<xsl:text> </xsl:text>
|
|
2254
2279
|
<!-- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/> -->
|
|
2255
2280
|
<xsl:apply-templates select="following-sibling::itu:definition">
|
|
2256
2281
|
<xsl:with-param name="process">true</xsl:with-param>
|
|
@@ -2262,7 +2287,12 @@
|
|
|
2262
2287
|
</xsl:if> -->
|
|
2263
2288
|
</xsl:template> <!-- preferred -->
|
|
2264
2289
|
|
|
2265
|
-
<xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"
|
|
2290
|
+
<xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2">
|
|
2291
|
+
<xsl:param name="process">false</xsl:param>
|
|
2292
|
+
<xsl:if test="$process = 'true'">
|
|
2293
|
+
<xsl:apply-templates/>
|
|
2294
|
+
</xsl:if>
|
|
2295
|
+
</xsl:template>
|
|
2266
2296
|
|
|
2267
2297
|
<xsl:template match="itu:term[itu:preferred]/itu:definition" priority="2">
|
|
2268
2298
|
<xsl:param name="process">false</xsl:param>
|
|
@@ -6296,7 +6326,10 @@
|
|
|
6296
6326
|
|
|
6297
6327
|
<xsl:value-of select="@reference"/>
|
|
6298
6328
|
|
|
6329
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
|
6330
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
|
6299
6331
|
<xsl:text>)</xsl:text>
|
|
6332
|
+
</xsl:if> -->
|
|
6300
6333
|
|
|
6301
6334
|
</fo:inline>
|
|
6302
6335
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
|
@@ -6307,7 +6340,7 @@
|
|
|
6307
6340
|
|
|
6308
6341
|
</xsl:if>
|
|
6309
6342
|
</xsl:for-each>
|
|
6310
|
-
</xsl:template>
|
|
6343
|
+
</xsl:template> <!-- table_fn_display -->
|
|
6311
6344
|
|
|
6312
6345
|
<xsl:template name="create_fn">
|
|
6313
6346
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
|
@@ -6339,8 +6372,10 @@
|
|
|
6339
6372
|
<!-- EMD table's footnotes rendering -->
|
|
6340
6373
|
<!-- ============================ -->
|
|
6341
6374
|
|
|
6375
|
+
<!-- ============================ -->
|
|
6342
6376
|
<!-- figure's footnotes rendering -->
|
|
6343
|
-
|
|
6377
|
+
<!-- ============================ -->
|
|
6378
|
+
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
|
6344
6379
|
|
|
6345
6380
|
<!-- current figure id -->
|
|
6346
6381
|
<xsl:variable name="figure_id_">
|
|
@@ -6453,9 +6488,28 @@
|
|
|
6453
6488
|
|
|
6454
6489
|
</fo:block>
|
|
6455
6490
|
</xsl:if>
|
|
6456
|
-
|
|
6457
6491
|
</xsl:template> <!-- fn_display_figure -->
|
|
6458
6492
|
|
|
6493
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
|
6494
|
+
<!-- figure's footnote label -->
|
|
6495
|
+
<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">
|
|
6496
|
+
<xsl:variable name="key_iso">
|
|
6497
|
+
|
|
6498
|
+
</xsl:variable>
|
|
6499
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
|
6500
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
|
6501
|
+
|
|
6502
|
+
</xsl:if>
|
|
6503
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
|
6504
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
|
6505
|
+
<xsl:apply-templates/>
|
|
6506
|
+
</fo:inline>
|
|
6507
|
+
</xsl:template>
|
|
6508
|
+
|
|
6509
|
+
<!-- ============================ -->
|
|
6510
|
+
<!-- END: figure's footnotes rendering -->
|
|
6511
|
+
<!-- ============================ -->
|
|
6512
|
+
|
|
6459
6513
|
<!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
|
|
6460
6514
|
<xsl:template match="*[local-name()='fn']">
|
|
6461
6515
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
|
@@ -6471,6 +6525,10 @@
|
|
|
6471
6525
|
|
|
6472
6526
|
<xsl:value-of select="@reference"/>
|
|
6473
6527
|
|
|
6528
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
|
6529
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
|
6530
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
|
6531
|
+
</xsl:if> -->
|
|
6474
6532
|
</fo:basic-link>
|
|
6475
6533
|
</fo:inline>
|
|
6476
6534
|
</xsl:template>
|
|
@@ -6631,17 +6689,22 @@
|
|
|
6631
6689
|
</fo:block>
|
|
6632
6690
|
</xsl:when> <!-- END: a few components -->
|
|
6633
6691
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
|
6634
|
-
|
|
6692
|
+
<!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
|
|
6693
|
+
<xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
|
|
6635
6694
|
|
|
6636
|
-
|
|
6695
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
|
6637
6696
|
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6697
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
|
6698
|
+
|
|
6699
|
+
<xsl:variable name="title-key">
|
|
6700
|
+
<xsl:call-template name="getLocalizedString">
|
|
6701
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
|
6702
|
+
</xsl:call-template>
|
|
6703
|
+
</xsl:variable>
|
|
6704
|
+
<xsl:value-of select="$title-key"/>
|
|
6705
|
+
</fo:block>
|
|
6706
|
+
|
|
6707
|
+
</xsl:if>
|
|
6645
6708
|
</xsl:when> <!-- END: definition list in a figure -->
|
|
6646
6709
|
</xsl:choose>
|
|
6647
6710
|
|
|
@@ -6827,6 +6890,14 @@
|
|
|
6827
6890
|
|
|
6828
6891
|
</xsl:template> <!-- END: dl -->
|
|
6829
6892
|
|
|
6893
|
+
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
|
6894
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
|
6895
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
|
6896
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
|
6897
|
+
<xsl:apply-templates/>
|
|
6898
|
+
</fo:block>
|
|
6899
|
+
</xsl:template>
|
|
6900
|
+
|
|
6830
6901
|
<xsl:template name="refine_dl_formula_where_style">
|
|
6831
6902
|
|
|
6832
6903
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
|
@@ -8869,6 +8940,39 @@
|
|
|
8869
8940
|
</xsl:copy>
|
|
8870
8941
|
</xsl:template>
|
|
8871
8942
|
|
|
8943
|
+
<xsl:template match="@*|node()" mode="mathml_linebreak">
|
|
8944
|
+
<xsl:copy>
|
|
8945
|
+
<xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
|
|
8946
|
+
</xsl:copy>
|
|
8947
|
+
</xsl:template>
|
|
8948
|
+
|
|
8949
|
+
<!-- split math into two math -->
|
|
8950
|
+
<xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
|
|
8951
|
+
<xsl:variable name="math_elements_tree_">
|
|
8952
|
+
<xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
|
|
8953
|
+
<element pos="{position()}">
|
|
8954
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
|
8955
|
+
<xsl:value-of select="name()"/>
|
|
8956
|
+
</element>
|
|
8957
|
+
</xsl:for-each>
|
|
8958
|
+
</xsl:variable>
|
|
8959
|
+
|
|
8960
|
+
<xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
|
|
8961
|
+
|
|
8962
|
+
<xsl:call-template name="insertClosingElements">
|
|
8963
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
|
8964
|
+
</xsl:call-template>
|
|
8965
|
+
|
|
8966
|
+
<xsl:element name="br" namespace="{$namespace_full}"/>
|
|
8967
|
+
|
|
8968
|
+
<xsl:call-template name="insertOpeningElements">
|
|
8969
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
|
8970
|
+
<xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
|
|
8971
|
+
<xsl:with-param name="add_continue">false</xsl:with-param>
|
|
8972
|
+
</xsl:call-template>
|
|
8973
|
+
|
|
8974
|
+
</xsl:template>
|
|
8975
|
+
|
|
8872
8976
|
<!-- Examples:
|
|
8873
8977
|
<stem type="AsciiMath">x = 1</stem>
|
|
8874
8978
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
|
@@ -9120,9 +9224,11 @@
|
|
|
9120
9224
|
</xsl:template>
|
|
9121
9225
|
|
|
9122
9226
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
|
|
9227
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
|
9123
9228
|
<xsl:if test="normalize-space() != ''">
|
|
9124
|
-
<xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
|
|
9125
|
-
</xsl:if>
|
|
9229
|
+
<xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
|
|
9230
|
+
</xsl:if> -->
|
|
9231
|
+
<xsl:apply-templates/>
|
|
9126
9232
|
</xsl:template>
|
|
9127
9233
|
|
|
9128
9234
|
<!-- stem inside formula with name (with formula's number) -->
|
|
@@ -9282,8 +9388,17 @@
|
|
|
9282
9388
|
</xsl:when>
|
|
9283
9389
|
<xsl:otherwise>
|
|
9284
9390
|
|
|
9285
|
-
|
|
9391
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
|
9392
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
|
9393
|
+
<xsl:text>—</xsl:text> em dash —
|
|
9394
|
+
</xsl:if> -->
|
|
9395
|
+
<!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
|
|
9396
|
+
<xsl:text>:</xsl:text>
|
|
9397
|
+
</xsl:if> -->
|
|
9286
9398
|
|
|
9399
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
|
|
9400
|
+
<xsl:text> – </xsl:text> en dash –
|
|
9401
|
+
</xsl:if> -->
|
|
9287
9402
|
</xsl:otherwise>
|
|
9288
9403
|
</xsl:choose>
|
|
9289
9404
|
</xsl:variable>
|
|
@@ -9302,8 +9417,16 @@
|
|
|
9302
9417
|
</xsl:when>
|
|
9303
9418
|
<xsl:otherwise>
|
|
9304
9419
|
|
|
9305
|
-
|
|
9306
|
-
|
|
9420
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
|
9421
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
|
9422
|
+
<xsl:text>—</xsl:text> em dash —
|
|
9423
|
+
</xsl:if> -->
|
|
9424
|
+
<!-- <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'">
|
|
9425
|
+
<xsl:text>:</xsl:text>
|
|
9426
|
+
</xsl:if> -->
|
|
9427
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
|
|
9428
|
+
<xsl:text> – </xsl:text> en dash –
|
|
9429
|
+
</xsl:if> -->
|
|
9307
9430
|
</xsl:otherwise>
|
|
9308
9431
|
</xsl:choose>
|
|
9309
9432
|
</xsl:variable>
|
|
@@ -11471,7 +11594,7 @@
|
|
|
11471
11594
|
<xsl:if test="normalize-space() != ''">
|
|
11472
11595
|
<fo:inline xsl:use-attribute-sets="termexample-name-style">
|
|
11473
11596
|
<xsl:call-template name="refine_termexample-name-style"/>
|
|
11474
|
-
<xsl:apply-templates/>
|
|
11597
|
+
<xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
|
|
11475
11598
|
</fo:inline>
|
|
11476
11599
|
</xsl:if>
|
|
11477
11600
|
</xsl:template>
|
|
@@ -11633,7 +11756,7 @@
|
|
|
11633
11756
|
<xsl:otherwise>
|
|
11634
11757
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
|
11635
11758
|
<xsl:call-template name="refine_example-name-style"/>
|
|
11636
|
-
<xsl:apply-templates/>
|
|
11759
|
+
<xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
|
|
11637
11760
|
</fo:inline>
|
|
11638
11761
|
</xsl:otherwise>
|
|
11639
11762
|
</xsl:choose>
|
|
@@ -11815,15 +11938,17 @@
|
|
|
11815
11938
|
|
|
11816
11939
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
11817
11940
|
<fo:block role="BlockQuote">
|
|
11818
|
-
<xsl:apply-templates select="./node()[not(local-name() = 'author') and
|
|
11941
|
+
<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 -->
|
|
11819
11942
|
</fo:block>
|
|
11820
11943
|
</fo:block-container>
|
|
11821
11944
|
</fo:block-container>
|
|
11822
|
-
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
|
11945
|
+
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
|
|
11823
11946
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
|
11824
11947
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
|
11825
11948
|
<xsl:apply-templates select="*[local-name() = 'author']"/>
|
|
11826
11949
|
<xsl:apply-templates select="*[local-name() = 'source']"/>
|
|
11950
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
|
11951
|
+
<xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
|
|
11827
11952
|
</fo:block>
|
|
11828
11953
|
</xsl:if>
|
|
11829
11954
|
|
|
@@ -11845,9 +11970,13 @@
|
|
|
11845
11970
|
</xsl:template>
|
|
11846
11971
|
|
|
11847
11972
|
<xsl:template match="*[local-name() = 'author']">
|
|
11848
|
-
<xsl:
|
|
11973
|
+
<xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
|
|
11974
|
+
<xsl:text>— </xsl:text>
|
|
11975
|
+
</xsl:if>
|
|
11849
11976
|
<xsl:apply-templates/>
|
|
11850
11977
|
</xsl:template>
|
|
11978
|
+
|
|
11979
|
+
<xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
|
|
11851
11980
|
<!-- ====== -->
|
|
11852
11981
|
<!-- ====== -->
|
|
11853
11982
|
|
|
@@ -12028,8 +12157,12 @@
|
|
|
12028
12157
|
</xsl:template>
|
|
12029
12158
|
|
|
12030
12159
|
<xsl:template match="*[local-name() = 'domain']">
|
|
12160
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
|
12031
12161
|
<fo:inline xsl:use-attribute-sets="domain-style"><<xsl:apply-templates/>></fo:inline>
|
|
12032
|
-
<xsl:text> </xsl:text>
|
|
12162
|
+
<xsl:text> </xsl:text> -->
|
|
12163
|
+
<xsl:if test="not(@hidden = 'true')">
|
|
12164
|
+
<xsl:apply-templates/>
|
|
12165
|
+
</xsl:if>
|
|
12033
12166
|
</xsl:template>
|
|
12034
12167
|
|
|
12035
12168
|
<xsl:template match="*[local-name() = 'admitted']">
|
|
@@ -12077,6 +12210,29 @@
|
|
|
12077
12210
|
<!-- END definition -->
|
|
12078
12211
|
<!-- ========== -->
|
|
12079
12212
|
|
|
12213
|
+
<xsl:variable name="reviews_">
|
|
12214
|
+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
|
12215
|
+
<xsl:copy>
|
|
12216
|
+
<xsl:copy-of select="@from"/>
|
|
12217
|
+
<xsl:copy-of select="@id"/>
|
|
12218
|
+
</xsl:copy>
|
|
12219
|
+
</xsl:for-each>
|
|
12220
|
+
</xsl:variable>
|
|
12221
|
+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
|
12222
|
+
|
|
12223
|
+
<xsl:template name="addReviewHelper">
|
|
12224
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
|
12225
|
+
<xsl:variable name="curr_id" select="@id"/>
|
|
12226
|
+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
|
|
12227
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
|
12228
|
+
<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>
|
|
12229
|
+
</xsl:if>
|
|
12230
|
+
<!-- <fo:block>
|
|
12231
|
+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
|
12232
|
+
<xsl:copy-of select="$reviews"/>
|
|
12233
|
+
</fo:block> -->
|
|
12234
|
+
</xsl:template>
|
|
12235
|
+
|
|
12080
12236
|
<!-- main sections -->
|
|
12081
12237
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
|
12082
12238
|
|
|
@@ -12085,6 +12241,8 @@
|
|
|
12085
12241
|
|
|
12086
12242
|
<xsl:call-template name="sections_element_style"/>
|
|
12087
12243
|
|
|
12244
|
+
<xsl:call-template name="addReviewHelper"/>
|
|
12245
|
+
|
|
12088
12246
|
<xsl:apply-templates/>
|
|
12089
12247
|
</fo:block>
|
|
12090
12248
|
|
|
@@ -12127,6 +12285,7 @@
|
|
|
12127
12285
|
|
|
12128
12286
|
<fo:block>
|
|
12129
12287
|
<xsl:call-template name="setId"/>
|
|
12288
|
+
<xsl:call-template name="addReviewHelper"/>
|
|
12130
12289
|
<xsl:apply-templates/>
|
|
12131
12290
|
</fo:block>
|
|
12132
12291
|
</xsl:template>
|
|
@@ -12163,6 +12322,8 @@
|
|
|
12163
12322
|
|
|
12164
12323
|
<xsl:call-template name="refine_clause_style"/>
|
|
12165
12324
|
|
|
12325
|
+
<xsl:call-template name="addReviewHelper"/>
|
|
12326
|
+
|
|
12166
12327
|
<xsl:apply-templates/>
|
|
12167
12328
|
</fo:block>
|
|
12168
12329
|
</xsl:template>
|
|
@@ -12219,6 +12380,23 @@
|
|
|
12219
12380
|
|
|
12220
12381
|
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
|
12221
12382
|
|
|
12383
|
+
<xsl:if test="1 = 1">
|
|
12384
|
+
<xsl:choose>
|
|
12385
|
+
<!-- if there isn't the attribute '@from', then -->
|
|
12386
|
+
<xsl:when test="$id_from = ''">
|
|
12387
|
+
<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>
|
|
12388
|
+
</xsl:when>
|
|
12389
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
|
12390
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
|
12391
|
+
<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>
|
|
12392
|
+
</xsl:when>
|
|
12393
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
|
12394
|
+
<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>
|
|
12395
|
+
</xsl:when>
|
|
12396
|
+
</xsl:choose>
|
|
12397
|
+
</xsl:if>
|
|
12398
|
+
|
|
12399
|
+
<xsl:if test="1 = 2">
|
|
12222
12400
|
<xsl:choose>
|
|
12223
12401
|
<!-- if there isn't the attribute '@from', then -->
|
|
12224
12402
|
<xsl:when test="$id_from = ''">
|
|
@@ -12232,6 +12410,7 @@
|
|
|
12232
12410
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
|
12233
12411
|
</xsl:when>
|
|
12234
12412
|
</xsl:choose>
|
|
12413
|
+
</xsl:if>
|
|
12235
12414
|
|
|
12236
12415
|
</xsl:template>
|
|
12237
12416
|
|
|
@@ -13621,7 +13800,7 @@
|
|
|
13621
13800
|
<!-- remove preprocess-xslt -->
|
|
13622
13801
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
|
13623
13802
|
|
|
13624
|
-
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
|
13803
|
+
<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">
|
|
13625
13804
|
<xsl:copy-of select="."/>
|
|
13626
13805
|
</xsl:template>
|
|
13627
13806
|
|
|
@@ -13687,6 +13866,22 @@
|
|
|
13687
13866
|
</xsl:choose>
|
|
13688
13867
|
</xsl:template>
|
|
13689
13868
|
|
|
13869
|
+
<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
|
|
13870
|
+
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
|
|
13871
|
+
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
|
|
13872
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
|
|
13873
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
|
13874
|
+
</xsl:if>
|
|
13875
|
+
</xsl:template>
|
|
13876
|
+
|
|
13877
|
+
<!-- split math by element with @linebreak into maths -->
|
|
13878
|
+
<xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
|
|
13879
|
+
<xsl:variable name="maths">
|
|
13880
|
+
<xsl:apply-templates select="." mode="mathml_linebreak"/>
|
|
13881
|
+
</xsl:variable>
|
|
13882
|
+
<xsl:copy-of select="$maths"/>
|
|
13883
|
+
</xsl:template>
|
|
13884
|
+
|
|
13690
13885
|
<!-- =========================================================================== -->
|
|
13691
13886
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
|
13692
13887
|
<!-- =========================================================================== -->
|
|
@@ -13790,6 +13985,8 @@
|
|
|
13790
13985
|
|
|
13791
13986
|
<xsl:template name="insertOpeningElements">
|
|
13792
13987
|
<xsl:param name="tree"/>
|
|
13988
|
+
<xsl:param name="xmlns"/>
|
|
13989
|
+
<xsl:param name="add_continue">true</xsl:param>
|
|
13793
13990
|
<xsl:for-each select="$tree//element">
|
|
13794
13991
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
|
13795
13992
|
<xsl:value-of select="."/>
|
|
@@ -13800,7 +13997,8 @@
|
|
|
13800
13997
|
<xsl:value-of select="."/>
|
|
13801
13998
|
<xsl:text>"</xsl:text>
|
|
13802
13999
|
</xsl:for-each>
|
|
13803
|
-
<xsl:if test="position() = 1"> continue="true"</xsl:if>
|
|
14000
|
+
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
|
14001
|
+
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
|
13804
14002
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
|
13805
14003
|
<xsl:if test="$debug = 'true'">
|
|
13806
14004
|
<xsl:message><<xsl:value-of select="."/>></xsl:message>
|