metanorma-ogc 1.3.4 → 1.3.8
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 +1 -1
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/lib/asciidoctor/ogc.rb +0 -1
- data/lib/asciidoctor/ogc/isodoc.rng +62 -8
- data/lib/isodoc/ogc.rb +0 -1
- data/lib/isodoc/ogc/metadata.rb +18 -13
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +583 -73
- data/lib/isodoc/ogc/ogc.best-practice.xsl +583 -73
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +583 -73
- data/lib/isodoc/ogc/ogc.community-practice.xsl +583 -73
- data/lib/isodoc/ogc/ogc.community-standard.xsl +583 -73
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +583 -73
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +583 -73
- data/lib/isodoc/ogc/ogc.other.xsl +583 -73
- data/lib/isodoc/ogc/ogc.policy.xsl +583 -73
- data/lib/isodoc/ogc/ogc.reference-model.xsl +583 -73
- data/lib/isodoc/ogc/ogc.release-notes.xsl +583 -73
- data/lib/isodoc/ogc/ogc.standard.xsl +583 -73
- data/lib/isodoc/ogc/ogc.test-suite.xsl +583 -73
- data/lib/isodoc/ogc/ogc.user-guide.xsl +583 -73
- data/lib/isodoc/ogc/ogc.white-paper.xsl +565 -55
- data/lib/isodoc/ogc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/ogc/reqt.rb +13 -6
- data/lib/isodoc/ogc/sections.rb +8 -6
- data/lib/isodoc/ogc/word_convert.rb +13 -12
- data/lib/isodoc/ogc/xref.rb +17 -10
- data/lib/metanorma/ogc.rb +3 -4
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1cf7a554aa5d0925f31dadc79986085ae51643cdcc2e3367087da1b2dc9e99b
|
4
|
+
data.tar.gz: 95a95b35de2d3f9613779bcef6a32b3a21ecfd7b4df77c3411b9da2755369a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b11e5d10627ebd1946e97cdd36ac9c32018033d3044242437149212d9ff6f182ba8c5e1fd9fda1a8fbb66629e36f2de8c40e20ed3022e33aa55a3850dc27141
|
7
|
+
data.tar.gz: b362a4c65d8c69d3ab99251c9067d6c5a3225e1d391c05953eab122ce5b0a154c17c6d4ac25c5933d12f7542a2c57d42120e8e9eb9561f5b959ded3c2128ddb4
|
data/.github/workflows/rake.yml
CHANGED
data/.rubocop.yml
CHANGED
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
data/lib/asciidoctor/ogc.rb
CHANGED
@@ -204,6 +204,18 @@
|
|
204
204
|
</zeroOrMore>
|
205
205
|
</element>
|
206
206
|
</define>
|
207
|
+
<define name="dt">
|
208
|
+
<element name="dt">
|
209
|
+
<optional>
|
210
|
+
<attribute name="id">
|
211
|
+
<data type="ID"/>
|
212
|
+
</attribute>
|
213
|
+
</optional>
|
214
|
+
<zeroOrMore>
|
215
|
+
<ref name="TextElement"/>
|
216
|
+
</zeroOrMore>
|
217
|
+
</element>
|
218
|
+
</define>
|
207
219
|
<define name="example">
|
208
220
|
<element name="example">
|
209
221
|
<attribute name="id">
|
@@ -899,7 +911,7 @@
|
|
899
911
|
</include>
|
900
912
|
<!-- end overrides -->
|
901
913
|
<define name="docsubtype">
|
902
|
-
<element name="
|
914
|
+
<element name="subdoctype">
|
903
915
|
<ref name="DocumentSubtype"/>
|
904
916
|
</element>
|
905
917
|
</define>
|
@@ -955,7 +967,34 @@
|
|
955
967
|
<define name="concept">
|
956
968
|
<element name="concept">
|
957
969
|
<optional>
|
958
|
-
<attribute name="
|
970
|
+
<attribute name="ital">
|
971
|
+
<data type="boolean"/>
|
972
|
+
</attribute>
|
973
|
+
</optional>
|
974
|
+
<optional>
|
975
|
+
<attribute name="ref">
|
976
|
+
<data type="boolean"/>
|
977
|
+
</attribute>
|
978
|
+
</optional>
|
979
|
+
<optional>
|
980
|
+
<element name="refterm">
|
981
|
+
<zeroOrMore>
|
982
|
+
<choice>
|
983
|
+
<ref name="PureTextElement"/>
|
984
|
+
<ref name="stem"/>
|
985
|
+
</choice>
|
986
|
+
</zeroOrMore>
|
987
|
+
</element>
|
988
|
+
</optional>
|
989
|
+
<optional>
|
990
|
+
<element name="renderterm">
|
991
|
+
<zeroOrMore>
|
992
|
+
<choice>
|
993
|
+
<ref name="PureTextElement"/>
|
994
|
+
<ref name="stem"/>
|
995
|
+
</choice>
|
996
|
+
</zeroOrMore>
|
997
|
+
</element>
|
959
998
|
</optional>
|
960
999
|
<choice>
|
961
1000
|
<ref name="eref"/>
|
@@ -972,8 +1011,14 @@
|
|
972
1011
|
<ref name="imagemap"/>
|
973
1012
|
<ref name="svgmap"/>
|
974
1013
|
<ref name="inputform"/>
|
1014
|
+
<ref name="toc"/>
|
975
1015
|
</choice>
|
976
1016
|
</define>
|
1017
|
+
<define name="toc">
|
1018
|
+
<element name="toc">
|
1019
|
+
<ref name="ul"/>
|
1020
|
+
</element>
|
1021
|
+
</define>
|
977
1022
|
<define name="inputform">
|
978
1023
|
<element name="form">
|
979
1024
|
<attribute name="id">
|
@@ -981,6 +1026,9 @@
|
|
981
1026
|
</attribute>
|
982
1027
|
<attribute name="name"/>
|
983
1028
|
<attribute name="action"/>
|
1029
|
+
<optional>
|
1030
|
+
<attribute name="class"/>
|
1031
|
+
</optional>
|
984
1032
|
<zeroOrMore>
|
985
1033
|
<choice>
|
986
1034
|
<ref name="TextElement"/>
|
@@ -1212,6 +1260,12 @@
|
|
1212
1260
|
<optional>
|
1213
1261
|
<attribute name="type"/>
|
1214
1262
|
</optional>
|
1263
|
+
<optional>
|
1264
|
+
<attribute name="identifier"/>
|
1265
|
+
</optional>
|
1266
|
+
<optional>
|
1267
|
+
<attribute name="prefix"/>
|
1268
|
+
</optional>
|
1215
1269
|
<text/>
|
1216
1270
|
</define>
|
1217
1271
|
<define name="ics">
|
@@ -1473,26 +1527,26 @@
|
|
1473
1527
|
<optional>
|
1474
1528
|
<ref name="section-title"/>
|
1475
1529
|
</optional>
|
1476
|
-
<
|
1530
|
+
<choice>
|
1477
1531
|
<choice>
|
1478
1532
|
<group>
|
1479
|
-
<
|
1533
|
+
<oneOrMore>
|
1480
1534
|
<ref name="BasicBlock"/>
|
1481
|
-
</
|
1535
|
+
</oneOrMore>
|
1482
1536
|
<zeroOrMore>
|
1483
1537
|
<ref name="note"/>
|
1484
1538
|
</zeroOrMore>
|
1485
1539
|
</group>
|
1486
1540
|
<ref name="amend"/>
|
1487
1541
|
</choice>
|
1488
|
-
<
|
1542
|
+
<oneOrMore>
|
1489
1543
|
<choice>
|
1490
1544
|
<ref name="clause-subsection"/>
|
1491
1545
|
<ref name="terms"/>
|
1492
1546
|
<ref name="definitions"/>
|
1493
1547
|
</choice>
|
1494
|
-
</
|
1495
|
-
</
|
1548
|
+
</oneOrMore>
|
1549
|
+
</choice>
|
1496
1550
|
</define>
|
1497
1551
|
<define name="Annex-Section">
|
1498
1552
|
<optional>
|
data/lib/isodoc/ogc.rb
CHANGED
data/lib/isodoc/ogc/metadata.rb
CHANGED
@@ -19,7 +19,7 @@ module IsoDoc
|
|
19
19
|
"user-guide" => "UG",
|
20
20
|
"white-paper" => "WP",
|
21
21
|
"other" => "other",
|
22
|
-
}
|
22
|
+
}.freeze
|
23
23
|
|
24
24
|
DOCSUBTYPE_ABBR = {
|
25
25
|
"implementation" => "IMP",
|
@@ -31,7 +31,7 @@ module IsoDoc
|
|
31
31
|
"profile" => "PF",
|
32
32
|
"profile-with-extension" => "PFE",
|
33
33
|
"general" => "GE",
|
34
|
-
}
|
34
|
+
}.freeze
|
35
35
|
|
36
36
|
class Metadata < IsoDoc::Metadata
|
37
37
|
def initialize(lang, script, i18n)
|
@@ -53,16 +53,20 @@ module IsoDoc
|
|
53
53
|
def author(isoxml, _out)
|
54
54
|
tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
|
55
55
|
set(:tc, tc.text) if tc
|
56
|
-
authors = isoxml.xpath(ns("//bibdata/contributor
|
56
|
+
authors = isoxml.xpath(ns("//bibdata/contributor"\
|
57
|
+
"[role/@type = 'author']/person"))
|
57
58
|
set(:authors, extract_person_names(authors))
|
58
|
-
editors = isoxml.xpath(ns("//bibdata/contributor
|
59
|
+
editors = isoxml.xpath(ns("//bibdata/contributor"\
|
60
|
+
"[role/@type = 'editor']/person"))
|
59
61
|
set(:editors, extract_person_names(editors))
|
60
62
|
agency(isoxml)
|
61
63
|
end
|
62
64
|
|
63
65
|
def docid(isoxml, _out)
|
64
|
-
set(:docnumber, isoxml&.at(ns("//bibdata/docidentifier
|
65
|
-
|
66
|
+
set(:docnumber, isoxml&.at(ns("//bibdata/docidentifier"\
|
67
|
+
"[@type = 'ogc-internal']"))&.text)
|
68
|
+
set(:externalid, isoxml&.at(ns("//bibdata/docidentifier"\
|
69
|
+
"[@type = 'ogc-external']"))&.text)
|
66
70
|
end
|
67
71
|
|
68
72
|
def unpublished(status)
|
@@ -78,11 +82,12 @@ module IsoDoc
|
|
78
82
|
|
79
83
|
def url(xml, _out)
|
80
84
|
super
|
81
|
-
a = xml.at(ns("//bibdata/uri[@type = 'previous']")) and
|
85
|
+
a = xml.at(ns("//bibdata/uri[@type = 'previous']")) and
|
86
|
+
set(:previousuri, a.text)
|
82
87
|
end
|
83
88
|
|
84
|
-
def type_capitalise(
|
85
|
-
|
89
|
+
def type_capitalise(type)
|
90
|
+
type.split(/[- ]/).map do |w|
|
86
91
|
%w(SWG).include?(w) ? w : w.capitalize
|
87
92
|
end.join(" ")
|
88
93
|
end
|
@@ -98,12 +103,12 @@ module IsoDoc
|
|
98
103
|
end
|
99
104
|
end
|
100
105
|
|
101
|
-
def doctype_abbr(
|
102
|
-
IsoDoc::Ogc::DOCTYPE_ABBR[
|
106
|
+
def doctype_abbr(type)
|
107
|
+
IsoDoc::Ogc::DOCTYPE_ABBR[type] || type
|
103
108
|
end
|
104
109
|
|
105
|
-
def docsubtype_abbr(
|
106
|
-
IsoDoc::Ogc::DOCSUBTYPE_ABBR[
|
110
|
+
def docsubtype_abbr(subtype, _type)
|
111
|
+
IsoDoc::Ogc::DOCSUBTYPE_ABBR[subtype] || st
|
107
112
|
end
|
108
113
|
|
109
114
|
def status_print(status)
|
@@ -7,8 +7,12 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
-
<xsl:variable name="pageWidth" select="
|
11
|
-
<xsl:variable name="pageHeight" select="
|
10
|
+
<xsl:variable name="pageWidth" select="215.9"/>
|
11
|
+
<xsl:variable name="pageHeight" select="279.4"/>
|
12
|
+
<xsl:variable name="marginLeftRight1" select="35"/>
|
13
|
+
<xsl:variable name="marginLeftRight2" select="17"/>
|
14
|
+
<xsl:variable name="marginTop" select="16.5"/>
|
15
|
+
<xsl:variable name="marginBottom" select="22.5"/>
|
12
16
|
|
13
17
|
|
14
18
|
|
@@ -74,7 +78,7 @@
|
|
74
78
|
<fo:root font-family="Lato, STIX Two Math, Source Han Sans" font-size="11pt" color="{$color_main}" xml:lang="{$lang}">
|
75
79
|
<fo:layout-master-set>
|
76
80
|
<!-- Cover page -->
|
77
|
-
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
81
|
+
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
78
82
|
<fo:region-body margin-top="16.5mm" margin-bottom="10mm" margin-left="16.5mm" margin-right="14mm"/>
|
79
83
|
<fo:region-before region-name="cover-page-header" extent="16.5mm"/>
|
80
84
|
<fo:region-after extent="10mm"/>
|
@@ -83,7 +87,7 @@
|
|
83
87
|
</fo:simple-page-master>
|
84
88
|
|
85
89
|
<!-- Preface pages -->
|
86
|
-
<fo:simple-page-master master-name="preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
90
|
+
<fo:simple-page-master master-name="preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
87
91
|
<fo:region-body margin-top="16.5mm" margin-bottom="22.5mm" margin-left="16.5mm" margin-right="16.5mm"/>
|
88
92
|
<fo:region-before region-name="header" extent="16.5mm"/>
|
89
93
|
<fo:region-after region-name="footer" extent="22.5mm"/>
|
@@ -93,12 +97,12 @@
|
|
93
97
|
|
94
98
|
|
95
99
|
<!-- Document pages -->
|
96
|
-
<fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
97
|
-
<fo:region-body margin-top="
|
98
|
-
<fo:region-before region-name="header" extent="
|
99
|
-
<fo:region-after region-name="footer" extent="
|
100
|
+
<fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
101
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
102
|
+
<fo:region-before region-name="header" extent="{$marginTop}mm"/>
|
103
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
100
104
|
<fo:region-start region-name="left-region" extent="16.5mm"/>
|
101
|
-
<fo:region-end region-name="right-region" extent="
|
105
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
102
106
|
</fo:simple-page-master>
|
103
107
|
|
104
108
|
</fo:layout-master-set>
|
@@ -124,16 +128,16 @@
|
|
124
128
|
<!-- background image -->
|
125
129
|
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
|
126
130
|
<fo:block>
|
127
|
-
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
|
131
|
+
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
|
128
132
|
</fo:block>
|
129
133
|
</fo:block-container>
|
130
134
|
|
131
135
|
<!-- background color -->
|
132
136
|
<fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
|
133
137
|
<fo:block>
|
134
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
135
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="
|
136
|
-
<rect width="
|
138
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
139
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
140
|
+
<rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:0.85"/>
|
137
141
|
</svg>
|
138
142
|
</fo:instream-foreign-object>
|
139
143
|
</fo:block>
|
@@ -272,10 +276,10 @@
|
|
272
276
|
</xsl:if>
|
273
277
|
|
274
278
|
<!-- crossing lines -->
|
275
|
-
<fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
|
279
|
+
<fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
|
276
280
|
<fo:block>
|
277
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
|
278
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
|
281
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
|
282
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
279
283
|
<line x1="230" y1="0" x2="2159" y2="490" stroke="{$color_lightorange}"/>
|
280
284
|
<line x1="0" y1="395" x2="820" y2="0" stroke="{$color_lightorange}"/>
|
281
285
|
<circle style="fill:{$color_lightorange};" cx="614" cy="100" r="15"/>
|
@@ -305,10 +309,10 @@
|
|
305
309
|
<fo:flow flow-name="xsl-region-body">
|
306
310
|
|
307
311
|
<!-- crossing lines -->
|
308
|
-
<fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
|
312
|
+
<fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
|
309
313
|
<fo:block>
|
310
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
|
311
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
|
314
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
|
315
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
312
316
|
<line x1="0" y1="545" x2="2084" y2="0" stroke="{$color_lightorange}"/>
|
313
317
|
<line x1="0" y1="1374" x2="355" y2="0" stroke="{$color_lightorange}"/>
|
314
318
|
<circle style="fill:{$color_lightorange};" cx="227" cy="487" r="15"/>
|
@@ -601,9 +605,9 @@
|
|
601
605
|
<!-- background color -->
|
602
606
|
<fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
|
603
607
|
<fo:block>
|
604
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
605
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
|
606
|
-
<rect width="
|
608
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
609
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
610
|
+
<rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:1"/>
|
607
611
|
</svg>
|
608
612
|
</fo:instream-foreign-object>
|
609
613
|
</fo:block>
|
@@ -1355,10 +1359,10 @@
|
|
1355
1359
|
</xsl:template>
|
1356
1360
|
|
1357
1361
|
<xsl:template name="insertCrossingLines">
|
1358
|
-
<fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
|
1362
|
+
<fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
|
1359
1363
|
<fo:block>
|
1360
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
|
1361
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
|
1364
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
|
1365
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
1362
1366
|
<line x1="0" y1="300" x2="2159" y2="675" stroke="{$color_orange}"/>
|
1363
1367
|
<line x1="1215" y1="0" x2="2159" y2="1380" stroke="{$color_orange}"/>
|
1364
1368
|
<line x1="0" y1="1850" x2="2159" y2="2390" stroke="{$color_orange}"/>
|
@@ -1720,7 +1724,7 @@
|
|
1720
1724
|
|
1721
1725
|
|
1722
1726
|
|
1723
|
-
|
1727
|
+
|
1724
1728
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
1725
1729
|
|
1726
1730
|
|
@@ -1785,7 +1789,10 @@
|
|
1785
1789
|
|
1786
1790
|
|
1787
1791
|
|
1788
|
-
|
1792
|
+
|
1793
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
1794
|
+
|
1795
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
1789
1796
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1790
1797
|
|
1791
1798
|
|
@@ -1806,6 +1813,8 @@
|
|
1806
1813
|
|
1807
1814
|
|
1808
1815
|
|
1816
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
1817
|
+
|
1809
1818
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1810
1819
|
|
1811
1820
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
@@ -1837,6 +1846,7 @@
|
|
1837
1846
|
|
1838
1847
|
|
1839
1848
|
|
1849
|
+
|
1840
1850
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
1841
1851
|
|
1842
1852
|
|
@@ -1856,6 +1866,7 @@
|
|
1856
1866
|
|
1857
1867
|
|
1858
1868
|
|
1869
|
+
|
1859
1870
|
</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">
|
1860
1871
|
|
1861
1872
|
|
@@ -1900,6 +1911,7 @@
|
|
1900
1911
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
1901
1912
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1902
1913
|
|
1914
|
+
|
1903
1915
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1904
1916
|
|
1905
1917
|
|
@@ -1907,6 +1919,7 @@
|
|
1907
1919
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1908
1920
|
|
1909
1921
|
|
1922
|
+
|
1910
1923
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1911
1924
|
|
1912
1925
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1965,6 +1978,7 @@
|
|
1965
1978
|
|
1966
1979
|
|
1967
1980
|
|
1981
|
+
|
1968
1982
|
|
1969
1983
|
|
1970
1984
|
|
@@ -2043,6 +2057,8 @@
|
|
2043
2057
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
2044
2058
|
|
2045
2059
|
|
2060
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
2061
|
+
|
2046
2062
|
</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">
|
2047
2063
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2048
2064
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -2053,14 +2069,15 @@
|
|
2053
2069
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2054
2070
|
|
2055
2071
|
<!-- Normative references -->
|
2056
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2072
|
+
<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"/>
|
2057
2073
|
<!-- Terms and definitions -->
|
2058
2074
|
<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"/>
|
2059
2075
|
<!-- Another main sections -->
|
2060
2076
|
<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"/>
|
2061
2077
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
2062
2078
|
<!-- Bibliography -->
|
2063
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2079
|
+
<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"/>
|
2080
|
+
|
2064
2081
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2065
2082
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2066
2083
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -2091,20 +2108,22 @@
|
|
2091
2108
|
<xsl:variable name="table-preamble">
|
2092
2109
|
|
2093
2110
|
|
2094
|
-
<fo:block> </fo:block>
|
2111
|
+
<fo:block> </fo:block>
|
2095
2112
|
|
2096
2113
|
</xsl:variable>
|
2097
2114
|
|
2098
2115
|
<xsl:variable name="table">
|
2099
2116
|
|
2100
2117
|
<xsl:variable name="simple-table">
|
2101
|
-
<xsl:call-template name="getSimpleTable"/>
|
2118
|
+
<xsl:call-template name="getSimpleTable"/>
|
2102
2119
|
</xsl:variable>
|
2103
2120
|
|
2104
2121
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2105
|
-
<fo:block> </fo:block>
|
2122
|
+
<fo:block> </fo:block>
|
2106
2123
|
</xsl:if> -->
|
2107
2124
|
|
2125
|
+
|
2126
|
+
<!-- Display table's name before table as standalone block -->
|
2108
2127
|
<!-- $namespace = 'iso' or -->
|
2109
2128
|
|
2110
2129
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -2188,6 +2207,12 @@
|
|
2188
2207
|
|
2189
2208
|
|
2190
2209
|
|
2210
|
+
|
2211
|
+
|
2212
|
+
|
2213
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
2214
|
+
|
2215
|
+
|
2191
2216
|
<xsl:variable name="table_width">
|
2192
2217
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
2193
2218
|
|
@@ -2212,6 +2237,7 @@
|
|
2212
2237
|
|
2213
2238
|
|
2214
2239
|
|
2240
|
+
|
2215
2241
|
<attribute name="margin-left">0mm</attribute>
|
2216
2242
|
<attribute name="margin-right">0mm</attribute>
|
2217
2243
|
|
@@ -2220,6 +2246,7 @@
|
|
2220
2246
|
|
2221
2247
|
|
2222
2248
|
|
2249
|
+
|
2223
2250
|
</xsl:variable>
|
2224
2251
|
|
2225
2252
|
|
@@ -2358,6 +2385,9 @@
|
|
2358
2385
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
2359
2386
|
|
2360
2387
|
|
2388
|
+
|
2389
|
+
|
2390
|
+
|
2361
2391
|
<xsl:choose>
|
2362
2392
|
<xsl:when test="$continued = 'true'">
|
2363
2393
|
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
@@ -2505,6 +2535,7 @@
|
|
2505
2535
|
<!-- font-weight="bold" -->
|
2506
2536
|
<fo:table-header>
|
2507
2537
|
|
2538
|
+
|
2508
2539
|
<xsl:apply-templates/>
|
2509
2540
|
</fo:table-header>
|
2510
2541
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -2631,6 +2662,8 @@
|
|
2631
2662
|
</xsl:choose>
|
2632
2663
|
</xsl:for-each>
|
2633
2664
|
|
2665
|
+
|
2666
|
+
|
2634
2667
|
<xsl:choose>
|
2635
2668
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2636
2669
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -2657,6 +2690,7 @@
|
|
2657
2690
|
|
2658
2691
|
|
2659
2692
|
|
2693
|
+
|
2660
2694
|
<!-- fn will be processed inside 'note' processing -->
|
2661
2695
|
|
2662
2696
|
|
@@ -2667,6 +2701,11 @@
|
|
2667
2701
|
|
2668
2702
|
|
2669
2703
|
|
2704
|
+
|
2705
|
+
|
2706
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
2707
|
+
|
2708
|
+
|
2670
2709
|
<!-- except gb -->
|
2671
2710
|
|
2672
2711
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -2692,6 +2731,10 @@
|
|
2692
2731
|
<!-- fn processing -->
|
2693
2732
|
<xsl:call-template name="fn_display"/>
|
2694
2733
|
|
2734
|
+
|
2735
|
+
<!-- for PAS display Notes after footnotes -->
|
2736
|
+
|
2737
|
+
|
2695
2738
|
</fo:table-cell>
|
2696
2739
|
</fo:table-row>
|
2697
2740
|
</fo:table-body>
|
@@ -2745,10 +2788,13 @@
|
|
2745
2788
|
|
2746
2789
|
|
2747
2790
|
|
2791
|
+
|
2792
|
+
|
2748
2793
|
</xsl:if>
|
2749
2794
|
<xsl:if test="$parent-name = 'tfoot'">
|
2750
2795
|
|
2751
2796
|
|
2797
|
+
|
2752
2798
|
</xsl:if>
|
2753
2799
|
|
2754
2800
|
|
@@ -2766,6 +2812,12 @@
|
|
2766
2812
|
</xsl:if>
|
2767
2813
|
|
2768
2814
|
|
2815
|
+
|
2816
|
+
|
2817
|
+
|
2818
|
+
|
2819
|
+
|
2820
|
+
|
2769
2821
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2770
2822
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2771
2823
|
</xsl:if> -->
|
@@ -2848,6 +2900,7 @@
|
|
2848
2900
|
|
2849
2901
|
|
2850
2902
|
|
2903
|
+
|
2851
2904
|
<xsl:attribute name="border">solid 0pt white</xsl:attribute>
|
2852
2905
|
|
2853
2906
|
|
@@ -2855,6 +2908,9 @@
|
|
2855
2908
|
|
2856
2909
|
|
2857
2910
|
|
2911
|
+
|
2912
|
+
|
2913
|
+
|
2858
2914
|
<xsl:if test=".//*[local-name() = 'table']">
|
2859
2915
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2860
2916
|
</xsl:if>
|
@@ -2884,8 +2940,14 @@
|
|
2884
2940
|
|
2885
2941
|
|
2886
2942
|
|
2943
|
+
|
2944
|
+
|
2945
|
+
<!-- Table's note name (NOTE, for example) -->
|
2946
|
+
|
2887
2947
|
<fo:inline padding-right="2mm">
|
2888
2948
|
|
2949
|
+
|
2950
|
+
|
2889
2951
|
|
2890
2952
|
|
2891
2953
|
|
@@ -2893,6 +2955,8 @@
|
|
2893
2955
|
|
2894
2956
|
</fo:inline>
|
2895
2957
|
|
2958
|
+
|
2959
|
+
|
2896
2960
|
<xsl:apply-templates mode="process"/>
|
2897
2961
|
</fo:block>
|
2898
2962
|
|
@@ -2918,6 +2982,8 @@
|
|
2918
2982
|
<xsl:variable name="reference" select="@reference"/>
|
2919
2983
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
2920
2984
|
<fo:block margin-bottom="12pt">
|
2985
|
+
|
2986
|
+
|
2921
2987
|
|
2922
2988
|
|
2923
2989
|
|
@@ -2933,9 +2999,11 @@
|
|
2933
2999
|
|
2934
3000
|
|
2935
3001
|
|
3002
|
+
|
2936
3003
|
<xsl:value-of select="@reference"/>
|
2937
3004
|
|
2938
3005
|
|
3006
|
+
|
2939
3007
|
</fo:inline>
|
2940
3008
|
<fo:inline>
|
2941
3009
|
|
@@ -3073,11 +3141,15 @@
|
|
3073
3141
|
|
3074
3142
|
|
3075
3143
|
|
3144
|
+
|
3145
|
+
|
3146
|
+
|
3076
3147
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
3077
3148
|
|
3078
3149
|
|
3079
3150
|
|
3080
3151
|
|
3152
|
+
|
3081
3153
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
3082
3154
|
|
3083
3155
|
<xsl:attribute name="internal-destination">
|
@@ -3088,6 +3160,7 @@
|
|
3088
3160
|
|
3089
3161
|
<xsl:value-of select="@reference"/>
|
3090
3162
|
|
3163
|
+
|
3091
3164
|
</fo:basic-link>
|
3092
3165
|
</fo:inline>
|
3093
3166
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3387,6 +3460,7 @@
|
|
3387
3460
|
|
3388
3461
|
<xsl:attribute name="min-height">8.5mm</xsl:attribute>
|
3389
3462
|
|
3463
|
+
|
3390
3464
|
<fo:table-cell>
|
3391
3465
|
|
3392
3466
|
<fo:block margin-top="6pt">
|
@@ -3405,6 +3479,7 @@
|
|
3405
3479
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3406
3480
|
|
3407
3481
|
|
3482
|
+
|
3408
3483
|
<xsl:apply-templates/>
|
3409
3484
|
<!-- <xsl:if test="$namespace = 'gb'">
|
3410
3485
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -3952,7 +4027,15 @@
|
|
3952
4027
|
<xsl:copy>
|
3953
4028
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3954
4029
|
</xsl:copy>
|
3955
|
-
<
|
4030
|
+
<xsl:choose>
|
4031
|
+
<!-- if in msub, then don't add space -->
|
4032
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
4033
|
+
<!-- if next char in digit, don't add space -->
|
4034
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
4035
|
+
<xsl:otherwise>
|
4036
|
+
<mathml:mspace width="0.5ex"/>
|
4037
|
+
</xsl:otherwise>
|
4038
|
+
</xsl:choose>
|
3956
4039
|
</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">
|
3957
4040
|
<xsl:variable name="target">
|
3958
4041
|
<xsl:choose>
|
@@ -3976,6 +4059,8 @@
|
|
3976
4059
|
</xsl:variable>
|
3977
4060
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3978
4061
|
|
4062
|
+
|
4063
|
+
|
3979
4064
|
<xsl:choose>
|
3980
4065
|
<xsl:when test="$target_text = ''">
|
3981
4066
|
<xsl:apply-templates/>
|
@@ -4088,6 +4173,7 @@
|
|
4088
4173
|
|
4089
4174
|
|
4090
4175
|
|
4176
|
+
|
4091
4177
|
<fo:block-container margin-left="0mm">
|
4092
4178
|
|
4093
4179
|
|
@@ -4131,6 +4217,7 @@
|
|
4131
4217
|
</xsl:choose>
|
4132
4218
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
4133
4219
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
4220
|
+
|
4134
4221
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4135
4222
|
|
4136
4223
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
@@ -4208,6 +4295,7 @@
|
|
4208
4295
|
</xsl:call-template>
|
4209
4296
|
|
4210
4297
|
<fo:block>
|
4298
|
+
|
4211
4299
|
<xsl:apply-templates/>
|
4212
4300
|
</fo:block>
|
4213
4301
|
<xsl:call-template name="fn_display_figure"/>
|
@@ -4262,7 +4350,24 @@
|
|
4262
4350
|
</fo:instream-foreign-object>
|
4263
4351
|
</xsl:when>
|
4264
4352
|
<xsl:otherwise>
|
4265
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
4353
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
4354
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
4355
|
+
|
4356
|
+
<xsl:variable name="img_src">
|
4357
|
+
<xsl:choose>
|
4358
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
4359
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
4360
|
+
</xsl:choose>
|
4361
|
+
</xsl:variable>
|
4362
|
+
|
4363
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
4364
|
+
<xsl:if test="number($scale) < 100">
|
4365
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
4366
|
+
</xsl:if>
|
4367
|
+
|
4368
|
+
</xsl:if>
|
4369
|
+
|
4370
|
+
</fo:external-graphic>
|
4266
4371
|
</xsl:otherwise>
|
4267
4372
|
</xsl:choose>
|
4268
4373
|
|
@@ -4330,6 +4435,253 @@
|
|
4330
4435
|
<xsl:param name="height"/>
|
4331
4436
|
<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; "/>
|
4332
4437
|
<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; "/>
|
4438
|
+
</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">
|
4439
|
+
<xsl:param name="name"/>
|
4440
|
+
|
4441
|
+
<xsl:variable name="svg_content">
|
4442
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
4443
|
+
</xsl:variable>
|
4444
|
+
|
4445
|
+
<xsl:variable name="alt-text">
|
4446
|
+
<xsl:choose>
|
4447
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
4448
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
4449
|
+
</xsl:when>
|
4450
|
+
<xsl:when test="normalize-space($name) != ''">
|
4451
|
+
<xsl:value-of select="$name"/>
|
4452
|
+
</xsl:when>
|
4453
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
4454
|
+
</xsl:choose>
|
4455
|
+
</xsl:variable>
|
4456
|
+
|
4457
|
+
<xsl:choose>
|
4458
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
4459
|
+
<fo:block>
|
4460
|
+
<xsl:variable name="width" select="@width"/>
|
4461
|
+
<xsl:variable name="height" select="@height"/>
|
4462
|
+
|
4463
|
+
<xsl:variable name="scale_x">
|
4464
|
+
<xsl:choose>
|
4465
|
+
<xsl:when test="$width > $width_effective_px">
|
4466
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
4467
|
+
</xsl:when>
|
4468
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4469
|
+
</xsl:choose>
|
4470
|
+
</xsl:variable>
|
4471
|
+
|
4472
|
+
<xsl:variable name="scale_y">
|
4473
|
+
<xsl:choose>
|
4474
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
4475
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
4476
|
+
</xsl:when>
|
4477
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4478
|
+
</xsl:choose>
|
4479
|
+
</xsl:variable>
|
4480
|
+
|
4481
|
+
<xsl:variable name="scale">
|
4482
|
+
<xsl:choose>
|
4483
|
+
<xsl:when test="$scale_y != 1">
|
4484
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
4485
|
+
</xsl:when>
|
4486
|
+
<xsl:otherwise>
|
4487
|
+
<xsl:value-of select="$scale_x"/>
|
4488
|
+
</xsl:otherwise>
|
4489
|
+
</xsl:choose>
|
4490
|
+
</xsl:variable>
|
4491
|
+
|
4492
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
4493
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
4494
|
+
|
4495
|
+
<fo:table table-layout="fixed" width="100%">
|
4496
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
4497
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
4498
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
4499
|
+
<fo:table-body>
|
4500
|
+
<fo:table-row>
|
4501
|
+
<fo:table-cell column-number="2">
|
4502
|
+
<fo:block>
|
4503
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
4504
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
4505
|
+
<fo:block line-height="0" font-size="0">
|
4506
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
4507
|
+
<xsl:call-template name="bookmark"/>
|
4508
|
+
</xsl:for-each>
|
4509
|
+
</fo:block>
|
4510
|
+
</xsl:if>
|
4511
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
4512
|
+
|
4513
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
4514
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
4515
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4516
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4517
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4518
|
+
|
4519
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
4520
|
+
</fo:instream-foreign-object>
|
4521
|
+
</fo:block>
|
4522
|
+
|
4523
|
+
<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">
|
4524
|
+
<xsl:with-param name="scale" select="$scale"/>
|
4525
|
+
</xsl:apply-templates>
|
4526
|
+
</fo:block-container>
|
4527
|
+
</fo:block>
|
4528
|
+
</fo:table-cell>
|
4529
|
+
</fo:table-row>
|
4530
|
+
</fo:table-body>
|
4531
|
+
</fo:table>
|
4532
|
+
</fo:block>
|
4533
|
+
|
4534
|
+
</xsl:when>
|
4535
|
+
<xsl:otherwise>
|
4536
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
4537
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
4538
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
4539
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4540
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4541
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
4542
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
4543
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
4544
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
4545
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
4546
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
4547
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
4548
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
4549
|
+
</xsl:if>
|
4550
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4551
|
+
<xsl:copy-of select="$svg_content"/>
|
4552
|
+
</fo:instream-foreign-object>
|
4553
|
+
</fo:block>
|
4554
|
+
</xsl:otherwise>
|
4555
|
+
</xsl:choose>
|
4556
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
4557
|
+
<xsl:copy>
|
4558
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
4559
|
+
</xsl:copy>
|
4560
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
4561
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
4562
|
+
<xsl:value-of select="."/>
|
4563
|
+
</xsl:attribute>
|
4564
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
4565
|
+
<xsl:copy>
|
4566
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
4567
|
+
<xsl:variable name="viewbox">
|
4568
|
+
<xsl:call-template name="split">
|
4569
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
4570
|
+
<xsl:with-param name="sep" select="' '"/>
|
4571
|
+
</xsl:call-template>
|
4572
|
+
</xsl:variable>
|
4573
|
+
<xsl:attribute name="width">
|
4574
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
4575
|
+
</xsl:attribute>
|
4576
|
+
<xsl:attribute name="height">
|
4577
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
4578
|
+
</xsl:attribute>
|
4579
|
+
<xsl:apply-templates mode="svg_update"/>
|
4580
|
+
</xsl:copy>
|
4581
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
4582
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
4583
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
4584
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
4585
|
+
<xsl:call-template name="image_svg">
|
4586
|
+
<xsl:with-param name="name" select="$name"/>
|
4587
|
+
</xsl:call-template>
|
4588
|
+
</xsl:for-each>
|
4589
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
4590
|
+
<xsl:copy>
|
4591
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
4592
|
+
</xsl:copy>
|
4593
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
4594
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
4595
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
4596
|
+
<xsl:param name="scale"/>
|
4597
|
+
<xsl:variable name="dest">
|
4598
|
+
<xsl:choose>
|
4599
|
+
<xsl:when test="starts-with(@href, '#')">
|
4600
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
4601
|
+
</xsl:when>
|
4602
|
+
<xsl:otherwise>
|
4603
|
+
<xsl:value-of select="@href"/>
|
4604
|
+
</xsl:otherwise>
|
4605
|
+
</xsl:choose>
|
4606
|
+
</xsl:variable>
|
4607
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
4608
|
+
<xsl:call-template name="insertSVGMapLink">
|
4609
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
4610
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
4611
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
4612
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
4613
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4614
|
+
</xsl:call-template>
|
4615
|
+
</xsl:for-each>
|
4616
|
+
|
4617
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
4618
|
+
<xsl:variable name="points">
|
4619
|
+
<xsl:call-template name="split">
|
4620
|
+
<xsl:with-param name="pText" select="@points"/>
|
4621
|
+
</xsl:call-template>
|
4622
|
+
</xsl:variable>
|
4623
|
+
<xsl:variable name="x_coords">
|
4624
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
4625
|
+
<xsl:sort select="." data-type="number"/>
|
4626
|
+
<x><xsl:value-of select="."/></x>
|
4627
|
+
</xsl:for-each>
|
4628
|
+
</xsl:variable>
|
4629
|
+
<xsl:variable name="y_coords">
|
4630
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
4631
|
+
<xsl:sort select="." data-type="number"/>
|
4632
|
+
<y><xsl:value-of select="."/></y>
|
4633
|
+
</xsl:for-each>
|
4634
|
+
</xsl:variable>
|
4635
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
4636
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
4637
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
4638
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
4639
|
+
<xsl:call-template name="insertSVGMapLink">
|
4640
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
4641
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
4642
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
4643
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
4644
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4645
|
+
</xsl:call-template>
|
4646
|
+
</xsl:for-each>
|
4647
|
+
|
4648
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
4649
|
+
<xsl:call-template name="insertSVGMapLink">
|
4650
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
4651
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
4652
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
4653
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
4654
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4655
|
+
</xsl:call-template>
|
4656
|
+
</xsl:for-each>
|
4657
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
4658
|
+
<xsl:call-template name="insertSVGMapLink">
|
4659
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
4660
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
4661
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
4662
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
4663
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4664
|
+
</xsl:call-template>
|
4665
|
+
</xsl:for-each>
|
4666
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
4667
|
+
<xsl:param name="left"/>
|
4668
|
+
<xsl:param name="top"/>
|
4669
|
+
<xsl:param name="width"/>
|
4670
|
+
<xsl:param name="height"/>
|
4671
|
+
<xsl:param name="dest"/>
|
4672
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
4673
|
+
<fo:block font-size="1pt">
|
4674
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
4675
|
+
<fo:inline-container inline-progression-dimension="100%">
|
4676
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
4677
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
4678
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
4679
|
+
</xsl:if> -->
|
4680
|
+
<fo:block> </fo:block></fo:block-container>
|
4681
|
+
</fo:inline-container>
|
4682
|
+
</fo:basic-link>
|
4683
|
+
</fo:block>
|
4684
|
+
</fo:block-container>
|
4333
4685
|
</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">
|
4334
4686
|
<xsl:apply-templates mode="contents"/>
|
4335
4687
|
<xsl:text> </xsl:text>
|
@@ -4358,28 +4710,39 @@
|
|
4358
4710
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
4359
4711
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
4360
4712
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
4713
|
+
<xsl:if test="@bundle = 'true'">
|
4714
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
4715
|
+
</xsl:if>
|
4361
4716
|
<fo:bookmark-title>
|
4362
|
-
<xsl:variable name="bookmark-title_">
|
4363
|
-
<xsl:call-template name="getLangVersion">
|
4364
|
-
<xsl:with-param name="lang" select="@lang"/>
|
4365
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
4366
|
-
<xsl:with-param name="title" select="@title-part"/>
|
4367
|
-
</xsl:call-template>
|
4368
|
-
</xsl:variable>
|
4369
4717
|
<xsl:choose>
|
4370
|
-
<xsl:when test="normalize-space(
|
4371
|
-
<xsl:
|
4372
|
-
|
4373
|
-
|
4718
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
4719
|
+
<xsl:variable name="bookmark-title_">
|
4720
|
+
<xsl:call-template name="getLangVersion">
|
4721
|
+
<xsl:with-param name="lang" select="@lang"/>
|
4722
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
4723
|
+
<xsl:with-param name="title" select="@title-part"/>
|
4724
|
+
</xsl:call-template>
|
4725
|
+
</xsl:variable>
|
4374
4726
|
<xsl:choose>
|
4375
|
-
<xsl:when test="
|
4376
|
-
|
4377
|
-
|
4378
|
-
<xsl:otherwise
|
4727
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
4728
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
4729
|
+
</xsl:when>
|
4730
|
+
<xsl:otherwise>
|
4731
|
+
<xsl:choose>
|
4732
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
4733
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
4734
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
4735
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
4736
|
+
</xsl:choose>
|
4737
|
+
</xsl:otherwise>
|
4379
4738
|
</xsl:choose>
|
4739
|
+
</xsl:when>
|
4740
|
+
<xsl:otherwise>
|
4741
|
+
<xsl:value-of select="@title-part"/>
|
4380
4742
|
</xsl:otherwise>
|
4381
4743
|
</xsl:choose>
|
4382
4744
|
</fo:bookmark-title>
|
4745
|
+
|
4383
4746
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
4384
4747
|
|
4385
4748
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -4521,20 +4884,28 @@
|
|
4521
4884
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
4522
4885
|
</xsl:choose>
|
4523
4886
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
4524
|
-
<
|
4525
|
-
|
4526
|
-
|
4527
|
-
|
4528
|
-
<xsl:
|
4529
|
-
|
4530
|
-
|
4531
|
-
|
4532
|
-
|
4533
|
-
|
4887
|
+
<xsl:choose>
|
4888
|
+
<xsl:when test="@id != ''">
|
4889
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
4890
|
+
<fo:bookmark-title>
|
4891
|
+
<xsl:if test="@section != ''">
|
4892
|
+
<xsl:value-of select="@section"/>
|
4893
|
+
<xsl:text> </xsl:text>
|
4894
|
+
</xsl:if>
|
4895
|
+
<xsl:value-of select="normalize-space(title)"/>
|
4896
|
+
</fo:bookmark-title>
|
4897
|
+
<xsl:apply-templates mode="bookmark"/>
|
4898
|
+
</fo:bookmark>
|
4899
|
+
</xsl:when>
|
4900
|
+
<xsl:otherwise>
|
4901
|
+
<xsl:apply-templates mode="bookmark"/>
|
4902
|
+
</xsl:otherwise>
|
4903
|
+
</xsl:choose>
|
4534
4904
|
</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">
|
4535
4905
|
<xsl:if test="normalize-space() != ''">
|
4536
4906
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
4537
4907
|
|
4908
|
+
|
4538
4909
|
<xsl:apply-templates/>
|
4539
4910
|
</fo:block>
|
4540
4911
|
</xsl:if>
|
@@ -4615,6 +4986,7 @@
|
|
4615
4986
|
|
4616
4987
|
<fo:block-container margin-left="0mm">
|
4617
4988
|
<xsl:copy-of select="@id"/>
|
4989
|
+
|
4618
4990
|
<xsl:if test="parent::*[local-name() = 'note']">
|
4619
4991
|
<xsl:attribute name="margin-left">
|
4620
4992
|
<xsl:choose>
|
@@ -4625,7 +4997,9 @@
|
|
4625
4997
|
|
4626
4998
|
</xsl:if>
|
4627
4999
|
<fo:block-container margin-left="0mm">
|
4628
|
-
|
5000
|
+
|
5001
|
+
|
5002
|
+
|
4629
5003
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4630
5004
|
<xsl:variable name="_font-size">
|
4631
5005
|
|
@@ -4654,10 +5028,14 @@
|
|
4654
5028
|
</xsl:choose>
|
4655
5029
|
</xsl:attribute>
|
4656
5030
|
</xsl:if>
|
4657
|
-
|
4658
|
-
|
5031
|
+
|
5032
|
+
<xsl:apply-templates/>
|
5033
|
+
</fo:block>
|
5034
|
+
|
5035
|
+
|
4659
5036
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4660
5037
|
|
5038
|
+
|
4661
5039
|
</fo:block-container>
|
4662
5040
|
</fo:block-container>
|
4663
5041
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5010,6 +5388,8 @@
|
|
5010
5388
|
|
5011
5389
|
|
5012
5390
|
|
5391
|
+
|
5392
|
+
|
5013
5393
|
<xsl:call-template name="getTitle">
|
5014
5394
|
<xsl:with-param name="name" select="'title-source'"/>
|
5015
5395
|
</xsl:call-template>
|
@@ -5086,7 +5466,9 @@
|
|
5086
5466
|
|
5087
5467
|
|
5088
5468
|
</xsl:if>
|
5089
|
-
|
5469
|
+
|
5470
|
+
|
5471
|
+
|
5090
5472
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5091
5473
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5092
5474
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -5096,6 +5478,7 @@
|
|
5096
5478
|
|
5097
5479
|
|
5098
5480
|
|
5481
|
+
|
5099
5482
|
</xsl:if>
|
5100
5483
|
|
5101
5484
|
<xsl:apply-templates/>
|
@@ -5241,6 +5624,7 @@
|
|
5241
5624
|
<xsl:call-template name="setId"/>
|
5242
5625
|
|
5243
5626
|
|
5627
|
+
|
5244
5628
|
<xsl:apply-templates/>
|
5245
5629
|
</fo:block>
|
5246
5630
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -5629,17 +6013,17 @@
|
|
5629
6013
|
<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')]"/>
|
5630
6014
|
<xsl:choose>
|
5631
6015
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
5632
|
-
<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"/>
|
6016
|
+
<!-- <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"/>
|
5633
6017
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
5634
6018
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5635
|
-
</xsl:if>
|
6019
|
+
</xsl:if> -->
|
5636
6020
|
<xsl:value-of select="$_doc_ident"/>
|
5637
6021
|
</xsl:when>
|
5638
6022
|
<xsl:otherwise>
|
5639
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6023
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
5640
6024
|
<xsl:if test="$type != ''">
|
5641
6025
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5642
|
-
</xsl:if>
|
6026
|
+
</xsl:if> -->
|
5643
6027
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
5644
6028
|
</xsl:otherwise>
|
5645
6029
|
</xsl:choose>
|
@@ -6080,20 +6464,40 @@
|
|
6080
6464
|
</xsl:call-template>
|
6081
6465
|
</xsl:if>
|
6082
6466
|
</xsl:template><xsl:template name="getLocalizedString">
|
6083
|
-
<xsl:param name="key"/>
|
6467
|
+
<xsl:param name="key"/>
|
6468
|
+
<xsl:param name="formatted">false</xsl:param>
|
6084
6469
|
|
6085
6470
|
<xsl:variable name="curr_lang">
|
6086
6471
|
<xsl:call-template name="getLang"/>
|
6087
6472
|
</xsl:variable>
|
6088
6473
|
|
6089
|
-
<xsl:variable name="data_value"
|
6474
|
+
<xsl:variable name="data_value">
|
6475
|
+
<xsl:choose>
|
6476
|
+
<xsl:when test="$formatted = 'true'">
|
6477
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6478
|
+
</xsl:when>
|
6479
|
+
<xsl:otherwise>
|
6480
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
6481
|
+
</xsl:otherwise>
|
6482
|
+
</xsl:choose>
|
6483
|
+
</xsl:variable>
|
6090
6484
|
|
6091
6485
|
<xsl:choose>
|
6092
|
-
<xsl:when test="$data_value != ''">
|
6093
|
-
<xsl:
|
6486
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
6487
|
+
<xsl:choose>
|
6488
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
6489
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
6490
|
+
</xsl:choose>
|
6094
6491
|
</xsl:when>
|
6095
6492
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6096
|
-
<xsl:
|
6493
|
+
<xsl:choose>
|
6494
|
+
<xsl:when test="$formatted = 'true'">
|
6495
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6496
|
+
</xsl:when>
|
6497
|
+
<xsl:otherwise>
|
6498
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6499
|
+
</xsl:otherwise>
|
6500
|
+
</xsl:choose>
|
6097
6501
|
</xsl:when>
|
6098
6502
|
<xsl:otherwise>
|
6099
6503
|
<xsl:variable name="key_">
|
@@ -6104,7 +6508,7 @@
|
|
6104
6508
|
<xsl:value-of select="$key_"/>
|
6105
6509
|
</xsl:otherwise>
|
6106
6510
|
</xsl:choose>
|
6107
|
-
|
6511
|
+
|
6108
6512
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
6109
6513
|
<xsl:param name="isAdded"/>
|
6110
6514
|
<xsl:param name="isDeleted"/>
|
@@ -6145,4 +6549,110 @@
|
|
6145
6549
|
<xsl:value-of select="$align"/>
|
6146
6550
|
</xsl:when>
|
6147
6551
|
</xsl:choose>
|
6552
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
6553
|
+
<xsl:param name="default">left</xsl:param>
|
6554
|
+
<xsl:attribute name="text-align">
|
6555
|
+
<xsl:choose>
|
6556
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6557
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6558
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6559
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6560
|
+
</xsl:choose>
|
6561
|
+
</xsl:attribute>
|
6562
|
+
</xsl:template><xsl:template name="number-to-words">
|
6563
|
+
<xsl:param name="number"/>
|
6564
|
+
<xsl:param name="first"/>
|
6565
|
+
<xsl:if test="$number != ''">
|
6566
|
+
<xsl:variable name="words">
|
6567
|
+
<words>
|
6568
|
+
<word cardinal="1">One-</word>
|
6569
|
+
<word ordinal="1">First </word>
|
6570
|
+
<word cardinal="2">Two-</word>
|
6571
|
+
<word ordinal="2">Second </word>
|
6572
|
+
<word cardinal="3">Three-</word>
|
6573
|
+
<word ordinal="3">Third </word>
|
6574
|
+
<word cardinal="4">Four-</word>
|
6575
|
+
<word ordinal="4">Fourth </word>
|
6576
|
+
<word cardinal="5">Five-</word>
|
6577
|
+
<word ordinal="5">Fifth </word>
|
6578
|
+
<word cardinal="6">Six-</word>
|
6579
|
+
<word ordinal="6">Sixth </word>
|
6580
|
+
<word cardinal="7">Seven-</word>
|
6581
|
+
<word ordinal="7">Seventh </word>
|
6582
|
+
<word cardinal="8">Eight-</word>
|
6583
|
+
<word ordinal="8">Eighth </word>
|
6584
|
+
<word cardinal="9">Nine-</word>
|
6585
|
+
<word ordinal="9">Ninth </word>
|
6586
|
+
<word ordinal="10">Tenth </word>
|
6587
|
+
<word ordinal="11">Eleventh </word>
|
6588
|
+
<word ordinal="12">Twelfth </word>
|
6589
|
+
<word ordinal="13">Thirteenth </word>
|
6590
|
+
<word ordinal="14">Fourteenth </word>
|
6591
|
+
<word ordinal="15">Fifteenth </word>
|
6592
|
+
<word ordinal="16">Sixteenth </word>
|
6593
|
+
<word ordinal="17">Seventeenth </word>
|
6594
|
+
<word ordinal="18">Eighteenth </word>
|
6595
|
+
<word ordinal="19">Nineteenth </word>
|
6596
|
+
<word cardinal="20">Twenty-</word>
|
6597
|
+
<word ordinal="20">Twentieth </word>
|
6598
|
+
<word cardinal="30">Thirty-</word>
|
6599
|
+
<word ordinal="30">Thirtieth </word>
|
6600
|
+
<word cardinal="40">Forty-</word>
|
6601
|
+
<word ordinal="40">Fortieth </word>
|
6602
|
+
<word cardinal="50">Fifty-</word>
|
6603
|
+
<word ordinal="50">Fiftieth </word>
|
6604
|
+
<word cardinal="60">Sixty-</word>
|
6605
|
+
<word ordinal="60">Sixtieth </word>
|
6606
|
+
<word cardinal="70">Seventy-</word>
|
6607
|
+
<word ordinal="70">Seventieth </word>
|
6608
|
+
<word cardinal="80">Eighty-</word>
|
6609
|
+
<word ordinal="80">Eightieth </word>
|
6610
|
+
<word cardinal="90">Ninety-</word>
|
6611
|
+
<word ordinal="90">Ninetieth </word>
|
6612
|
+
<word cardinal="100">Hundred-</word>
|
6613
|
+
<word ordinal="100">Hundredth </word>
|
6614
|
+
</words>
|
6615
|
+
</xsl:variable>
|
6616
|
+
|
6617
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6618
|
+
|
6619
|
+
<xsl:variable name="value">
|
6620
|
+
<xsl:choose>
|
6621
|
+
<xsl:when test="$ordinal != ''">
|
6622
|
+
<xsl:value-of select="$ordinal"/>
|
6623
|
+
</xsl:when>
|
6624
|
+
<xsl:otherwise>
|
6625
|
+
<xsl:choose>
|
6626
|
+
<xsl:when test="$number < 100">
|
6627
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6628
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6629
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6630
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6631
|
+
</xsl:when>
|
6632
|
+
<xsl:otherwise>
|
6633
|
+
<!-- more 100 -->
|
6634
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6635
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6636
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6637
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6638
|
+
<xsl:call-template name="number-to-words">
|
6639
|
+
<xsl:with-param name="number" select="$digits"/>
|
6640
|
+
</xsl:call-template>
|
6641
|
+
</xsl:otherwise>
|
6642
|
+
</xsl:choose>
|
6643
|
+
</xsl:otherwise>
|
6644
|
+
</xsl:choose>
|
6645
|
+
</xsl:variable>
|
6646
|
+
<xsl:choose>
|
6647
|
+
<xsl:when test="$first = 'true'">
|
6648
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6649
|
+
<xsl:call-template name="capitalize">
|
6650
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6651
|
+
</xsl:call-template>
|
6652
|
+
</xsl:when>
|
6653
|
+
<xsl:otherwise>
|
6654
|
+
<xsl:value-of select="$value"/>
|
6655
|
+
</xsl:otherwise>
|
6656
|
+
</xsl:choose>
|
6657
|
+
</xsl:if>
|
6148
6658
|
</xsl:template></xsl:stylesheet>
|