metanorma-un 0.6.7 → 0.6.11
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/Gemfile +2 -2
- data/Rakefile +2 -2
- data/lib/asciidoctor/un/converter.rb +27 -27
- data/lib/asciidoctor/un/isodoc.rng +52 -11
- data/lib/asciidoctor/un/reqt.rng +15 -4
- data/lib/asciidoctor/un/validate.rb +3 -4
- data/lib/isodoc/un/html/htmlstyle.css +6 -0
- data/lib/isodoc/un/html/htmlstyle.scss +7 -0
- data/lib/isodoc/un/i18n.rb +0 -1
- data/lib/isodoc/un/init.rb +1 -2
- data/lib/isodoc/un/un.plenary-attachment.xsl +284 -63
- data/lib/isodoc/un/un.plenary.xsl +284 -63
- data/lib/isodoc/un/un.recommendation.xsl +289 -67
- data/lib/isodoc/un.rb +0 -1
- data/lib/metanorma/un/input.rb +1 -3
- data/lib/metanorma/un/processor.rb +2 -1
- data/lib/metanorma/un/version.rb +1 -1
- data/lib/metanorma/un.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0b63d794f083c6c3b1048ccbf269cf9717f5e5dcb58edd343d0f42b4c4094f2
|
4
|
+
data.tar.gz: 8d1087956f701934a0964394cd1296aaa623d09cc3c3a1ef2229a204519b6c4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e9a5d52516279061f8660dce71f2986594f545e17b05e85bedae6fc0098ae93eb314ac57cdba61805b5a3d3211874525dc1275f5b8e243a9df94ddf42772b5
|
7
|
+
data.tar.gz: 4179212a7487ab5fec81997cdf1bb156a9f5dbd61bb44a4b8997f8716fd74fc745c285bd7058c94815961c42a1616ae25c7491e880d3fb0a46915d11453d9f1b
|
data/Gemfile
CHANGED
@@ -6,6 +6,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
|
|
6
6
|
|
7
7
|
gemspec
|
8
8
|
|
9
|
-
if File.exist?
|
10
|
-
eval File.read(
|
9
|
+
if File.exist? "Gemfile.devel"
|
10
|
+
eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
|
11
11
|
end
|
data/Rakefile
CHANGED
@@ -17,13 +17,14 @@ module Asciidoctor
|
|
17
17
|
|
18
18
|
def metadata_committee(node, xml)
|
19
19
|
return unless node.attr("committee")
|
20
|
+
|
20
21
|
xml.editorialgroup do |a|
|
21
22
|
a.committee node.attr("committee"),
|
22
|
-
|
23
|
+
**attr_code(type: node.attr("committee-type"))
|
23
24
|
i = 2
|
24
|
-
while node.attr("committee_#{i}")
|
25
|
+
while node.attr("committee_#{i}")
|
25
26
|
a.committee node.attr("committee_#{i}"),
|
26
|
-
|
27
|
+
**attr_code(type: node.attr("committee-type_#{i}"))
|
27
28
|
i += 1
|
28
29
|
end
|
29
30
|
end
|
@@ -66,13 +67,13 @@ module Asciidoctor
|
|
66
67
|
xml.session do |session|
|
67
68
|
session.number node.attr("session") if node.attr("session")
|
68
69
|
session.date node.attr("session-date") if node.attr("session-date")
|
69
|
-
node&.attr("item-number")&.split(/,
|
70
|
+
node&.attr("item-number")&.split(/, */)&.each do |i|
|
70
71
|
session.item_number i
|
71
72
|
end
|
72
|
-
node&.attr("item-name")&.split(/,
|
73
|
+
node&.attr("item-name")&.split(/, */)&.each do |i|
|
73
74
|
session.item_name i
|
74
75
|
end
|
75
|
-
node&.attr("subitem-name")&.split(/,
|
76
|
+
node&.attr("subitem-name")&.split(/, */)&.each do |i|
|
76
77
|
session.subitem_name i
|
77
78
|
end
|
78
79
|
node.attr("collaborator") and
|
@@ -84,13 +85,13 @@ module Asciidoctor
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def metadata_language(node, xml)
|
87
|
-
languages = node&.attr("language")&.split(/,
|
88
|
+
languages = node&.attr("language")&.split(/, */) ||
|
88
89
|
%w(ar ru en fr zh es)
|
89
90
|
languages.each { |l| xml.language l }
|
90
91
|
end
|
91
92
|
|
92
93
|
def metadata_submission_language(node, xml)
|
93
|
-
languages = node&.attr("submissionlanguage")&.split(/,
|
94
|
+
languages = node&.attr("submissionlanguage")&.split(/, */) || []
|
94
95
|
languages.each { |l| xml.submissionlanguage l }
|
95
96
|
end
|
96
97
|
|
@@ -101,7 +102,7 @@ module Asciidoctor
|
|
101
102
|
metadata_submission_language(node, xml)
|
102
103
|
end
|
103
104
|
|
104
|
-
def title_validate(
|
105
|
+
def title_validate(_root)
|
105
106
|
nil
|
106
107
|
end
|
107
108
|
|
@@ -114,12 +115,11 @@ module Asciidoctor
|
|
114
115
|
|
115
116
|
def doctype(node)
|
116
117
|
d = super
|
117
|
-
unless %w{plenary recommendation addendum communication corrigendum
|
118
|
-
|
119
|
-
|
120
|
-
@log.add(
|
121
|
-
|
122
|
-
"#{d} is not a legal document type: reverting to 'recommendation'")
|
118
|
+
unless %w{plenary recommendation addendum communication corrigendum
|
119
|
+
reissue agenda budgetary sec-gen-notes expert-report
|
120
|
+
resolution plenary-attachment}.include? d
|
121
|
+
@log.add("Document Attributes", nil,
|
122
|
+
"#{d} is not a legal document type: reverting to 'recommendation'")
|
123
123
|
d = "recommendation"
|
124
124
|
end
|
125
125
|
d
|
@@ -128,11 +128,11 @@ module Asciidoctor
|
|
128
128
|
def outputs(node, ret)
|
129
129
|
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
130
130
|
presentation_xml_converter(node).convert(@filename + ".xml")
|
131
|
-
html_converter(node).convert(@filename + ".presentation.xml",
|
131
|
+
html_converter(node).convert(@filename + ".presentation.xml",
|
132
132
|
nil, false, "#{@filename}.html")
|
133
|
-
doc_converter(node).convert(@filename + ".presentation.xml",
|
133
|
+
doc_converter(node).convert(@filename + ".presentation.xml",
|
134
134
|
nil, false, "#{@filename}.doc")
|
135
|
-
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
135
|
+
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
136
136
|
nil, false, "#{@filename}.pdf")
|
137
137
|
end
|
138
138
|
|
@@ -142,8 +142,8 @@ module Asciidoctor
|
|
142
142
|
File.join(File.dirname(__FILE__), "un.rng"))
|
143
143
|
end
|
144
144
|
|
145
|
-
def style(
|
146
|
-
|
145
|
+
def style(_node, _text)
|
146
|
+
nil
|
147
147
|
end
|
148
148
|
|
149
149
|
def html_extract_attributes(node)
|
@@ -168,6 +168,7 @@ module Asciidoctor
|
|
168
168
|
|
169
169
|
def pdf_converter(node)
|
170
170
|
return nil if node.attr("no-pdf")
|
171
|
+
|
171
172
|
IsoDoc::UN::PdfConvert.new(doc_extract_attributes(node))
|
172
173
|
end
|
173
174
|
|
@@ -196,25 +197,24 @@ module Asciidoctor
|
|
196
197
|
xmldoc.xpath("//clause/p | //annex/p").each do |p|
|
197
198
|
cl = Nokogiri::XML::Node.new("clause", xmldoc)
|
198
199
|
cl["id"] = p["id"]
|
199
|
-
cl["inline-header"]="true"
|
200
|
-
p["id"] = "_
|
200
|
+
cl["inline-header"] = "true"
|
201
|
+
p["id"] = "_#{UUIDTools::UUID.random_create}"
|
201
202
|
p.replace(cl)
|
202
203
|
p.parent = cl
|
203
|
-
while n = cl.next_element
|
204
|
+
while (n = cl.next_element) && !%w(p clause).include?(n.name)
|
204
205
|
n.parent = cl
|
205
206
|
end
|
206
207
|
end
|
207
208
|
end
|
208
209
|
|
209
210
|
def admonition_attrs(node)
|
210
|
-
attr_code(super.merge(
|
211
|
-
|
211
|
+
attr_code(super.merge(unnumbered: node.option?("unnumbered"),
|
212
|
+
subsequence: node.attr("subsequence")))
|
212
213
|
end
|
213
214
|
|
214
215
|
def sectiontype_streamline(ret)
|
215
216
|
case ret
|
216
|
-
when "foreword" then "donotrecognise-foreword"
|
217
|
-
when "introduction" then "donotrecognise-foreword"
|
217
|
+
when "foreword", "introduction" then "donotrecognise-foreword"
|
218
218
|
else
|
219
219
|
super
|
220
220
|
end
|
@@ -32,6 +32,18 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="section-title">
|
36
|
+
<element name="title">
|
37
|
+
<zeroOrMore>
|
38
|
+
<ref name="TextElement"/>
|
39
|
+
</zeroOrMore>
|
40
|
+
</element>
|
41
|
+
<zeroOrMore>
|
42
|
+
<element name="variant-title">
|
43
|
+
<ref name="TypedTitleString"/>
|
44
|
+
</element>
|
45
|
+
</zeroOrMore>
|
46
|
+
</define>
|
35
47
|
<define name="hyperlink">
|
36
48
|
<element name="link">
|
37
49
|
<attribute name="target">
|
@@ -158,15 +170,17 @@
|
|
158
170
|
<data type="boolean"/>
|
159
171
|
</attribute>
|
160
172
|
</optional>
|
161
|
-
<
|
162
|
-
<
|
163
|
-
<
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
173
|
+
<optional>
|
174
|
+
<attribute name="type">
|
175
|
+
<choice>
|
176
|
+
<value>roman</value>
|
177
|
+
<value>alphabet</value>
|
178
|
+
<value>arabic</value>
|
179
|
+
<value>roman_upper</value>
|
180
|
+
<value>alphabet_upper</value>
|
181
|
+
</choice>
|
182
|
+
</attribute>
|
183
|
+
</optional>
|
170
184
|
<oneOrMore>
|
171
185
|
<ref name="li"/>
|
172
186
|
</oneOrMore>
|
@@ -976,6 +990,16 @@
|
|
976
990
|
<data type="boolean"/>
|
977
991
|
</attribute>
|
978
992
|
</optional>
|
993
|
+
<optional>
|
994
|
+
<attribute name="linkmention">
|
995
|
+
<data type="boolean"/>
|
996
|
+
</attribute>
|
997
|
+
</optional>
|
998
|
+
<optional>
|
999
|
+
<attribute name="linkref">
|
1000
|
+
<data type="boolean"/>
|
1001
|
+
</attribute>
|
1002
|
+
</optional>
|
979
1003
|
<optional>
|
980
1004
|
<element name="refterm">
|
981
1005
|
<zeroOrMore>
|
@@ -1011,8 +1035,14 @@
|
|
1011
1035
|
<ref name="imagemap"/>
|
1012
1036
|
<ref name="svgmap"/>
|
1013
1037
|
<ref name="inputform"/>
|
1038
|
+
<ref name="toc"/>
|
1014
1039
|
</choice>
|
1015
1040
|
</define>
|
1041
|
+
<define name="toc">
|
1042
|
+
<element name="toc">
|
1043
|
+
<ref name="ul"/>
|
1044
|
+
</element>
|
1045
|
+
</define>
|
1016
1046
|
<define name="inputform">
|
1017
1047
|
<element name="form">
|
1018
1048
|
<attribute name="id">
|
@@ -1254,6 +1284,12 @@
|
|
1254
1284
|
<optional>
|
1255
1285
|
<attribute name="type"/>
|
1256
1286
|
</optional>
|
1287
|
+
<optional>
|
1288
|
+
<attribute name="identifier"/>
|
1289
|
+
</optional>
|
1290
|
+
<optional>
|
1291
|
+
<attribute name="prefix"/>
|
1292
|
+
</optional>
|
1257
1293
|
<text/>
|
1258
1294
|
</define>
|
1259
1295
|
<define name="ics">
|
@@ -1674,7 +1710,9 @@
|
|
1674
1710
|
<zeroOrMore>
|
1675
1711
|
<ref name="termgrammar"/>
|
1676
1712
|
</zeroOrMore>
|
1677
|
-
<
|
1713
|
+
<oneOrMore>
|
1714
|
+
<ref name="termdefinition"/>
|
1715
|
+
</oneOrMore>
|
1678
1716
|
<zeroOrMore>
|
1679
1717
|
<ref name="termnote"/>
|
1680
1718
|
</zeroOrMore>
|
@@ -1737,7 +1775,7 @@
|
|
1737
1775
|
</oneOrMore>
|
1738
1776
|
</element>
|
1739
1777
|
</define>
|
1740
|
-
<define name="
|
1778
|
+
<define name="termdefinition">
|
1741
1779
|
<element name="definition">
|
1742
1780
|
<oneOrMore>
|
1743
1781
|
<choice>
|
@@ -1746,6 +1784,9 @@
|
|
1746
1784
|
<ref name="formula"/>
|
1747
1785
|
</choice>
|
1748
1786
|
</oneOrMore>
|
1787
|
+
<zeroOrMore>
|
1788
|
+
<ref name="termsource"/>
|
1789
|
+
</zeroOrMore>
|
1749
1790
|
</element>
|
1750
1791
|
</define>
|
1751
1792
|
<define name="termnote">
|
data/lib/asciidoctor/un/reqt.rng
CHANGED
@@ -64,9 +64,9 @@
|
|
64
64
|
<optional>
|
65
65
|
<ref name="label"/>
|
66
66
|
</optional>
|
67
|
-
<
|
67
|
+
<zeroOrMore>
|
68
68
|
<ref name="subject"/>
|
69
|
-
</
|
69
|
+
</zeroOrMore>
|
70
70
|
<zeroOrMore>
|
71
71
|
<ref name="reqinherit"/>
|
72
72
|
</zeroOrMore>
|
@@ -80,6 +80,7 @@
|
|
80
80
|
<ref name="verification"/>
|
81
81
|
<ref name="import"/>
|
82
82
|
<ref name="description"/>
|
83
|
+
<ref name="component"/>
|
83
84
|
</choice>
|
84
85
|
</zeroOrMore>
|
85
86
|
<optional>
|
@@ -105,12 +106,16 @@
|
|
105
106
|
</define>
|
106
107
|
<define name="subject">
|
107
108
|
<element name="subject">
|
108
|
-
<
|
109
|
+
<oneOrMore>
|
110
|
+
<ref name="TextElement"/>
|
111
|
+
</oneOrMore>
|
109
112
|
</element>
|
110
113
|
</define>
|
111
114
|
<define name="reqinherit">
|
112
115
|
<element name="inherit">
|
113
|
-
<
|
116
|
+
<oneOrMore>
|
117
|
+
<ref name="TextElement"/>
|
118
|
+
</oneOrMore>
|
114
119
|
</element>
|
115
120
|
</define>
|
116
121
|
<define name="measurementtarget">
|
@@ -138,6 +143,12 @@
|
|
138
143
|
<ref name="RequirementSubpart"/>
|
139
144
|
</element>
|
140
145
|
</define>
|
146
|
+
<define name="component">
|
147
|
+
<element name="component">
|
148
|
+
<attribute name="class"/>
|
149
|
+
<ref name="RequirementSubpart"/>
|
150
|
+
</element>
|
151
|
+
</define>
|
141
152
|
<define name="reqt_references">
|
142
153
|
<element name="references">
|
143
154
|
<oneOrMore>
|
@@ -13,11 +13,10 @@ module Asciidoctor
|
|
13
13
|
def stage_validate(xmldoc)
|
14
14
|
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
15
15
|
%w(proposal working-draft committee-draft draft-standard final-draft
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
published withdrawn).include? stage or
|
17
|
+
@log.add("Document Attributes", nil,
|
18
|
+
"#{stage} is not a recognised status")
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
data/lib/isodoc/un/i18n.rb
CHANGED
data/lib/isodoc/un/init.rb
CHANGED
@@ -11,7 +11,7 @@ module IsoDoc
|
|
11
11
|
@meta.set(:toc, @toc)
|
12
12
|
end
|
13
13
|
|
14
|
-
def xref_init(lang, script,
|
14
|
+
def xref_init(lang, script, _klass, labels, options)
|
15
15
|
html = HtmlConvert.new(language: lang, script: script)
|
16
16
|
@xrefs = Xref.new(lang, script, html, labels, options)
|
17
17
|
end
|
@@ -26,4 +26,3 @@ module IsoDoc
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
@@ -160,7 +160,7 @@
|
|
160
160
|
<fo:block>
|
161
161
|
<xsl:value-of select="translate(/un:un-standard/un:sections/un:clause[1]/un:ol[1]/un:li[1]/un:p[1], '.', '')"/>
|
162
162
|
</fo:block>
|
163
|
-
<fo:block><xsl:value-of select="$title"/></fo:block>
|
163
|
+
<fo:block role="H1"><xsl:value-of select="$title"/></fo:block>
|
164
164
|
</fo:block>
|
165
165
|
</fo:block-container>
|
166
166
|
|
@@ -485,7 +485,10 @@
|
|
485
485
|
</xsl:template>
|
486
486
|
|
487
487
|
<xsl:template match="un:title" mode="inline-header">
|
488
|
-
<
|
488
|
+
<xsl:variable name="level">
|
489
|
+
<xsl:call-template name="getLevel"/>
|
490
|
+
</xsl:variable>
|
491
|
+
<fo:inline role="H{$level}">
|
489
492
|
<xsl:apply-templates/>
|
490
493
|
</fo:inline>
|
491
494
|
</xsl:template>
|
@@ -715,8 +718,9 @@
|
|
715
718
|
<xsl:otherwise>11pt</xsl:otherwise>
|
716
719
|
</xsl:choose>
|
717
720
|
</xsl:variable>
|
718
|
-
<fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always">
|
721
|
+
<fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always" role="H{$level}">
|
719
722
|
<xsl:apply-templates/>
|
723
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
720
724
|
</fo:block>
|
721
725
|
</xsl:template>
|
722
726
|
|
@@ -734,15 +738,17 @@
|
|
734
738
|
</xsl:variable>
|
735
739
|
<xsl:choose>
|
736
740
|
<xsl:when test="$level = 1">
|
737
|
-
<fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always">
|
741
|
+
<fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always" role="H{$level}">
|
738
742
|
<fo:block margin-bottom="12pt">
|
739
743
|
<xsl:apply-templates/>
|
744
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
740
745
|
</fo:block>
|
741
746
|
</fo:block>
|
742
747
|
</xsl:when>
|
743
748
|
<xsl:otherwise>
|
744
|
-
<fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always">
|
749
|
+
<fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always" role="H{$level}">
|
745
750
|
<xsl:apply-templates/>
|
751
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
746
752
|
</fo:block>
|
747
753
|
</xsl:otherwise>
|
748
754
|
</xsl:choose>
|
@@ -769,7 +775,7 @@
|
|
769
775
|
<xsl:choose>
|
770
776
|
<xsl:when test="ancestor::un:sections and $level = 1">
|
771
777
|
<fo:block-container margin-left="-16mm">
|
772
|
-
<fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always">
|
778
|
+
<fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always" role="H{$level}">
|
773
779
|
<fo:table table-layout="fixed" width="100%">
|
774
780
|
<fo:table-column column-width="16mm"/>
|
775
781
|
<fo:table-column column-width="130mm"/>
|
@@ -788,6 +794,7 @@
|
|
788
794
|
<fo:table-cell>
|
789
795
|
<fo:block>
|
790
796
|
<xsl:call-template name="extractTitle"/>
|
797
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
791
798
|
</fo:block>
|
792
799
|
</fo:table-cell>
|
793
800
|
</fo:table-row>
|
@@ -797,7 +804,7 @@
|
|
797
804
|
</fo:block-container>
|
798
805
|
</xsl:when>
|
799
806
|
<xsl:when test="ancestor::un:sections">
|
800
|
-
<fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always">
|
807
|
+
<fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always" role="H{$level}">
|
801
808
|
<xsl:if test="$level = 2">
|
802
809
|
<xsl:attribute name="margin-left">1mm</xsl:attribute>
|
803
810
|
<xsl:attribute name="space-before">12pt</xsl:attribute>
|
@@ -814,8 +821,9 @@
|
|
814
821
|
</fo:block>
|
815
822
|
</xsl:when>
|
816
823
|
<xsl:otherwise>
|
817
|
-
<fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always">
|
824
|
+
<fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always" role="H{$level}">
|
818
825
|
<xsl:apply-templates/>
|
826
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
819
827
|
</fo:block>
|
820
828
|
</xsl:otherwise>
|
821
829
|
</xsl:choose>
|
@@ -1046,26 +1054,26 @@
|
|
1046
1054
|
<!-- ============================ -->
|
1047
1055
|
|
1048
1056
|
<xsl:template name="insertHeaderFooter">
|
1049
|
-
<fo:static-content flow-name="header-odd">
|
1057
|
+
<fo:static-content flow-name="header-odd" role="artifact">
|
1050
1058
|
<fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
|
1051
1059
|
<fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
|
1052
1060
|
<xsl:value-of select="$id"/>
|
1053
1061
|
</fo:block>
|
1054
1062
|
</fo:block-container>
|
1055
1063
|
</fo:static-content>
|
1056
|
-
<fo:static-content flow-name="footer-odd">
|
1064
|
+
<fo:static-content flow-name="footer-odd" role="artifact">
|
1057
1065
|
<fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
|
1058
1066
|
<fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
|
1059
1067
|
</fo:block-container>
|
1060
1068
|
</fo:static-content>
|
1061
|
-
<fo:static-content flow-name="header-even">
|
1069
|
+
<fo:static-content flow-name="header-even" role="artifact">
|
1062
1070
|
<fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
|
1063
1071
|
<fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
|
1064
1072
|
<xsl:value-of select="$id"/>
|
1065
1073
|
</fo:block>
|
1066
1074
|
</fo:block-container>
|
1067
1075
|
</fo:static-content>
|
1068
|
-
<fo:static-content flow-name="footer-even">
|
1076
|
+
<fo:static-content flow-name="footer-even" role="artifact">
|
1069
1077
|
<fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
|
1070
1078
|
<fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
|
1071
1079
|
</fo:block-container>
|
@@ -1271,12 +1279,13 @@
|
|
1271
1279
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
1272
1280
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1273
1281
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
1282
|
+
<xsl:attribute name="role">Code</xsl:attribute>
|
1274
1283
|
|
1275
1284
|
|
1276
1285
|
|
1277
1286
|
|
1278
1287
|
|
1279
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
1288
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
1280
1289
|
<xsl:attribute name="margin-top">6pt</xsl:attribute>
|
1281
1290
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1282
1291
|
|
@@ -1296,8 +1305,13 @@
|
|
1296
1305
|
|
1297
1306
|
</xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
|
1298
1307
|
|
1299
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
1300
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
1308
|
+
</xsl:attribute-set><xsl:attribute-set name="subject-style">
|
1309
|
+
</xsl:attribute-set><xsl:attribute-set name="inherit-style">
|
1310
|
+
</xsl:attribute-set><xsl:attribute-set name="description-style">
|
1311
|
+
</xsl:attribute-set><xsl:attribute-set name="specification-style">
|
1312
|
+
</xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
|
1313
|
+
</xsl:attribute-set><xsl:attribute-set name="verification-style">
|
1314
|
+
</xsl:attribute-set><xsl:attribute-set name="import-style">
|
1301
1315
|
</xsl:attribute-set><xsl:attribute-set name="recommendation-style">
|
1302
1316
|
|
1303
1317
|
|
@@ -1365,6 +1379,7 @@
|
|
1365
1379
|
|
1366
1380
|
|
1367
1381
|
|
1382
|
+
|
1368
1383
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
1369
1384
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
1370
1385
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
@@ -1379,7 +1394,9 @@
|
|
1379
1394
|
|
1380
1395
|
|
1381
1396
|
|
1382
|
-
</xsl:attribute-set><xsl:
|
1397
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
1398
|
+
|
1399
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
1383
1400
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1384
1401
|
|
1385
1402
|
|
@@ -1494,7 +1511,8 @@
|
|
1494
1511
|
|
1495
1512
|
|
1496
1513
|
|
1497
|
-
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1514
|
+
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1515
|
+
<xsl:attribute name="role">BlockQuote</xsl:attribute>
|
1498
1516
|
|
1499
1517
|
|
1500
1518
|
|
@@ -1679,11 +1697,15 @@
|
|
1679
1697
|
<fo:block> </fo:block>
|
1680
1698
|
</xsl:if> -->
|
1681
1699
|
|
1700
|
+
|
1701
|
+
<!-- Display table's name before table as standalone block -->
|
1682
1702
|
<!-- $namespace = 'iso' or -->
|
1683
1703
|
|
1684
1704
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1685
1705
|
|
1686
|
-
|
1706
|
+
|
1707
|
+
|
1708
|
+
|
1687
1709
|
|
1688
1710
|
<xsl:call-template name="fn_name_display"/>
|
1689
1711
|
|
@@ -1757,6 +1779,12 @@
|
|
1757
1779
|
|
1758
1780
|
|
1759
1781
|
|
1782
|
+
|
1783
|
+
|
1784
|
+
|
1785
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
1786
|
+
|
1787
|
+
|
1760
1788
|
<xsl:variable name="table_width">
|
1761
1789
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1762
1790
|
|
@@ -1780,6 +1808,7 @@
|
|
1780
1808
|
|
1781
1809
|
|
1782
1810
|
|
1811
|
+
|
1783
1812
|
|
1784
1813
|
|
1785
1814
|
|
@@ -1805,6 +1834,8 @@
|
|
1805
1834
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1806
1835
|
</xsl:if>
|
1807
1836
|
|
1837
|
+
|
1838
|
+
|
1808
1839
|
<xsl:choose>
|
1809
1840
|
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1810
1841
|
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
@@ -2089,9 +2120,9 @@
|
|
2089
2120
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
2090
2121
|
<xsl:with-param name="continued">true</xsl:with-param>
|
2091
2122
|
</xsl:apply-templates>
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2123
|
+
|
2124
|
+
|
2125
|
+
|
2095
2126
|
|
2096
2127
|
</fo:table-cell>
|
2097
2128
|
</fo:table-row>
|
@@ -2173,7 +2204,11 @@
|
|
2173
2204
|
|
2174
2205
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2175
2206
|
|
2176
|
-
<xsl:
|
2207
|
+
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
2208
|
+
|
2209
|
+
</xsl:variable>
|
2210
|
+
|
2211
|
+
<xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
|
2177
2212
|
|
2178
2213
|
<xsl:variable name="cols-count">
|
2179
2214
|
<xsl:choose>
|
@@ -2202,6 +2237,8 @@
|
|
2202
2237
|
</xsl:choose>
|
2203
2238
|
</xsl:for-each>
|
2204
2239
|
|
2240
|
+
|
2241
|
+
|
2205
2242
|
<xsl:choose>
|
2206
2243
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2207
2244
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -2238,6 +2275,7 @@
|
|
2238
2275
|
|
2239
2276
|
|
2240
2277
|
|
2278
|
+
|
2241
2279
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
2242
2280
|
|
2243
2281
|
|
@@ -2311,6 +2349,19 @@
|
|
2311
2349
|
|
2312
2350
|
</fo:table-body>
|
2313
2351
|
|
2352
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
|
2353
|
+
<xsl:choose>
|
2354
|
+
<xsl:when test="substring-after(., '—') != ''">
|
2355
|
+
<xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
|
2356
|
+
</xsl:when>
|
2357
|
+
<xsl:otherwise>
|
2358
|
+
<xsl:value-of select="."/>
|
2359
|
+
</xsl:otherwise>
|
2360
|
+
</xsl:choose>
|
2361
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
|
2362
|
+
<xsl:apply-templates mode="presentation_name"/>
|
2363
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
|
2364
|
+
<xsl:apply-templates select="."/>
|
2314
2365
|
</xsl:template><xsl:template match="*[local-name()='tr']">
|
2315
2366
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
2316
2367
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
@@ -2323,6 +2374,8 @@
|
|
2323
2374
|
|
2324
2375
|
|
2325
2376
|
|
2377
|
+
|
2378
|
+
|
2326
2379
|
</xsl:if>
|
2327
2380
|
<xsl:if test="$parent-name = 'tfoot'">
|
2328
2381
|
|
@@ -2341,6 +2394,8 @@
|
|
2341
2394
|
|
2342
2395
|
|
2343
2396
|
|
2397
|
+
|
2398
|
+
|
2344
2399
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2345
2400
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2346
2401
|
</xsl:if> -->
|
@@ -2511,14 +2566,12 @@
|
|
2511
2566
|
<xsl:apply-templates/>
|
2512
2567
|
</xsl:template><xsl:template name="fn_display">
|
2513
2568
|
<xsl:variable name="references">
|
2569
|
+
|
2514
2570
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
2515
|
-
<
|
2516
|
-
|
2517
|
-
|
2518
|
-
<xsl:apply-templates/>
|
2519
|
-
</fn>
|
2571
|
+
<xsl:call-template name="create_fn"/>
|
2520
2572
|
</xsl:for-each>
|
2521
2573
|
</xsl:variable>
|
2574
|
+
|
2522
2575
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
2523
2576
|
<xsl:variable name="reference" select="@reference"/>
|
2524
2577
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
@@ -2554,6 +2607,12 @@
|
|
2554
2607
|
</fo:block>
|
2555
2608
|
</xsl:if>
|
2556
2609
|
</xsl:for-each>
|
2610
|
+
</xsl:template><xsl:template name="create_fn">
|
2611
|
+
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
2612
|
+
|
2613
|
+
|
2614
|
+
<xsl:apply-templates/>
|
2615
|
+
</fn>
|
2557
2616
|
</xsl:template><xsl:template name="fn_name_display">
|
2558
2617
|
<!-- <xsl:variable name="references">
|
2559
2618
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
@@ -3533,16 +3592,68 @@
|
|
3533
3592
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3534
3593
|
</xsl:call-template>
|
3535
3594
|
|
3595
|
+
|
3596
|
+
|
3536
3597
|
<xsl:variable name="mathml">
|
3537
3598
|
<xsl:apply-templates select="." mode="mathml"/>
|
3538
3599
|
</xsl:variable>
|
3539
3600
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3540
3601
|
|
3541
3602
|
|
3603
|
+
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
3604
|
+
<xsl:variable name="comment_text_">
|
3605
|
+
<xsl:choose>
|
3606
|
+
<xsl:when test="normalize-space($comment_text_following) != ''">
|
3607
|
+
<xsl:value-of select="$comment_text_following"/>
|
3608
|
+
</xsl:when>
|
3609
|
+
<xsl:otherwise>
|
3610
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
3611
|
+
</xsl:otherwise>
|
3612
|
+
</xsl:choose>
|
3613
|
+
</xsl:variable>
|
3614
|
+
<xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
3615
|
+
|
3616
|
+
<xsl:if test="normalize-space($comment_text) != ''">
|
3617
|
+
<!-- put Mathin Alternate Text -->
|
3618
|
+
<xsl:attribute name="fox:alt-text">
|
3619
|
+
<xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
|
3620
|
+
</xsl:attribute>
|
3621
|
+
</xsl:if>
|
3622
|
+
|
3623
|
+
<xsl:variable name="mathml_content">
|
3624
|
+
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
3625
|
+
</xsl:variable>
|
3626
|
+
<!-- put MathML in Actual Text -->
|
3627
|
+
<xsl:attribute name="fox:actual-text">
|
3628
|
+
<xsl:value-of select="$mathml_content"/>
|
3629
|
+
</xsl:attribute>
|
3630
|
+
|
3631
|
+
|
3542
3632
|
<!-- <xsl:copy-of select="."/> -->
|
3543
3633
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3544
3634
|
</fo:instream-foreign-object>
|
3545
3635
|
</fo:inline>
|
3636
|
+
</xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
|
3637
|
+
<!-- <xsl:text>a+b</xsl:text> -->
|
3638
|
+
<xsl:text><</xsl:text>
|
3639
|
+
<xsl:value-of select="local-name()"/>
|
3640
|
+
<xsl:if test="local-name() = 'math'">
|
3641
|
+
<xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
|
3642
|
+
</xsl:if>
|
3643
|
+
<xsl:for-each select="@*">
|
3644
|
+
<xsl:text> </xsl:text>
|
3645
|
+
<xsl:value-of select="local-name()"/>
|
3646
|
+
<xsl:text>="</xsl:text>
|
3647
|
+
<xsl:value-of select="."/>
|
3648
|
+
<xsl:text>"</xsl:text>
|
3649
|
+
</xsl:for-each>
|
3650
|
+
<xsl:text>></xsl:text>
|
3651
|
+
<xsl:apply-templates mode="mathml_actual_text"/>
|
3652
|
+
<xsl:text></</xsl:text>
|
3653
|
+
<xsl:value-of select="local-name()"/>
|
3654
|
+
<xsl:text>></xsl:text>
|
3655
|
+
</xsl:template><xsl:template match="text()" mode="mathml_actual_text">
|
3656
|
+
<xsl:value-of select="normalize-space()"/>
|
3546
3657
|
</xsl:template><xsl:template match="@*|node()" mode="mathml">
|
3547
3658
|
<xsl:copy>
|
3548
3659
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
@@ -3552,19 +3663,6 @@
|
|
3552
3663
|
<!-- replace start and end spaces to non-break space -->
|
3553
3664
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3554
3665
|
</xsl:copy>
|
3555
|
-
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3556
|
-
<xsl:copy>
|
3557
|
-
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3558
|
-
</xsl:copy>
|
3559
|
-
<xsl:choose>
|
3560
|
-
<!-- if in msub, then don't add space -->
|
3561
|
-
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
3562
|
-
<!-- if next char in digit, don't add space -->
|
3563
|
-
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
3564
|
-
<xsl:otherwise>
|
3565
|
-
<mathml:mspace width="0.5ex"/>
|
3566
|
-
</xsl:otherwise>
|
3567
|
-
</xsl:choose>
|
3568
3666
|
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
3569
3667
|
<xsl:variable name="target">
|
3570
3668
|
<xsl:choose>
|
@@ -3617,7 +3715,10 @@
|
|
3617
3715
|
</fo:block>
|
3618
3716
|
<xsl:apply-templates/>
|
3619
3717
|
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
3620
|
-
<
|
3718
|
+
<xsl:variable name="level">
|
3719
|
+
<xsl:call-template name="getLevel"/>
|
3720
|
+
</xsl:variable>
|
3721
|
+
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
3621
3722
|
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
3622
3723
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
3623
3724
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -3652,9 +3753,10 @@
|
|
3652
3753
|
|
3653
3754
|
</xsl:variable>
|
3654
3755
|
|
3756
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3655
3757
|
<xsl:choose>
|
3656
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
3657
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
3758
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
3759
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
3658
3760
|
</xsl:choose>
|
3659
3761
|
<xsl:apply-templates/>
|
3660
3762
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
@@ -3811,7 +3913,10 @@
|
|
3811
3913
|
</fo:block>
|
3812
3914
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
3813
3915
|
<xsl:if test="normalize-space() != ''">
|
3814
|
-
<
|
3916
|
+
<xsl:variable name="level">
|
3917
|
+
<xsl:call-template name="getLevelTermName"/>
|
3918
|
+
</xsl:variable>
|
3919
|
+
<fo:inline role="H{$level}">
|
3815
3920
|
<xsl:apply-templates/>
|
3816
3921
|
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
|
3817
3922
|
<xsl:text>.</xsl:text>
|
@@ -3884,7 +3989,24 @@
|
|
3884
3989
|
</fo:instream-foreign-object>
|
3885
3990
|
</xsl:when>
|
3886
3991
|
<xsl:otherwise>
|
3887
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
3992
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
3993
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
3994
|
+
|
3995
|
+
<xsl:variable name="img_src">
|
3996
|
+
<xsl:choose>
|
3997
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
3998
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
3999
|
+
</xsl:choose>
|
4000
|
+
</xsl:variable>
|
4001
|
+
|
4002
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
4003
|
+
<xsl:if test="number($scale) < 100">
|
4004
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
4005
|
+
</xsl:if>
|
4006
|
+
|
4007
|
+
</xsl:if>
|
4008
|
+
|
4009
|
+
</fo:external-graphic>
|
3888
4010
|
</xsl:otherwise>
|
3889
4011
|
</xsl:choose>
|
3890
4012
|
|
@@ -4055,11 +4177,13 @@
|
|
4055
4177
|
<xsl:attribute name="width">100%</xsl:attribute>
|
4056
4178
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4057
4179
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4180
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
4181
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
4058
4182
|
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
4059
4183
|
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
4060
4184
|
<!-- effective height / width = 1.48, 1.4 - with title -->
|
4061
|
-
<xsl:if test="
|
4062
|
-
<xsl:variable name="width" select="((
|
4185
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
4186
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
4063
4187
|
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
4064
4188
|
</xsl:if>
|
4065
4189
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -4076,6 +4200,23 @@
|
|
4076
4200
|
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
4077
4201
|
<xsl:value-of select="."/>
|
4078
4202
|
</xsl:attribute>
|
4203
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
4204
|
+
<xsl:copy>
|
4205
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
4206
|
+
<xsl:variable name="viewbox">
|
4207
|
+
<xsl:call-template name="split">
|
4208
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
4209
|
+
<xsl:with-param name="sep" select="' '"/>
|
4210
|
+
</xsl:call-template>
|
4211
|
+
</xsl:variable>
|
4212
|
+
<xsl:attribute name="width">
|
4213
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
4214
|
+
</xsl:attribute>
|
4215
|
+
<xsl:attribute name="height">
|
4216
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
4217
|
+
</xsl:attribute>
|
4218
|
+
<xsl:apply-templates mode="svg_update"/>
|
4219
|
+
</xsl:copy>
|
4079
4220
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
4080
4221
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
4081
4222
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -4406,6 +4547,7 @@
|
|
4406
4547
|
</xsl:when>
|
4407
4548
|
<xsl:otherwise>
|
4408
4549
|
<xsl:apply-templates/>
|
4550
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
4409
4551
|
</xsl:otherwise>
|
4410
4552
|
</xsl:choose>
|
4411
4553
|
</fo:block>
|
@@ -4546,14 +4688,6 @@
|
|
4546
4688
|
<fo:block>
|
4547
4689
|
<fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
|
4548
4690
|
</fo:block>
|
4549
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
4550
|
-
<fo:block xsl:use-attribute-sets="requirement-subject-style">
|
4551
|
-
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4552
|
-
</fo:block>
|
4553
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
|
4554
|
-
<fo:block xsl:use-attribute-sets="requirement-inherit-style">
|
4555
|
-
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
4556
|
-
</fo:block>
|
4557
4691
|
</xsl:template><xsl:template match="*[local-name() = 'recommendation']">
|
4558
4692
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
4559
4693
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -4570,6 +4704,38 @@
|
|
4570
4704
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
4571
4705
|
<xsl:apply-templates/>
|
4572
4706
|
</fo:block>
|
4707
|
+
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
4708
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
4709
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4710
|
+
</fo:block>
|
4711
|
+
</xsl:template><xsl:template match="*[local-name() = 'subject']">
|
4712
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
4713
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4714
|
+
</fo:block>
|
4715
|
+
</xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
|
4716
|
+
<fo:block xsl:use-attribute-sets="inherit-style">
|
4717
|
+
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
4718
|
+
</fo:block>
|
4719
|
+
</xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
|
4720
|
+
<fo:block xsl:use-attribute-sets="description-style">
|
4721
|
+
<xsl:apply-templates/>
|
4722
|
+
</fo:block>
|
4723
|
+
</xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
|
4724
|
+
<fo:block xsl:use-attribute-sets="specification-style">
|
4725
|
+
<xsl:apply-templates/>
|
4726
|
+
</fo:block>
|
4727
|
+
</xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
|
4728
|
+
<fo:block xsl:use-attribute-sets="measurement-target-style">
|
4729
|
+
<xsl:apply-templates/>
|
4730
|
+
</fo:block>
|
4731
|
+
</xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
|
4732
|
+
<fo:block xsl:use-attribute-sets="verification-style">
|
4733
|
+
<xsl:apply-templates/>
|
4734
|
+
</fo:block>
|
4735
|
+
</xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
|
4736
|
+
<fo:block xsl:use-attribute-sets="import-style">
|
4737
|
+
<xsl:apply-templates/>
|
4738
|
+
</fo:block>
|
4573
4739
|
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
4574
4740
|
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
4575
4741
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -4721,7 +4887,19 @@
|
|
4721
4887
|
</fo:inline>
|
4722
4888
|
</xsl:if>
|
4723
4889
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
|
4724
|
-
<
|
4890
|
+
<xsl:variable name="element">inline
|
4891
|
+
|
4892
|
+
</xsl:variable>
|
4893
|
+
<xsl:choose>
|
4894
|
+
<xsl:when test="contains($element, 'block')">
|
4895
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
4896
|
+
<xsl:apply-templates/>
|
4897
|
+
</fo:block>
|
4898
|
+
</xsl:when>
|
4899
|
+
<xsl:otherwise>
|
4900
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4901
|
+
</xsl:otherwise>
|
4902
|
+
</xsl:choose>
|
4725
4903
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
4726
4904
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
4727
4905
|
|
@@ -5262,6 +5440,7 @@
|
|
5262
5440
|
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
5263
5441
|
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
5264
5442
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
5443
|
+
|
5265
5444
|
<xsl:apply-templates/>
|
5266
5445
|
</fo:block>
|
5267
5446
|
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
@@ -5301,7 +5480,6 @@
|
|
5301
5480
|
</xsl:template><xsl:template name="processBibitem">
|
5302
5481
|
|
5303
5482
|
|
5304
|
-
<!-- end BIPM bibitem processing-->
|
5305
5483
|
|
5306
5484
|
|
5307
5485
|
|
@@ -5431,6 +5609,9 @@
|
|
5431
5609
|
<fo:block-container border="1pt solid black" width="50%">
|
5432
5610
|
<fo:block> </fo:block>
|
5433
5611
|
</fo:block-container>
|
5612
|
+
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
5613
|
+
<fo:inline padding-right="5mm"> </fo:inline>
|
5614
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
5434
5615
|
</xsl:template><xsl:template name="convertDate">
|
5435
5616
|
<xsl:param name="date"/>
|
5436
5617
|
<xsl:param name="format" select="'short'"/>
|
@@ -5669,6 +5850,26 @@
|
|
5669
5850
|
<xsl:value-of select="$level"/>
|
5670
5851
|
</xsl:otherwise>
|
5671
5852
|
</xsl:choose>
|
5853
|
+
</xsl:template><xsl:template name="getLevelTermName">
|
5854
|
+
<xsl:choose>
|
5855
|
+
<xsl:when test="normalize-space(../@depth) != ''">
|
5856
|
+
<xsl:value-of select="../@depth"/>
|
5857
|
+
</xsl:when>
|
5858
|
+
<xsl:otherwise>
|
5859
|
+
<xsl:variable name="title_level_">
|
5860
|
+
<xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
|
5861
|
+
<xsl:call-template name="getLevel"/>
|
5862
|
+
</xsl:for-each>
|
5863
|
+
</xsl:variable>
|
5864
|
+
<xsl:variable name="title_level" select="normalize-space($title_level_)"/>
|
5865
|
+
<xsl:choose>
|
5866
|
+
<xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
|
5867
|
+
<xsl:otherwise>
|
5868
|
+
<xsl:call-template name="getLevel"/>
|
5869
|
+
</xsl:otherwise>
|
5870
|
+
</xsl:choose>
|
5871
|
+
</xsl:otherwise>
|
5872
|
+
</xsl:choose>
|
5672
5873
|
</xsl:template><xsl:template name="split">
|
5673
5874
|
<xsl:param name="pText" select="."/>
|
5674
5875
|
<xsl:param name="sep" select="','"/>
|
@@ -5766,20 +5967,40 @@
|
|
5766
5967
|
</xsl:call-template>
|
5767
5968
|
</xsl:if>
|
5768
5969
|
</xsl:template><xsl:template name="getLocalizedString">
|
5769
|
-
<xsl:param name="key"/>
|
5970
|
+
<xsl:param name="key"/>
|
5971
|
+
<xsl:param name="formatted">false</xsl:param>
|
5770
5972
|
|
5771
5973
|
<xsl:variable name="curr_lang">
|
5772
5974
|
<xsl:call-template name="getLang"/>
|
5773
5975
|
</xsl:variable>
|
5774
5976
|
|
5775
|
-
<xsl:variable name="data_value"
|
5977
|
+
<xsl:variable name="data_value">
|
5978
|
+
<xsl:choose>
|
5979
|
+
<xsl:when test="$formatted = 'true'">
|
5980
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5981
|
+
</xsl:when>
|
5982
|
+
<xsl:otherwise>
|
5983
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5984
|
+
</xsl:otherwise>
|
5985
|
+
</xsl:choose>
|
5986
|
+
</xsl:variable>
|
5776
5987
|
|
5777
5988
|
<xsl:choose>
|
5778
|
-
<xsl:when test="$data_value != ''">
|
5779
|
-
<xsl:
|
5989
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
5990
|
+
<xsl:choose>
|
5991
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
5992
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
5993
|
+
</xsl:choose>
|
5780
5994
|
</xsl:when>
|
5781
5995
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5782
|
-
<xsl:
|
5996
|
+
<xsl:choose>
|
5997
|
+
<xsl:when test="$formatted = 'true'">
|
5998
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5999
|
+
</xsl:when>
|
6000
|
+
<xsl:otherwise>
|
6001
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6002
|
+
</xsl:otherwise>
|
6003
|
+
</xsl:choose>
|
5783
6004
|
</xsl:when>
|
5784
6005
|
<xsl:otherwise>
|
5785
6006
|
<xsl:variable name="key_">
|
@@ -5790,7 +6011,7 @@
|
|
5790
6011
|
<xsl:value-of select="$key_"/>
|
5791
6012
|
</xsl:otherwise>
|
5792
6013
|
</xsl:choose>
|
5793
|
-
|
6014
|
+
|
5794
6015
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5795
6016
|
<xsl:param name="isAdded"/>
|
5796
6017
|
<xsl:param name="isDeleted"/>
|