metanorma-itu 1.3.3 → 1.3.7
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/.hound.yml +3 -1
- data/.rubocop.yml +4 -6
- data/lib/asciidoctor/itu/isodoc.rng +65 -7
- data/lib/asciidoctor/itu/itu.rng +3 -0
- data/lib/isodoc/itu/i18n-ar.yaml +1 -1
- data/lib/isodoc/itu/itu.implementers-guide.xsl +534 -66
- data/lib/isodoc/itu/itu.in-force.xsl +534 -66
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +534 -66
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +534 -66
- data/lib/isodoc/itu/itu.recommendation.xsl +534 -66
- data/lib/isodoc/itu/itu.resolution.xsl +534 -66
- data/lib/isodoc/itu/itu.technical-paper.xsl +534 -66
- data/lib/isodoc/itu/itu.technical-report.xsl +534 -66
- data/lib/isodoc/itu/ref.rb +15 -9
- data/lib/isodoc/itu/xref.rb +42 -117
- data/lib/isodoc/itu/xref_section.rb +109 -0
- data/lib/metanorma/itu/version.rb +1 -1
- data/metanorma-itu.gemspec +3 -3
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ca33e71c52b4abfd8da601d6a7138fee1b2f9f8635fd6c2f59873dbdce25874
|
4
|
+
data.tar.gz: 8300592013092cffc941fa2c391cab8d26186c54ca76534a50009c88a469a9d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae3b8e20958c4af55882f7042f7501d89a78435262beff085b445879eccc4fcff6124bb56c70761b68d355147ae016d4e2f1d99218e9db54efb5c161ebcc2f19
|
7
|
+
data.tar.gz: 8beff7d2981d2403465f2304520dea41883ed868947e5ed42b5cc86a844c8be77845dd0ef16bb9ee073f963770db742b6a8d47d67339650dcac60f039d5cea6c
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
@@ -40,3 +30,14 @@ jobs:
|
|
40
30
|
bundler-cache: true
|
41
31
|
|
42
32
|
- run: bundle exec rake
|
33
|
+
|
34
|
+
tests-passed:
|
35
|
+
needs: rake
|
36
|
+
runs-on: ubuntu-latest
|
37
|
+
steps:
|
38
|
+
- uses: peter-evans/repository-dispatch@v1
|
39
|
+
with:
|
40
|
+
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
41
|
+
repository: ${{ github.repository }}
|
42
|
+
event-type: tests-passed
|
43
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
-
#
|
2
|
-
# https://github.com/
|
3
|
-
# All project-specific additions and overrides should be specified in this file.
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
4
3
|
inherit_from:
|
5
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
6
5
|
|
7
6
|
# local repo-specific modifications
|
7
|
+
# ...
|
8
8
|
|
9
9
|
AllCops:
|
10
|
-
|
11
|
-
StyleGuideCopsOnly: false
|
12
|
-
TargetRubyVersion: 2.4
|
10
|
+
TargetRubyVersion: 2.5
|
@@ -45,6 +45,11 @@
|
|
45
45
|
<optional>
|
46
46
|
<attribute name="alt"/>
|
47
47
|
</optional>
|
48
|
+
<optional>
|
49
|
+
<attribute name="updatetype">
|
50
|
+
<data type="boolean"/>
|
51
|
+
</attribute>
|
52
|
+
</optional>
|
48
53
|
<text/>
|
49
54
|
</element>
|
50
55
|
</define>
|
@@ -199,6 +204,18 @@
|
|
199
204
|
</zeroOrMore>
|
200
205
|
</element>
|
201
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>
|
202
219
|
<define name="example">
|
203
220
|
<element name="example">
|
204
221
|
<attribute name="id">
|
@@ -543,6 +560,9 @@
|
|
543
560
|
</define>
|
544
561
|
<define name="BibDataExtensionType">
|
545
562
|
<ref name="doctype"/>
|
563
|
+
<optional>
|
564
|
+
<ref name="docsubtype"/>
|
565
|
+
</optional>
|
546
566
|
<optional>
|
547
567
|
<ref name="editorialgroup"/>
|
548
568
|
</optional>
|
@@ -890,6 +910,14 @@
|
|
890
910
|
</define>
|
891
911
|
</include>
|
892
912
|
<!-- end overrides -->
|
913
|
+
<define name="docsubtype">
|
914
|
+
<element name="subdoctype">
|
915
|
+
<ref name="DocumentSubtype"/>
|
916
|
+
</element>
|
917
|
+
</define>
|
918
|
+
<define name="DocumentSubtype">
|
919
|
+
<text/>
|
920
|
+
</define>
|
893
921
|
<define name="colgroup">
|
894
922
|
<element name="colgroup">
|
895
923
|
<oneOrMore>
|
@@ -939,7 +967,34 @@
|
|
939
967
|
<define name="concept">
|
940
968
|
<element name="concept">
|
941
969
|
<optional>
|
942
|
-
<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>
|
943
998
|
</optional>
|
944
999
|
<choice>
|
945
1000
|
<ref name="eref"/>
|
@@ -965,6 +1020,9 @@
|
|
965
1020
|
</attribute>
|
966
1021
|
<attribute name="name"/>
|
967
1022
|
<attribute name="action"/>
|
1023
|
+
<optional>
|
1024
|
+
<attribute name="class"/>
|
1025
|
+
</optional>
|
968
1026
|
<zeroOrMore>
|
969
1027
|
<choice>
|
970
1028
|
<ref name="TextElement"/>
|
@@ -1457,26 +1515,26 @@
|
|
1457
1515
|
<optional>
|
1458
1516
|
<ref name="section-title"/>
|
1459
1517
|
</optional>
|
1460
|
-
<
|
1518
|
+
<choice>
|
1461
1519
|
<choice>
|
1462
1520
|
<group>
|
1463
|
-
<
|
1521
|
+
<oneOrMore>
|
1464
1522
|
<ref name="BasicBlock"/>
|
1465
|
-
</
|
1523
|
+
</oneOrMore>
|
1466
1524
|
<zeroOrMore>
|
1467
1525
|
<ref name="note"/>
|
1468
1526
|
</zeroOrMore>
|
1469
1527
|
</group>
|
1470
1528
|
<ref name="amend"/>
|
1471
1529
|
</choice>
|
1472
|
-
<
|
1530
|
+
<oneOrMore>
|
1473
1531
|
<choice>
|
1474
1532
|
<ref name="clause-subsection"/>
|
1475
1533
|
<ref name="terms"/>
|
1476
1534
|
<ref name="definitions"/>
|
1477
1535
|
</choice>
|
1478
|
-
</
|
1479
|
-
</
|
1536
|
+
</oneOrMore>
|
1537
|
+
</choice>
|
1480
1538
|
</define>
|
1481
1539
|
<define name="Annex-Section">
|
1482
1540
|
<optional>
|
data/lib/asciidoctor/itu/itu.rng
CHANGED
data/lib/isodoc/itu/i18n-ar.yaml
CHANGED
@@ -22,7 +22,7 @@ annex_subclause: فقرة
|
|
22
22
|
in: في
|
23
23
|
to: إلى
|
24
24
|
where: حيث,
|
25
|
-
blankclause:
|
25
|
+
blankclause: تم ترك هذا الشرط فارغًا عمدًا
|
26
26
|
norm_with_refs_pref: تتضمن التوصيات التالية لقطاع تقييس الاتصالات وغيرها من المراجع أحكاماً تشكل من خلال الإشارة إليها في هذا النص جزءاً لا يتجزأ من هذه التوصية. وقدكانت جميع الطبعات المذكورة سارية الصلاحية في وقت النشر. ولماكانت جميع التوصيات والمراجع الأخرى تخضع للمراجعة، نحث جميع المستعملين لهذه التوصية على السعي إلى تطبيق أحدث طبعة للتوصيات والمراجع الواردة أدناه. وتُنشر بانتظام قائمة توصيات قطاع تقييس الاتصالات السارية الصلاحية. والإشارة إلى وثيقة في هذه التوصية لا يضفي على الوثيقة في حد ذاتها صفة التوصية.
|
27
27
|
internal_termsdef: مصطلحات معّرفة في هذه التوصية
|
28
28
|
external_termsdef: المصطلحات المعَّرفة في وثائق أخرى
|
@@ -14,8 +14,12 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
<xsl:variable name="debug">false</xsl:variable>
|
17
|
-
<xsl:variable name="pageWidth" select="
|
18
|
-
<xsl:variable name="pageHeight" select="
|
17
|
+
<xsl:variable name="pageWidth" select="210"/>
|
18
|
+
<xsl:variable name="pageHeight" select="297"/>
|
19
|
+
<xsl:variable name="marginLeftRight1" select="20"/>
|
20
|
+
<xsl:variable name="marginLeftRight2" select="20"/>
|
21
|
+
<xsl:variable name="marginTop" select="20"/>
|
22
|
+
<xsl:variable name="marginBottom" select="20"/>
|
19
23
|
|
20
24
|
<!-- Rec. ITU-T G.650.1 (03/2018) -->
|
21
25
|
<xsl:variable name="footerprefix" select="'Rec. '"/>
|
@@ -133,7 +137,7 @@
|
|
133
137
|
|
134
138
|
|
135
139
|
<!-- Technical Report first page -->
|
136
|
-
<fo:simple-page-master master-name="TR-first-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
140
|
+
<fo:simple-page-master master-name="TR-first-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
137
141
|
<fo:region-body margin-top="21.6mm" margin-bottom="25.4mm" margin-left="20.1mm" margin-right="22.6mm"/>
|
138
142
|
<fo:region-before region-name="TR-first-page-header" extent="21.6mm" display-align="center"/>
|
139
143
|
<fo:region-after region-name="TR-first-page-footer" extent="25.4mm" display-align="center"/>
|
@@ -142,7 +146,7 @@
|
|
142
146
|
</fo:simple-page-master>
|
143
147
|
|
144
148
|
<!-- cover page -->
|
145
|
-
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
149
|
+
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
146
150
|
<fo:region-body margin-top="19.2mm" margin-bottom="5mm" margin-left="19.2mm" margin-right="19.2mm"/>
|
147
151
|
<fo:region-before region-name="cover-page-header" extent="19.2mm" display-align="center"/>
|
148
152
|
<fo:region-after/>
|
@@ -151,7 +155,7 @@
|
|
151
155
|
</fo:simple-page-master>
|
152
156
|
<!-- contents pages -->
|
153
157
|
<!-- odd pages Preface -->
|
154
|
-
<fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
158
|
+
<fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
155
159
|
<fo:region-body margin-top="19.2mm" margin-bottom="19.2mm" margin-left="19.2mm" margin-right="19.2mm"/>
|
156
160
|
<fo:region-before region-name="header-odd" extent="19.2mm" display-align="center"/>
|
157
161
|
<fo:region-after region-name="footer-odd" extent="19.2mm"/>
|
@@ -159,7 +163,7 @@
|
|
159
163
|
<fo:region-end region-name="right-region" extent="19.2mm"/>
|
160
164
|
</fo:simple-page-master>
|
161
165
|
<!-- even pages Preface -->
|
162
|
-
<fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
166
|
+
<fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
163
167
|
<fo:region-body margin-top="19.2mm" margin-bottom="19.2mm" margin-left="19.2mm" margin-right="19.2mm"/>
|
164
168
|
<fo:region-before region-name="header-even" extent="19.2mm" display-align="center"/>
|
165
169
|
<fo:region-after region-name="footer-even" extent="19.2mm"/>
|
@@ -173,20 +177,20 @@
|
|
173
177
|
</fo:repeatable-page-master-alternatives>
|
174
178
|
</fo:page-sequence-master>
|
175
179
|
<!-- odd pages Body -->
|
176
|
-
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
177
|
-
<fo:region-body margin-top="
|
178
|
-
<fo:region-before region-name="header-odd" extent="
|
179
|
-
<fo:region-after region-name="footer-odd" extent="
|
180
|
-
<fo:region-start region-name="left-region" extent="
|
181
|
-
<fo:region-end region-name="right-region" extent="
|
180
|
+
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
181
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
182
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm" display-align="center"/>
|
183
|
+
<fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
|
184
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
185
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
182
186
|
</fo:simple-page-master>
|
183
187
|
<!-- even pages Body -->
|
184
|
-
<fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
185
|
-
<fo:region-body margin-top="
|
186
|
-
<fo:region-before region-name="header-even" extent="
|
187
|
-
<fo:region-after region-name="footer-even" extent="
|
188
|
-
<fo:region-start region-name="left-region" extent="
|
189
|
-
<fo:region-end region-name="right-region" extent="
|
188
|
+
<fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
189
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
190
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm" display-align="center"/>
|
191
|
+
<fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
|
192
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
193
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
190
194
|
</fo:simple-page-master>
|
191
195
|
<fo:page-sequence-master master-name="document">
|
192
196
|
<fo:repeatable-page-master-alternatives>
|
@@ -2096,6 +2100,7 @@
|
|
2096
2100
|
|
2097
2101
|
|
2098
2102
|
|
2103
|
+
|
2099
2104
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
2100
2105
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
2101
2106
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -2141,7 +2146,7 @@
|
|
2141
2146
|
|
2142
2147
|
|
2143
2148
|
|
2144
|
-
|
2149
|
+
|
2145
2150
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
2146
2151
|
|
2147
2152
|
|
@@ -2157,6 +2162,7 @@
|
|
2157
2162
|
|
2158
2163
|
|
2159
2164
|
|
2165
|
+
|
2160
2166
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
2161
2167
|
|
2162
2168
|
|
@@ -2175,9 +2181,7 @@
|
|
2175
2181
|
|
2176
2182
|
|
2177
2183
|
|
2178
|
-
|
2179
|
-
|
2180
|
-
|
2184
|
+
|
2181
2185
|
|
2182
2186
|
|
2183
2187
|
|
@@ -2206,6 +2210,7 @@
|
|
2206
2210
|
|
2207
2211
|
|
2208
2212
|
|
2213
|
+
|
2209
2214
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
2210
2215
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2211
2216
|
|
@@ -2225,6 +2230,9 @@
|
|
2225
2230
|
|
2226
2231
|
|
2227
2232
|
|
2233
|
+
|
2234
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
2235
|
+
|
2228
2236
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2229
2237
|
|
2230
2238
|
|
@@ -2241,14 +2249,17 @@
|
|
2241
2249
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2242
2250
|
|
2243
2251
|
|
2252
|
+
|
2244
2253
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
2245
2254
|
|
2246
2255
|
|
2256
|
+
|
2247
2257
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2248
2258
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2249
2259
|
|
2250
2260
|
|
2251
2261
|
|
2262
|
+
|
2252
2263
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2253
2264
|
|
2254
2265
|
|
@@ -2269,6 +2280,7 @@
|
|
2269
2280
|
|
2270
2281
|
|
2271
2282
|
|
2283
|
+
|
2272
2284
|
</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">
|
2273
2285
|
|
2274
2286
|
|
@@ -2309,10 +2321,12 @@
|
|
2309
2321
|
<xsl:attribute name="margin-top">4pt</xsl:attribute>
|
2310
2322
|
|
2311
2323
|
|
2324
|
+
|
2312
2325
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
2313
2326
|
|
2314
2327
|
|
2315
2328
|
|
2329
|
+
|
2316
2330
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2317
2331
|
|
2318
2332
|
|
@@ -2338,10 +2352,12 @@
|
|
2338
2352
|
|
2339
2353
|
|
2340
2354
|
|
2355
|
+
|
2341
2356
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
2342
2357
|
|
2343
2358
|
|
2344
2359
|
|
2360
|
+
|
2345
2361
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
2346
2362
|
|
2347
2363
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
@@ -2366,6 +2382,7 @@
|
|
2366
2382
|
|
2367
2383
|
|
2368
2384
|
|
2385
|
+
|
2369
2386
|
|
2370
2387
|
|
2371
2388
|
|
@@ -2417,8 +2434,10 @@
|
|
2417
2434
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
2418
2435
|
|
2419
2436
|
|
2437
|
+
|
2420
2438
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
2421
2439
|
|
2440
|
+
|
2422
2441
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
2423
2442
|
|
2424
2443
|
|
@@ -2443,6 +2462,8 @@
|
|
2443
2462
|
|
2444
2463
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
2445
2464
|
|
2465
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
2466
|
+
|
2446
2467
|
</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">
|
2447
2468
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2448
2469
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -2453,14 +2474,15 @@
|
|
2453
2474
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2454
2475
|
|
2455
2476
|
<!-- Normative references -->
|
2456
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2477
|
+
<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"/>
|
2457
2478
|
<!-- Terms and definitions -->
|
2458
2479
|
<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"/>
|
2459
2480
|
<!-- Another main sections -->
|
2460
2481
|
<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"/>
|
2461
2482
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
2462
2483
|
<!-- Bibliography -->
|
2463
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2484
|
+
<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"/>
|
2485
|
+
|
2464
2486
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2465
2487
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2466
2488
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -2490,7 +2512,7 @@
|
|
2490
2512
|
|
2491
2513
|
<xsl:variable name="table-preamble">
|
2492
2514
|
|
2493
|
-
<fo:block space-before="18pt"> </fo:block>
|
2515
|
+
<fo:block space-before="18pt"> </fo:block>
|
2494
2516
|
|
2495
2517
|
|
2496
2518
|
</xsl:variable>
|
@@ -2498,11 +2520,11 @@
|
|
2498
2520
|
<xsl:variable name="table">
|
2499
2521
|
|
2500
2522
|
<xsl:variable name="simple-table">
|
2501
|
-
<xsl:call-template name="getSimpleTable"/>
|
2523
|
+
<xsl:call-template name="getSimpleTable"/>
|
2502
2524
|
</xsl:variable>
|
2503
2525
|
|
2504
2526
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2505
|
-
<fo:block> </fo:block>
|
2527
|
+
<fo:block> </fo:block>
|
2506
2528
|
</xsl:if> -->
|
2507
2529
|
|
2508
2530
|
<!-- $namespace = 'iso' or -->
|
@@ -2615,6 +2637,7 @@
|
|
2615
2637
|
|
2616
2638
|
|
2617
2639
|
|
2640
|
+
|
2618
2641
|
</xsl:variable>
|
2619
2642
|
|
2620
2643
|
|
@@ -2756,6 +2779,9 @@
|
|
2756
2779
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
2757
2780
|
|
2758
2781
|
|
2782
|
+
|
2783
|
+
|
2784
|
+
|
2759
2785
|
<xsl:choose>
|
2760
2786
|
<xsl:when test="$continued = 'true'">
|
2761
2787
|
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
@@ -2903,6 +2929,7 @@
|
|
2903
2929
|
<!-- font-weight="bold" -->
|
2904
2930
|
<fo:table-header>
|
2905
2931
|
|
2932
|
+
|
2906
2933
|
<xsl:apply-templates/>
|
2907
2934
|
</fo:table-header>
|
2908
2935
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -3057,6 +3084,7 @@
|
|
3057
3084
|
|
3058
3085
|
|
3059
3086
|
|
3087
|
+
|
3060
3088
|
<xsl:if test="ancestor::*[local-name()='preface']">
|
3061
3089
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
3062
3090
|
</xsl:if>
|
@@ -3069,6 +3097,10 @@
|
|
3069
3097
|
|
3070
3098
|
|
3071
3099
|
|
3100
|
+
|
3101
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3102
|
+
|
3103
|
+
|
3072
3104
|
<!-- except gb -->
|
3073
3105
|
|
3074
3106
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -3094,6 +3126,10 @@
|
|
3094
3126
|
<!-- fn processing -->
|
3095
3127
|
<xsl:call-template name="fn_display"/>
|
3096
3128
|
|
3129
|
+
|
3130
|
+
<!-- for PAS display Notes after footnotes -->
|
3131
|
+
|
3132
|
+
|
3097
3133
|
</fo:table-cell>
|
3098
3134
|
</fo:table-row>
|
3099
3135
|
</fo:table-body>
|
@@ -3151,11 +3187,16 @@
|
|
3151
3187
|
<xsl:if test="$parent-name = 'tfoot'">
|
3152
3188
|
|
3153
3189
|
|
3190
|
+
|
3154
3191
|
</xsl:if>
|
3155
3192
|
|
3156
3193
|
|
3157
3194
|
|
3158
3195
|
|
3196
|
+
|
3197
|
+
|
3198
|
+
|
3199
|
+
|
3159
3200
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3160
3201
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3161
3202
|
</xsl:if> -->
|
@@ -3189,6 +3230,7 @@
|
|
3189
3230
|
|
3190
3231
|
|
3191
3232
|
|
3233
|
+
|
3192
3234
|
<xsl:if test="$lang = 'ar'">
|
3193
3235
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3194
3236
|
</xsl:if>
|
@@ -3235,6 +3277,7 @@
|
|
3235
3277
|
|
3236
3278
|
|
3237
3279
|
|
3280
|
+
|
3238
3281
|
<xsl:if test="ancestor::*[local-name()='preface']">
|
3239
3282
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
3240
3283
|
</xsl:if>
|
@@ -3249,6 +3292,9 @@
|
|
3249
3292
|
|
3250
3293
|
|
3251
3294
|
|
3295
|
+
|
3296
|
+
|
3297
|
+
|
3252
3298
|
<xsl:if test=".//*[local-name() = 'table']">
|
3253
3299
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3254
3300
|
</xsl:if>
|
@@ -3278,8 +3324,14 @@
|
|
3278
3324
|
|
3279
3325
|
|
3280
3326
|
|
3327
|
+
|
3328
|
+
|
3329
|
+
<!-- Table's note name (NOTE, for example) -->
|
3330
|
+
|
3281
3331
|
<fo:inline padding-right="2mm">
|
3282
3332
|
|
3333
|
+
|
3334
|
+
|
3283
3335
|
|
3284
3336
|
|
3285
3337
|
|
@@ -3287,6 +3339,8 @@
|
|
3287
3339
|
|
3288
3340
|
</fo:inline>
|
3289
3341
|
|
3342
|
+
|
3343
|
+
|
3290
3344
|
<xsl:apply-templates mode="process"/>
|
3291
3345
|
</fo:block>
|
3292
3346
|
|
@@ -3310,6 +3364,8 @@
|
|
3310
3364
|
<xsl:variable name="reference" select="@reference"/>
|
3311
3365
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3312
3366
|
<fo:block margin-bottom="12pt">
|
3367
|
+
|
3368
|
+
|
3313
3369
|
|
3314
3370
|
|
3315
3371
|
|
@@ -3328,6 +3384,7 @@
|
|
3328
3384
|
|
3329
3385
|
|
3330
3386
|
|
3387
|
+
|
3331
3388
|
<xsl:attribute name="padding-right">3mm</xsl:attribute>
|
3332
3389
|
<xsl:attribute name="font-size">70%</xsl:attribute>
|
3333
3390
|
|
@@ -3340,6 +3397,7 @@
|
|
3340
3397
|
<xsl:text>)</xsl:text>
|
3341
3398
|
<!-- </xsl:if> -->
|
3342
3399
|
|
3400
|
+
|
3343
3401
|
</fo:inline>
|
3344
3402
|
<fo:inline>
|
3345
3403
|
|
@@ -3478,16 +3536,21 @@
|
|
3478
3536
|
|
3479
3537
|
|
3480
3538
|
|
3539
|
+
|
3540
|
+
|
3541
|
+
|
3481
3542
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
3482
3543
|
<xsl:attribute name="color">blue</xsl:attribute>
|
3483
3544
|
|
3484
3545
|
|
3485
3546
|
|
3547
|
+
|
3486
3548
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
3487
3549
|
|
3488
3550
|
|
3489
3551
|
<xsl:value-of select="@reference"/>
|
3490
3552
|
|
3553
|
+
|
3491
3554
|
</fo:basic-link>
|
3492
3555
|
</fo:inline>
|
3493
3556
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3576,6 +3639,7 @@
|
|
3576
3639
|
|
3577
3640
|
|
3578
3641
|
|
3642
|
+
|
3579
3643
|
<xsl:variable name="title-key">
|
3580
3644
|
|
3581
3645
|
|
@@ -3793,6 +3857,7 @@
|
|
3793
3857
|
|
3794
3858
|
<fo:table-row>
|
3795
3859
|
|
3860
|
+
|
3796
3861
|
<fo:table-cell>
|
3797
3862
|
|
3798
3863
|
<xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
|
@@ -3816,6 +3881,7 @@
|
|
3816
3881
|
|
3817
3882
|
|
3818
3883
|
|
3884
|
+
|
3819
3885
|
<xsl:apply-templates/>
|
3820
3886
|
<!-- <xsl:if test="$namespace = 'gb'">
|
3821
3887
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -3874,6 +3940,8 @@
|
|
3874
3940
|
|
3875
3941
|
<xsl:apply-templates/>
|
3876
3942
|
</fo:inline>
|
3943
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
3944
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
3877
3945
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
3878
3946
|
<fo:inline font-size="80%" vertical-align="super">
|
3879
3947
|
<xsl:apply-templates/>
|
@@ -4363,9 +4431,27 @@
|
|
4363
4431
|
<xsl:copy>
|
4364
4432
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4365
4433
|
</xsl:copy>
|
4366
|
-
<
|
4434
|
+
<xsl:choose>
|
4435
|
+
<!-- if in msub, then don't add space -->
|
4436
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
4437
|
+
<!-- if next char in digit, don't add space -->
|
4438
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
4439
|
+
<xsl:otherwise>
|
4440
|
+
<mathml:mspace width="0.5ex"/>
|
4441
|
+
</xsl:otherwise>
|
4442
|
+
</xsl:choose>
|
4367
4443
|
</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">
|
4368
4444
|
<xsl:variable name="target">
|
4445
|
+
<xsl:choose>
|
4446
|
+
<xsl:when test="@updatetype = 'true'">
|
4447
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
4448
|
+
</xsl:when>
|
4449
|
+
<xsl:otherwise>
|
4450
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
4451
|
+
</xsl:otherwise>
|
4452
|
+
</xsl:choose>
|
4453
|
+
</xsl:variable>
|
4454
|
+
<xsl:variable name="target_text">
|
4369
4455
|
<xsl:choose>
|
4370
4456
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
4371
4457
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -4377,20 +4463,22 @@
|
|
4377
4463
|
</xsl:variable>
|
4378
4464
|
<fo:inline xsl:use-attribute-sets="link-style">
|
4379
4465
|
|
4466
|
+
|
4467
|
+
|
4380
4468
|
<xsl:choose>
|
4381
|
-
<xsl:when test="$
|
4469
|
+
<xsl:when test="$target_text = ''">
|
4382
4470
|
<xsl:apply-templates/>
|
4383
4471
|
</xsl:when>
|
4384
4472
|
<xsl:otherwise>
|
4385
|
-
<fo:basic-link external-destination="{
|
4473
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
4386
4474
|
<xsl:choose>
|
4387
4475
|
<xsl:when test="normalize-space(.) = ''">
|
4388
|
-
<!-- <xsl:value-of select="$target"/> -->
|
4389
4476
|
<xsl:call-template name="add-zero-spaces-link-java">
|
4390
|
-
<xsl:with-param name="text" select="$
|
4477
|
+
<xsl:with-param name="text" select="$target_text"/>
|
4391
4478
|
</xsl:call-template>
|
4392
4479
|
</xsl:when>
|
4393
4480
|
<xsl:otherwise>
|
4481
|
+
<!-- output text from <link>text</link> -->
|
4394
4482
|
<xsl:apply-templates/>
|
4395
4483
|
</xsl:otherwise>
|
4396
4484
|
</xsl:choose>
|
@@ -4485,6 +4573,7 @@
|
|
4485
4573
|
|
4486
4574
|
|
4487
4575
|
|
4576
|
+
|
4488
4577
|
<fo:block-container margin-left="0mm">
|
4489
4578
|
|
4490
4579
|
|
@@ -4532,6 +4621,7 @@
|
|
4532
4621
|
</xsl:choose>
|
4533
4622
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
4534
4623
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
4624
|
+
|
4535
4625
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4536
4626
|
|
4537
4627
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
@@ -4609,6 +4699,7 @@
|
|
4609
4699
|
</xsl:call-template>
|
4610
4700
|
|
4611
4701
|
<fo:block>
|
4702
|
+
|
4612
4703
|
<xsl:apply-templates/>
|
4613
4704
|
</fo:block>
|
4614
4705
|
<xsl:call-template name="fn_display_figure"/>
|
@@ -4731,6 +4822,234 @@
|
|
4731
4822
|
<xsl:param name="height"/>
|
4732
4823
|
<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; "/>
|
4733
4824
|
<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; "/>
|
4825
|
+
</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">
|
4826
|
+
<xsl:param name="name"/>
|
4827
|
+
|
4828
|
+
<xsl:variable name="svg_content">
|
4829
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
4830
|
+
</xsl:variable>
|
4831
|
+
|
4832
|
+
<xsl:variable name="alt-text">
|
4833
|
+
<xsl:choose>
|
4834
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
4835
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
4836
|
+
</xsl:when>
|
4837
|
+
<xsl:when test="normalize-space($name) != ''">
|
4838
|
+
<xsl:value-of select="$name"/>
|
4839
|
+
</xsl:when>
|
4840
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
4841
|
+
</xsl:choose>
|
4842
|
+
</xsl:variable>
|
4843
|
+
|
4844
|
+
<xsl:choose>
|
4845
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
4846
|
+
<fo:block>
|
4847
|
+
<xsl:variable name="width" select="@width"/>
|
4848
|
+
<xsl:variable name="height" select="@height"/>
|
4849
|
+
|
4850
|
+
<xsl:variable name="scale_x">
|
4851
|
+
<xsl:choose>
|
4852
|
+
<xsl:when test="$width > $width_effective_px">
|
4853
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
4854
|
+
</xsl:when>
|
4855
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4856
|
+
</xsl:choose>
|
4857
|
+
</xsl:variable>
|
4858
|
+
|
4859
|
+
<xsl:variable name="scale_y">
|
4860
|
+
<xsl:choose>
|
4861
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
4862
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
4863
|
+
</xsl:when>
|
4864
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4865
|
+
</xsl:choose>
|
4866
|
+
</xsl:variable>
|
4867
|
+
|
4868
|
+
<xsl:variable name="scale">
|
4869
|
+
<xsl:choose>
|
4870
|
+
<xsl:when test="$scale_y != 1">
|
4871
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
4872
|
+
</xsl:when>
|
4873
|
+
<xsl:otherwise>
|
4874
|
+
<xsl:value-of select="$scale_x"/>
|
4875
|
+
</xsl:otherwise>
|
4876
|
+
</xsl:choose>
|
4877
|
+
</xsl:variable>
|
4878
|
+
|
4879
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
4880
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
4881
|
+
|
4882
|
+
<fo:table table-layout="fixed" width="100%">
|
4883
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
4884
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
4885
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
4886
|
+
<fo:table-body>
|
4887
|
+
<fo:table-row>
|
4888
|
+
<fo:table-cell column-number="2">
|
4889
|
+
<fo:block>
|
4890
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
4891
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
4892
|
+
<fo:block line-height="0" font-size="0">
|
4893
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
4894
|
+
<xsl:call-template name="bookmark"/>
|
4895
|
+
</xsl:for-each>
|
4896
|
+
</fo:block>
|
4897
|
+
</xsl:if>
|
4898
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
4899
|
+
|
4900
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
4901
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
4902
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4903
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4904
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4905
|
+
|
4906
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
4907
|
+
</fo:instream-foreign-object>
|
4908
|
+
</fo:block>
|
4909
|
+
|
4910
|
+
<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">
|
4911
|
+
<xsl:with-param name="scale" select="$scale"/>
|
4912
|
+
</xsl:apply-templates>
|
4913
|
+
</fo:block-container>
|
4914
|
+
</fo:block>
|
4915
|
+
</fo:table-cell>
|
4916
|
+
</fo:table-row>
|
4917
|
+
</fo:table-body>
|
4918
|
+
</fo:table>
|
4919
|
+
</fo:block>
|
4920
|
+
|
4921
|
+
</xsl:when>
|
4922
|
+
<xsl:otherwise>
|
4923
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
4924
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
4925
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
4926
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4927
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4928
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
4929
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
4930
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
4931
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
4932
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
4933
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
4934
|
+
</xsl:if>
|
4935
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4936
|
+
<xsl:copy-of select="$svg_content"/>
|
4937
|
+
</fo:instream-foreign-object>
|
4938
|
+
</fo:block>
|
4939
|
+
</xsl:otherwise>
|
4940
|
+
</xsl:choose>
|
4941
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
4942
|
+
<xsl:copy>
|
4943
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
4944
|
+
</xsl:copy>
|
4945
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
4946
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
4947
|
+
<xsl:value-of select="."/>
|
4948
|
+
</xsl:attribute>
|
4949
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
4950
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
4951
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
4952
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
4953
|
+
<xsl:call-template name="image_svg">
|
4954
|
+
<xsl:with-param name="name" select="$name"/>
|
4955
|
+
</xsl:call-template>
|
4956
|
+
</xsl:for-each>
|
4957
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
4958
|
+
<xsl:copy>
|
4959
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
4960
|
+
</xsl:copy>
|
4961
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
4962
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
4963
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
4964
|
+
<xsl:param name="scale"/>
|
4965
|
+
<xsl:variable name="dest">
|
4966
|
+
<xsl:choose>
|
4967
|
+
<xsl:when test="starts-with(@href, '#')">
|
4968
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
4969
|
+
</xsl:when>
|
4970
|
+
<xsl:otherwise>
|
4971
|
+
<xsl:value-of select="@href"/>
|
4972
|
+
</xsl:otherwise>
|
4973
|
+
</xsl:choose>
|
4974
|
+
</xsl:variable>
|
4975
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
4976
|
+
<xsl:call-template name="insertSVGMapLink">
|
4977
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
4978
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
4979
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
4980
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
4981
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4982
|
+
</xsl:call-template>
|
4983
|
+
</xsl:for-each>
|
4984
|
+
|
4985
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
4986
|
+
<xsl:variable name="points">
|
4987
|
+
<xsl:call-template name="split">
|
4988
|
+
<xsl:with-param name="pText" select="@points"/>
|
4989
|
+
</xsl:call-template>
|
4990
|
+
</xsl:variable>
|
4991
|
+
<xsl:variable name="x_coords">
|
4992
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
4993
|
+
<xsl:sort select="." data-type="number"/>
|
4994
|
+
<x><xsl:value-of select="."/></x>
|
4995
|
+
</xsl:for-each>
|
4996
|
+
</xsl:variable>
|
4997
|
+
<xsl:variable name="y_coords">
|
4998
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
4999
|
+
<xsl:sort select="." data-type="number"/>
|
5000
|
+
<y><xsl:value-of select="."/></y>
|
5001
|
+
</xsl:for-each>
|
5002
|
+
</xsl:variable>
|
5003
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5004
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5005
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5006
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5007
|
+
<xsl:call-template name="insertSVGMapLink">
|
5008
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5009
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5010
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5011
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5012
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5013
|
+
</xsl:call-template>
|
5014
|
+
</xsl:for-each>
|
5015
|
+
|
5016
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5017
|
+
<xsl:call-template name="insertSVGMapLink">
|
5018
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5019
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5020
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5021
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5022
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5023
|
+
</xsl:call-template>
|
5024
|
+
</xsl:for-each>
|
5025
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5026
|
+
<xsl:call-template name="insertSVGMapLink">
|
5027
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5028
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5029
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5030
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5031
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5032
|
+
</xsl:call-template>
|
5033
|
+
</xsl:for-each>
|
5034
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5035
|
+
<xsl:param name="left"/>
|
5036
|
+
<xsl:param name="top"/>
|
5037
|
+
<xsl:param name="width"/>
|
5038
|
+
<xsl:param name="height"/>
|
5039
|
+
<xsl:param name="dest"/>
|
5040
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5041
|
+
<fo:block font-size="1pt">
|
5042
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5043
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5044
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5045
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5046
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5047
|
+
</xsl:if> -->
|
5048
|
+
<fo:block> </fo:block></fo:block-container>
|
5049
|
+
</fo:inline-container>
|
5050
|
+
</fo:basic-link>
|
5051
|
+
</fo:block>
|
5052
|
+
</fo:block-container>
|
4734
5053
|
</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">
|
4735
5054
|
<xsl:apply-templates mode="contents"/>
|
4736
5055
|
<xsl:text> </xsl:text>
|
@@ -4759,28 +5078,39 @@
|
|
4759
5078
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
4760
5079
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
4761
5080
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5081
|
+
<xsl:if test="@bundle = 'true'">
|
5082
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5083
|
+
</xsl:if>
|
4762
5084
|
<fo:bookmark-title>
|
4763
|
-
<xsl:variable name="bookmark-title_">
|
4764
|
-
<xsl:call-template name="getLangVersion">
|
4765
|
-
<xsl:with-param name="lang" select="@lang"/>
|
4766
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
4767
|
-
<xsl:with-param name="title" select="@title-part"/>
|
4768
|
-
</xsl:call-template>
|
4769
|
-
</xsl:variable>
|
4770
5085
|
<xsl:choose>
|
4771
|
-
<xsl:when test="normalize-space(
|
4772
|
-
<xsl:
|
4773
|
-
|
4774
|
-
|
5086
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5087
|
+
<xsl:variable name="bookmark-title_">
|
5088
|
+
<xsl:call-template name="getLangVersion">
|
5089
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5090
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5091
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5092
|
+
</xsl:call-template>
|
5093
|
+
</xsl:variable>
|
4775
5094
|
<xsl:choose>
|
4776
|
-
<xsl:when test="
|
4777
|
-
|
4778
|
-
|
4779
|
-
<xsl:otherwise
|
5095
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5096
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5097
|
+
</xsl:when>
|
5098
|
+
<xsl:otherwise>
|
5099
|
+
<xsl:choose>
|
5100
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5101
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5102
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5103
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5104
|
+
</xsl:choose>
|
5105
|
+
</xsl:otherwise>
|
4780
5106
|
</xsl:choose>
|
5107
|
+
</xsl:when>
|
5108
|
+
<xsl:otherwise>
|
5109
|
+
<xsl:value-of select="@title-part"/>
|
4781
5110
|
</xsl:otherwise>
|
4782
5111
|
</xsl:choose>
|
4783
5112
|
</fo:bookmark-title>
|
5113
|
+
|
4784
5114
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
4785
5115
|
|
4786
5116
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -4879,20 +5209,28 @@
|
|
4879
5209
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
4880
5210
|
</xsl:choose>
|
4881
5211
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
4882
|
-
<
|
4883
|
-
|
4884
|
-
|
4885
|
-
|
4886
|
-
<xsl:
|
4887
|
-
|
4888
|
-
|
4889
|
-
|
4890
|
-
|
4891
|
-
|
5212
|
+
<xsl:choose>
|
5213
|
+
<xsl:when test="@id != ''">
|
5214
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5215
|
+
<fo:bookmark-title>
|
5216
|
+
<xsl:if test="@section != ''">
|
5217
|
+
<xsl:value-of select="@section"/>
|
5218
|
+
<xsl:text> </xsl:text>
|
5219
|
+
</xsl:if>
|
5220
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5221
|
+
</fo:bookmark-title>
|
5222
|
+
<xsl:apply-templates mode="bookmark"/>
|
5223
|
+
</fo:bookmark>
|
5224
|
+
</xsl:when>
|
5225
|
+
<xsl:otherwise>
|
5226
|
+
<xsl:apply-templates mode="bookmark"/>
|
5227
|
+
</xsl:otherwise>
|
5228
|
+
</xsl:choose>
|
4892
5229
|
</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">
|
4893
5230
|
<xsl:if test="normalize-space() != ''">
|
4894
5231
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
4895
5232
|
|
5233
|
+
|
4896
5234
|
<xsl:apply-templates/>
|
4897
5235
|
</fo:block>
|
4898
5236
|
</xsl:if>
|
@@ -4972,6 +5310,8 @@
|
|
4972
5310
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
4973
5311
|
|
4974
5312
|
<fo:block-container margin-left="0mm">
|
5313
|
+
<xsl:copy-of select="@id"/>
|
5314
|
+
|
4975
5315
|
<xsl:if test="parent::*[local-name() = 'note']">
|
4976
5316
|
<xsl:attribute name="margin-left">
|
4977
5317
|
<xsl:choose>
|
@@ -4982,7 +5322,9 @@
|
|
4982
5322
|
|
4983
5323
|
</xsl:if>
|
4984
5324
|
<fo:block-container margin-left="0mm">
|
4985
|
-
|
5325
|
+
|
5326
|
+
|
5327
|
+
|
4986
5328
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4987
5329
|
<xsl:variable name="_font-size">
|
4988
5330
|
|
@@ -5011,10 +5353,14 @@
|
|
5011
5353
|
</xsl:choose>
|
5012
5354
|
</xsl:attribute>
|
5013
5355
|
</xsl:if>
|
5014
|
-
|
5015
|
-
|
5356
|
+
|
5357
|
+
<xsl:apply-templates/>
|
5358
|
+
</fo:block>
|
5359
|
+
|
5360
|
+
|
5016
5361
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5017
5362
|
|
5363
|
+
|
5018
5364
|
</fo:block-container>
|
5019
5365
|
</fo:block-container>
|
5020
5366
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5249,6 +5595,7 @@
|
|
5249
5595
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
5250
5596
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
5251
5597
|
|
5598
|
+
|
5252
5599
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5253
5600
|
|
5254
5601
|
<xsl:variable name="element">
|
@@ -5422,7 +5769,9 @@
|
|
5422
5769
|
|
5423
5770
|
|
5424
5771
|
</xsl:if>
|
5425
|
-
|
5772
|
+
|
5773
|
+
|
5774
|
+
|
5426
5775
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5427
5776
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5428
5777
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -5431,6 +5780,7 @@
|
|
5431
5780
|
|
5432
5781
|
|
5433
5782
|
|
5783
|
+
|
5434
5784
|
</xsl:if>
|
5435
5785
|
|
5436
5786
|
<xsl:apply-templates/>
|
@@ -5458,6 +5808,7 @@
|
|
5458
5808
|
|
5459
5809
|
|
5460
5810
|
|
5811
|
+
|
5461
5812
|
<xsl:choose>
|
5462
5813
|
<xsl:when test="$depth = 5">7</xsl:when>
|
5463
5814
|
<xsl:when test="$depth = 4">10</xsl:when>
|
@@ -5580,6 +5931,7 @@
|
|
5580
5931
|
<xsl:call-template name="setId"/>
|
5581
5932
|
|
5582
5933
|
|
5934
|
+
|
5583
5935
|
<xsl:if test="@inline-header='true'">
|
5584
5936
|
<xsl:attribute name="text-align">justify</xsl:attribute>
|
5585
5937
|
</xsl:if>
|
@@ -5830,17 +6182,17 @@
|
|
5830
6182
|
<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')]"/>
|
5831
6183
|
<xsl:choose>
|
5832
6184
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
5833
|
-
<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"/>
|
6185
|
+
<!-- <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"/>
|
5834
6186
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
5835
6187
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5836
|
-
</xsl:if>
|
6188
|
+
</xsl:if> -->
|
5837
6189
|
<xsl:value-of select="$_doc_ident"/>
|
5838
6190
|
</xsl:when>
|
5839
6191
|
<xsl:otherwise>
|
5840
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6192
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
5841
6193
|
<xsl:if test="$type != ''">
|
5842
6194
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5843
|
-
</xsl:if>
|
6195
|
+
</xsl:if> -->
|
5844
6196
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
5845
6197
|
</xsl:otherwise>
|
5846
6198
|
</xsl:choose>
|
@@ -6153,6 +6505,9 @@
|
|
6153
6505
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
6154
6506
|
<xsl:value-of select="$level_total - 1"/>
|
6155
6507
|
</xsl:when>
|
6508
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
6509
|
+
<xsl:value-of select="$level_total - 1"/>
|
6510
|
+
</xsl:when>
|
6156
6511
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
6157
6512
|
<xsl:value-of select="$level_total - 2"/>
|
6158
6513
|
</xsl:when>
|
@@ -6293,7 +6648,14 @@
|
|
6293
6648
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6294
6649
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6295
6650
|
</xsl:when>
|
6296
|
-
<xsl:otherwise
|
6651
|
+
<xsl:otherwise>
|
6652
|
+
<xsl:variable name="key_">
|
6653
|
+
<xsl:call-template name="capitalize">
|
6654
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
6655
|
+
</xsl:call-template>
|
6656
|
+
</xsl:variable>
|
6657
|
+
<xsl:value-of select="$key_"/>
|
6658
|
+
</xsl:otherwise>
|
6297
6659
|
</xsl:choose>
|
6298
6660
|
|
6299
6661
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
@@ -6336,4 +6698,110 @@
|
|
6336
6698
|
<xsl:value-of select="$align"/>
|
6337
6699
|
</xsl:when>
|
6338
6700
|
</xsl:choose>
|
6701
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
6702
|
+
<xsl:param name="default">left</xsl:param>
|
6703
|
+
<xsl:attribute name="text-align">
|
6704
|
+
<xsl:choose>
|
6705
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6706
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6707
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6708
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6709
|
+
</xsl:choose>
|
6710
|
+
</xsl:attribute>
|
6711
|
+
</xsl:template><xsl:template name="number-to-words">
|
6712
|
+
<xsl:param name="number"/>
|
6713
|
+
<xsl:param name="first"/>
|
6714
|
+
<xsl:if test="$number != ''">
|
6715
|
+
<xsl:variable name="words">
|
6716
|
+
<words>
|
6717
|
+
<word cardinal="1">One-</word>
|
6718
|
+
<word ordinal="1">First </word>
|
6719
|
+
<word cardinal="2">Two-</word>
|
6720
|
+
<word ordinal="2">Second </word>
|
6721
|
+
<word cardinal="3">Three-</word>
|
6722
|
+
<word ordinal="3">Third </word>
|
6723
|
+
<word cardinal="4">Four-</word>
|
6724
|
+
<word ordinal="4">Fourth </word>
|
6725
|
+
<word cardinal="5">Five-</word>
|
6726
|
+
<word ordinal="5">Fifth </word>
|
6727
|
+
<word cardinal="6">Six-</word>
|
6728
|
+
<word ordinal="6">Sixth </word>
|
6729
|
+
<word cardinal="7">Seven-</word>
|
6730
|
+
<word ordinal="7">Seventh </word>
|
6731
|
+
<word cardinal="8">Eight-</word>
|
6732
|
+
<word ordinal="8">Eighth </word>
|
6733
|
+
<word cardinal="9">Nine-</word>
|
6734
|
+
<word ordinal="9">Ninth </word>
|
6735
|
+
<word ordinal="10">Tenth </word>
|
6736
|
+
<word ordinal="11">Eleventh </word>
|
6737
|
+
<word ordinal="12">Twelfth </word>
|
6738
|
+
<word ordinal="13">Thirteenth </word>
|
6739
|
+
<word ordinal="14">Fourteenth </word>
|
6740
|
+
<word ordinal="15">Fifteenth </word>
|
6741
|
+
<word ordinal="16">Sixteenth </word>
|
6742
|
+
<word ordinal="17">Seventeenth </word>
|
6743
|
+
<word ordinal="18">Eighteenth </word>
|
6744
|
+
<word ordinal="19">Nineteenth </word>
|
6745
|
+
<word cardinal="20">Twenty-</word>
|
6746
|
+
<word ordinal="20">Twentieth </word>
|
6747
|
+
<word cardinal="30">Thirty-</word>
|
6748
|
+
<word ordinal="30">Thirtieth </word>
|
6749
|
+
<word cardinal="40">Forty-</word>
|
6750
|
+
<word ordinal="40">Fortieth </word>
|
6751
|
+
<word cardinal="50">Fifty-</word>
|
6752
|
+
<word ordinal="50">Fiftieth </word>
|
6753
|
+
<word cardinal="60">Sixty-</word>
|
6754
|
+
<word ordinal="60">Sixtieth </word>
|
6755
|
+
<word cardinal="70">Seventy-</word>
|
6756
|
+
<word ordinal="70">Seventieth </word>
|
6757
|
+
<word cardinal="80">Eighty-</word>
|
6758
|
+
<word ordinal="80">Eightieth </word>
|
6759
|
+
<word cardinal="90">Ninety-</word>
|
6760
|
+
<word ordinal="90">Ninetieth </word>
|
6761
|
+
<word cardinal="100">Hundred-</word>
|
6762
|
+
<word ordinal="100">Hundredth </word>
|
6763
|
+
</words>
|
6764
|
+
</xsl:variable>
|
6765
|
+
|
6766
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6767
|
+
|
6768
|
+
<xsl:variable name="value">
|
6769
|
+
<xsl:choose>
|
6770
|
+
<xsl:when test="$ordinal != ''">
|
6771
|
+
<xsl:value-of select="$ordinal"/>
|
6772
|
+
</xsl:when>
|
6773
|
+
<xsl:otherwise>
|
6774
|
+
<xsl:choose>
|
6775
|
+
<xsl:when test="$number < 100">
|
6776
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6777
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6778
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6779
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6780
|
+
</xsl:when>
|
6781
|
+
<xsl:otherwise>
|
6782
|
+
<!-- more 100 -->
|
6783
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6784
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6785
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6786
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6787
|
+
<xsl:call-template name="number-to-words">
|
6788
|
+
<xsl:with-param name="number" select="$digits"/>
|
6789
|
+
</xsl:call-template>
|
6790
|
+
</xsl:otherwise>
|
6791
|
+
</xsl:choose>
|
6792
|
+
</xsl:otherwise>
|
6793
|
+
</xsl:choose>
|
6794
|
+
</xsl:variable>
|
6795
|
+
<xsl:choose>
|
6796
|
+
<xsl:when test="$first = 'true'">
|
6797
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6798
|
+
<xsl:call-template name="capitalize">
|
6799
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6800
|
+
</xsl:call-template>
|
6801
|
+
</xsl:when>
|
6802
|
+
<xsl:otherwise>
|
6803
|
+
<xsl:value-of select="$value"/>
|
6804
|
+
</xsl:otherwise>
|
6805
|
+
</xsl:choose>
|
6806
|
+
</xsl:if>
|
6339
6807
|
</xsl:template></xsl:stylesheet>
|