metanorma-bipm 1.1.1 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.gitignore +4 -1
- data/.hound.yml +5 -0
- data/.rubocop.yml +4 -8
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/lib/asciidoctor/bipm/biblio.rng +1 -0
- data/lib/asciidoctor/bipm/bipm.rng +3 -0
- data/lib/asciidoctor/bipm/converter.rb +9 -1
- data/lib/asciidoctor/bipm/isodoc.rng +240 -10
- data/lib/isodoc/bipm/base_convert.rb +25 -11
- data/lib/isodoc/bipm/bipm.brochure.xsl +842 -118
- data/lib/isodoc/bipm/bipm.guide.xsl +842 -118
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +842 -118
- data/lib/isodoc/bipm/bipm.rapport.xsl +842 -118
- data/lib/isodoc/bipm/i18n-en.yaml +2 -0
- data/lib/isodoc/bipm/i18n-fr.yaml +2 -0
- data/lib/isodoc/bipm/index.rb +20 -16
- data/lib/isodoc/bipm/init.rb +1 -2
- data/lib/isodoc/bipm/jcgm.standard.xsl +714 -178
- data/lib/isodoc/bipm/presentation_xml_convert.rb +93 -34
- data/lib/isodoc/bipm/xref.rb +30 -7
- data/lib/metanorma-bipm.rb +4 -4
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +6 -5
@@ -1,5 +1,6 @@
|
|
1
1
|
annex: Appendix
|
2
2
|
appendix: Annex
|
3
|
+
iso_annex: Annex
|
3
4
|
see: see
|
4
5
|
see_also: see also
|
5
6
|
clause: Chapter
|
@@ -17,3 +18,4 @@ norm_with_refs_pref:
|
|
17
18
|
document (including any amendments) applies.
|
18
19
|
all_rights_reserved: All rights reserved
|
19
20
|
table_of_contents: Contents
|
21
|
+
source: Adapted from
|
@@ -1,5 +1,6 @@
|
|
1
1
|
annex: Annexe
|
2
2
|
appendix: Appendice
|
3
|
+
iso_annex: Annexe
|
3
4
|
see: voir
|
4
5
|
see_also: voir aussi
|
5
6
|
clause: chapître
|
@@ -40,3 +41,4 @@ norm_with_refs_pref:
|
|
40
41
|
Les documents suivants cités dans le texte sont indispensables pour l'application de ce document. Pour les références datées, seule l’édition citée s’applique. Pour les références non datées, la dernière édition du document de référence s’applique (y compris les éventuels amendements).
|
41
42
|
all_rights_reserved: Tous droits réservés
|
42
43
|
table_of_contents: Table des matières
|
44
|
+
source: Adapté de
|
data/lib/isodoc/bipm/index.rb
CHANGED
@@ -10,14 +10,17 @@ module IsoDoc
|
|
10
10
|
|
11
11
|
def index(docxml)
|
12
12
|
unless docxml.at(ns("//index"))
|
13
|
-
docxml.xpath(ns("//indexsect")).each
|
13
|
+
docxml.xpath(ns("//indexsect")).each(&:remove)
|
14
14
|
return
|
15
15
|
end
|
16
16
|
i = docxml.at(ns("//indexsect")) ||
|
17
|
-
docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}"\
|
18
|
+
"</title></indexsect>").first
|
19
|
+
index = sort_indexterms(
|
20
|
+
docxml.xpath(ns("//index")),
|
21
|
+
docxml.xpath(ns("//index-xref[@also = 'false']")),
|
22
|
+
docxml.xpath(ns("//index-xref[@also = 'true']"))
|
23
|
+
)
|
21
24
|
index1(docxml, i, index)
|
22
25
|
end
|
23
26
|
|
@@ -33,8 +36,8 @@ module IsoDoc
|
|
33
36
|
@xrefs.bookmark_anchor_names(docxml)
|
34
37
|
end
|
35
38
|
|
36
|
-
def sortable(
|
37
|
-
HTMLEntities.new.decode(Nokogiri::XML.fragment(
|
39
|
+
def sortable(str)
|
40
|
+
HTMLEntities.new.decode(Nokogiri::XML.fragment(str).text)
|
38
41
|
end
|
39
42
|
|
40
43
|
def index_entries_opt
|
@@ -45,7 +48,7 @@ module IsoDoc
|
|
45
48
|
ret = index_entries_head(words[primary],
|
46
49
|
index.dig(words[primary], nil, nil),
|
47
50
|
index_entries_opt)
|
48
|
-
words2 = index[words[primary]]&.keys&.
|
51
|
+
words2 = index[words[primary]]&.keys&.compact
|
49
52
|
&.each_with_object({}) { |w, v| v[w.downcase] = w }
|
50
53
|
unless words2.empty?
|
51
54
|
ret += "<ul>"
|
@@ -54,7 +57,7 @@ module IsoDoc
|
|
54
57
|
end
|
55
58
|
ret += "</ul>"
|
56
59
|
end
|
57
|
-
ret
|
60
|
+
"#{ret}</li>"
|
58
61
|
end
|
59
62
|
|
60
63
|
def index_entries2(words, index, secondary)
|
@@ -70,7 +73,7 @@ module IsoDoc
|
|
70
73
|
end
|
71
74
|
ret += "</ul>"
|
72
75
|
end
|
73
|
-
ret
|
76
|
+
"#{ret}</li>"
|
74
77
|
end
|
75
78
|
|
76
79
|
def index_entries_head(head, entries, opt)
|
@@ -118,8 +121,9 @@ module IsoDoc
|
|
118
121
|
end
|
119
122
|
end
|
120
123
|
|
121
|
-
def xml_encode_attr(
|
122
|
-
HTMLEntities.new.encode(
|
124
|
+
def xml_encode_attr(str)
|
125
|
+
HTMLEntities.new.encode(str, :basic, :hexadecimal)
|
126
|
+
.gsub(/&#x([^;]+);/) { |_x| "&#x#{$1.upcase};" }
|
123
127
|
end
|
124
128
|
|
125
129
|
# attributes are decoded into UTF-8, elements in extract_indexsee are still in entities
|
@@ -138,10 +142,10 @@ module IsoDoc
|
|
138
142
|
end
|
139
143
|
end
|
140
144
|
|
141
|
-
def index2bookmark(
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
+
def index2bookmark(node)
|
146
|
+
node.name = "bookmark"
|
147
|
+
node.children.each(&:remove)
|
148
|
+
node["id"] = "_#{UUIDTools::UUID.random_create}"
|
145
149
|
end
|
146
150
|
end
|
147
151
|
end
|
data/lib/isodoc/bipm/init.rb
CHANGED
@@ -10,7 +10,7 @@ module IsoDoc
|
|
10
10
|
@meta = Metadata.new(lang, script, labels)
|
11
11
|
end
|
12
12
|
|
13
|
-
def xref_init(lang, script,
|
13
|
+
def xref_init(lang, script, _klass, labels, options)
|
14
14
|
html = HtmlConvert.new(language: lang, script: script)
|
15
15
|
@xrefs = Xref.new(lang, script, html, labels, options)
|
16
16
|
end
|
@@ -21,4 +21,3 @@ module IsoDoc
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
@@ -76,8 +76,13 @@
|
|
76
76
|
<xsl:variable name="column_width" select="($page_width - $column_gap) div $docs_count"/>
|
77
77
|
|
78
78
|
<xsl:variable name="debug">false</xsl:variable>
|
79
|
-
<xsl:variable name="pageWidth" select="
|
80
|
-
<xsl:variable name="pageHeight" select="
|
79
|
+
<xsl:variable name="pageWidth" select="210"/>
|
80
|
+
<xsl:variable name="pageHeight" select="297"/>
|
81
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
82
|
+
<xsl:variable name="marginLeftRight2" select="15"/>
|
83
|
+
<xsl:variable name="marginTop" select="29.5"/>
|
84
|
+
<xsl:variable name="marginBottom" select="23.5"/>
|
85
|
+
|
81
86
|
|
82
87
|
<xsl:variable name="all_rights_reserved">
|
83
88
|
<xsl:call-template name="getLocalizedString">
|
@@ -161,7 +166,7 @@
|
|
161
166
|
<fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
|
162
167
|
<fo:layout-master-set>
|
163
168
|
<!-- cover page -->
|
164
|
-
<fo:simple-page-master master-name="cover-page-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
169
|
+
<fo:simple-page-master master-name="cover-page-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
165
170
|
<fo:region-body margin-top="85mm" margin-bottom="30mm" margin-left="100mm" margin-right="19mm"/>
|
166
171
|
<fo:region-before extent="85mm"/>
|
167
172
|
<fo:region-after region-name="cover-page-jcgm-footer" extent="30mm"/>
|
@@ -169,7 +174,7 @@
|
|
169
174
|
<fo:region-end extent="19mm"/>
|
170
175
|
</fo:simple-page-master>
|
171
176
|
<!-- internal cover page -->
|
172
|
-
<fo:simple-page-master master-name="internal-cover-page-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
177
|
+
<fo:simple-page-master master-name="internal-cover-page-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
173
178
|
<fo:region-body margin-top="11mm" margin-bottom="21mm" margin-left="25mm" margin-right="19mm"/>
|
174
179
|
<fo:region-before extent="11mm"/>
|
175
180
|
<fo:region-after region-name="internal-cover-page-jcgm-footer" extent="21mm"/>
|
@@ -177,19 +182,19 @@
|
|
177
182
|
<fo:region-end extent="19mm"/>
|
178
183
|
</fo:simple-page-master>
|
179
184
|
|
180
|
-
<fo:simple-page-master master-name="odd-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
181
|
-
<fo:region-body margin-top="
|
182
|
-
<fo:region-before region-name="header-odd-jcgm" extent="
|
183
|
-
<fo:region-after region-name="footer-odd-jcgm" extent="
|
184
|
-
<fo:region-start region-name="left-region" extent="
|
185
|
-
<fo:region-end region-name="right-region" extent="
|
185
|
+
<fo:simple-page-master master-name="odd-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
186
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
187
|
+
<fo:region-before region-name="header-odd-jcgm" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
188
|
+
<fo:region-after region-name="footer-odd-jcgm" extent="{$marginBottom}mm"/>
|
189
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
190
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
186
191
|
</fo:simple-page-master>
|
187
|
-
<fo:simple-page-master master-name="even-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
188
|
-
<fo:region-body margin-top="
|
189
|
-
<fo:region-before region-name="header-even-jcgm" extent="
|
190
|
-
<fo:region-after region-name="footer-even-jcgm" extent="
|
191
|
-
<fo:region-start region-name="left-region" extent="
|
192
|
-
<fo:region-end region-name="right-region" extent="
|
192
|
+
<fo:simple-page-master master-name="even-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
193
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
194
|
+
<fo:region-before region-name="header-even-jcgm" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
195
|
+
<fo:region-after region-name="footer-even-jcgm" extent="{$marginBottom}mm"/>
|
196
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
197
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
193
198
|
</fo:simple-page-master>
|
194
199
|
<fo:page-sequence-master master-name="document-jcgm">
|
195
200
|
<fo:repeatable-page-master-alternatives>
|
@@ -1022,7 +1027,7 @@
|
|
1022
1027
|
<xsl:apply-templates select="." mode="mathml"/>
|
1023
1028
|
</xsl:variable>
|
1024
1029
|
<fo:instream-foreign-object fox:alt-text="Math">
|
1025
|
-
<xsl:if test="local-name(../..) = 'formula'">
|
1030
|
+
<xsl:if test="local-name(../..) = 'formula' or (local-name(../..) = 'td' and count(../../*) = 1)">
|
1026
1031
|
<xsl:attribute name="width">95%</xsl:attribute>
|
1027
1032
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
1028
1033
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
@@ -1162,89 +1167,6 @@
|
|
1162
1167
|
</fo:block>
|
1163
1168
|
</xsl:template>
|
1164
1169
|
|
1165
|
-
|
1166
|
-
|
1167
|
-
<xsl:template name="number-to-words">
|
1168
|
-
<xsl:param name="number"/>
|
1169
|
-
<xsl:variable name="words">
|
1170
|
-
<words>
|
1171
|
-
<word cardinal="1">One-</word>
|
1172
|
-
<word ordinal="1">First </word>
|
1173
|
-
<word cardinal="2">Two-</word>
|
1174
|
-
<word ordinal="2">Second </word>
|
1175
|
-
<word cardinal="3">Three-</word>
|
1176
|
-
<word ordinal="3">Third </word>
|
1177
|
-
<word cardinal="4">Four-</word>
|
1178
|
-
<word ordinal="4">Fourth </word>
|
1179
|
-
<word cardinal="5">Five-</word>
|
1180
|
-
<word ordinal="5">Fifth </word>
|
1181
|
-
<word cardinal="6">Six-</word>
|
1182
|
-
<word ordinal="6">Sixth </word>
|
1183
|
-
<word cardinal="7">Seven-</word>
|
1184
|
-
<word ordinal="7">Seventh </word>
|
1185
|
-
<word cardinal="8">Eight-</word>
|
1186
|
-
<word ordinal="8">Eighth </word>
|
1187
|
-
<word cardinal="9">Nine-</word>
|
1188
|
-
<word ordinal="9">Ninth </word>
|
1189
|
-
<word ordinal="10">Tenth </word>
|
1190
|
-
<word ordinal="11">Eleventh </word>
|
1191
|
-
<word ordinal="12">Twelfth </word>
|
1192
|
-
<word ordinal="13">Thirteenth </word>
|
1193
|
-
<word ordinal="14">Fourteenth </word>
|
1194
|
-
<word ordinal="15">Fifteenth </word>
|
1195
|
-
<word ordinal="16">Sixteenth </word>
|
1196
|
-
<word ordinal="17">Seventeenth </word>
|
1197
|
-
<word ordinal="18">Eighteenth </word>
|
1198
|
-
<word ordinal="19">Nineteenth </word>
|
1199
|
-
<word cardinal="20">Twenty-</word>
|
1200
|
-
<word ordinal="20">Twentieth </word>
|
1201
|
-
<word cardinal="30">Thirty-</word>
|
1202
|
-
<word ordinal="30">Thirtieth </word>
|
1203
|
-
<word cardinal="40">Forty-</word>
|
1204
|
-
<word ordinal="40">Fortieth </word>
|
1205
|
-
<word cardinal="50">Fifty-</word>
|
1206
|
-
<word ordinal="50">Fiftieth </word>
|
1207
|
-
<word cardinal="60">Sixty-</word>
|
1208
|
-
<word ordinal="60">Sixtieth </word>
|
1209
|
-
<word cardinal="70">Seventy-</word>
|
1210
|
-
<word ordinal="70">Seventieth </word>
|
1211
|
-
<word cardinal="80">Eighty-</word>
|
1212
|
-
<word ordinal="80">Eightieth </word>
|
1213
|
-
<word cardinal="90">Ninety-</word>
|
1214
|
-
<word ordinal="90">Ninetieth </word>
|
1215
|
-
<word cardinal="100">Hundred-</word>
|
1216
|
-
<word ordinal="100">Hundredth </word>
|
1217
|
-
</words>
|
1218
|
-
</xsl:variable>
|
1219
|
-
|
1220
|
-
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
1221
|
-
|
1222
|
-
<xsl:choose>
|
1223
|
-
<xsl:when test="$ordinal != ''">
|
1224
|
-
<xsl:value-of select="$ordinal"/>
|
1225
|
-
</xsl:when>
|
1226
|
-
<xsl:otherwise>
|
1227
|
-
<xsl:choose>
|
1228
|
-
<xsl:when test="$number < 100">
|
1229
|
-
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
1230
|
-
<xsl:variable name="digit" select="substring($number,2)"/>
|
1231
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
1232
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
1233
|
-
</xsl:when>
|
1234
|
-
<xsl:otherwise>
|
1235
|
-
<!-- more 100 -->
|
1236
|
-
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
1237
|
-
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
1238
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
1239
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
1240
|
-
<xsl:call-template name="number-to-words">
|
1241
|
-
<xsl:with-param name="number" select="$digits"/>
|
1242
|
-
</xsl:call-template>
|
1243
|
-
</xsl:otherwise>
|
1244
|
-
</xsl:choose>
|
1245
|
-
</xsl:otherwise>
|
1246
|
-
</xsl:choose>
|
1247
|
-
</xsl:template>
|
1248
1170
|
|
1249
1171
|
<xsl:template name="printEdition">
|
1250
1172
|
<xsl:variable name="edition" select="normalize-space(//*[local-name()='bibdata']/*[local-name()='edition'])"/>
|
@@ -2084,7 +2006,7 @@
|
|
2084
2006
|
<!-- grey opacity -->
|
2085
2007
|
<fo:block-container absolute-position="fixed" left="0" top="0">
|
2086
2008
|
<fo:block>
|
2087
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
2009
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
2088
2010
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="210mm" height="297mm">
|
2089
2011
|
<rect width="210mm" height="297mm" style="fill:rgb(255,255,255);stroke-width:0;fill-opacity:0.73"/>
|
2090
2012
|
</svg>
|
@@ -2211,6 +2133,9 @@
|
|
2211
2133
|
<title-continued lang="en">(continued)</title-continued>
|
2212
2134
|
<title-continued lang="fr">(continué)</title-continued>
|
2213
2135
|
|
2136
|
+
</xsl:variable><xsl:variable name="bibdata">
|
2137
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
2138
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
2214
2139
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
2215
2140
|
<xsl:param name="name"/>
|
2216
2141
|
<xsl:param name="lang"/>
|
@@ -2242,11 +2167,13 @@
|
|
2242
2167
|
|
2243
2168
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
2244
2169
|
|
2170
|
+
|
2245
2171
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2246
2172
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2247
2173
|
|
2248
2174
|
|
2249
2175
|
|
2176
|
+
|
2250
2177
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
2251
2178
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
2252
2179
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -2296,7 +2223,7 @@
|
|
2296
2223
|
|
2297
2224
|
|
2298
2225
|
|
2299
|
-
|
2226
|
+
|
2300
2227
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
2301
2228
|
|
2302
2229
|
|
@@ -2313,6 +2240,7 @@
|
|
2313
2240
|
|
2314
2241
|
|
2315
2242
|
|
2243
|
+
|
2316
2244
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
2317
2245
|
|
2318
2246
|
|
@@ -2332,9 +2260,7 @@
|
|
2332
2260
|
|
2333
2261
|
|
2334
2262
|
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2263
|
+
|
2338
2264
|
|
2339
2265
|
|
2340
2266
|
|
@@ -2365,8 +2291,10 @@
|
|
2365
2291
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
2366
2292
|
|
2367
2293
|
|
2294
|
+
|
2368
2295
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
2369
2296
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2297
|
+
|
2370
2298
|
|
2371
2299
|
|
2372
2300
|
|
@@ -2385,6 +2313,9 @@
|
|
2385
2313
|
|
2386
2314
|
|
2387
2315
|
|
2316
|
+
|
2317
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
2318
|
+
|
2388
2319
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2389
2320
|
|
2390
2321
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
@@ -2405,19 +2336,24 @@
|
|
2405
2336
|
</xsl:attribute-set><xsl:attribute-set name="xref-style">
|
2406
2337
|
|
2407
2338
|
|
2339
|
+
|
2408
2340
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2409
2341
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2410
2342
|
|
2411
2343
|
|
2344
|
+
|
2412
2345
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
2413
2346
|
|
2414
2347
|
|
2415
2348
|
|
2416
2349
|
|
2350
|
+
|
2351
|
+
|
2417
2352
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2418
2353
|
|
2419
2354
|
|
2420
2355
|
|
2356
|
+
|
2421
2357
|
|
2422
2358
|
|
2423
2359
|
|
@@ -2434,6 +2370,7 @@
|
|
2434
2370
|
|
2435
2371
|
|
2436
2372
|
|
2373
|
+
|
2437
2374
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
2438
2375
|
|
2439
2376
|
|
@@ -2441,6 +2378,7 @@
|
|
2441
2378
|
|
2442
2379
|
|
2443
2380
|
|
2381
|
+
|
2444
2382
|
<xsl:attribute name="padding-right">6mm</xsl:attribute>
|
2445
2383
|
|
2446
2384
|
|
@@ -2470,6 +2408,7 @@
|
|
2470
2408
|
|
2471
2409
|
|
2472
2410
|
|
2411
|
+
|
2473
2412
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2474
2413
|
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
2475
2414
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
@@ -2477,9 +2416,12 @@
|
|
2477
2416
|
|
2478
2417
|
|
2479
2418
|
|
2419
|
+
|
2480
2420
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
2421
|
+
|
2481
2422
|
|
2482
2423
|
|
2424
|
+
|
2483
2425
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2484
2426
|
|
2485
2427
|
|
@@ -2506,18 +2448,22 @@
|
|
2506
2448
|
|
2507
2449
|
|
2508
2450
|
|
2451
|
+
|
2509
2452
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
2510
2453
|
|
2454
|
+
|
2511
2455
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
2512
2456
|
|
2513
2457
|
|
2514
2458
|
|
2459
|
+
|
2515
2460
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
2516
2461
|
|
2517
2462
|
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
2518
2463
|
|
2519
2464
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
2520
2465
|
|
2466
|
+
|
2521
2467
|
|
2522
2468
|
|
2523
2469
|
|
@@ -2537,6 +2483,7 @@
|
|
2537
2483
|
|
2538
2484
|
|
2539
2485
|
|
2486
|
+
|
2540
2487
|
|
2541
2488
|
|
2542
2489
|
|
@@ -2550,10 +2497,12 @@
|
|
2550
2497
|
|
2551
2498
|
|
2552
2499
|
|
2500
|
+
|
2553
2501
|
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
|
2554
2502
|
|
2555
2503
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
2556
2504
|
|
2505
|
+
|
2557
2506
|
<xsl:attribute name="width">100%</xsl:attribute>
|
2558
2507
|
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
2559
2508
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -2582,13 +2531,16 @@
|
|
2582
2531
|
|
2583
2532
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2584
2533
|
|
2534
|
+
|
2585
2535
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
2586
2536
|
|
2537
|
+
|
2587
2538
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
2588
2539
|
|
2589
2540
|
|
2590
2541
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
2591
2542
|
|
2543
|
+
|
2592
2544
|
</xsl:attribute-set><xsl:variable name="color-added-text">
|
2593
2545
|
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
2594
2546
|
</xsl:variable><xsl:attribute-set name="add-style">
|
@@ -2607,6 +2559,8 @@
|
|
2607
2559
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
2608
2560
|
|
2609
2561
|
|
2562
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
2563
|
+
|
2610
2564
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
2611
2565
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2612
2566
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -2617,14 +2571,15 @@
|
|
2617
2571
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2618
2572
|
|
2619
2573
|
<!-- Normative references -->
|
2620
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2574
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
2621
2575
|
<!-- Terms and definitions -->
|
2622
2576
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
2623
2577
|
<!-- Another main sections -->
|
2624
2578
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
2625
2579
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
2626
2580
|
<!-- Bibliography -->
|
2627
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2581
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
2582
|
+
|
2628
2583
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2629
2584
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2630
2585
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -2660,11 +2615,11 @@
|
|
2660
2615
|
<xsl:variable name="table">
|
2661
2616
|
|
2662
2617
|
<xsl:variable name="simple-table">
|
2663
|
-
<xsl:call-template name="getSimpleTable"/>
|
2618
|
+
<xsl:call-template name="getSimpleTable"/>
|
2664
2619
|
</xsl:variable>
|
2665
2620
|
|
2666
2621
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2667
|
-
<fo:block> </fo:block>
|
2622
|
+
<fo:block> </fo:block>
|
2668
2623
|
</xsl:if> -->
|
2669
2624
|
|
2670
2625
|
<!-- $namespace = 'iso' or -->
|
@@ -2722,6 +2677,7 @@
|
|
2722
2677
|
|
2723
2678
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2724
2679
|
|
2680
|
+
|
2725
2681
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2726
2682
|
|
2727
2683
|
|
@@ -2733,6 +2689,7 @@
|
|
2733
2689
|
|
2734
2690
|
|
2735
2691
|
|
2692
|
+
|
2736
2693
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
2737
2694
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2738
2695
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -2742,6 +2699,7 @@
|
|
2742
2699
|
|
2743
2700
|
|
2744
2701
|
|
2702
|
+
|
2745
2703
|
<xsl:variable name="table_width">
|
2746
2704
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
2747
2705
|
100%
|
@@ -2755,6 +2713,7 @@
|
|
2755
2713
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2756
2714
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2757
2715
|
|
2716
|
+
|
2758
2717
|
<attribute name="border">1.5pt solid black</attribute>
|
2759
2718
|
<xsl:if test="*[local-name()='thead']">
|
2760
2719
|
<attribute name="border-top">1pt solid black</attribute>
|
@@ -2773,6 +2732,7 @@
|
|
2773
2732
|
|
2774
2733
|
|
2775
2734
|
|
2735
|
+
|
2776
2736
|
</xsl:variable>
|
2777
2737
|
|
2778
2738
|
|
@@ -2909,13 +2869,29 @@
|
|
2909
2869
|
</xsl:choose>
|
2910
2870
|
|
2911
2871
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
2872
|
+
<xsl:param name="continued"/>
|
2912
2873
|
<xsl:if test="normalize-space() != ''">
|
2913
2874
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
2914
2875
|
|
2915
2876
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
2916
2877
|
|
2917
2878
|
|
2918
|
-
|
2879
|
+
|
2880
|
+
|
2881
|
+
|
2882
|
+
<xsl:choose>
|
2883
|
+
<xsl:when test="$continued = 'true'">
|
2884
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
2885
|
+
|
2886
|
+
<xsl:apply-templates/>
|
2887
|
+
|
2888
|
+
</xsl:when>
|
2889
|
+
<xsl:otherwise>
|
2890
|
+
<xsl:apply-templates/>
|
2891
|
+
</xsl:otherwise>
|
2892
|
+
</xsl:choose>
|
2893
|
+
|
2894
|
+
|
2919
2895
|
</fo:block>
|
2920
2896
|
</xsl:if>
|
2921
2897
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -3056,21 +3032,27 @@
|
|
3056
3032
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3057
3033
|
</xsl:call-template>
|
3058
3034
|
|
3035
|
+
|
3059
3036
|
<xsl:apply-templates/>
|
3060
3037
|
</fo:table-header>
|
3061
3038
|
</xsl:template><xsl:template name="table-header-title">
|
3062
|
-
<xsl:param name="cols-count"/>
|
3039
|
+
<xsl:param name="cols-count"/>
|
3063
3040
|
<!-- row for title -->
|
3064
3041
|
<fo:table-row>
|
3065
3042
|
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
|
3066
|
-
|
3043
|
+
|
3044
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
3045
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
3046
|
+
</xsl:apply-templates>
|
3067
3047
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
3068
3048
|
<xsl:call-template name="fn_name_display"/>
|
3069
|
-
</xsl:for-each>
|
3070
|
-
|
3071
|
-
<
|
3072
|
-
|
3073
|
-
|
3049
|
+
</xsl:for-each>
|
3050
|
+
|
3051
|
+
<fo:block text-align="right" font-style="italic">
|
3052
|
+
<xsl:text> </xsl:text>
|
3053
|
+
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
3054
|
+
</fo:block>
|
3055
|
+
|
3074
3056
|
</fo:table-cell>
|
3075
3057
|
</fo:table-row>
|
3076
3058
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -3206,6 +3188,7 @@
|
|
3206
3188
|
<fo:table-row>
|
3207
3189
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3208
3190
|
|
3191
|
+
|
3209
3192
|
<xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
|
3210
3193
|
|
3211
3194
|
|
@@ -3218,6 +3201,10 @@
|
|
3218
3201
|
|
3219
3202
|
|
3220
3203
|
|
3204
|
+
|
3205
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3206
|
+
|
3207
|
+
|
3221
3208
|
<!-- except gb -->
|
3222
3209
|
|
3223
3210
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -3243,6 +3230,10 @@
|
|
3243
3230
|
<!-- fn processing -->
|
3244
3231
|
<xsl:call-template name="fn_display"/>
|
3245
3232
|
|
3233
|
+
|
3234
|
+
<!-- for PAS display Notes after footnotes -->
|
3235
|
+
|
3236
|
+
|
3246
3237
|
</fo:table-cell>
|
3247
3238
|
</fo:table-row>
|
3248
3239
|
</fo:table-body>
|
@@ -3291,20 +3282,26 @@
|
|
3291
3282
|
<xsl:call-template name="getTitle">
|
3292
3283
|
<xsl:with-param name="name" select="'title-continued'"/>
|
3293
3284
|
</xsl:call-template>
|
3294
|
-
</xsl:variable>
|
3285
|
+
</xsl:variable>
|
3286
|
+
|
3287
|
+
<xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
|
3288
|
+
<xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
|
3289
|
+
|
3295
3290
|
<fo:table-row height="0" keep-with-next.within-page="always">
|
3296
3291
|
<fo:table-cell>
|
3297
|
-
|
3292
|
+
|
3293
|
+
|
3294
|
+
<fo:marker marker-class-name="table_continued"/>
|
3295
|
+
|
3298
3296
|
<fo:block/>
|
3299
3297
|
</fo:table-cell>
|
3300
3298
|
</fo:table-row>
|
3301
3299
|
<fo:table-row height="0" keep-with-next.within-page="always">
|
3302
3300
|
<fo:table-cell>
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3307
|
-
</fo:marker>
|
3301
|
+
|
3302
|
+
<fo:marker marker-class-name="table_continued">
|
3303
|
+
<xsl:value-of select="$title_continued"/>
|
3304
|
+
</fo:marker>
|
3308
3305
|
<fo:block/>
|
3309
3306
|
</fo:table-cell>
|
3310
3307
|
</fo:table-row>
|
@@ -3341,9 +3338,11 @@
|
|
3341
3338
|
|
3342
3339
|
|
3343
3340
|
|
3341
|
+
|
3344
3342
|
</xsl:if>
|
3345
3343
|
<xsl:if test="$parent-name = 'tfoot'">
|
3346
3344
|
|
3345
|
+
|
3347
3346
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3348
3347
|
<xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
|
3349
3348
|
<xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
|
@@ -3354,6 +3353,10 @@
|
|
3354
3353
|
|
3355
3354
|
|
3356
3355
|
|
3356
|
+
|
3357
|
+
|
3358
|
+
|
3359
|
+
|
3357
3360
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3358
3361
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3359
3362
|
</xsl:if> -->
|
@@ -3372,6 +3375,7 @@
|
|
3372
3375
|
</xsl:choose>
|
3373
3376
|
</xsl:attribute>
|
3374
3377
|
|
3378
|
+
|
3375
3379
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
3376
3380
|
|
3377
3381
|
|
@@ -3384,6 +3388,7 @@
|
|
3384
3388
|
|
3385
3389
|
|
3386
3390
|
|
3391
|
+
|
3387
3392
|
<xsl:if test="$lang = 'ar'">
|
3388
3393
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3389
3394
|
</xsl:if>
|
@@ -3432,6 +3437,12 @@
|
|
3432
3437
|
|
3433
3438
|
|
3434
3439
|
|
3440
|
+
<xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
|
3441
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
3442
|
+
</xsl:if>
|
3443
|
+
|
3444
|
+
|
3445
|
+
|
3435
3446
|
<xsl:if test="ancestor::*[local-name() = 'tfoot']">
|
3436
3447
|
<xsl:attribute name="border">solid black 0</xsl:attribute>
|
3437
3448
|
</xsl:if>
|
@@ -3444,6 +3455,9 @@
|
|
3444
3455
|
|
3445
3456
|
|
3446
3457
|
|
3458
|
+
|
3459
|
+
|
3460
|
+
|
3447
3461
|
<xsl:if test=".//*[local-name() = 'table']">
|
3448
3462
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3449
3463
|
</xsl:if>
|
@@ -3468,6 +3482,7 @@
|
|
3468
3482
|
|
3469
3483
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
3470
3484
|
|
3485
|
+
|
3471
3486
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3472
3487
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3473
3488
|
|
@@ -3476,8 +3491,13 @@
|
|
3476
3491
|
|
3477
3492
|
|
3478
3493
|
|
3494
|
+
|
3495
|
+
<!-- Table's note name (NOTE, for example) -->
|
3496
|
+
|
3479
3497
|
<fo:inline padding-right="2mm">
|
3480
3498
|
|
3499
|
+
|
3500
|
+
|
3481
3501
|
|
3482
3502
|
|
3483
3503
|
|
@@ -3485,6 +3505,8 @@
|
|
3485
3505
|
|
3486
3506
|
</fo:inline>
|
3487
3507
|
|
3508
|
+
|
3509
|
+
|
3488
3510
|
<xsl:apply-templates mode="process"/>
|
3489
3511
|
</fo:block>
|
3490
3512
|
|
@@ -3504,6 +3526,8 @@
|
|
3504
3526
|
<xsl:variable name="reference" select="@reference"/>
|
3505
3527
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3506
3528
|
<fo:block margin-bottom="12pt">
|
3529
|
+
|
3530
|
+
|
3507
3531
|
|
3508
3532
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3509
3533
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -3522,9 +3546,11 @@
|
|
3522
3546
|
|
3523
3547
|
|
3524
3548
|
|
3549
|
+
|
3525
3550
|
<xsl:value-of select="@reference"/>
|
3526
3551
|
|
3527
3552
|
|
3553
|
+
|
3528
3554
|
</fo:inline>
|
3529
3555
|
<fo:inline>
|
3530
3556
|
|
@@ -3660,6 +3686,8 @@
|
|
3660
3686
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3661
3687
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
3662
3688
|
|
3689
|
+
|
3690
|
+
|
3663
3691
|
<xsl:if test="ancestor::*[local-name()='td']">
|
3664
3692
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
3665
3693
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
@@ -3671,11 +3699,14 @@
|
|
3671
3699
|
|
3672
3700
|
|
3673
3701
|
|
3702
|
+
|
3703
|
+
|
3674
3704
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
3675
3705
|
|
3676
3706
|
|
3677
3707
|
<xsl:value-of select="@reference"/>
|
3678
3708
|
|
3709
|
+
|
3679
3710
|
</fo:basic-link>
|
3680
3711
|
</fo:inline>
|
3681
3712
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3771,6 +3802,7 @@
|
|
3771
3802
|
|
3772
3803
|
|
3773
3804
|
|
3805
|
+
|
3774
3806
|
<xsl:variable name="title-key">
|
3775
3807
|
|
3776
3808
|
<xsl:call-template name="getLocalizedString">
|
@@ -3986,6 +4018,7 @@
|
|
3986
4018
|
|
3987
4019
|
<fo:table-row>
|
3988
4020
|
|
4021
|
+
|
3989
4022
|
<fo:table-cell>
|
3990
4023
|
|
3991
4024
|
<fo:block margin-top="6pt">
|
@@ -4003,6 +4036,7 @@
|
|
4003
4036
|
|
4004
4037
|
|
4005
4038
|
|
4039
|
+
|
4006
4040
|
<xsl:apply-templates/>
|
4007
4041
|
<!-- <xsl:if test="$namespace = 'gb'">
|
4008
4042
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -4059,6 +4093,8 @@
|
|
4059
4093
|
|
4060
4094
|
<xsl:apply-templates/>
|
4061
4095
|
</fo:inline>
|
4096
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
4097
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
4062
4098
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
4063
4099
|
<fo:inline font-size="80%" vertical-align="super">
|
4064
4100
|
<xsl:apply-templates/>
|
@@ -4076,6 +4112,7 @@
|
|
4076
4112
|
|
4077
4113
|
|
4078
4114
|
|
4115
|
+
|
4079
4116
|
10
|
4080
4117
|
|
4081
4118
|
|
@@ -4465,11 +4502,15 @@
|
|
4465
4502
|
</xsl:apply-templates>
|
4466
4503
|
</xsl:template><xsl:template name="getLang">
|
4467
4504
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
4505
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
4468
4506
|
<xsl:variable name="language">
|
4469
4507
|
<xsl:choose>
|
4470
4508
|
<xsl:when test="$language_current != ''">
|
4471
4509
|
<xsl:value-of select="$language_current"/>
|
4472
4510
|
</xsl:when>
|
4511
|
+
<xsl:when test="$language_current_2 != ''">
|
4512
|
+
<xsl:value-of select="$language_current_2"/>
|
4513
|
+
</xsl:when>
|
4473
4514
|
<xsl:otherwise>
|
4474
4515
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
4475
4516
|
</xsl:otherwise>
|
@@ -4543,9 +4584,27 @@
|
|
4543
4584
|
<xsl:copy>
|
4544
4585
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4545
4586
|
</xsl:copy>
|
4546
|
-
<
|
4587
|
+
<xsl:choose>
|
4588
|
+
<!-- if in msub, then don't add space -->
|
4589
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
4590
|
+
<!-- if next char in digit, don't add space -->
|
4591
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
4592
|
+
<xsl:otherwise>
|
4593
|
+
<mathml:mspace width="0.5ex"/>
|
4594
|
+
</xsl:otherwise>
|
4595
|
+
</xsl:choose>
|
4547
4596
|
</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">
|
4548
4597
|
<xsl:variable name="target">
|
4598
|
+
<xsl:choose>
|
4599
|
+
<xsl:when test="@updatetype = 'true'">
|
4600
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
4601
|
+
</xsl:when>
|
4602
|
+
<xsl:otherwise>
|
4603
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
4604
|
+
</xsl:otherwise>
|
4605
|
+
</xsl:choose>
|
4606
|
+
</xsl:variable>
|
4607
|
+
<xsl:variable name="target_text">
|
4549
4608
|
<xsl:choose>
|
4550
4609
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
4551
4610
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -4557,20 +4616,22 @@
|
|
4557
4616
|
</xsl:variable>
|
4558
4617
|
<fo:inline xsl:use-attribute-sets="link-style">
|
4559
4618
|
|
4619
|
+
|
4620
|
+
|
4560
4621
|
<xsl:choose>
|
4561
|
-
<xsl:when test="$
|
4622
|
+
<xsl:when test="$target_text = ''">
|
4562
4623
|
<xsl:apply-templates/>
|
4563
4624
|
</xsl:when>
|
4564
4625
|
<xsl:otherwise>
|
4565
|
-
<fo:basic-link external-destination="{
|
4626
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
4566
4627
|
<xsl:choose>
|
4567
4628
|
<xsl:when test="normalize-space(.) = ''">
|
4568
|
-
<!-- <xsl:value-of select="$target"/> -->
|
4569
4629
|
<xsl:call-template name="add-zero-spaces-link-java">
|
4570
|
-
<xsl:with-param name="text" select="$
|
4630
|
+
<xsl:with-param name="text" select="$target_text"/>
|
4571
4631
|
</xsl:call-template>
|
4572
4632
|
</xsl:when>
|
4573
4633
|
<xsl:otherwise>
|
4634
|
+
<!-- output text from <link>text</link> -->
|
4574
4635
|
<xsl:apply-templates/>
|
4575
4636
|
</xsl:otherwise>
|
4576
4637
|
</xsl:choose>
|
@@ -4665,6 +4726,7 @@
|
|
4665
4726
|
|
4666
4727
|
|
4667
4728
|
|
4729
|
+
|
4668
4730
|
<fo:block-container margin-left="0mm">
|
4669
4731
|
|
4670
4732
|
|
@@ -4682,6 +4744,7 @@
|
|
4682
4744
|
|
4683
4745
|
|
4684
4746
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
4747
|
+
|
4685
4748
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4686
4749
|
</fo:inline>
|
4687
4750
|
<xsl:apply-templates/>
|
@@ -4707,7 +4770,9 @@
|
|
4707
4770
|
</xsl:choose>
|
4708
4771
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
4709
4772
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
4773
|
+
|
4710
4774
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4775
|
+
|
4711
4776
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4712
4777
|
</fo:inline>
|
4713
4778
|
<xsl:apply-templates/>
|
@@ -4781,13 +4846,17 @@
|
|
4781
4846
|
</xsl:call-template>
|
4782
4847
|
|
4783
4848
|
<fo:block>
|
4849
|
+
|
4784
4850
|
<xsl:apply-templates/>
|
4785
4851
|
</fo:block>
|
4786
4852
|
<xsl:call-template name="fn_display_figure"/>
|
4787
4853
|
<xsl:for-each select="*[local-name() = 'note']">
|
4788
4854
|
<xsl:call-template name="note"/>
|
4789
4855
|
</xsl:for-each>
|
4790
|
-
|
4856
|
+
|
4857
|
+
|
4858
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4859
|
+
|
4791
4860
|
</fo:block-container>
|
4792
4861
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
4793
4862
|
<fo:block id="{@id}">
|
@@ -4900,21 +4969,249 @@
|
|
4900
4969
|
<xsl:param name="height"/>
|
4901
4970
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
4902
4971
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
4972
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
4973
|
+
<xsl:param name="name"/>
|
4974
|
+
|
4975
|
+
<xsl:variable name="svg_content">
|
4976
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
4977
|
+
</xsl:variable>
|
4978
|
+
|
4979
|
+
<xsl:variable name="alt-text">
|
4980
|
+
<xsl:choose>
|
4981
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
4982
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
4983
|
+
</xsl:when>
|
4984
|
+
<xsl:when test="normalize-space($name) != ''">
|
4985
|
+
<xsl:value-of select="$name"/>
|
4986
|
+
</xsl:when>
|
4987
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
4988
|
+
</xsl:choose>
|
4989
|
+
</xsl:variable>
|
4990
|
+
|
4991
|
+
<xsl:choose>
|
4992
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
4993
|
+
<fo:block>
|
4994
|
+
<xsl:variable name="width" select="@width"/>
|
4995
|
+
<xsl:variable name="height" select="@height"/>
|
4996
|
+
|
4997
|
+
<xsl:variable name="scale_x">
|
4998
|
+
<xsl:choose>
|
4999
|
+
<xsl:when test="$width > $width_effective_px">
|
5000
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
5001
|
+
</xsl:when>
|
5002
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5003
|
+
</xsl:choose>
|
5004
|
+
</xsl:variable>
|
5005
|
+
|
5006
|
+
<xsl:variable name="scale_y">
|
5007
|
+
<xsl:choose>
|
5008
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
5009
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
5010
|
+
</xsl:when>
|
5011
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5012
|
+
</xsl:choose>
|
5013
|
+
</xsl:variable>
|
5014
|
+
|
5015
|
+
<xsl:variable name="scale">
|
5016
|
+
<xsl:choose>
|
5017
|
+
<xsl:when test="$scale_y != 1">
|
5018
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
5019
|
+
</xsl:when>
|
5020
|
+
<xsl:otherwise>
|
5021
|
+
<xsl:value-of select="$scale_x"/>
|
5022
|
+
</xsl:otherwise>
|
5023
|
+
</xsl:choose>
|
5024
|
+
</xsl:variable>
|
5025
|
+
|
5026
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
5027
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
5028
|
+
|
5029
|
+
<fo:table table-layout="fixed" width="100%">
|
5030
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5031
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
5032
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5033
|
+
<fo:table-body>
|
5034
|
+
<fo:table-row>
|
5035
|
+
<fo:table-cell column-number="2">
|
5036
|
+
<fo:block>
|
5037
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
5038
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5039
|
+
<fo:block line-height="0" font-size="0">
|
5040
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5041
|
+
<xsl:call-template name="bookmark"/>
|
5042
|
+
</xsl:for-each>
|
5043
|
+
</fo:block>
|
5044
|
+
</xsl:if>
|
5045
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
5046
|
+
|
5047
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5048
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5049
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5050
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5051
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5052
|
+
|
5053
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
5054
|
+
</fo:instream-foreign-object>
|
5055
|
+
</fo:block>
|
5056
|
+
|
5057
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
5058
|
+
<xsl:with-param name="scale" select="$scale"/>
|
5059
|
+
</xsl:apply-templates>
|
5060
|
+
</fo:block-container>
|
5061
|
+
</fo:block>
|
5062
|
+
</fo:table-cell>
|
5063
|
+
</fo:table-row>
|
5064
|
+
</fo:table-body>
|
5065
|
+
</fo:table>
|
5066
|
+
</fo:block>
|
5067
|
+
|
5068
|
+
</xsl:when>
|
5069
|
+
<xsl:otherwise>
|
5070
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5071
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5072
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5073
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5074
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5075
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5076
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5077
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5078
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
5079
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
5080
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5081
|
+
</xsl:if>
|
5082
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5083
|
+
<xsl:copy-of select="$svg_content"/>
|
5084
|
+
</fo:instream-foreign-object>
|
5085
|
+
</fo:block>
|
5086
|
+
</xsl:otherwise>
|
5087
|
+
</xsl:choose>
|
5088
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
5089
|
+
<xsl:copy>
|
5090
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
5091
|
+
</xsl:copy>
|
5092
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
5093
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5094
|
+
<xsl:value-of select="."/>
|
5095
|
+
</xsl:attribute>
|
5096
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5097
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
5098
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5099
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
5100
|
+
<xsl:call-template name="image_svg">
|
5101
|
+
<xsl:with-param name="name" select="$name"/>
|
5102
|
+
</xsl:call-template>
|
5103
|
+
</xsl:for-each>
|
5104
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
5105
|
+
<xsl:copy>
|
5106
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
5107
|
+
</xsl:copy>
|
5108
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
5109
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
5110
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
5111
|
+
<xsl:param name="scale"/>
|
5112
|
+
<xsl:variable name="dest">
|
5113
|
+
<xsl:choose>
|
5114
|
+
<xsl:when test="starts-with(@href, '#')">
|
5115
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
5116
|
+
</xsl:when>
|
5117
|
+
<xsl:otherwise>
|
5118
|
+
<xsl:value-of select="@href"/>
|
5119
|
+
</xsl:otherwise>
|
5120
|
+
</xsl:choose>
|
5121
|
+
</xsl:variable>
|
5122
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
5123
|
+
<xsl:call-template name="insertSVGMapLink">
|
5124
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
5125
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
5126
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
5127
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
5128
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5129
|
+
</xsl:call-template>
|
5130
|
+
</xsl:for-each>
|
5131
|
+
|
5132
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
5133
|
+
<xsl:variable name="points">
|
5134
|
+
<xsl:call-template name="split">
|
5135
|
+
<xsl:with-param name="pText" select="@points"/>
|
5136
|
+
</xsl:call-template>
|
5137
|
+
</xsl:variable>
|
5138
|
+
<xsl:variable name="x_coords">
|
5139
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
5140
|
+
<xsl:sort select="." data-type="number"/>
|
5141
|
+
<x><xsl:value-of select="."/></x>
|
5142
|
+
</xsl:for-each>
|
5143
|
+
</xsl:variable>
|
5144
|
+
<xsl:variable name="y_coords">
|
5145
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
5146
|
+
<xsl:sort select="." data-type="number"/>
|
5147
|
+
<y><xsl:value-of select="."/></y>
|
5148
|
+
</xsl:for-each>
|
5149
|
+
</xsl:variable>
|
5150
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5151
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5152
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5153
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5154
|
+
<xsl:call-template name="insertSVGMapLink">
|
5155
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5156
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5157
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5158
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5159
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5160
|
+
</xsl:call-template>
|
5161
|
+
</xsl:for-each>
|
5162
|
+
|
5163
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5164
|
+
<xsl:call-template name="insertSVGMapLink">
|
5165
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5166
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5167
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5168
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5169
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5170
|
+
</xsl:call-template>
|
5171
|
+
</xsl:for-each>
|
5172
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5173
|
+
<xsl:call-template name="insertSVGMapLink">
|
5174
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5175
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5176
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5177
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5178
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5179
|
+
</xsl:call-template>
|
5180
|
+
</xsl:for-each>
|
5181
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5182
|
+
<xsl:param name="left"/>
|
5183
|
+
<xsl:param name="top"/>
|
5184
|
+
<xsl:param name="width"/>
|
5185
|
+
<xsl:param name="height"/>
|
5186
|
+
<xsl:param name="dest"/>
|
5187
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5188
|
+
<fo:block font-size="1pt">
|
5189
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5190
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5191
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5192
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5193
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5194
|
+
</xsl:if> -->
|
5195
|
+
<fo:block> </fo:block></fo:block-container>
|
5196
|
+
</fo:inline-container>
|
5197
|
+
</fo:basic-link>
|
5198
|
+
</fo:block>
|
5199
|
+
</fo:block-container>
|
4903
5200
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4904
5201
|
<xsl:apply-templates mode="contents"/>
|
4905
5202
|
<xsl:text> </xsl:text>
|
4906
5203
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
4907
5204
|
<xsl:apply-templates mode="bookmarks"/>
|
4908
5205
|
<xsl:text> </xsl:text>
|
4909
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
5206
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
4910
5207
|
<xsl:value-of select="."/>
|
4911
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
5208
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
4912
5209
|
<xsl:value-of select="."/>
|
4913
5210
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4914
5211
|
<xsl:apply-templates mode="contents"/>
|
4915
5212
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
4916
5213
|
<xsl:apply-templates mode="bookmarks"/>
|
4917
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
5214
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
4918
5215
|
<xsl:apply-templates select="."/>
|
4919
5216
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
4920
5217
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -4928,28 +5225,39 @@
|
|
4928
5225
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
4929
5226
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
4930
5227
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5228
|
+
<xsl:if test="@bundle = 'true'">
|
5229
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5230
|
+
</xsl:if>
|
4931
5231
|
<fo:bookmark-title>
|
4932
|
-
<xsl:variable name="bookmark-title_">
|
4933
|
-
<xsl:call-template name="getLangVersion">
|
4934
|
-
<xsl:with-param name="lang" select="@lang"/>
|
4935
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
4936
|
-
<xsl:with-param name="title" select="@title-part"/>
|
4937
|
-
</xsl:call-template>
|
4938
|
-
</xsl:variable>
|
4939
5232
|
<xsl:choose>
|
4940
|
-
<xsl:when test="normalize-space(
|
4941
|
-
<xsl:
|
4942
|
-
|
4943
|
-
|
5233
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5234
|
+
<xsl:variable name="bookmark-title_">
|
5235
|
+
<xsl:call-template name="getLangVersion">
|
5236
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5237
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5238
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5239
|
+
</xsl:call-template>
|
5240
|
+
</xsl:variable>
|
4944
5241
|
<xsl:choose>
|
4945
|
-
<xsl:when test="
|
4946
|
-
|
4947
|
-
|
4948
|
-
<xsl:otherwise
|
5242
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5243
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5244
|
+
</xsl:when>
|
5245
|
+
<xsl:otherwise>
|
5246
|
+
<xsl:choose>
|
5247
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5248
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5249
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5250
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5251
|
+
</xsl:choose>
|
5252
|
+
</xsl:otherwise>
|
4949
5253
|
</xsl:choose>
|
5254
|
+
</xsl:when>
|
5255
|
+
<xsl:otherwise>
|
5256
|
+
<xsl:value-of select="@title-part"/>
|
4950
5257
|
</xsl:otherwise>
|
4951
5258
|
</xsl:choose>
|
4952
5259
|
</fo:bookmark-title>
|
5260
|
+
|
4953
5261
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
4954
5262
|
|
4955
5263
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -5048,20 +5356,28 @@
|
|
5048
5356
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
5049
5357
|
</xsl:choose>
|
5050
5358
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
5051
|
-
<
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5055
|
-
<xsl:
|
5056
|
-
|
5057
|
-
|
5058
|
-
|
5059
|
-
|
5060
|
-
|
5359
|
+
<xsl:choose>
|
5360
|
+
<xsl:when test="@id != ''">
|
5361
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5362
|
+
<fo:bookmark-title>
|
5363
|
+
<xsl:if test="@section != ''">
|
5364
|
+
<xsl:value-of select="@section"/>
|
5365
|
+
<xsl:text> </xsl:text>
|
5366
|
+
</xsl:if>
|
5367
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5368
|
+
</fo:bookmark-title>
|
5369
|
+
<xsl:apply-templates mode="bookmark"/>
|
5370
|
+
</fo:bookmark>
|
5371
|
+
</xsl:when>
|
5372
|
+
<xsl:otherwise>
|
5373
|
+
<xsl:apply-templates mode="bookmark"/>
|
5374
|
+
</xsl:otherwise>
|
5375
|
+
</xsl:choose>
|
5061
5376
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
5062
5377
|
<xsl:if test="normalize-space() != ''">
|
5063
5378
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
5064
5379
|
|
5380
|
+
|
5065
5381
|
<xsl:apply-templates/>
|
5066
5382
|
</fo:block>
|
5067
5383
|
</xsl:if>
|
@@ -5113,6 +5429,8 @@
|
|
5113
5429
|
</fo:list-item-body>
|
5114
5430
|
</fo:list-item>
|
5115
5431
|
</fo:list-block>
|
5432
|
+
</xsl:template><xsl:template name="extractSection">
|
5433
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
5116
5434
|
</xsl:template><xsl:template name="extractTitle">
|
5117
5435
|
<xsl:choose>
|
5118
5436
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -5139,6 +5457,8 @@
|
|
5139
5457
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
5140
5458
|
|
5141
5459
|
<fo:block-container margin-left="0mm">
|
5460
|
+
<xsl:copy-of select="@id"/>
|
5461
|
+
|
5142
5462
|
<xsl:if test="parent::*[local-name() = 'note']">
|
5143
5463
|
<xsl:attribute name="margin-left">
|
5144
5464
|
<xsl:choose>
|
@@ -5149,7 +5469,9 @@
|
|
5149
5469
|
|
5150
5470
|
</xsl:if>
|
5151
5471
|
<fo:block-container margin-left="0mm">
|
5152
|
-
|
5472
|
+
|
5473
|
+
|
5474
|
+
|
5153
5475
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
5154
5476
|
<xsl:variable name="_font-size">
|
5155
5477
|
|
@@ -5158,6 +5480,7 @@
|
|
5158
5480
|
|
5159
5481
|
|
5160
5482
|
|
5483
|
+
|
5161
5484
|
9
|
5162
5485
|
|
5163
5486
|
|
@@ -5177,10 +5500,14 @@
|
|
5177
5500
|
</xsl:choose>
|
5178
5501
|
</xsl:attribute>
|
5179
5502
|
</xsl:if>
|
5180
|
-
|
5181
|
-
|
5503
|
+
|
5504
|
+
<xsl:apply-templates/>
|
5505
|
+
</fo:block>
|
5506
|
+
|
5507
|
+
|
5182
5508
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5183
5509
|
|
5510
|
+
|
5184
5511
|
</fo:block-container>
|
5185
5512
|
</fo:block-container>
|
5186
5513
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5415,6 +5742,7 @@
|
|
5415
5742
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
5416
5743
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
5417
5744
|
|
5745
|
+
|
5418
5746
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5419
5747
|
|
5420
5748
|
<xsl:variable name="element">
|
@@ -5487,7 +5815,7 @@
|
|
5487
5815
|
</fo:inline>
|
5488
5816
|
</xsl:otherwise>
|
5489
5817
|
</xsl:choose>
|
5490
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
5818
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
5491
5819
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
5492
5820
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
5493
5821
|
<xsl:variable name="termsource_text">
|
@@ -5496,13 +5824,15 @@
|
|
5496
5824
|
|
5497
5825
|
<xsl:choose>
|
5498
5826
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
5499
|
-
<xsl:apply-templates/>
|
5827
|
+
<!-- <xsl:apply-templates /> -->
|
5828
|
+
<xsl:copy-of select="$termsource_text"/>
|
5500
5829
|
</xsl:when>
|
5501
5830
|
<xsl:otherwise>
|
5502
5831
|
|
5503
5832
|
<xsl:text>[</xsl:text>
|
5504
5833
|
|
5505
|
-
<xsl:apply-templates/>
|
5834
|
+
<!-- <xsl:apply-templates /> -->
|
5835
|
+
<xsl:copy-of select="$termsource_text"/>
|
5506
5836
|
|
5507
5837
|
<xsl:text>]</xsl:text>
|
5508
5838
|
|
@@ -5513,20 +5843,27 @@
|
|
5513
5843
|
<xsl:if test="normalize-space() != ''">
|
5514
5844
|
<xsl:value-of select="."/>
|
5515
5845
|
</xsl:if>
|
5516
|
-
</xsl:template><xsl:
|
5846
|
+
</xsl:template><xsl:variable name="localized.source">
|
5847
|
+
<xsl:call-template name="getLocalizedString">
|
5848
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
5849
|
+
</xsl:call-template>
|
5850
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
5517
5851
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5852
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
5853
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
5854
|
+
</xsl:if>
|
5518
5855
|
|
5519
5856
|
<fo:inline>
|
5520
5857
|
|
5521
5858
|
|
5522
5859
|
|
5523
|
-
|
5524
|
-
|
5525
|
-
|
5860
|
+
|
5861
|
+
|
5862
|
+
<xsl:value-of select="$localized.source"/>
|
5863
|
+
<xsl:text> </xsl:text>
|
5526
5864
|
|
5527
5865
|
|
5528
5866
|
|
5529
|
-
<xsl:text>: </xsl:text>
|
5530
5867
|
</fo:inline>
|
5531
5868
|
|
5532
5869
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
@@ -5607,7 +5944,9 @@
|
|
5607
5944
|
|
5608
5945
|
|
5609
5946
|
</xsl:if>
|
5610
|
-
|
5947
|
+
|
5948
|
+
|
5949
|
+
|
5611
5950
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5612
5951
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5613
5952
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -5616,6 +5955,7 @@
|
|
5616
5955
|
|
5617
5956
|
|
5618
5957
|
|
5958
|
+
|
5619
5959
|
</xsl:if>
|
5620
5960
|
|
5621
5961
|
<xsl:apply-templates/>
|
@@ -5642,6 +5982,7 @@
|
|
5642
5982
|
|
5643
5983
|
|
5644
5984
|
|
5985
|
+
|
5645
5986
|
<xsl:choose>
|
5646
5987
|
<xsl:when test="$depth = 2">3</xsl:when>
|
5647
5988
|
<xsl:otherwise>4</xsl:otherwise>
|
@@ -5744,7 +6085,6 @@
|
|
5744
6085
|
|
5745
6086
|
|
5746
6087
|
|
5747
|
-
|
5748
6088
|
<xsl:apply-templates/>
|
5749
6089
|
</fo:block>
|
5750
6090
|
|
@@ -5761,6 +6101,11 @@
|
|
5761
6101
|
<xsl:call-template name="setId"/>
|
5762
6102
|
|
5763
6103
|
|
6104
|
+
|
6105
|
+
<xsl:if test="@inline-header='true'">
|
6106
|
+
<xsl:attribute name="text-align">justify</xsl:attribute>
|
6107
|
+
</xsl:if>
|
6108
|
+
|
5764
6109
|
<xsl:apply-templates/>
|
5765
6110
|
</fo:block>
|
5766
6111
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -5787,7 +6132,7 @@
|
|
5787
6132
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5788
6133
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5789
6134
|
<xsl:choose>
|
5790
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
6135
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
5791
6136
|
<fo:block-container>
|
5792
6137
|
<xsl:attribute name="margin-left">
|
5793
6138
|
<xsl:choose>
|
@@ -5797,6 +6142,7 @@
|
|
5797
6142
|
</xsl:attribute>
|
5798
6143
|
|
5799
6144
|
|
6145
|
+
|
5800
6146
|
<fo:block-container margin-left="0mm">
|
5801
6147
|
<fo:block>
|
5802
6148
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -5998,21 +6344,25 @@
|
|
5998
6344
|
|
5999
6345
|
|
6000
6346
|
|
6347
|
+
|
6348
|
+
|
6349
|
+
|
6350
|
+
|
6001
6351
|
</xsl:template><xsl:template name="processBibitemDocId">
|
6002
6352
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
6003
6353
|
<xsl:choose>
|
6004
6354
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
6005
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6355
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6006
6356
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
6007
6357
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6008
|
-
</xsl:if>
|
6358
|
+
</xsl:if> -->
|
6009
6359
|
<xsl:value-of select="$_doc_ident"/>
|
6010
6360
|
</xsl:when>
|
6011
6361
|
<xsl:otherwise>
|
6012
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6362
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6013
6363
|
<xsl:if test="$type != ''">
|
6014
6364
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6015
|
-
</xsl:if>
|
6365
|
+
</xsl:if> -->
|
6016
6366
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
6017
6367
|
</xsl:otherwise>
|
6018
6368
|
</xsl:choose>
|
@@ -6054,6 +6404,70 @@
|
|
6054
6404
|
<xsl:value-of select="substring(.,1,1)"/>
|
6055
6405
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
6056
6406
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
6407
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
6408
|
+
<fo:block>
|
6409
|
+
<xsl:apply-templates/>
|
6410
|
+
</fo:block>
|
6411
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
6412
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
6413
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
6414
|
+
<fo:inline>
|
6415
|
+
<xsl:call-template name="text_input"/>
|
6416
|
+
</fo:inline>
|
6417
|
+
</xsl:template><xsl:template name="text_input">
|
6418
|
+
<xsl:variable name="count">
|
6419
|
+
<xsl:choose>
|
6420
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
6421
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
6422
|
+
<xsl:otherwise>10</xsl:otherwise>
|
6423
|
+
</xsl:choose>
|
6424
|
+
</xsl:variable>
|
6425
|
+
<xsl:call-template name="repeat">
|
6426
|
+
<xsl:with-param name="char" select="'_'"/>
|
6427
|
+
<xsl:with-param name="count" select="$count"/>
|
6428
|
+
</xsl:call-template>
|
6429
|
+
<xsl:text> </xsl:text>
|
6430
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
6431
|
+
<xsl:variable name="caption">
|
6432
|
+
<xsl:choose>
|
6433
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
6434
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
6435
|
+
</xsl:choose>
|
6436
|
+
</xsl:variable>
|
6437
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
6438
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
6439
|
+
<fo:inline padding-right="1mm">
|
6440
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
6441
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
6442
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
6443
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
6444
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
6445
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
6446
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
6447
|
+
</svg>
|
6448
|
+
</fo:instream-foreign-object>
|
6449
|
+
</fo:inline>
|
6450
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
6451
|
+
<fo:inline padding-right="1mm">
|
6452
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
6453
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
6454
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
6455
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
6456
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
6457
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
6458
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
6459
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
6460
|
+
</svg>
|
6461
|
+
</fo:instream-foreign-object>
|
6462
|
+
</fo:inline>
|
6463
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
6464
|
+
<fo:inline>
|
6465
|
+
<xsl:call-template name="text_input"/>
|
6466
|
+
</fo:inline>
|
6467
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
6468
|
+
<fo:block-container border="1pt solid black" width="50%">
|
6469
|
+
<fo:block> </fo:block>
|
6470
|
+
</fo:block-container>
|
6057
6471
|
</xsl:template><xsl:template name="convertDate">
|
6058
6472
|
<xsl:param name="date"/>
|
6059
6473
|
<xsl:param name="format" select="'short'"/>
|
@@ -6258,6 +6672,9 @@
|
|
6258
6672
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
6259
6673
|
<xsl:value-of select="$level_total - 1"/>
|
6260
6674
|
</xsl:when>
|
6675
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
6676
|
+
<xsl:value-of select="$level_total - 1"/>
|
6677
|
+
</xsl:when>
|
6261
6678
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
6262
6679
|
<xsl:value-of select="$level_total - 2"/>
|
6263
6680
|
</xsl:when>
|
@@ -6322,6 +6739,7 @@
|
|
6322
6739
|
|
6323
6740
|
|
6324
6741
|
|
6742
|
+
|
6325
6743
|
|
6326
6744
|
|
6327
6745
|
|
@@ -6382,17 +6800,29 @@
|
|
6382
6800
|
</xsl:call-template>
|
6383
6801
|
</xsl:if>
|
6384
6802
|
</xsl:template><xsl:template name="getLocalizedString">
|
6385
|
-
<xsl:param name="key"/>
|
6803
|
+
<xsl:param name="key"/>
|
6386
6804
|
|
6387
6805
|
<xsl:variable name="curr_lang">
|
6388
6806
|
<xsl:call-template name="getLang"/>
|
6389
6807
|
</xsl:variable>
|
6390
6808
|
|
6809
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
6810
|
+
|
6391
6811
|
<xsl:choose>
|
6812
|
+
<xsl:when test="$data_value != ''">
|
6813
|
+
<xsl:value-of select="$data_value"/>
|
6814
|
+
</xsl:when>
|
6392
6815
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6393
6816
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6394
6817
|
</xsl:when>
|
6395
|
-
<xsl:otherwise
|
6818
|
+
<xsl:otherwise>
|
6819
|
+
<xsl:variable name="key_">
|
6820
|
+
<xsl:call-template name="capitalize">
|
6821
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
6822
|
+
</xsl:call-template>
|
6823
|
+
</xsl:variable>
|
6824
|
+
<xsl:value-of select="$key_"/>
|
6825
|
+
</xsl:otherwise>
|
6396
6826
|
</xsl:choose>
|
6397
6827
|
|
6398
6828
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
@@ -6435,4 +6865,110 @@
|
|
6435
6865
|
<xsl:value-of select="$align"/>
|
6436
6866
|
</xsl:when>
|
6437
6867
|
</xsl:choose>
|
6868
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
6869
|
+
<xsl:param name="default">left</xsl:param>
|
6870
|
+
<xsl:attribute name="text-align">
|
6871
|
+
<xsl:choose>
|
6872
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6873
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6874
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6875
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6876
|
+
</xsl:choose>
|
6877
|
+
</xsl:attribute>
|
6878
|
+
</xsl:template><xsl:template name="number-to-words">
|
6879
|
+
<xsl:param name="number"/>
|
6880
|
+
<xsl:param name="first"/>
|
6881
|
+
<xsl:if test="$number != ''">
|
6882
|
+
<xsl:variable name="words">
|
6883
|
+
<words>
|
6884
|
+
<word cardinal="1">One-</word>
|
6885
|
+
<word ordinal="1">First </word>
|
6886
|
+
<word cardinal="2">Two-</word>
|
6887
|
+
<word ordinal="2">Second </word>
|
6888
|
+
<word cardinal="3">Three-</word>
|
6889
|
+
<word ordinal="3">Third </word>
|
6890
|
+
<word cardinal="4">Four-</word>
|
6891
|
+
<word ordinal="4">Fourth </word>
|
6892
|
+
<word cardinal="5">Five-</word>
|
6893
|
+
<word ordinal="5">Fifth </word>
|
6894
|
+
<word cardinal="6">Six-</word>
|
6895
|
+
<word ordinal="6">Sixth </word>
|
6896
|
+
<word cardinal="7">Seven-</word>
|
6897
|
+
<word ordinal="7">Seventh </word>
|
6898
|
+
<word cardinal="8">Eight-</word>
|
6899
|
+
<word ordinal="8">Eighth </word>
|
6900
|
+
<word cardinal="9">Nine-</word>
|
6901
|
+
<word ordinal="9">Ninth </word>
|
6902
|
+
<word ordinal="10">Tenth </word>
|
6903
|
+
<word ordinal="11">Eleventh </word>
|
6904
|
+
<word ordinal="12">Twelfth </word>
|
6905
|
+
<word ordinal="13">Thirteenth </word>
|
6906
|
+
<word ordinal="14">Fourteenth </word>
|
6907
|
+
<word ordinal="15">Fifteenth </word>
|
6908
|
+
<word ordinal="16">Sixteenth </word>
|
6909
|
+
<word ordinal="17">Seventeenth </word>
|
6910
|
+
<word ordinal="18">Eighteenth </word>
|
6911
|
+
<word ordinal="19">Nineteenth </word>
|
6912
|
+
<word cardinal="20">Twenty-</word>
|
6913
|
+
<word ordinal="20">Twentieth </word>
|
6914
|
+
<word cardinal="30">Thirty-</word>
|
6915
|
+
<word ordinal="30">Thirtieth </word>
|
6916
|
+
<word cardinal="40">Forty-</word>
|
6917
|
+
<word ordinal="40">Fortieth </word>
|
6918
|
+
<word cardinal="50">Fifty-</word>
|
6919
|
+
<word ordinal="50">Fiftieth </word>
|
6920
|
+
<word cardinal="60">Sixty-</word>
|
6921
|
+
<word ordinal="60">Sixtieth </word>
|
6922
|
+
<word cardinal="70">Seventy-</word>
|
6923
|
+
<word ordinal="70">Seventieth </word>
|
6924
|
+
<word cardinal="80">Eighty-</word>
|
6925
|
+
<word ordinal="80">Eightieth </word>
|
6926
|
+
<word cardinal="90">Ninety-</word>
|
6927
|
+
<word ordinal="90">Ninetieth </word>
|
6928
|
+
<word cardinal="100">Hundred-</word>
|
6929
|
+
<word ordinal="100">Hundredth </word>
|
6930
|
+
</words>
|
6931
|
+
</xsl:variable>
|
6932
|
+
|
6933
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6934
|
+
|
6935
|
+
<xsl:variable name="value">
|
6936
|
+
<xsl:choose>
|
6937
|
+
<xsl:when test="$ordinal != ''">
|
6938
|
+
<xsl:value-of select="$ordinal"/>
|
6939
|
+
</xsl:when>
|
6940
|
+
<xsl:otherwise>
|
6941
|
+
<xsl:choose>
|
6942
|
+
<xsl:when test="$number < 100">
|
6943
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6944
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6945
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6946
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6947
|
+
</xsl:when>
|
6948
|
+
<xsl:otherwise>
|
6949
|
+
<!-- more 100 -->
|
6950
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6951
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6952
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6953
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6954
|
+
<xsl:call-template name="number-to-words">
|
6955
|
+
<xsl:with-param name="number" select="$digits"/>
|
6956
|
+
</xsl:call-template>
|
6957
|
+
</xsl:otherwise>
|
6958
|
+
</xsl:choose>
|
6959
|
+
</xsl:otherwise>
|
6960
|
+
</xsl:choose>
|
6961
|
+
</xsl:variable>
|
6962
|
+
<xsl:choose>
|
6963
|
+
<xsl:when test="$first = 'true'">
|
6964
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6965
|
+
<xsl:call-template name="capitalize">
|
6966
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6967
|
+
</xsl:call-template>
|
6968
|
+
</xsl:when>
|
6969
|
+
<xsl:otherwise>
|
6970
|
+
<xsl:value-of select="$value"/>
|
6971
|
+
</xsl:otherwise>
|
6972
|
+
</xsl:choose>
|
6973
|
+
</xsl:if>
|
6438
6974
|
</xsl:template></xsl:stylesheet>
|