metanorma-bipm 1.1.2 → 1.1.5.1
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 +5 -0
- data/.rubocop.yml +4 -6
- data/lib/asciidoctor/bipm/biblio.rng +1 -0
- data/lib/asciidoctor/bipm/bipm.rng +3 -0
- data/lib/asciidoctor/bipm/converter.rb +2 -1
- data/lib/asciidoctor/bipm/isodoc.rng +66 -10
- data/lib/isodoc/bipm/bipm.brochure.xsl +777 -118
- data/lib/isodoc/bipm/bipm.guide.xsl +777 -118
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +777 -118
- data/lib/isodoc/bipm/bipm.rapport.xsl +777 -118
- data/lib/isodoc/bipm/jcgm.standard.xsl +640 -177
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +3 -3
- metadata +8 -7
@@ -76,8 +76,13 @@
|
|
76
76
|
<xsl:variable name="column_width" select="($page_width - $column_gap) div $docs_count"/>
|
77
77
|
|
78
78
|
<xsl:variable name="debug">false</xsl:variable>
|
79
|
-
<xsl:variable name="pageWidth" select="
|
80
|
-
<xsl:variable name="pageHeight" select="
|
79
|
+
<xsl:variable name="pageWidth" select="210"/>
|
80
|
+
<xsl:variable name="pageHeight" select="297"/>
|
81
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
82
|
+
<xsl:variable name="marginLeftRight2" select="15"/>
|
83
|
+
<xsl:variable name="marginTop" select="29.5"/>
|
84
|
+
<xsl:variable name="marginBottom" select="23.5"/>
|
85
|
+
|
81
86
|
|
82
87
|
<xsl:variable name="all_rights_reserved">
|
83
88
|
<xsl:call-template name="getLocalizedString">
|
@@ -161,7 +166,7 @@
|
|
161
166
|
<fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
|
162
167
|
<fo:layout-master-set>
|
163
168
|
<!-- cover page -->
|
164
|
-
<fo:simple-page-master master-name="cover-page-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
169
|
+
<fo:simple-page-master master-name="cover-page-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
165
170
|
<fo:region-body margin-top="85mm" margin-bottom="30mm" margin-left="100mm" margin-right="19mm"/>
|
166
171
|
<fo:region-before extent="85mm"/>
|
167
172
|
<fo:region-after region-name="cover-page-jcgm-footer" extent="30mm"/>
|
@@ -169,7 +174,7 @@
|
|
169
174
|
<fo:region-end extent="19mm"/>
|
170
175
|
</fo:simple-page-master>
|
171
176
|
<!-- internal cover page -->
|
172
|
-
<fo:simple-page-master master-name="internal-cover-page-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
177
|
+
<fo:simple-page-master master-name="internal-cover-page-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
173
178
|
<fo:region-body margin-top="11mm" margin-bottom="21mm" margin-left="25mm" margin-right="19mm"/>
|
174
179
|
<fo:region-before extent="11mm"/>
|
175
180
|
<fo:region-after region-name="internal-cover-page-jcgm-footer" extent="21mm"/>
|
@@ -177,19 +182,19 @@
|
|
177
182
|
<fo:region-end extent="19mm"/>
|
178
183
|
</fo:simple-page-master>
|
179
184
|
|
180
|
-
<fo:simple-page-master master-name="odd-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
181
|
-
<fo:region-body margin-top="
|
182
|
-
<fo:region-before region-name="header-odd-jcgm" extent="
|
183
|
-
<fo:region-after region-name="footer-odd-jcgm" extent="
|
184
|
-
<fo:region-start region-name="left-region" extent="
|
185
|
-
<fo:region-end region-name="right-region" extent="
|
185
|
+
<fo:simple-page-master master-name="odd-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
186
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
187
|
+
<fo:region-before region-name="header-odd-jcgm" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
188
|
+
<fo:region-after region-name="footer-odd-jcgm" extent="{$marginBottom}mm"/>
|
189
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
190
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
186
191
|
</fo:simple-page-master>
|
187
|
-
<fo:simple-page-master master-name="even-jcgm" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
188
|
-
<fo:region-body margin-top="
|
189
|
-
<fo:region-before region-name="header-even-jcgm" extent="
|
190
|
-
<fo:region-after region-name="footer-even-jcgm" extent="
|
191
|
-
<fo:region-start region-name="left-region" extent="
|
192
|
-
<fo:region-end region-name="right-region" extent="
|
192
|
+
<fo:simple-page-master master-name="even-jcgm" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
193
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
194
|
+
<fo:region-before region-name="header-even-jcgm" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
195
|
+
<fo:region-after region-name="footer-even-jcgm" extent="{$marginBottom}mm"/>
|
196
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
197
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
193
198
|
</fo:simple-page-master>
|
194
199
|
<fo:page-sequence-master master-name="document-jcgm">
|
195
200
|
<fo:repeatable-page-master-alternatives>
|
@@ -1162,89 +1167,6 @@
|
|
1162
1167
|
</fo:block>
|
1163
1168
|
</xsl:template>
|
1164
1169
|
|
1165
|
-
|
1166
|
-
|
1167
|
-
<xsl:template name="number-to-words">
|
1168
|
-
<xsl:param name="number"/>
|
1169
|
-
<xsl:variable name="words">
|
1170
|
-
<words>
|
1171
|
-
<word cardinal="1">One-</word>
|
1172
|
-
<word ordinal="1">First </word>
|
1173
|
-
<word cardinal="2">Two-</word>
|
1174
|
-
<word ordinal="2">Second </word>
|
1175
|
-
<word cardinal="3">Three-</word>
|
1176
|
-
<word ordinal="3">Third </word>
|
1177
|
-
<word cardinal="4">Four-</word>
|
1178
|
-
<word ordinal="4">Fourth </word>
|
1179
|
-
<word cardinal="5">Five-</word>
|
1180
|
-
<word ordinal="5">Fifth </word>
|
1181
|
-
<word cardinal="6">Six-</word>
|
1182
|
-
<word ordinal="6">Sixth </word>
|
1183
|
-
<word cardinal="7">Seven-</word>
|
1184
|
-
<word ordinal="7">Seventh </word>
|
1185
|
-
<word cardinal="8">Eight-</word>
|
1186
|
-
<word ordinal="8">Eighth </word>
|
1187
|
-
<word cardinal="9">Nine-</word>
|
1188
|
-
<word ordinal="9">Ninth </word>
|
1189
|
-
<word ordinal="10">Tenth </word>
|
1190
|
-
<word ordinal="11">Eleventh </word>
|
1191
|
-
<word ordinal="12">Twelfth </word>
|
1192
|
-
<word ordinal="13">Thirteenth </word>
|
1193
|
-
<word ordinal="14">Fourteenth </word>
|
1194
|
-
<word ordinal="15">Fifteenth </word>
|
1195
|
-
<word ordinal="16">Sixteenth </word>
|
1196
|
-
<word ordinal="17">Seventeenth </word>
|
1197
|
-
<word ordinal="18">Eighteenth </word>
|
1198
|
-
<word ordinal="19">Nineteenth </word>
|
1199
|
-
<word cardinal="20">Twenty-</word>
|
1200
|
-
<word ordinal="20">Twentieth </word>
|
1201
|
-
<word cardinal="30">Thirty-</word>
|
1202
|
-
<word ordinal="30">Thirtieth </word>
|
1203
|
-
<word cardinal="40">Forty-</word>
|
1204
|
-
<word ordinal="40">Fortieth </word>
|
1205
|
-
<word cardinal="50">Fifty-</word>
|
1206
|
-
<word ordinal="50">Fiftieth </word>
|
1207
|
-
<word cardinal="60">Sixty-</word>
|
1208
|
-
<word ordinal="60">Sixtieth </word>
|
1209
|
-
<word cardinal="70">Seventy-</word>
|
1210
|
-
<word ordinal="70">Seventieth </word>
|
1211
|
-
<word cardinal="80">Eighty-</word>
|
1212
|
-
<word ordinal="80">Eightieth </word>
|
1213
|
-
<word cardinal="90">Ninety-</word>
|
1214
|
-
<word ordinal="90">Ninetieth </word>
|
1215
|
-
<word cardinal="100">Hundred-</word>
|
1216
|
-
<word ordinal="100">Hundredth </word>
|
1217
|
-
</words>
|
1218
|
-
</xsl:variable>
|
1219
|
-
|
1220
|
-
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
1221
|
-
|
1222
|
-
<xsl:choose>
|
1223
|
-
<xsl:when test="$ordinal != ''">
|
1224
|
-
<xsl:value-of select="$ordinal"/>
|
1225
|
-
</xsl:when>
|
1226
|
-
<xsl:otherwise>
|
1227
|
-
<xsl:choose>
|
1228
|
-
<xsl:when test="$number < 100">
|
1229
|
-
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
1230
|
-
<xsl:variable name="digit" select="substring($number,2)"/>
|
1231
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
1232
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
1233
|
-
</xsl:when>
|
1234
|
-
<xsl:otherwise>
|
1235
|
-
<!-- more 100 -->
|
1236
|
-
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
1237
|
-
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
1238
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
1239
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
1240
|
-
<xsl:call-template name="number-to-words">
|
1241
|
-
<xsl:with-param name="number" select="$digits"/>
|
1242
|
-
</xsl:call-template>
|
1243
|
-
</xsl:otherwise>
|
1244
|
-
</xsl:choose>
|
1245
|
-
</xsl:otherwise>
|
1246
|
-
</xsl:choose>
|
1247
|
-
</xsl:template>
|
1248
1170
|
|
1249
1171
|
<xsl:template name="printEdition">
|
1250
1172
|
<xsl:variable name="edition" select="normalize-space(//*[local-name()='bibdata']/*[local-name()='edition'])"/>
|
@@ -2084,7 +2006,7 @@
|
|
2084
2006
|
<!-- grey opacity -->
|
2085
2007
|
<fo:block-container absolute-position="fixed" left="0" top="0">
|
2086
2008
|
<fo:block>
|
2087
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
2009
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
2088
2010
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="210mm" height="297mm">
|
2089
2011
|
<rect width="210mm" height="297mm" style="fill:rgb(255,255,255);stroke-width:0;fill-opacity:0.73"/>
|
2090
2012
|
</svg>
|
@@ -2211,6 +2133,9 @@
|
|
2211
2133
|
<title-continued lang="en">(continued)</title-continued>
|
2212
2134
|
<title-continued lang="fr">(continué)</title-continued>
|
2213
2135
|
|
2136
|
+
</xsl:variable><xsl:variable name="bibdata">
|
2137
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
2138
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
2214
2139
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
2215
2140
|
<xsl:param name="name"/>
|
2216
2141
|
<xsl:param name="lang"/>
|
@@ -2242,11 +2167,13 @@
|
|
2242
2167
|
|
2243
2168
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
2244
2169
|
|
2170
|
+
|
2245
2171
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2246
2172
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2247
2173
|
|
2248
2174
|
|
2249
2175
|
|
2176
|
+
|
2250
2177
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
2251
2178
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
2252
2179
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -2296,7 +2223,7 @@
|
|
2296
2223
|
|
2297
2224
|
|
2298
2225
|
|
2299
|
-
|
2226
|
+
|
2300
2227
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
2301
2228
|
|
2302
2229
|
|
@@ -2313,6 +2240,7 @@
|
|
2313
2240
|
|
2314
2241
|
|
2315
2242
|
|
2243
|
+
|
2316
2244
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
2317
2245
|
|
2318
2246
|
|
@@ -2332,9 +2260,7 @@
|
|
2332
2260
|
|
2333
2261
|
|
2334
2262
|
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2263
|
+
|
2338
2264
|
|
2339
2265
|
|
2340
2266
|
|
@@ -2365,8 +2291,10 @@
|
|
2365
2291
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
2366
2292
|
|
2367
2293
|
|
2294
|
+
|
2368
2295
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
2369
2296
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2297
|
+
|
2370
2298
|
|
2371
2299
|
|
2372
2300
|
|
@@ -2385,6 +2313,9 @@
|
|
2385
2313
|
|
2386
2314
|
|
2387
2315
|
|
2316
|
+
|
2317
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
2318
|
+
|
2388
2319
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2389
2320
|
|
2390
2321
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
@@ -2405,19 +2336,24 @@
|
|
2405
2336
|
</xsl:attribute-set><xsl:attribute-set name="xref-style">
|
2406
2337
|
|
2407
2338
|
|
2339
|
+
|
2408
2340
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2409
2341
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2410
2342
|
|
2411
2343
|
|
2344
|
+
|
2412
2345
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
2413
2346
|
|
2414
2347
|
|
2415
2348
|
|
2416
2349
|
|
2350
|
+
|
2351
|
+
|
2417
2352
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2418
2353
|
|
2419
2354
|
|
2420
2355
|
|
2356
|
+
|
2421
2357
|
|
2422
2358
|
|
2423
2359
|
|
@@ -2434,6 +2370,7 @@
|
|
2434
2370
|
|
2435
2371
|
|
2436
2372
|
|
2373
|
+
|
2437
2374
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
2438
2375
|
|
2439
2376
|
|
@@ -2441,6 +2378,7 @@
|
|
2441
2378
|
|
2442
2379
|
|
2443
2380
|
|
2381
|
+
|
2444
2382
|
<xsl:attribute name="padding-right">6mm</xsl:attribute>
|
2445
2383
|
|
2446
2384
|
|
@@ -2470,6 +2408,7 @@
|
|
2470
2408
|
|
2471
2409
|
|
2472
2410
|
|
2411
|
+
|
2473
2412
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2474
2413
|
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
2475
2414
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
@@ -2477,9 +2416,12 @@
|
|
2477
2416
|
|
2478
2417
|
|
2479
2418
|
|
2419
|
+
|
2480
2420
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
2421
|
+
|
2481
2422
|
|
2482
2423
|
|
2424
|
+
|
2483
2425
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2484
2426
|
|
2485
2427
|
|
@@ -2506,18 +2448,22 @@
|
|
2506
2448
|
|
2507
2449
|
|
2508
2450
|
|
2451
|
+
|
2509
2452
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
2510
2453
|
|
2454
|
+
|
2511
2455
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
2512
2456
|
|
2513
2457
|
|
2514
2458
|
|
2459
|
+
|
2515
2460
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
2516
2461
|
|
2517
2462
|
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
2518
2463
|
|
2519
2464
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
2520
2465
|
|
2466
|
+
|
2521
2467
|
|
2522
2468
|
|
2523
2469
|
|
@@ -2537,6 +2483,7 @@
|
|
2537
2483
|
|
2538
2484
|
|
2539
2485
|
|
2486
|
+
|
2540
2487
|
|
2541
2488
|
|
2542
2489
|
|
@@ -2550,10 +2497,12 @@
|
|
2550
2497
|
|
2551
2498
|
|
2552
2499
|
|
2500
|
+
|
2553
2501
|
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
|
2554
2502
|
|
2555
2503
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
2556
2504
|
|
2505
|
+
|
2557
2506
|
<xsl:attribute name="width">100%</xsl:attribute>
|
2558
2507
|
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
2559
2508
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -2582,13 +2531,16 @@
|
|
2582
2531
|
|
2583
2532
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2584
2533
|
|
2534
|
+
|
2585
2535
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
2586
2536
|
|
2537
|
+
|
2587
2538
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
2588
2539
|
|
2589
2540
|
|
2590
2541
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
2591
2542
|
|
2543
|
+
|
2592
2544
|
</xsl:attribute-set><xsl:variable name="color-added-text">
|
2593
2545
|
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
2594
2546
|
</xsl:variable><xsl:attribute-set name="add-style">
|
@@ -2607,6 +2559,8 @@
|
|
2607
2559
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
2608
2560
|
|
2609
2561
|
|
2562
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
2563
|
+
|
2610
2564
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
2611
2565
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2612
2566
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -2617,14 +2571,15 @@
|
|
2617
2571
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2618
2572
|
|
2619
2573
|
<!-- Normative references -->
|
2620
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2574
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
2621
2575
|
<!-- Terms and definitions -->
|
2622
2576
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
2623
2577
|
<!-- Another main sections -->
|
2624
2578
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
2625
2579
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
2626
2580
|
<!-- Bibliography -->
|
2627
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2581
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
2582
|
+
|
2628
2583
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2629
2584
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2630
2585
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -2660,11 +2615,11 @@
|
|
2660
2615
|
<xsl:variable name="table">
|
2661
2616
|
|
2662
2617
|
<xsl:variable name="simple-table">
|
2663
|
-
<xsl:call-template name="getSimpleTable"/>
|
2618
|
+
<xsl:call-template name="getSimpleTable"/>
|
2664
2619
|
</xsl:variable>
|
2665
2620
|
|
2666
2621
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2667
|
-
<fo:block> </fo:block>
|
2622
|
+
<fo:block> </fo:block>
|
2668
2623
|
</xsl:if> -->
|
2669
2624
|
|
2670
2625
|
<!-- $namespace = 'iso' or -->
|
@@ -2722,6 +2677,7 @@
|
|
2722
2677
|
|
2723
2678
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2724
2679
|
|
2680
|
+
|
2725
2681
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2726
2682
|
|
2727
2683
|
|
@@ -2733,6 +2689,7 @@
|
|
2733
2689
|
|
2734
2690
|
|
2735
2691
|
|
2692
|
+
|
2736
2693
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
2737
2694
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2738
2695
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -2742,6 +2699,7 @@
|
|
2742
2699
|
|
2743
2700
|
|
2744
2701
|
|
2702
|
+
|
2745
2703
|
<xsl:variable name="table_width">
|
2746
2704
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
2747
2705
|
100%
|
@@ -2755,6 +2713,7 @@
|
|
2755
2713
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2756
2714
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2757
2715
|
|
2716
|
+
|
2758
2717
|
<attribute name="border">1.5pt solid black</attribute>
|
2759
2718
|
<xsl:if test="*[local-name()='thead']">
|
2760
2719
|
<attribute name="border-top">1pt solid black</attribute>
|
@@ -2773,6 +2732,7 @@
|
|
2773
2732
|
|
2774
2733
|
|
2775
2734
|
|
2735
|
+
|
2776
2736
|
</xsl:variable>
|
2777
2737
|
|
2778
2738
|
|
@@ -2909,13 +2869,29 @@
|
|
2909
2869
|
</xsl:choose>
|
2910
2870
|
|
2911
2871
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
2872
|
+
<xsl:param name="continued"/>
|
2912
2873
|
<xsl:if test="normalize-space() != ''">
|
2913
2874
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
2914
2875
|
|
2915
2876
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
2916
2877
|
|
2917
2878
|
|
2918
|
-
|
2879
|
+
|
2880
|
+
|
2881
|
+
|
2882
|
+
<xsl:choose>
|
2883
|
+
<xsl:when test="$continued = 'true'">
|
2884
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
2885
|
+
|
2886
|
+
<xsl:apply-templates/>
|
2887
|
+
|
2888
|
+
</xsl:when>
|
2889
|
+
<xsl:otherwise>
|
2890
|
+
<xsl:apply-templates/>
|
2891
|
+
</xsl:otherwise>
|
2892
|
+
</xsl:choose>
|
2893
|
+
|
2894
|
+
|
2919
2895
|
</fo:block>
|
2920
2896
|
</xsl:if>
|
2921
2897
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -3056,21 +3032,27 @@
|
|
3056
3032
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3057
3033
|
</xsl:call-template>
|
3058
3034
|
|
3035
|
+
|
3059
3036
|
<xsl:apply-templates/>
|
3060
3037
|
</fo:table-header>
|
3061
3038
|
</xsl:template><xsl:template name="table-header-title">
|
3062
|
-
<xsl:param name="cols-count"/>
|
3039
|
+
<xsl:param name="cols-count"/>
|
3063
3040
|
<!-- row for title -->
|
3064
3041
|
<fo:table-row>
|
3065
3042
|
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
|
3066
|
-
|
3043
|
+
|
3044
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
3045
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
3046
|
+
</xsl:apply-templates>
|
3067
3047
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
3068
3048
|
<xsl:call-template name="fn_name_display"/>
|
3069
|
-
</xsl:for-each>
|
3070
|
-
|
3071
|
-
<
|
3072
|
-
|
3073
|
-
|
3049
|
+
</xsl:for-each>
|
3050
|
+
|
3051
|
+
<fo:block text-align="right" font-style="italic">
|
3052
|
+
<xsl:text> </xsl:text>
|
3053
|
+
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
3054
|
+
</fo:block>
|
3055
|
+
|
3074
3056
|
</fo:table-cell>
|
3075
3057
|
</fo:table-row>
|
3076
3058
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -3206,6 +3188,7 @@
|
|
3206
3188
|
<fo:table-row>
|
3207
3189
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3208
3190
|
|
3191
|
+
|
3209
3192
|
<xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
|
3210
3193
|
|
3211
3194
|
|
@@ -3218,6 +3201,10 @@
|
|
3218
3201
|
|
3219
3202
|
|
3220
3203
|
|
3204
|
+
|
3205
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3206
|
+
|
3207
|
+
|
3221
3208
|
<!-- except gb -->
|
3222
3209
|
|
3223
3210
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -3243,6 +3230,10 @@
|
|
3243
3230
|
<!-- fn processing -->
|
3244
3231
|
<xsl:call-template name="fn_display"/>
|
3245
3232
|
|
3233
|
+
|
3234
|
+
<!-- for PAS display Notes after footnotes -->
|
3235
|
+
|
3236
|
+
|
3246
3237
|
</fo:table-cell>
|
3247
3238
|
</fo:table-row>
|
3248
3239
|
</fo:table-body>
|
@@ -3291,20 +3282,26 @@
|
|
3291
3282
|
<xsl:call-template name="getTitle">
|
3292
3283
|
<xsl:with-param name="name" select="'title-continued'"/>
|
3293
3284
|
</xsl:call-template>
|
3294
|
-
</xsl:variable>
|
3285
|
+
</xsl:variable>
|
3286
|
+
|
3287
|
+
<xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
|
3288
|
+
<xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
|
3289
|
+
|
3295
3290
|
<fo:table-row height="0" keep-with-next.within-page="always">
|
3296
3291
|
<fo:table-cell>
|
3297
|
-
|
3292
|
+
|
3293
|
+
|
3294
|
+
<fo:marker marker-class-name="table_continued"/>
|
3295
|
+
|
3298
3296
|
<fo:block/>
|
3299
3297
|
</fo:table-cell>
|
3300
3298
|
</fo:table-row>
|
3301
3299
|
<fo:table-row height="0" keep-with-next.within-page="always">
|
3302
3300
|
<fo:table-cell>
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3307
|
-
</fo:marker>
|
3301
|
+
|
3302
|
+
<fo:marker marker-class-name="table_continued">
|
3303
|
+
<xsl:value-of select="$title_continued"/>
|
3304
|
+
</fo:marker>
|
3308
3305
|
<fo:block/>
|
3309
3306
|
</fo:table-cell>
|
3310
3307
|
</fo:table-row>
|
@@ -3341,9 +3338,11 @@
|
|
3341
3338
|
|
3342
3339
|
|
3343
3340
|
|
3341
|
+
|
3344
3342
|
</xsl:if>
|
3345
3343
|
<xsl:if test="$parent-name = 'tfoot'">
|
3346
3344
|
|
3345
|
+
|
3347
3346
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3348
3347
|
<xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
|
3349
3348
|
<xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
|
@@ -3354,6 +3353,10 @@
|
|
3354
3353
|
|
3355
3354
|
|
3356
3355
|
|
3356
|
+
|
3357
|
+
|
3358
|
+
|
3359
|
+
|
3357
3360
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3358
3361
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3359
3362
|
</xsl:if> -->
|
@@ -3372,6 +3375,7 @@
|
|
3372
3375
|
</xsl:choose>
|
3373
3376
|
</xsl:attribute>
|
3374
3377
|
|
3378
|
+
|
3375
3379
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
3376
3380
|
|
3377
3381
|
|
@@ -3384,6 +3388,7 @@
|
|
3384
3388
|
|
3385
3389
|
|
3386
3390
|
|
3391
|
+
|
3387
3392
|
<xsl:if test="$lang = 'ar'">
|
3388
3393
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3389
3394
|
</xsl:if>
|
@@ -3431,6 +3436,7 @@
|
|
3431
3436
|
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
3432
3437
|
|
3433
3438
|
|
3439
|
+
|
3434
3440
|
<xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
|
3435
3441
|
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
3436
3442
|
</xsl:if>
|
@@ -3449,6 +3455,9 @@
|
|
3449
3455
|
|
3450
3456
|
|
3451
3457
|
|
3458
|
+
|
3459
|
+
|
3460
|
+
|
3452
3461
|
<xsl:if test=".//*[local-name() = 'table']">
|
3453
3462
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3454
3463
|
</xsl:if>
|
@@ -3473,6 +3482,7 @@
|
|
3473
3482
|
|
3474
3483
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
3475
3484
|
|
3485
|
+
|
3476
3486
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3477
3487
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3478
3488
|
|
@@ -3481,8 +3491,13 @@
|
|
3481
3491
|
|
3482
3492
|
|
3483
3493
|
|
3494
|
+
|
3495
|
+
<!-- Table's note name (NOTE, for example) -->
|
3496
|
+
|
3484
3497
|
<fo:inline padding-right="2mm">
|
3485
3498
|
|
3499
|
+
|
3500
|
+
|
3486
3501
|
|
3487
3502
|
|
3488
3503
|
|
@@ -3490,6 +3505,8 @@
|
|
3490
3505
|
|
3491
3506
|
</fo:inline>
|
3492
3507
|
|
3508
|
+
|
3509
|
+
|
3493
3510
|
<xsl:apply-templates mode="process"/>
|
3494
3511
|
</fo:block>
|
3495
3512
|
|
@@ -3509,6 +3526,8 @@
|
|
3509
3526
|
<xsl:variable name="reference" select="@reference"/>
|
3510
3527
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3511
3528
|
<fo:block margin-bottom="12pt">
|
3529
|
+
|
3530
|
+
|
3512
3531
|
|
3513
3532
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3514
3533
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -3527,9 +3546,11 @@
|
|
3527
3546
|
|
3528
3547
|
|
3529
3548
|
|
3549
|
+
|
3530
3550
|
<xsl:value-of select="@reference"/>
|
3531
3551
|
|
3532
3552
|
|
3553
|
+
|
3533
3554
|
</fo:inline>
|
3534
3555
|
<fo:inline>
|
3535
3556
|
|
@@ -3665,6 +3686,8 @@
|
|
3665
3686
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3666
3687
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
3667
3688
|
|
3689
|
+
|
3690
|
+
|
3668
3691
|
<xsl:if test="ancestor::*[local-name()='td']">
|
3669
3692
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
3670
3693
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
@@ -3676,11 +3699,14 @@
|
|
3676
3699
|
|
3677
3700
|
|
3678
3701
|
|
3702
|
+
|
3703
|
+
|
3679
3704
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
3680
3705
|
|
3681
3706
|
|
3682
3707
|
<xsl:value-of select="@reference"/>
|
3683
3708
|
|
3709
|
+
|
3684
3710
|
</fo:basic-link>
|
3685
3711
|
</fo:inline>
|
3686
3712
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3776,6 +3802,7 @@
|
|
3776
3802
|
|
3777
3803
|
|
3778
3804
|
|
3805
|
+
|
3779
3806
|
<xsl:variable name="title-key">
|
3780
3807
|
|
3781
3808
|
<xsl:call-template name="getLocalizedString">
|
@@ -3991,6 +4018,7 @@
|
|
3991
4018
|
|
3992
4019
|
<fo:table-row>
|
3993
4020
|
|
4021
|
+
|
3994
4022
|
<fo:table-cell>
|
3995
4023
|
|
3996
4024
|
<fo:block margin-top="6pt">
|
@@ -4008,6 +4036,7 @@
|
|
4008
4036
|
|
4009
4037
|
|
4010
4038
|
|
4039
|
+
|
4011
4040
|
<xsl:apply-templates/>
|
4012
4041
|
<!-- <xsl:if test="$namespace = 'gb'">
|
4013
4042
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -4064,6 +4093,8 @@
|
|
4064
4093
|
|
4065
4094
|
<xsl:apply-templates/>
|
4066
4095
|
</fo:inline>
|
4096
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
4097
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
4067
4098
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
4068
4099
|
<fo:inline font-size="80%" vertical-align="super">
|
4069
4100
|
<xsl:apply-templates/>
|
@@ -4081,6 +4112,7 @@
|
|
4081
4112
|
|
4082
4113
|
|
4083
4114
|
|
4115
|
+
|
4084
4116
|
10
|
4085
4117
|
|
4086
4118
|
|
@@ -4470,11 +4502,15 @@
|
|
4470
4502
|
</xsl:apply-templates>
|
4471
4503
|
</xsl:template><xsl:template name="getLang">
|
4472
4504
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
4505
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
4473
4506
|
<xsl:variable name="language">
|
4474
4507
|
<xsl:choose>
|
4475
4508
|
<xsl:when test="$language_current != ''">
|
4476
4509
|
<xsl:value-of select="$language_current"/>
|
4477
4510
|
</xsl:when>
|
4511
|
+
<xsl:when test="$language_current_2 != ''">
|
4512
|
+
<xsl:value-of select="$language_current_2"/>
|
4513
|
+
</xsl:when>
|
4478
4514
|
<xsl:otherwise>
|
4479
4515
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
4480
4516
|
</xsl:otherwise>
|
@@ -4548,9 +4584,27 @@
|
|
4548
4584
|
<xsl:copy>
|
4549
4585
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4550
4586
|
</xsl:copy>
|
4551
|
-
<
|
4587
|
+
<xsl:choose>
|
4588
|
+
<!-- if in msub, then don't add space -->
|
4589
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
4590
|
+
<!-- if next char in digit, don't add space -->
|
4591
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
4592
|
+
<xsl:otherwise>
|
4593
|
+
<mathml:mspace width="0.5ex"/>
|
4594
|
+
</xsl:otherwise>
|
4595
|
+
</xsl:choose>
|
4552
4596
|
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4553
4597
|
<xsl:variable name="target">
|
4598
|
+
<xsl:choose>
|
4599
|
+
<xsl:when test="@updatetype = 'true'">
|
4600
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
4601
|
+
</xsl:when>
|
4602
|
+
<xsl:otherwise>
|
4603
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
4604
|
+
</xsl:otherwise>
|
4605
|
+
</xsl:choose>
|
4606
|
+
</xsl:variable>
|
4607
|
+
<xsl:variable name="target_text">
|
4554
4608
|
<xsl:choose>
|
4555
4609
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
4556
4610
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -4562,20 +4616,22 @@
|
|
4562
4616
|
</xsl:variable>
|
4563
4617
|
<fo:inline xsl:use-attribute-sets="link-style">
|
4564
4618
|
|
4619
|
+
|
4620
|
+
|
4565
4621
|
<xsl:choose>
|
4566
|
-
<xsl:when test="$
|
4622
|
+
<xsl:when test="$target_text = ''">
|
4567
4623
|
<xsl:apply-templates/>
|
4568
4624
|
</xsl:when>
|
4569
4625
|
<xsl:otherwise>
|
4570
|
-
<fo:basic-link external-destination="{
|
4626
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
4571
4627
|
<xsl:choose>
|
4572
4628
|
<xsl:when test="normalize-space(.) = ''">
|
4573
|
-
<!-- <xsl:value-of select="$target"/> -->
|
4574
4629
|
<xsl:call-template name="add-zero-spaces-link-java">
|
4575
|
-
<xsl:with-param name="text" select="$
|
4630
|
+
<xsl:with-param name="text" select="$target_text"/>
|
4576
4631
|
</xsl:call-template>
|
4577
4632
|
</xsl:when>
|
4578
4633
|
<xsl:otherwise>
|
4634
|
+
<!-- output text from <link>text</link> -->
|
4579
4635
|
<xsl:apply-templates/>
|
4580
4636
|
</xsl:otherwise>
|
4581
4637
|
</xsl:choose>
|
@@ -4670,6 +4726,7 @@
|
|
4670
4726
|
|
4671
4727
|
|
4672
4728
|
|
4729
|
+
|
4673
4730
|
<fo:block-container margin-left="0mm">
|
4674
4731
|
|
4675
4732
|
|
@@ -4687,6 +4744,7 @@
|
|
4687
4744
|
|
4688
4745
|
|
4689
4746
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
4747
|
+
|
4690
4748
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4691
4749
|
</fo:inline>
|
4692
4750
|
<xsl:apply-templates/>
|
@@ -4712,7 +4770,9 @@
|
|
4712
4770
|
</xsl:choose>
|
4713
4771
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
4714
4772
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
4773
|
+
|
4715
4774
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4775
|
+
|
4716
4776
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4717
4777
|
</fo:inline>
|
4718
4778
|
<xsl:apply-templates/>
|
@@ -4786,13 +4846,17 @@
|
|
4786
4846
|
</xsl:call-template>
|
4787
4847
|
|
4788
4848
|
<fo:block>
|
4849
|
+
|
4789
4850
|
<xsl:apply-templates/>
|
4790
4851
|
</fo:block>
|
4791
4852
|
<xsl:call-template name="fn_display_figure"/>
|
4792
4853
|
<xsl:for-each select="*[local-name() = 'note']">
|
4793
4854
|
<xsl:call-template name="note"/>
|
4794
4855
|
</xsl:for-each>
|
4795
|
-
|
4856
|
+
|
4857
|
+
|
4858
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4859
|
+
|
4796
4860
|
</fo:block-container>
|
4797
4861
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
4798
4862
|
<fo:block id="{@id}">
|
@@ -4905,21 +4969,249 @@
|
|
4905
4969
|
<xsl:param name="height"/>
|
4906
4970
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
4907
4971
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
4972
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
4973
|
+
<xsl:param name="name"/>
|
4974
|
+
|
4975
|
+
<xsl:variable name="svg_content">
|
4976
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
4977
|
+
</xsl:variable>
|
4978
|
+
|
4979
|
+
<xsl:variable name="alt-text">
|
4980
|
+
<xsl:choose>
|
4981
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
4982
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
4983
|
+
</xsl:when>
|
4984
|
+
<xsl:when test="normalize-space($name) != ''">
|
4985
|
+
<xsl:value-of select="$name"/>
|
4986
|
+
</xsl:when>
|
4987
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
4988
|
+
</xsl:choose>
|
4989
|
+
</xsl:variable>
|
4990
|
+
|
4991
|
+
<xsl:choose>
|
4992
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
4993
|
+
<fo:block>
|
4994
|
+
<xsl:variable name="width" select="@width"/>
|
4995
|
+
<xsl:variable name="height" select="@height"/>
|
4996
|
+
|
4997
|
+
<xsl:variable name="scale_x">
|
4998
|
+
<xsl:choose>
|
4999
|
+
<xsl:when test="$width > $width_effective_px">
|
5000
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
5001
|
+
</xsl:when>
|
5002
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5003
|
+
</xsl:choose>
|
5004
|
+
</xsl:variable>
|
5005
|
+
|
5006
|
+
<xsl:variable name="scale_y">
|
5007
|
+
<xsl:choose>
|
5008
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
5009
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
5010
|
+
</xsl:when>
|
5011
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5012
|
+
</xsl:choose>
|
5013
|
+
</xsl:variable>
|
5014
|
+
|
5015
|
+
<xsl:variable name="scale">
|
5016
|
+
<xsl:choose>
|
5017
|
+
<xsl:when test="$scale_y != 1">
|
5018
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
5019
|
+
</xsl:when>
|
5020
|
+
<xsl:otherwise>
|
5021
|
+
<xsl:value-of select="$scale_x"/>
|
5022
|
+
</xsl:otherwise>
|
5023
|
+
</xsl:choose>
|
5024
|
+
</xsl:variable>
|
5025
|
+
|
5026
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
5027
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
5028
|
+
|
5029
|
+
<fo:table table-layout="fixed" width="100%">
|
5030
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5031
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
5032
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5033
|
+
<fo:table-body>
|
5034
|
+
<fo:table-row>
|
5035
|
+
<fo:table-cell column-number="2">
|
5036
|
+
<fo:block>
|
5037
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
5038
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5039
|
+
<fo:block line-height="0" font-size="0">
|
5040
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5041
|
+
<xsl:call-template name="bookmark"/>
|
5042
|
+
</xsl:for-each>
|
5043
|
+
</fo:block>
|
5044
|
+
</xsl:if>
|
5045
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
5046
|
+
|
5047
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5048
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5049
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5050
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5051
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5052
|
+
|
5053
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
5054
|
+
</fo:instream-foreign-object>
|
5055
|
+
</fo:block>
|
5056
|
+
|
5057
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
5058
|
+
<xsl:with-param name="scale" select="$scale"/>
|
5059
|
+
</xsl:apply-templates>
|
5060
|
+
</fo:block-container>
|
5061
|
+
</fo:block>
|
5062
|
+
</fo:table-cell>
|
5063
|
+
</fo:table-row>
|
5064
|
+
</fo:table-body>
|
5065
|
+
</fo:table>
|
5066
|
+
</fo:block>
|
5067
|
+
|
5068
|
+
</xsl:when>
|
5069
|
+
<xsl:otherwise>
|
5070
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5071
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5072
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5073
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5074
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5075
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5076
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5077
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5078
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
5079
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
5080
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5081
|
+
</xsl:if>
|
5082
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5083
|
+
<xsl:copy-of select="$svg_content"/>
|
5084
|
+
</fo:instream-foreign-object>
|
5085
|
+
</fo:block>
|
5086
|
+
</xsl:otherwise>
|
5087
|
+
</xsl:choose>
|
5088
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
5089
|
+
<xsl:copy>
|
5090
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
5091
|
+
</xsl:copy>
|
5092
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
5093
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5094
|
+
<xsl:value-of select="."/>
|
5095
|
+
</xsl:attribute>
|
5096
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5097
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
5098
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5099
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
5100
|
+
<xsl:call-template name="image_svg">
|
5101
|
+
<xsl:with-param name="name" select="$name"/>
|
5102
|
+
</xsl:call-template>
|
5103
|
+
</xsl:for-each>
|
5104
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
5105
|
+
<xsl:copy>
|
5106
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
5107
|
+
</xsl:copy>
|
5108
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
5109
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
5110
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
5111
|
+
<xsl:param name="scale"/>
|
5112
|
+
<xsl:variable name="dest">
|
5113
|
+
<xsl:choose>
|
5114
|
+
<xsl:when test="starts-with(@href, '#')">
|
5115
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
5116
|
+
</xsl:when>
|
5117
|
+
<xsl:otherwise>
|
5118
|
+
<xsl:value-of select="@href"/>
|
5119
|
+
</xsl:otherwise>
|
5120
|
+
</xsl:choose>
|
5121
|
+
</xsl:variable>
|
5122
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
5123
|
+
<xsl:call-template name="insertSVGMapLink">
|
5124
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
5125
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
5126
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
5127
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
5128
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5129
|
+
</xsl:call-template>
|
5130
|
+
</xsl:for-each>
|
5131
|
+
|
5132
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
5133
|
+
<xsl:variable name="points">
|
5134
|
+
<xsl:call-template name="split">
|
5135
|
+
<xsl:with-param name="pText" select="@points"/>
|
5136
|
+
</xsl:call-template>
|
5137
|
+
</xsl:variable>
|
5138
|
+
<xsl:variable name="x_coords">
|
5139
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
5140
|
+
<xsl:sort select="." data-type="number"/>
|
5141
|
+
<x><xsl:value-of select="."/></x>
|
5142
|
+
</xsl:for-each>
|
5143
|
+
</xsl:variable>
|
5144
|
+
<xsl:variable name="y_coords">
|
5145
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
5146
|
+
<xsl:sort select="." data-type="number"/>
|
5147
|
+
<y><xsl:value-of select="."/></y>
|
5148
|
+
</xsl:for-each>
|
5149
|
+
</xsl:variable>
|
5150
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5151
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5152
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5153
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5154
|
+
<xsl:call-template name="insertSVGMapLink">
|
5155
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5156
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5157
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5158
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5159
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5160
|
+
</xsl:call-template>
|
5161
|
+
</xsl:for-each>
|
5162
|
+
|
5163
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5164
|
+
<xsl:call-template name="insertSVGMapLink">
|
5165
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5166
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5167
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5168
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5169
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5170
|
+
</xsl:call-template>
|
5171
|
+
</xsl:for-each>
|
5172
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5173
|
+
<xsl:call-template name="insertSVGMapLink">
|
5174
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5175
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5176
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5177
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5178
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5179
|
+
</xsl:call-template>
|
5180
|
+
</xsl:for-each>
|
5181
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5182
|
+
<xsl:param name="left"/>
|
5183
|
+
<xsl:param name="top"/>
|
5184
|
+
<xsl:param name="width"/>
|
5185
|
+
<xsl:param name="height"/>
|
5186
|
+
<xsl:param name="dest"/>
|
5187
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5188
|
+
<fo:block font-size="1pt">
|
5189
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5190
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5191
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5192
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5193
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5194
|
+
</xsl:if> -->
|
5195
|
+
<fo:block> </fo:block></fo:block-container>
|
5196
|
+
</fo:inline-container>
|
5197
|
+
</fo:basic-link>
|
5198
|
+
</fo:block>
|
5199
|
+
</fo:block-container>
|
4908
5200
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4909
5201
|
<xsl:apply-templates mode="contents"/>
|
4910
5202
|
<xsl:text> </xsl:text>
|
4911
5203
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
4912
5204
|
<xsl:apply-templates mode="bookmarks"/>
|
4913
5205
|
<xsl:text> </xsl:text>
|
4914
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
5206
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
4915
5207
|
<xsl:value-of select="."/>
|
4916
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
5208
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
4917
5209
|
<xsl:value-of select="."/>
|
4918
5210
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4919
5211
|
<xsl:apply-templates mode="contents"/>
|
4920
5212
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
4921
5213
|
<xsl:apply-templates mode="bookmarks"/>
|
4922
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
5214
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
4923
5215
|
<xsl:apply-templates select="."/>
|
4924
5216
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
4925
5217
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -4933,28 +5225,39 @@
|
|
4933
5225
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
4934
5226
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
4935
5227
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5228
|
+
<xsl:if test="@bundle = 'true'">
|
5229
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5230
|
+
</xsl:if>
|
4936
5231
|
<fo:bookmark-title>
|
4937
|
-
<xsl:variable name="bookmark-title_">
|
4938
|
-
<xsl:call-template name="getLangVersion">
|
4939
|
-
<xsl:with-param name="lang" select="@lang"/>
|
4940
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
4941
|
-
<xsl:with-param name="title" select="@title-part"/>
|
4942
|
-
</xsl:call-template>
|
4943
|
-
</xsl:variable>
|
4944
5232
|
<xsl:choose>
|
4945
|
-
<xsl:when test="normalize-space(
|
4946
|
-
<xsl:
|
4947
|
-
|
4948
|
-
|
5233
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5234
|
+
<xsl:variable name="bookmark-title_">
|
5235
|
+
<xsl:call-template name="getLangVersion">
|
5236
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5237
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5238
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5239
|
+
</xsl:call-template>
|
5240
|
+
</xsl:variable>
|
4949
5241
|
<xsl:choose>
|
4950
|
-
<xsl:when test="
|
4951
|
-
|
4952
|
-
|
4953
|
-
<xsl:otherwise
|
5242
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5243
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5244
|
+
</xsl:when>
|
5245
|
+
<xsl:otherwise>
|
5246
|
+
<xsl:choose>
|
5247
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5248
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5249
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5250
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5251
|
+
</xsl:choose>
|
5252
|
+
</xsl:otherwise>
|
4954
5253
|
</xsl:choose>
|
5254
|
+
</xsl:when>
|
5255
|
+
<xsl:otherwise>
|
5256
|
+
<xsl:value-of select="@title-part"/>
|
4955
5257
|
</xsl:otherwise>
|
4956
5258
|
</xsl:choose>
|
4957
5259
|
</fo:bookmark-title>
|
5260
|
+
|
4958
5261
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
4959
5262
|
|
4960
5263
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -5053,20 +5356,28 @@
|
|
5053
5356
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
5054
5357
|
</xsl:choose>
|
5055
5358
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
5056
|
-
<
|
5057
|
-
|
5058
|
-
|
5059
|
-
|
5060
|
-
<xsl:
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5359
|
+
<xsl:choose>
|
5360
|
+
<xsl:when test="@id != ''">
|
5361
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5362
|
+
<fo:bookmark-title>
|
5363
|
+
<xsl:if test="@section != ''">
|
5364
|
+
<xsl:value-of select="@section"/>
|
5365
|
+
<xsl:text> </xsl:text>
|
5366
|
+
</xsl:if>
|
5367
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5368
|
+
</fo:bookmark-title>
|
5369
|
+
<xsl:apply-templates mode="bookmark"/>
|
5370
|
+
</fo:bookmark>
|
5371
|
+
</xsl:when>
|
5372
|
+
<xsl:otherwise>
|
5373
|
+
<xsl:apply-templates mode="bookmark"/>
|
5374
|
+
</xsl:otherwise>
|
5375
|
+
</xsl:choose>
|
5066
5376
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
5067
5377
|
<xsl:if test="normalize-space() != ''">
|
5068
5378
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
5069
5379
|
|
5380
|
+
|
5070
5381
|
<xsl:apply-templates/>
|
5071
5382
|
</fo:block>
|
5072
5383
|
</xsl:if>
|
@@ -5118,6 +5429,8 @@
|
|
5118
5429
|
</fo:list-item-body>
|
5119
5430
|
</fo:list-item>
|
5120
5431
|
</fo:list-block>
|
5432
|
+
</xsl:template><xsl:template name="extractSection">
|
5433
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
5121
5434
|
</xsl:template><xsl:template name="extractTitle">
|
5122
5435
|
<xsl:choose>
|
5123
5436
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -5144,6 +5457,8 @@
|
|
5144
5457
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
5145
5458
|
|
5146
5459
|
<fo:block-container margin-left="0mm">
|
5460
|
+
<xsl:copy-of select="@id"/>
|
5461
|
+
|
5147
5462
|
<xsl:if test="parent::*[local-name() = 'note']">
|
5148
5463
|
<xsl:attribute name="margin-left">
|
5149
5464
|
<xsl:choose>
|
@@ -5154,7 +5469,9 @@
|
|
5154
5469
|
|
5155
5470
|
</xsl:if>
|
5156
5471
|
<fo:block-container margin-left="0mm">
|
5157
|
-
|
5472
|
+
|
5473
|
+
|
5474
|
+
|
5158
5475
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
5159
5476
|
<xsl:variable name="_font-size">
|
5160
5477
|
|
@@ -5163,6 +5480,7 @@
|
|
5163
5480
|
|
5164
5481
|
|
5165
5482
|
|
5483
|
+
|
5166
5484
|
9
|
5167
5485
|
|
5168
5486
|
|
@@ -5182,10 +5500,14 @@
|
|
5182
5500
|
</xsl:choose>
|
5183
5501
|
</xsl:attribute>
|
5184
5502
|
</xsl:if>
|
5185
|
-
|
5186
|
-
|
5503
|
+
|
5504
|
+
<xsl:apply-templates/>
|
5505
|
+
</fo:block>
|
5506
|
+
|
5507
|
+
|
5187
5508
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5188
5509
|
|
5510
|
+
|
5189
5511
|
</fo:block-container>
|
5190
5512
|
</fo:block-container>
|
5191
5513
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5420,6 +5742,7 @@
|
|
5420
5742
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
5421
5743
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
5422
5744
|
|
5745
|
+
|
5423
5746
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5424
5747
|
|
5425
5748
|
<xsl:variable name="element">
|
@@ -5492,7 +5815,7 @@
|
|
5492
5815
|
</fo:inline>
|
5493
5816
|
</xsl:otherwise>
|
5494
5817
|
</xsl:choose>
|
5495
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
5818
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
5496
5819
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
5497
5820
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
5498
5821
|
<xsl:variable name="termsource_text">
|
@@ -5501,13 +5824,15 @@
|
|
5501
5824
|
|
5502
5825
|
<xsl:choose>
|
5503
5826
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
5504
|
-
<xsl:apply-templates/>
|
5827
|
+
<!-- <xsl:apply-templates /> -->
|
5828
|
+
<xsl:copy-of select="$termsource_text"/>
|
5505
5829
|
</xsl:when>
|
5506
5830
|
<xsl:otherwise>
|
5507
5831
|
|
5508
5832
|
<xsl:text>[</xsl:text>
|
5509
5833
|
|
5510
|
-
<xsl:apply-templates/>
|
5834
|
+
<!-- <xsl:apply-templates /> -->
|
5835
|
+
<xsl:copy-of select="$termsource_text"/>
|
5511
5836
|
|
5512
5837
|
<xsl:text>]</xsl:text>
|
5513
5838
|
|
@@ -5518,20 +5843,27 @@
|
|
5518
5843
|
<xsl:if test="normalize-space() != ''">
|
5519
5844
|
<xsl:value-of select="."/>
|
5520
5845
|
</xsl:if>
|
5521
|
-
</xsl:template><xsl:
|
5846
|
+
</xsl:template><xsl:variable name="localized.source">
|
5847
|
+
<xsl:call-template name="getLocalizedString">
|
5848
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
5849
|
+
</xsl:call-template>
|
5850
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
5522
5851
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5852
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
5853
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
5854
|
+
</xsl:if>
|
5523
5855
|
|
5524
5856
|
<fo:inline>
|
5525
5857
|
|
5526
5858
|
|
5527
5859
|
|
5528
|
-
|
5529
|
-
|
5530
|
-
|
5860
|
+
|
5861
|
+
|
5862
|
+
<xsl:value-of select="$localized.source"/>
|
5863
|
+
<xsl:text> </xsl:text>
|
5531
5864
|
|
5532
5865
|
|
5533
5866
|
|
5534
|
-
<xsl:text>: </xsl:text>
|
5535
5867
|
</fo:inline>
|
5536
5868
|
|
5537
5869
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
@@ -5612,7 +5944,9 @@
|
|
5612
5944
|
|
5613
5945
|
|
5614
5946
|
</xsl:if>
|
5615
|
-
|
5947
|
+
|
5948
|
+
|
5949
|
+
|
5616
5950
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5617
5951
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5618
5952
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -5621,6 +5955,7 @@
|
|
5621
5955
|
|
5622
5956
|
|
5623
5957
|
|
5958
|
+
|
5624
5959
|
</xsl:if>
|
5625
5960
|
|
5626
5961
|
<xsl:apply-templates/>
|
@@ -5647,6 +5982,7 @@
|
|
5647
5982
|
|
5648
5983
|
|
5649
5984
|
|
5985
|
+
|
5650
5986
|
<xsl:choose>
|
5651
5987
|
<xsl:when test="$depth = 2">3</xsl:when>
|
5652
5988
|
<xsl:otherwise>4</xsl:otherwise>
|
@@ -5749,7 +6085,6 @@
|
|
5749
6085
|
|
5750
6086
|
|
5751
6087
|
|
5752
|
-
|
5753
6088
|
<xsl:apply-templates/>
|
5754
6089
|
</fo:block>
|
5755
6090
|
|
@@ -5766,6 +6101,7 @@
|
|
5766
6101
|
<xsl:call-template name="setId"/>
|
5767
6102
|
|
5768
6103
|
|
6104
|
+
|
5769
6105
|
<xsl:if test="@inline-header='true'">
|
5770
6106
|
<xsl:attribute name="text-align">justify</xsl:attribute>
|
5771
6107
|
</xsl:if>
|
@@ -5796,7 +6132,7 @@
|
|
5796
6132
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5797
6133
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5798
6134
|
<xsl:choose>
|
5799
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
6135
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
5800
6136
|
<fo:block-container>
|
5801
6137
|
<xsl:attribute name="margin-left">
|
5802
6138
|
<xsl:choose>
|
@@ -5806,6 +6142,7 @@
|
|
5806
6142
|
</xsl:attribute>
|
5807
6143
|
|
5808
6144
|
|
6145
|
+
|
5809
6146
|
<fo:block-container margin-left="0mm">
|
5810
6147
|
<fo:block>
|
5811
6148
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -6007,21 +6344,25 @@
|
|
6007
6344
|
|
6008
6345
|
|
6009
6346
|
|
6347
|
+
|
6348
|
+
|
6349
|
+
|
6350
|
+
|
6010
6351
|
</xsl:template><xsl:template name="processBibitemDocId">
|
6011
6352
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
6012
6353
|
<xsl:choose>
|
6013
6354
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
6014
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6355
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6015
6356
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
6016
6357
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6017
|
-
</xsl:if>
|
6358
|
+
</xsl:if> -->
|
6018
6359
|
<xsl:value-of select="$_doc_ident"/>
|
6019
6360
|
</xsl:when>
|
6020
6361
|
<xsl:otherwise>
|
6021
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6362
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6022
6363
|
<xsl:if test="$type != ''">
|
6023
6364
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6024
|
-
</xsl:if>
|
6365
|
+
</xsl:if> -->
|
6025
6366
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
6026
6367
|
</xsl:otherwise>
|
6027
6368
|
</xsl:choose>
|
@@ -6331,6 +6672,9 @@
|
|
6331
6672
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
6332
6673
|
<xsl:value-of select="$level_total - 1"/>
|
6333
6674
|
</xsl:when>
|
6675
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
6676
|
+
<xsl:value-of select="$level_total - 1"/>
|
6677
|
+
</xsl:when>
|
6334
6678
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
6335
6679
|
<xsl:value-of select="$level_total - 2"/>
|
6336
6680
|
</xsl:when>
|
@@ -6395,6 +6739,7 @@
|
|
6395
6739
|
|
6396
6740
|
|
6397
6741
|
|
6742
|
+
|
6398
6743
|
|
6399
6744
|
|
6400
6745
|
|
@@ -6455,17 +6800,29 @@
|
|
6455
6800
|
</xsl:call-template>
|
6456
6801
|
</xsl:if>
|
6457
6802
|
</xsl:template><xsl:template name="getLocalizedString">
|
6458
|
-
<xsl:param name="key"/>
|
6803
|
+
<xsl:param name="key"/>
|
6459
6804
|
|
6460
6805
|
<xsl:variable name="curr_lang">
|
6461
6806
|
<xsl:call-template name="getLang"/>
|
6462
6807
|
</xsl:variable>
|
6463
6808
|
|
6809
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
6810
|
+
|
6464
6811
|
<xsl:choose>
|
6812
|
+
<xsl:when test="$data_value != ''">
|
6813
|
+
<xsl:value-of select="$data_value"/>
|
6814
|
+
</xsl:when>
|
6465
6815
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6466
6816
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
6467
6817
|
</xsl:when>
|
6468
|
-
<xsl:otherwise
|
6818
|
+
<xsl:otherwise>
|
6819
|
+
<xsl:variable name="key_">
|
6820
|
+
<xsl:call-template name="capitalize">
|
6821
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
6822
|
+
</xsl:call-template>
|
6823
|
+
</xsl:variable>
|
6824
|
+
<xsl:value-of select="$key_"/>
|
6825
|
+
</xsl:otherwise>
|
6469
6826
|
</xsl:choose>
|
6470
6827
|
|
6471
6828
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
@@ -6508,4 +6865,110 @@
|
|
6508
6865
|
<xsl:value-of select="$align"/>
|
6509
6866
|
</xsl:when>
|
6510
6867
|
</xsl:choose>
|
6868
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
6869
|
+
<xsl:param name="default">left</xsl:param>
|
6870
|
+
<xsl:attribute name="text-align">
|
6871
|
+
<xsl:choose>
|
6872
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6873
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6874
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6875
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6876
|
+
</xsl:choose>
|
6877
|
+
</xsl:attribute>
|
6878
|
+
</xsl:template><xsl:template name="number-to-words">
|
6879
|
+
<xsl:param name="number"/>
|
6880
|
+
<xsl:param name="first"/>
|
6881
|
+
<xsl:if test="$number != ''">
|
6882
|
+
<xsl:variable name="words">
|
6883
|
+
<words>
|
6884
|
+
<word cardinal="1">One-</word>
|
6885
|
+
<word ordinal="1">First </word>
|
6886
|
+
<word cardinal="2">Two-</word>
|
6887
|
+
<word ordinal="2">Second </word>
|
6888
|
+
<word cardinal="3">Three-</word>
|
6889
|
+
<word ordinal="3">Third </word>
|
6890
|
+
<word cardinal="4">Four-</word>
|
6891
|
+
<word ordinal="4">Fourth </word>
|
6892
|
+
<word cardinal="5">Five-</word>
|
6893
|
+
<word ordinal="5">Fifth </word>
|
6894
|
+
<word cardinal="6">Six-</word>
|
6895
|
+
<word ordinal="6">Sixth </word>
|
6896
|
+
<word cardinal="7">Seven-</word>
|
6897
|
+
<word ordinal="7">Seventh </word>
|
6898
|
+
<word cardinal="8">Eight-</word>
|
6899
|
+
<word ordinal="8">Eighth </word>
|
6900
|
+
<word cardinal="9">Nine-</word>
|
6901
|
+
<word ordinal="9">Ninth </word>
|
6902
|
+
<word ordinal="10">Tenth </word>
|
6903
|
+
<word ordinal="11">Eleventh </word>
|
6904
|
+
<word ordinal="12">Twelfth </word>
|
6905
|
+
<word ordinal="13">Thirteenth </word>
|
6906
|
+
<word ordinal="14">Fourteenth </word>
|
6907
|
+
<word ordinal="15">Fifteenth </word>
|
6908
|
+
<word ordinal="16">Sixteenth </word>
|
6909
|
+
<word ordinal="17">Seventeenth </word>
|
6910
|
+
<word ordinal="18">Eighteenth </word>
|
6911
|
+
<word ordinal="19">Nineteenth </word>
|
6912
|
+
<word cardinal="20">Twenty-</word>
|
6913
|
+
<word ordinal="20">Twentieth </word>
|
6914
|
+
<word cardinal="30">Thirty-</word>
|
6915
|
+
<word ordinal="30">Thirtieth </word>
|
6916
|
+
<word cardinal="40">Forty-</word>
|
6917
|
+
<word ordinal="40">Fortieth </word>
|
6918
|
+
<word cardinal="50">Fifty-</word>
|
6919
|
+
<word ordinal="50">Fiftieth </word>
|
6920
|
+
<word cardinal="60">Sixty-</word>
|
6921
|
+
<word ordinal="60">Sixtieth </word>
|
6922
|
+
<word cardinal="70">Seventy-</word>
|
6923
|
+
<word ordinal="70">Seventieth </word>
|
6924
|
+
<word cardinal="80">Eighty-</word>
|
6925
|
+
<word ordinal="80">Eightieth </word>
|
6926
|
+
<word cardinal="90">Ninety-</word>
|
6927
|
+
<word ordinal="90">Ninetieth </word>
|
6928
|
+
<word cardinal="100">Hundred-</word>
|
6929
|
+
<word ordinal="100">Hundredth </word>
|
6930
|
+
</words>
|
6931
|
+
</xsl:variable>
|
6932
|
+
|
6933
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6934
|
+
|
6935
|
+
<xsl:variable name="value">
|
6936
|
+
<xsl:choose>
|
6937
|
+
<xsl:when test="$ordinal != ''">
|
6938
|
+
<xsl:value-of select="$ordinal"/>
|
6939
|
+
</xsl:when>
|
6940
|
+
<xsl:otherwise>
|
6941
|
+
<xsl:choose>
|
6942
|
+
<xsl:when test="$number < 100">
|
6943
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6944
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6945
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6946
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6947
|
+
</xsl:when>
|
6948
|
+
<xsl:otherwise>
|
6949
|
+
<!-- more 100 -->
|
6950
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6951
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6952
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6953
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6954
|
+
<xsl:call-template name="number-to-words">
|
6955
|
+
<xsl:with-param name="number" select="$digits"/>
|
6956
|
+
</xsl:call-template>
|
6957
|
+
</xsl:otherwise>
|
6958
|
+
</xsl:choose>
|
6959
|
+
</xsl:otherwise>
|
6960
|
+
</xsl:choose>
|
6961
|
+
</xsl:variable>
|
6962
|
+
<xsl:choose>
|
6963
|
+
<xsl:when test="$first = 'true'">
|
6964
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6965
|
+
<xsl:call-template name="capitalize">
|
6966
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6967
|
+
</xsl:call-template>
|
6968
|
+
</xsl:when>
|
6969
|
+
<xsl:otherwise>
|
6970
|
+
<xsl:value-of select="$value"/>
|
6971
|
+
</xsl:otherwise>
|
6972
|
+
</xsl:choose>
|
6973
|
+
</xsl:if>
|
6511
6974
|
</xsl:template></xsl:stylesheet>
|