metanorma-bipm 1.1.1 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.gitignore +4 -1
- data/.hound.yml +5 -0
- data/.rubocop.yml +4 -8
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/lib/asciidoctor/bipm/biblio.rng +1 -0
- data/lib/asciidoctor/bipm/bipm.rng +3 -0
- data/lib/asciidoctor/bipm/converter.rb +9 -1
- data/lib/asciidoctor/bipm/isodoc.rng +240 -10
- data/lib/isodoc/bipm/base_convert.rb +25 -11
- data/lib/isodoc/bipm/bipm.brochure.xsl +842 -118
- data/lib/isodoc/bipm/bipm.guide.xsl +842 -118
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +842 -118
- data/lib/isodoc/bipm/bipm.rapport.xsl +842 -118
- data/lib/isodoc/bipm/i18n-en.yaml +2 -0
- data/lib/isodoc/bipm/i18n-fr.yaml +2 -0
- data/lib/isodoc/bipm/index.rb +20 -16
- data/lib/isodoc/bipm/init.rb +1 -2
- data/lib/isodoc/bipm/jcgm.standard.xsl +714 -178
- data/lib/isodoc/bipm/presentation_xml_convert.rb +93 -34
- data/lib/isodoc/bipm/xref.rb +30 -7
- data/lib/metanorma-bipm.rb +4 -4
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +6 -5
@@ -39,33 +39,47 @@ module IsoDoc
|
|
39
39
|
ret
|
40
40
|
end
|
41
41
|
|
42
|
-
def nonstd_bibitem(list,
|
43
|
-
list.p **attr_code(iso_bibitem_entry_attrs(
|
44
|
-
ids = bibitem_ref_code(
|
42
|
+
def nonstd_bibitem(list, bibitem, ordinal, biblio)
|
43
|
+
list.p **attr_code(iso_bibitem_entry_attrs(bibitem, biblio)) do |ref|
|
44
|
+
ids = bibitem_ref_code(bibitem)
|
45
45
|
identifiers = render_identifier(ids)
|
46
46
|
if biblio then ref_entry_code(ref, ordinal, identifiers, ids)
|
47
47
|
else
|
48
|
-
ref <<
|
48
|
+
ref << identifiers[0] || identifiers[1]
|
49
49
|
ref << " #{identifiers[1]}" if identifiers[0] && identifiers[1]
|
50
50
|
end
|
51
51
|
ref << " " unless biblio && !identifiers[1]
|
52
|
-
reference_format(
|
52
|
+
reference_format(bibitem, ref)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
def std_bibitem_entry(list,
|
57
|
-
list.p **attr_code(iso_bibitem_entry_attrs(
|
58
|
-
identifiers = render_identifier(bibitem_ref_code(
|
56
|
+
def std_bibitem_entry(list, bibitem, ordinal, biblio)
|
57
|
+
list.p **attr_code(iso_bibitem_entry_attrs(bibitem, biblio)) do |ref|
|
58
|
+
identifiers = render_identifier(bibitem_ref_code(bibitem))
|
59
59
|
if biblio then ref_entry_code(ref, ordinal, identifiers, nil)
|
60
60
|
else
|
61
|
-
ref <<
|
61
|
+
ref << identifiers[0] || identifiers[1]
|
62
62
|
ref << " #{identifiers[1]}" if identifiers[0] && identifiers[1]
|
63
63
|
end
|
64
|
-
date_note_process(
|
64
|
+
date_note_process(bibitem, ref)
|
65
65
|
ref << " " unless biblio && !identifiers[1]
|
66
|
-
reference_format(
|
66
|
+
reference_format(bibitem, ref)
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
def term_cleanup(docxml)
|
71
|
+
@jcgm ? docxml : super
|
72
|
+
end
|
73
|
+
|
74
|
+
def termref_cleanup(docxml)
|
75
|
+
docxml
|
76
|
+
.gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/,
|
77
|
+
l10n(", #{@i18n.modified} [/TERMREF]"))
|
78
|
+
.gsub(%r{\s*\[/TERMREF\]\s*</p>\s*<p>\s*\[TERMREF\]}, "; ")
|
79
|
+
.gsub(/\[TERMREF\]\s*/, l10n("[#{@i18n.source} "))
|
80
|
+
.gsub(%r{\s*\[/TERMREF\]\s*}, l10n("]"))
|
81
|
+
.gsub(/\s*\[MODIFICATION\]/, l10n(", #{@i18n.modified} — "))
|
82
|
+
end
|
69
83
|
end
|
70
84
|
end
|
71
85
|
end
|
@@ -15,8 +15,12 @@
|
|
15
15
|
|
16
16
|
<xsl:variable name="first_pass" select="count($index//item) = 0"/>
|
17
17
|
|
18
|
-
<xsl:variable name="pageWidth" select="
|
19
|
-
<xsl:variable name="pageHeight" select="
|
18
|
+
<xsl:variable name="pageWidth" select="210"/>
|
19
|
+
<xsl:variable name="pageHeight" select="297"/>
|
20
|
+
<xsl:variable name="marginLeftRight1" select="31.7"/>
|
21
|
+
<xsl:variable name="marginLeftRight2" select="40"/>
|
22
|
+
<xsl:variable name="marginTop" select="25.4"/>
|
23
|
+
<xsl:variable name="marginBottom" select="22"/>
|
20
24
|
|
21
25
|
|
22
26
|
|
@@ -207,7 +211,7 @@
|
|
207
211
|
<fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
|
208
212
|
<fo:layout-master-set>
|
209
213
|
<!-- Cover page -->
|
210
|
-
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
214
|
+
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
211
215
|
<fo:region-body margin-top="36mm" margin-bottom="43mm" margin-left="49mm" margin-right="48mm"/>
|
212
216
|
<fo:region-before extent="36mm"/>
|
213
217
|
<fo:region-after extent="43mm"/>
|
@@ -216,7 +220,7 @@
|
|
216
220
|
</fo:simple-page-master>
|
217
221
|
|
218
222
|
<!-- Cover page -->
|
219
|
-
<fo:simple-page-master master-name="cover-page-appendix" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
223
|
+
<fo:simple-page-master master-name="cover-page-appendix" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
220
224
|
<fo:region-body margin-top="90mm" margin-bottom="40mm" margin-left="12.5mm" margin-right="53mm"/>
|
221
225
|
<fo:region-before extent="60mm"/>
|
222
226
|
<fo:region-after extent="40mm"/>
|
@@ -225,7 +229,7 @@
|
|
225
229
|
</fo:simple-page-master>
|
226
230
|
|
227
231
|
<!-- Title page -->
|
228
|
-
<fo:simple-page-master master-name="title-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
232
|
+
<fo:simple-page-master master-name="title-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
229
233
|
<fo:region-body margin-top="38mm" margin-bottom="25mm" margin-left="95mm" margin-right="12mm"/>
|
230
234
|
<fo:region-before extent="38mm"/>
|
231
235
|
<fo:region-after extent="25mm"/>
|
@@ -234,17 +238,17 @@
|
|
234
238
|
</fo:simple-page-master>
|
235
239
|
|
236
240
|
<!-- Document pages -->
|
237
|
-
<fo:simple-page-master master-name="document-odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
238
|
-
<fo:region-body margin-top="
|
239
|
-
<fo:region-before region-name="header-odd" extent="
|
240
|
-
<fo:region-after region-name="footer" extent="
|
241
|
+
<fo:simple-page-master master-name="document-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
242
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
243
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
244
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- debug: background-color="green" -->
|
241
245
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
242
246
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
243
247
|
</fo:simple-page-master>
|
244
|
-
<fo:simple-page-master master-name="document-even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
245
|
-
<fo:region-body margin-top="
|
246
|
-
<fo:region-before region-name="header-even" extent="
|
247
|
-
<fo:region-after region-name="footer" extent="
|
248
|
+
<fo:simple-page-master master-name="document-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
249
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
250
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
251
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- debug: background-color="green" -->
|
248
252
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
249
253
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
250
254
|
</fo:simple-page-master>
|
@@ -256,17 +260,17 @@
|
|
256
260
|
</fo:page-sequence-master>
|
257
261
|
|
258
262
|
<!-- Document pages (landscape orientation) -->
|
259
|
-
<fo:simple-page-master master-name="document-landscape-odd" page-width="{$pageHeight}" page-height="{$pageWidth}">
|
260
|
-
<fo:region-body margin-top="
|
261
|
-
<fo:region-before region-name="header-odd" extent="
|
262
|
-
<fo:region-after region-name="footer" extent="
|
263
|
+
<fo:simple-page-master master-name="document-landscape-odd" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
|
264
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
265
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
266
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- debug: background-color="green" -->
|
263
267
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
264
268
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
265
269
|
</fo:simple-page-master>
|
266
|
-
<fo:simple-page-master master-name="document-landscape-even" page-width="{$pageHeight}" page-height="{$pageWidth}">
|
267
|
-
<fo:region-body margin-top="
|
268
|
-
<fo:region-before region-name="header-even" extent="
|
269
|
-
<fo:region-after region-name="footer" extent="
|
270
|
+
<fo:simple-page-master master-name="document-landscape-even" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
|
271
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
272
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
273
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- debug: background-color="green" -->
|
270
274
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
271
275
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
272
276
|
</fo:simple-page-master>
|
@@ -278,17 +282,17 @@
|
|
278
282
|
</fo:page-sequence-master>
|
279
283
|
|
280
284
|
<!-- Index pages -->
|
281
|
-
<fo:simple-page-master master-name="index-odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
282
|
-
<fo:region-body margin-top="
|
283
|
-
<fo:region-before region-name="header-odd" extent="
|
284
|
-
<fo:region-after region-name="footer" extent="
|
285
|
+
<fo:simple-page-master master-name="index-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
286
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="41.7mm" column-count="2" column-gap="10mm"/>
|
287
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
288
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
285
289
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
286
290
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
287
291
|
</fo:simple-page-master>
|
288
|
-
<fo:simple-page-master master-name="index-even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
289
|
-
<fo:region-body margin-top="
|
290
|
-
<fo:region-before region-name="header-even" extent="
|
291
|
-
<fo:region-after region-name="footer" extent="
|
292
|
+
<fo:simple-page-master master-name="index-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
293
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="41.7mm" column-count="2" column-gap="10mm"/>
|
294
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
295
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
292
296
|
<fo:region-start region-name="left-region" extent="17mm"/>
|
293
297
|
<fo:region-end region-name="right-region" extent="26.5mm"/>
|
294
298
|
</fo:simple-page-master>
|
@@ -352,8 +356,12 @@
|
|
352
356
|
<xsl:apply-templates select="xalan:nodeset($current_document)" mode="flatxml"/>
|
353
357
|
</xsl:variable> -->
|
354
358
|
|
359
|
+
<xsl:variable name="title_eref">
|
360
|
+
<xsl:apply-templates select="." mode="title_eref"/>
|
361
|
+
</xsl:variable>
|
362
|
+
|
355
363
|
<xsl:variable name="flatxml_">
|
356
|
-
<xsl:apply-templates select="
|
364
|
+
<xsl:apply-templates select="xalan:nodeset($title_eref)" mode="flatxml"/>
|
357
365
|
</xsl:variable>
|
358
366
|
|
359
367
|
<xsl:variable name="flatxml">
|
@@ -383,8 +391,12 @@
|
|
383
391
|
<xsl:apply-templates select="xalan:nodeset($current_document)" mode="flatxml"/>
|
384
392
|
</xsl:variable> -->
|
385
393
|
|
394
|
+
<xsl:variable name="title_eref">
|
395
|
+
<xsl:apply-templates select="." mode="title_eref"/>
|
396
|
+
</xsl:variable>
|
397
|
+
|
386
398
|
<xsl:variable name="flatxml_">
|
387
|
-
<xsl:apply-templates select="
|
399
|
+
<xsl:apply-templates select="xalan:nodeset($title_eref)" mode="flatxml"/>
|
388
400
|
</xsl:variable>
|
389
401
|
|
390
402
|
<xsl:variable name="flatxml">
|
@@ -403,8 +415,12 @@
|
|
403
415
|
</xsl:when>
|
404
416
|
<xsl:otherwise>
|
405
417
|
|
418
|
+
<xsl:variable name="title_eref">
|
419
|
+
<xsl:apply-templates mode="title_eref"/>
|
420
|
+
</xsl:variable>
|
421
|
+
|
406
422
|
<xsl:variable name="flatxml_">
|
407
|
-
<xsl:apply-templates mode="flatxml"/>
|
423
|
+
<xsl:apply-templates select="xalan:nodeset($title_eref)" mode="flatxml"/>
|
408
424
|
</xsl:variable>
|
409
425
|
|
410
426
|
<xsl:variable name="flatxml">
|
@@ -426,6 +442,27 @@
|
|
426
442
|
</fo:root>
|
427
443
|
</xsl:template>
|
428
444
|
|
445
|
+
<!-- ================================= -->
|
446
|
+
<!-- Move eref inside title -->
|
447
|
+
<!-- ================================= -->
|
448
|
+
<xsl:template match="@*|node()" mode="title_eref">
|
449
|
+
<xsl:copy>
|
450
|
+
<xsl:apply-templates select="@*|node()" mode="title_eref"/>
|
451
|
+
</xsl:copy>
|
452
|
+
</xsl:template>
|
453
|
+
|
454
|
+
<xsl:template match="bipm:title[following-sibling::*[1][self::bipm:eref]]" mode="title_eref">
|
455
|
+
<xsl:copy>
|
456
|
+
<xsl:apply-templates select="@*|node()" mode="title_eref"/>
|
457
|
+
<!-- move next eref inside title -->
|
458
|
+
<xsl:copy-of select="following-sibling::*[1][self::bipm:eref]"/>
|
459
|
+
</xsl:copy>
|
460
|
+
</xsl:template>
|
461
|
+
<!-- remove eref immediately after title -->
|
462
|
+
<xsl:template match="bipm:eref[preceding-sibling::*[1][self::bipm:title]]" mode="title_eref"/>
|
463
|
+
<!-- ================================= -->
|
464
|
+
<!-- END Move eref inside title -->
|
465
|
+
<!-- ================================= -->
|
429
466
|
|
430
467
|
<!-- ================================= -->
|
431
468
|
<!-- Flattening xml for fit notes at page sides (margins) -->
|
@@ -1112,8 +1149,11 @@
|
|
1112
1149
|
|
1113
1150
|
<xsl:variable name="title-toc">
|
1114
1151
|
<fo:inline>
|
1115
|
-
<xsl:call-template name="getTitle">
|
1152
|
+
<!-- <xsl:call-template name="getTitle">
|
1116
1153
|
<xsl:with-param name="name" select="'title-toc'"/>
|
1154
|
+
</xsl:call-template> -->
|
1155
|
+
<xsl:call-template name="getLocalizedString">
|
1156
|
+
<xsl:with-param name="key">table_of_contents</xsl:with-param>
|
1117
1157
|
</xsl:call-template>
|
1118
1158
|
</fo:inline>
|
1119
1159
|
</xsl:variable>
|
@@ -1706,9 +1746,9 @@
|
|
1706
1746
|
<!-- background color -->
|
1707
1747
|
<fo:block-container absolute-position="fixed" left="0" top="-1mm">
|
1708
1748
|
<fo:block>
|
1709
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
1710
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
|
1711
|
-
<rect width="{$pageWidth}" height="{$pageHeight}" style="fill:rgb(214,226,239);stroke-width:0"/>
|
1749
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
1750
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
|
1751
|
+
<rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(214,226,239);stroke-width:0"/>
|
1712
1752
|
</svg>
|
1713
1753
|
</fo:instream-foreign-object>
|
1714
1754
|
</fo:block>
|
@@ -2268,7 +2308,7 @@
|
|
2268
2308
|
<xsl:when test="$level = 2 and ancestor::bipm:annex">10.5pt</xsl:when>
|
2269
2309
|
<xsl:when test="$level = 2">14pt</xsl:when>
|
2270
2310
|
<xsl:when test="$level = 3 and ancestor::bipm:annex">10pt</xsl:when>
|
2271
|
-
<xsl:when test="$level
|
2311
|
+
<xsl:when test="$level >= 4 and ancestor::bipm:annex">9pt</xsl:when>
|
2272
2312
|
<xsl:when test="$level = 3">12pt</xsl:when>
|
2273
2313
|
<xsl:otherwise>11pt</xsl:otherwise>
|
2274
2314
|
</xsl:choose>
|
@@ -2364,8 +2404,10 @@
|
|
2364
2404
|
</xsl:if> -->
|
2365
2405
|
<xsl:choose>
|
2366
2406
|
<xsl:when test="ancestor::bipm:annex and $level >= 2">
|
2367
|
-
<xsl:if test="$level
|
2407
|
+
<xsl:if test="$level >= 3">
|
2368
2408
|
<xsl:attribute name="margin-left">14mm</xsl:attribute>
|
2409
|
+
</xsl:if>
|
2410
|
+
<xsl:if test="$level = 3">
|
2369
2411
|
<fo:inline padding-right="2.5mm" baseline-shift="15%">
|
2370
2412
|
<fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
|
2371
2413
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
|
@@ -2375,7 +2417,6 @@
|
|
2375
2417
|
</fo:inline>
|
2376
2418
|
</xsl:if>
|
2377
2419
|
<xsl:if test="$level = 4">
|
2378
|
-
<xsl:attribute name="margin-left">14mm</xsl:attribute>
|
2379
2420
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
2380
2421
|
</xsl:if>
|
2381
2422
|
<xsl:call-template name="extractTitle"/>
|
@@ -2900,11 +2941,13 @@
|
|
2900
2941
|
<xsl:choose>
|
2901
2942
|
<xsl:when test="$num = 1">
|
2902
2943
|
<fo:inline xsl:use-attribute-sets="note-p-style">
|
2944
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
2903
2945
|
<xsl:apply-templates/>
|
2904
2946
|
</fo:inline>
|
2905
2947
|
</xsl:when>
|
2906
2948
|
<xsl:otherwise>
|
2907
2949
|
<fo:block xsl:use-attribute-sets="note-p-style">
|
2950
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
2908
2951
|
<xsl:apply-templates/>
|
2909
2952
|
</fo:block>
|
2910
2953
|
</xsl:otherwise>
|
@@ -2968,6 +3011,7 @@
|
|
2968
3011
|
<xsl:attribute name="text-align">
|
2969
3012
|
<xsl:choose>
|
2970
3013
|
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
3014
|
+
<xsl:when test="ancestor::*[local-name() = 'note_side']">left</xsl:when>
|
2971
3015
|
<xsl:when test="../@align"><xsl:value-of select="../@align"/></xsl:when>
|
2972
3016
|
<xsl:otherwise>justify</xsl:otherwise>
|
2973
3017
|
</xsl:choose>
|
@@ -3075,9 +3119,10 @@
|
|
3075
3119
|
<fo:inline>
|
3076
3120
|
<!-- <xsl:if test="@list_type = 'ul'">
|
3077
3121
|
<xsl:attribute name="font-size">15pt</xsl:attribute> -->
|
3078
|
-
<xsl:
|
3079
|
-
|
3080
|
-
|
3122
|
+
<xsl:copy-of select="@font-size"/>
|
3123
|
+
<xsl:copy-of select="@baseline-shift"/>
|
3124
|
+
<xsl:if test="@list_type = 'ul' and ancestor::bipm:note_side">
|
3125
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3081
3126
|
</xsl:if>
|
3082
3127
|
<xsl:value-of select="@label"/>
|
3083
3128
|
</fo:inline>
|
@@ -3175,7 +3220,7 @@
|
|
3175
3220
|
</xsl:template>
|
3176
3221
|
|
3177
3222
|
<xsl:template match="bipm:example" priority="2">
|
3178
|
-
<fo:block margin-top="6pt" margin-bottom="6pt">
|
3223
|
+
<fo:block margin-top="6pt" margin-bottom="6pt" keep-together.within-column="1">
|
3179
3224
|
<fo:table table-layout="fixed" width="100%">
|
3180
3225
|
<fo:table-column column-width="27.5mm"/>
|
3181
3226
|
<fo:table-column column-width="108mm"/>
|
@@ -3321,6 +3366,11 @@
|
|
3321
3366
|
|
3322
3367
|
<xsl:template match="bipm:xref" priority="2">
|
3323
3368
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
|
3369
|
+
|
3370
|
+
<xsl:if test="parent::*[local-name() = 'title']">
|
3371
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
3372
|
+
</xsl:if>
|
3373
|
+
|
3324
3374
|
<xsl:choose>
|
3325
3375
|
<xsl:when test="@pagenumber='true'"><!-- ToC in Appendix, and page in references like this: « Le BIPM et la Convention du Mètre » (page 5). -->
|
3326
3376
|
<fo:inline> <!-- font-weight="bold" -->
|
@@ -3477,6 +3527,12 @@
|
|
3477
3527
|
<xsl:attribute name="separators"/>
|
3478
3528
|
</xsl:if>
|
3479
3529
|
<mathml:mspace width="-0.15em"/> <!-- decrease space between opening brackets and inside text-->
|
3530
|
+
|
3531
|
+
<!-- if there is previous or next mfenced with superscript, then increase height of Parentheses -->
|
3532
|
+
<xsl:if test="following-sibling::mathml:mfenced[.//mathml:msup] or preceding-sibling::mathml:mfenced[.//mathml:msup] or ancestor::*[following-sibling::mathml:mfenced[.//mathml:msup] or preceding-sibling::mathml:mfenced[.//mathml:msup]]">
|
3533
|
+
<mathml:mspace height="1.15em"/> <!-- increase height of parentheses -->
|
3534
|
+
</xsl:if>
|
3535
|
+
|
3480
3536
|
<xsl:apply-templates mode="mathml"/>
|
3481
3537
|
<mathml:mspace width="-0.1em"/> <!-- decrease space between inside text and closing brackets -->
|
3482
3538
|
</xsl:copy>
|
@@ -3501,12 +3557,41 @@
|
|
3501
3557
|
</xsl:template> -->
|
3502
3558
|
|
3503
3559
|
<!-- Decrease height of / and | -->
|
3560
|
+
<!-- Decrease space before and after / -->
|
3504
3561
|
<xsl:template match="mathml:mo[normalize-space(text()) = '/' or normalize-space(text()) = '|']" mode="mathml">
|
3505
3562
|
<xsl:copy>
|
3506
3563
|
<xsl:apply-templates select="@*" mode="mathml"/>
|
3507
|
-
|
3508
|
-
|
3564
|
+
<xsl:if test="not(@stretchy) and not(preceding-sibling::*[1][local-name() = 'mfrac'] and following-sibling::*[1][local-name() = 'mfrac'])">
|
3565
|
+
<xsl:attribute name="stretchy">false</xsl:attribute>
|
3566
|
+
</xsl:if>
|
3567
|
+
<xsl:if test="normalize-space(text()) = '/'">
|
3568
|
+
<xsl:if test="not(@lspace)">
|
3569
|
+
<xsl:attribute name="lspace">0em</xsl:attribute>
|
3570
|
+
<xsl:if test="preceding-sibling::*[1][local-name() = 'msub']">
|
3571
|
+
<xsl:attribute name="lspace">0.1em</xsl:attribute>
|
3572
|
+
</xsl:if>
|
3509
3573
|
</xsl:if>
|
3574
|
+
<xsl:if test="not(@rspace)">
|
3575
|
+
<xsl:attribute name="rspace">0em</xsl:attribute>
|
3576
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'mfenced']">
|
3577
|
+
<xsl:attribute name="rspace">-0.1em</xsl:attribute>
|
3578
|
+
</xsl:if>
|
3579
|
+
</xsl:if>
|
3580
|
+
</xsl:if>
|
3581
|
+
<xsl:apply-templates mode="mathml"/>
|
3582
|
+
</xsl:copy>
|
3583
|
+
</xsl:template>
|
3584
|
+
|
3585
|
+
<!-- Increase space before and after multiplication sign -->
|
3586
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '×']" mode="mathml"> <!-- multiplication sign -->
|
3587
|
+
<xsl:copy>
|
3588
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
3589
|
+
<xsl:if test="not(@lspace)">
|
3590
|
+
<xsl:attribute name="lspace">0.5em</xsl:attribute>
|
3591
|
+
</xsl:if>
|
3592
|
+
<xsl:if test="not(@rspace)">
|
3593
|
+
<xsl:attribute name="rspace">0.5em</xsl:attribute>
|
3594
|
+
</xsl:if>
|
3510
3595
|
<xsl:apply-templates mode="mathml"/>
|
3511
3596
|
</xsl:copy>
|
3512
3597
|
</xsl:template>
|
@@ -3525,6 +3610,29 @@
|
|
3525
3610
|
</xsl:copy>
|
3526
3611
|
</xsl:template>
|
3527
3612
|
|
3613
|
+
<!-- decrease space before and after sign 'minus' -->
|
3614
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '−']" mode="mathml"> <!-- minus sign -->
|
3615
|
+
<xsl:copy>
|
3616
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
3617
|
+
<xsl:choose>
|
3618
|
+
<xsl:when test="not(preceding-sibling::*)"><!-- example: -0.234 -->
|
3619
|
+
<xsl:if test="not(@rspace)">
|
3620
|
+
<xsl:attribute name="rspace">0em</xsl:attribute>
|
3621
|
+
</xsl:if>
|
3622
|
+
</xsl:when>
|
3623
|
+
<xsl:otherwise>
|
3624
|
+
<xsl:if test="not(@lspace)">
|
3625
|
+
<xsl:attribute name="lspace">0.2em</xsl:attribute>
|
3626
|
+
</xsl:if>
|
3627
|
+
<xsl:if test="not(@rspace)">
|
3628
|
+
<xsl:attribute name="rspace">0.2em</xsl:attribute>
|
3629
|
+
</xsl:if>
|
3630
|
+
</xsl:otherwise>
|
3631
|
+
</xsl:choose>
|
3632
|
+
<xsl:apply-templates mode="mathml"/>
|
3633
|
+
</xsl:copy>
|
3634
|
+
</xsl:template>
|
3635
|
+
|
3528
3636
|
<xsl:template match="mathml:mi[string-length(normalize-space()) > 1]" mode="mathml" priority="2">
|
3529
3637
|
<xsl:if test="preceding-sibling::* and preceding-sibling::*[1][not(local-name() = 'mfenced' or local-name() = 'mo')]">
|
3530
3638
|
<mathml:mspace width="0.3em"/>
|
@@ -3535,6 +3643,10 @@
|
|
3535
3643
|
</xsl:if>
|
3536
3644
|
</xsl:template>
|
3537
3645
|
|
3646
|
+
<xsl:template match="mathml:mn/text()" mode="mathml">
|
3647
|
+
<xsl:value-of select="translate(., ' ', ' ')"/>
|
3648
|
+
</xsl:template>
|
3649
|
+
|
3538
3650
|
<xsl:template name="insertHeaderFooter">
|
3539
3651
|
<xsl:param name="header-title"/>
|
3540
3652
|
<xsl:param name="orientation"/>
|
@@ -4077,7 +4189,7 @@
|
|
4077
4189
|
<!-- grey opacity -->
|
4078
4190
|
<fo:block-container absolute-position="fixed" left="0" top="0">
|
4079
4191
|
<fo:block>
|
4080
|
-
<fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
|
4192
|
+
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
4081
4193
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
|
4082
4194
|
<rect width="215.9mm" height="279.4mm" style="fill:rgb(255,255,255);stroke-width:0;fill-opacity:0.73"/>
|
4083
4195
|
</svg>
|
@@ -4314,6 +4426,9 @@
|
|
4314
4426
|
<title-continued lang="en">(continued)</title-continued>
|
4315
4427
|
<title-continued lang="fr">(continué)</title-continued>
|
4316
4428
|
|
4429
|
+
</xsl:variable><xsl:variable name="bibdata">
|
4430
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
4431
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
4317
4432
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
4318
4433
|
<xsl:param name="name"/>
|
4319
4434
|
<xsl:param name="lang"/>
|
@@ -4345,11 +4460,13 @@
|
|
4345
4460
|
|
4346
4461
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
4347
4462
|
|
4463
|
+
|
4348
4464
|
<xsl:attribute name="color">blue</xsl:attribute>
|
4349
4465
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
4350
4466
|
|
4351
4467
|
|
4352
4468
|
|
4469
|
+
|
4353
4470
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
4354
4471
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
4355
4472
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -4391,7 +4508,7 @@
|
|
4391
4508
|
|
4392
4509
|
|
4393
4510
|
|
4394
|
-
|
4511
|
+
|
4395
4512
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
4396
4513
|
|
4397
4514
|
|
@@ -4407,6 +4524,7 @@
|
|
4407
4524
|
<xsl:attribute name="margin-top">6pt</xsl:attribute>
|
4408
4525
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4409
4526
|
|
4527
|
+
|
4410
4528
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
4411
4529
|
|
4412
4530
|
|
@@ -4423,9 +4541,7 @@
|
|
4423
4541
|
|
4424
4542
|
|
4425
4543
|
|
4426
|
-
|
4427
|
-
|
4428
|
-
|
4544
|
+
|
4429
4545
|
|
4430
4546
|
|
4431
4547
|
|
@@ -4452,8 +4568,10 @@
|
|
4452
4568
|
|
4453
4569
|
|
4454
4570
|
|
4571
|
+
|
4455
4572
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
4456
4573
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4574
|
+
|
4457
4575
|
|
4458
4576
|
|
4459
4577
|
|
@@ -4473,6 +4591,9 @@
|
|
4473
4591
|
<xsl:attribute name="text-indent">-25mm</xsl:attribute>
|
4474
4592
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4475
4593
|
|
4594
|
+
|
4595
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
4596
|
+
|
4476
4597
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
4477
4598
|
|
4478
4599
|
|
@@ -4485,15 +4606,20 @@
|
|
4485
4606
|
|
4486
4607
|
|
4487
4608
|
|
4609
|
+
|
4610
|
+
|
4488
4611
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
4489
4612
|
|
4490
4613
|
|
4491
4614
|
|
4492
4615
|
|
4616
|
+
|
4617
|
+
|
4493
4618
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
4494
4619
|
|
4495
4620
|
|
4496
4621
|
|
4622
|
+
|
4497
4623
|
|
4498
4624
|
|
4499
4625
|
|
@@ -4507,6 +4633,7 @@
|
|
4507
4633
|
|
4508
4634
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
4509
4635
|
|
4636
|
+
|
4510
4637
|
</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">
|
4511
4638
|
|
4512
4639
|
|
@@ -4520,6 +4647,7 @@
|
|
4520
4647
|
|
4521
4648
|
|
4522
4649
|
|
4650
|
+
|
4523
4651
|
</xsl:attribute-set><xsl:attribute-set name="note-p-style">
|
4524
4652
|
|
4525
4653
|
|
@@ -4542,11 +4670,15 @@
|
|
4542
4670
|
|
4543
4671
|
|
4544
4672
|
|
4673
|
+
|
4674
|
+
|
4545
4675
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
4676
|
+
|
4546
4677
|
|
4547
4678
|
|
4548
4679
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4549
4680
|
|
4681
|
+
|
4550
4682
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
4551
4683
|
|
4552
4684
|
|
@@ -4565,14 +4697,18 @@
|
|
4565
4697
|
|
4566
4698
|
|
4567
4699
|
|
4700
|
+
|
4701
|
+
|
4568
4702
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
4569
4703
|
|
4570
4704
|
|
4571
4705
|
|
4706
|
+
|
4572
4707
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
4573
4708
|
|
4574
4709
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
4575
4710
|
|
4711
|
+
|
4576
4712
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
4577
4713
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4578
4714
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
@@ -4592,6 +4728,7 @@
|
|
4592
4728
|
|
4593
4729
|
|
4594
4730
|
|
4731
|
+
|
4595
4732
|
|
4596
4733
|
|
4597
4734
|
|
@@ -4605,10 +4742,12 @@
|
|
4605
4742
|
|
4606
4743
|
|
4607
4744
|
|
4745
|
+
|
4608
4746
|
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
|
4609
4747
|
|
4610
4748
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
4611
4749
|
|
4750
|
+
|
4612
4751
|
<xsl:attribute name="width">100%</xsl:attribute>
|
4613
4752
|
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
4614
4753
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -4633,11 +4772,14 @@
|
|
4633
4772
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
4634
4773
|
|
4635
4774
|
|
4775
|
+
|
4636
4776
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
4637
4777
|
|
4778
|
+
|
4638
4779
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
4639
4780
|
|
4640
4781
|
|
4782
|
+
|
4641
4783
|
</xsl:attribute-set><xsl:variable name="color-added-text">
|
4642
4784
|
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
4643
4785
|
</xsl:variable><xsl:attribute-set name="add-style">
|
@@ -4656,6 +4798,8 @@
|
|
4656
4798
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
4657
4799
|
|
4658
4800
|
|
4801
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
4802
|
+
|
4659
4803
|
</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">
|
4660
4804
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
4661
4805
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -4666,14 +4810,15 @@
|
|
4666
4810
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
4667
4811
|
|
4668
4812
|
<!-- Normative references -->
|
4669
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
4813
|
+
<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"/>
|
4670
4814
|
<!-- Terms and definitions -->
|
4671
4815
|
<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"/>
|
4672
4816
|
<!-- Another main sections -->
|
4673
4817
|
<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"/>
|
4674
4818
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
4675
4819
|
<!-- Bibliography -->
|
4676
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
4820
|
+
<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"/>
|
4821
|
+
|
4677
4822
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
4678
4823
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
4679
4824
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -4709,11 +4854,11 @@
|
|
4709
4854
|
<xsl:variable name="table">
|
4710
4855
|
|
4711
4856
|
<xsl:variable name="simple-table">
|
4712
|
-
<xsl:call-template name="getSimpleTable"/>
|
4857
|
+
<xsl:call-template name="getSimpleTable"/>
|
4713
4858
|
</xsl:variable>
|
4714
4859
|
|
4715
4860
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
4716
|
-
<fo:block> </fo:block>
|
4861
|
+
<fo:block> </fo:block>
|
4717
4862
|
</xsl:if> -->
|
4718
4863
|
|
4719
4864
|
<!-- $namespace = 'iso' or -->
|
@@ -4776,6 +4921,7 @@
|
|
4776
4921
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
4777
4922
|
|
4778
4923
|
|
4924
|
+
|
4779
4925
|
|
4780
4926
|
|
4781
4927
|
|
@@ -4787,6 +4933,8 @@
|
|
4787
4933
|
|
4788
4934
|
|
4789
4935
|
|
4936
|
+
|
4937
|
+
|
4790
4938
|
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
4791
4939
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
4792
4940
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -4822,6 +4970,7 @@
|
|
4822
4970
|
|
4823
4971
|
|
4824
4972
|
|
4973
|
+
|
4825
4974
|
|
4826
4975
|
|
4827
4976
|
|
@@ -4834,6 +4983,8 @@
|
|
4834
4983
|
</xsl:if>
|
4835
4984
|
<attribute name="margin-left">0mm</attribute>
|
4836
4985
|
<attribute name="margin-right">0mm</attribute>
|
4986
|
+
<!-- <attribute name="keep-together.within-column">1</attribute> --> <!-- integer value instead 'always'! -->
|
4987
|
+
|
4837
4988
|
|
4838
4989
|
</xsl:variable>
|
4839
4990
|
|
@@ -4968,6 +5119,7 @@
|
|
4968
5119
|
</xsl:choose>
|
4969
5120
|
|
4970
5121
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
5122
|
+
<xsl:param name="continued"/>
|
4971
5123
|
<xsl:if test="normalize-space() != ''">
|
4972
5124
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
4973
5125
|
|
@@ -4979,7 +5131,20 @@
|
|
4979
5131
|
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
4980
5132
|
</xsl:if>
|
4981
5133
|
|
4982
|
-
|
5134
|
+
|
5135
|
+
|
5136
|
+
|
5137
|
+
<xsl:choose>
|
5138
|
+
<xsl:when test="$continued = 'true'">
|
5139
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
5140
|
+
|
5141
|
+
</xsl:when>
|
5142
|
+
<xsl:otherwise>
|
5143
|
+
<xsl:apply-templates/>
|
5144
|
+
</xsl:otherwise>
|
5145
|
+
</xsl:choose>
|
5146
|
+
|
5147
|
+
|
4983
5148
|
</fo:block>
|
4984
5149
|
</xsl:if>
|
4985
5150
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -5116,21 +5281,22 @@
|
|
5116
5281
|
<!-- font-weight="bold" -->
|
5117
5282
|
<fo:table-header>
|
5118
5283
|
|
5284
|
+
|
5119
5285
|
<xsl:apply-templates/>
|
5120
5286
|
</fo:table-header>
|
5121
5287
|
</xsl:template><xsl:template name="table-header-title">
|
5122
|
-
<xsl:param name="cols-count"/>
|
5288
|
+
<xsl:param name="cols-count"/>
|
5123
5289
|
<!-- row for title -->
|
5124
5290
|
<fo:table-row>
|
5125
5291
|
<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">
|
5126
|
-
|
5292
|
+
|
5293
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
5294
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
5295
|
+
</xsl:apply-templates>
|
5127
5296
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
5128
5297
|
<xsl:call-template name="fn_name_display"/>
|
5129
|
-
</xsl:for-each>
|
5130
|
-
|
5131
|
-
<xsl:text> </xsl:text>
|
5132
|
-
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
5133
|
-
</fo:block>
|
5298
|
+
</xsl:for-each>
|
5299
|
+
|
5134
5300
|
</fo:table-cell>
|
5135
5301
|
</fo:table-row>
|
5136
5302
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -5268,6 +5434,7 @@
|
|
5268
5434
|
|
5269
5435
|
|
5270
5436
|
|
5437
|
+
|
5271
5438
|
<!-- fn will be processed inside 'note' processing -->
|
5272
5439
|
|
5273
5440
|
|
@@ -5276,7 +5443,6 @@
|
|
5276
5443
|
|
5277
5444
|
|
5278
5445
|
|
5279
|
-
|
5280
5446
|
<xsl:if test="count(ancestor::bipm:table//*[local-name()='note']) > 1">
|
5281
5447
|
<fo:block font-weight="bold">
|
5282
5448
|
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language"/>
|
@@ -5288,6 +5454,11 @@
|
|
5288
5454
|
</xsl:if>
|
5289
5455
|
|
5290
5456
|
|
5457
|
+
|
5458
|
+
|
5459
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
5460
|
+
|
5461
|
+
|
5291
5462
|
<!-- except gb -->
|
5292
5463
|
|
5293
5464
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -5313,6 +5484,10 @@
|
|
5313
5484
|
<!-- fn processing -->
|
5314
5485
|
<xsl:call-template name="fn_display"/>
|
5315
5486
|
|
5487
|
+
|
5488
|
+
<!-- for PAS display Notes after footnotes -->
|
5489
|
+
|
5490
|
+
|
5316
5491
|
</fo:table-cell>
|
5317
5492
|
</fo:table-row>
|
5318
5493
|
</fo:table-body>
|
@@ -5365,10 +5540,12 @@
|
|
5365
5540
|
|
5366
5541
|
|
5367
5542
|
|
5543
|
+
|
5368
5544
|
</xsl:if>
|
5369
5545
|
<xsl:if test="$parent-name = 'tfoot'">
|
5370
5546
|
|
5371
5547
|
|
5548
|
+
|
5372
5549
|
</xsl:if>
|
5373
5550
|
|
5374
5551
|
|
@@ -5381,6 +5558,10 @@
|
|
5381
5558
|
<xsl:attribute name="min-height">5mm</xsl:attribute>
|
5382
5559
|
</xsl:if>
|
5383
5560
|
|
5561
|
+
|
5562
|
+
|
5563
|
+
|
5564
|
+
|
5384
5565
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
5385
5566
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
5386
5567
|
</xsl:if> -->
|
@@ -5409,6 +5590,7 @@
|
|
5409
5590
|
|
5410
5591
|
|
5411
5592
|
|
5593
|
+
|
5412
5594
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5413
5595
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
5414
5596
|
<!-- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute> -->
|
@@ -5431,6 +5613,7 @@
|
|
5431
5613
|
<xsl:attribute name="display-align">before</xsl:attribute>
|
5432
5614
|
</xsl:if>
|
5433
5615
|
|
5616
|
+
|
5434
5617
|
<xsl:if test="$lang = 'ar'">
|
5435
5618
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
5436
5619
|
</xsl:if>
|
@@ -5485,6 +5668,8 @@
|
|
5485
5668
|
|
5486
5669
|
|
5487
5670
|
|
5671
|
+
|
5672
|
+
|
5488
5673
|
<xsl:attribute name="border">solid 0pt white</xsl:attribute>
|
5489
5674
|
<xsl:variable name="rownum"><xsl:number count="*[local-name()='tr']"/></xsl:variable>
|
5490
5675
|
<xsl:if test="$rownum = 1">
|
@@ -5497,6 +5682,9 @@
|
|
5497
5682
|
<xsl:attribute name="display-align">before</xsl:attribute>
|
5498
5683
|
</xsl:if>
|
5499
5684
|
|
5685
|
+
|
5686
|
+
|
5687
|
+
|
5500
5688
|
<xsl:if test=".//*[local-name() = 'table']">
|
5501
5689
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
5502
5690
|
</xsl:if>
|
@@ -5516,6 +5704,11 @@
|
|
5516
5704
|
<xsl:if test="not(.//bipm:image)">
|
5517
5705
|
<xsl:attribute name="line-stacking-strategy">font-height</xsl:attribute>
|
5518
5706
|
</xsl:if>
|
5707
|
+
<!-- hanging indent for left column -->
|
5708
|
+
<xsl:if test="not(preceding-sibling::*[local-name() = 'td'])">
|
5709
|
+
<xsl:attribute name="text-indent">-3mm</xsl:attribute>
|
5710
|
+
<xsl:attribute name="start-indent">3mm</xsl:attribute>
|
5711
|
+
</xsl:if>
|
5519
5712
|
|
5520
5713
|
<xsl:apply-templates/>
|
5521
5714
|
</fo:block>
|
@@ -5528,6 +5721,7 @@
|
|
5528
5721
|
|
5529
5722
|
|
5530
5723
|
|
5724
|
+
|
5531
5725
|
|
5532
5726
|
<xsl:attribute name="text-align">justify</xsl:attribute>
|
5533
5727
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
@@ -5535,11 +5729,15 @@
|
|
5535
5729
|
<xsl:attribute name="margin-top">18pt</xsl:attribute>
|
5536
5730
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
5537
5731
|
</xsl:if>
|
5538
|
-
|
5539
5732
|
|
5540
5733
|
|
5734
|
+
|
5735
|
+
<!-- Table's note name (NOTE, for example) -->
|
5736
|
+
|
5541
5737
|
<fo:inline padding-right="2mm">
|
5542
5738
|
|
5739
|
+
|
5740
|
+
|
5543
5741
|
|
5544
5742
|
|
5545
5743
|
|
@@ -5552,10 +5750,12 @@
|
|
5552
5750
|
|
5553
5751
|
</fo:inline>
|
5554
5752
|
|
5753
|
+
|
5555
5754
|
<xsl:if test="ancestor::bipm:preface">
|
5556
5755
|
<fo:block> </fo:block>
|
5557
5756
|
</xsl:if>
|
5558
5757
|
|
5758
|
+
|
5559
5759
|
<xsl:apply-templates mode="process"/>
|
5560
5760
|
</fo:block>
|
5561
5761
|
|
@@ -5575,6 +5775,8 @@
|
|
5575
5775
|
<xsl:variable name="reference" select="@reference"/>
|
5576
5776
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
5577
5777
|
<fo:block margin-bottom="12pt">
|
5778
|
+
|
5779
|
+
|
5578
5780
|
|
5579
5781
|
|
5580
5782
|
|
@@ -5593,6 +5795,7 @@
|
|
5593
5795
|
|
5594
5796
|
|
5595
5797
|
|
5798
|
+
|
5596
5799
|
<xsl:attribute name="font-style">italic</xsl:attribute>
|
5597
5800
|
|
5598
5801
|
<xsl:attribute name="padding-right">2.5mm</xsl:attribute>
|
@@ -5603,6 +5806,7 @@
|
|
5603
5806
|
<fo:inline font-style="normal">)</fo:inline>
|
5604
5807
|
|
5605
5808
|
|
5809
|
+
|
5606
5810
|
</fo:inline>
|
5607
5811
|
<fo:inline>
|
5608
5812
|
|
@@ -5743,10 +5947,14 @@
|
|
5743
5947
|
|
5744
5948
|
|
5745
5949
|
|
5950
|
+
|
5951
|
+
|
5952
|
+
|
5746
5953
|
<xsl:attribute name="font-size">70%</xsl:attribute>
|
5747
5954
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
5748
5955
|
<xsl:attribute name="font-style">italic</xsl:attribute>
|
5749
5956
|
|
5957
|
+
|
5750
5958
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
5751
5959
|
|
5752
5960
|
|
@@ -5756,6 +5964,7 @@
|
|
5756
5964
|
|
5757
5965
|
<fo:inline font-style="normal">)</fo:inline>
|
5758
5966
|
|
5967
|
+
|
5759
5968
|
</fo:basic-link>
|
5760
5969
|
</fo:inline>
|
5761
5970
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -5846,6 +6055,7 @@
|
|
5846
6055
|
|
5847
6056
|
|
5848
6057
|
|
6058
|
+
|
5849
6059
|
<xsl:variable name="title-key">
|
5850
6060
|
|
5851
6061
|
|
@@ -6056,6 +6266,7 @@
|
|
6056
6266
|
|
6057
6267
|
<fo:table-row>
|
6058
6268
|
|
6269
|
+
|
6059
6270
|
<fo:table-cell>
|
6060
6271
|
|
6061
6272
|
<fo:block margin-top="6pt">
|
@@ -6074,6 +6285,7 @@
|
|
6074
6285
|
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
6075
6286
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
6076
6287
|
|
6288
|
+
|
6077
6289
|
<xsl:apply-templates/>
|
6078
6290
|
<!-- <xsl:if test="$namespace = 'gb'">
|
6079
6291
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -6130,6 +6342,8 @@
|
|
6130
6342
|
|
6131
6343
|
<xsl:apply-templates/>
|
6132
6344
|
</fo:inline>
|
6345
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
6346
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
6133
6347
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
6134
6348
|
<fo:inline font-size="80%" vertical-align="super">
|
6135
6349
|
<xsl:apply-templates/>
|
@@ -6155,6 +6369,7 @@
|
|
6155
6369
|
|
6156
6370
|
|
6157
6371
|
|
6372
|
+
|
6158
6373
|
|
6159
6374
|
</xsl:variable>
|
6160
6375
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -6536,11 +6751,15 @@
|
|
6536
6751
|
</xsl:apply-templates>
|
6537
6752
|
</xsl:template><xsl:template name="getLang">
|
6538
6753
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
6754
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
6539
6755
|
<xsl:variable name="language">
|
6540
6756
|
<xsl:choose>
|
6541
6757
|
<xsl:when test="$language_current != ''">
|
6542
6758
|
<xsl:value-of select="$language_current"/>
|
6543
6759
|
</xsl:when>
|
6760
|
+
<xsl:when test="$language_current_2 != ''">
|
6761
|
+
<xsl:value-of select="$language_current_2"/>
|
6762
|
+
</xsl:when>
|
6544
6763
|
<xsl:otherwise>
|
6545
6764
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
6546
6765
|
</xsl:otherwise>
|
@@ -6606,6 +6825,9 @@
|
|
6606
6825
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
6607
6826
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
6608
6827
|
</xsl:if>
|
6828
|
+
<!-- <xsl:attribute name="fox:alt-text">
|
6829
|
+
put AsciiMath/LaTeX math
|
6830
|
+
</xsl:attribute> -->
|
6609
6831
|
|
6610
6832
|
|
6611
6833
|
<!-- <xsl:copy-of select="."/> -->
|
@@ -6625,9 +6847,27 @@
|
|
6625
6847
|
<xsl:copy>
|
6626
6848
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
6627
6849
|
</xsl:copy>
|
6628
|
-
<
|
6850
|
+
<xsl:choose>
|
6851
|
+
<!-- if in msub, then don't add space -->
|
6852
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
6853
|
+
<!-- if next char in digit, don't add space -->
|
6854
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
6855
|
+
<xsl:otherwise>
|
6856
|
+
<mathml:mspace width="0.5ex"/>
|
6857
|
+
</xsl:otherwise>
|
6858
|
+
</xsl:choose>
|
6629
6859
|
</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">
|
6630
6860
|
<xsl:variable name="target">
|
6861
|
+
<xsl:choose>
|
6862
|
+
<xsl:when test="@updatetype = 'true'">
|
6863
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
6864
|
+
</xsl:when>
|
6865
|
+
<xsl:otherwise>
|
6866
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
6867
|
+
</xsl:otherwise>
|
6868
|
+
</xsl:choose>
|
6869
|
+
</xsl:variable>
|
6870
|
+
<xsl:variable name="target_text">
|
6631
6871
|
<xsl:choose>
|
6632
6872
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
6633
6873
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -6639,20 +6879,22 @@
|
|
6639
6879
|
</xsl:variable>
|
6640
6880
|
<fo:inline xsl:use-attribute-sets="link-style">
|
6641
6881
|
|
6882
|
+
|
6883
|
+
|
6642
6884
|
<xsl:choose>
|
6643
|
-
<xsl:when test="$
|
6885
|
+
<xsl:when test="$target_text = ''">
|
6644
6886
|
<xsl:apply-templates/>
|
6645
6887
|
</xsl:when>
|
6646
6888
|
<xsl:otherwise>
|
6647
|
-
<fo:basic-link external-destination="{
|
6889
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
6648
6890
|
<xsl:choose>
|
6649
6891
|
<xsl:when test="normalize-space(.) = ''">
|
6650
|
-
<!-- <xsl:value-of select="$target"/> -->
|
6651
6892
|
<xsl:call-template name="add-zero-spaces-link-java">
|
6652
|
-
<xsl:with-param name="text" select="$
|
6893
|
+
<xsl:with-param name="text" select="$target_text"/>
|
6653
6894
|
</xsl:call-template>
|
6654
6895
|
</xsl:when>
|
6655
6896
|
<xsl:otherwise>
|
6897
|
+
<!-- output text from <link>text</link> -->
|
6656
6898
|
<xsl:apply-templates/>
|
6657
6899
|
</xsl:otherwise>
|
6658
6900
|
</xsl:choose>
|
@@ -6747,6 +6989,12 @@
|
|
6747
6989
|
|
6748
6990
|
|
6749
6991
|
|
6992
|
+
|
6993
|
+
<xsl:if test="parent::*[local-name() = 'li']">
|
6994
|
+
<xsl:attribute name="margin-top">4pt</xsl:attribute>
|
6995
|
+
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
|
6996
|
+
</xsl:if>
|
6997
|
+
|
6750
6998
|
<fo:block-container margin-left="0mm">
|
6751
6999
|
|
6752
7000
|
|
@@ -6771,6 +7019,7 @@
|
|
6771
7019
|
|
6772
7020
|
|
6773
7021
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
7022
|
+
|
6774
7023
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
6775
7024
|
</fo:inline>
|
6776
7025
|
<xsl:apply-templates/>
|
@@ -6796,7 +7045,9 @@
|
|
6796
7045
|
</xsl:choose>
|
6797
7046
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
6798
7047
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
7048
|
+
|
6799
7049
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
7050
|
+
|
6800
7051
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
6801
7052
|
</fo:inline>
|
6802
7053
|
<xsl:apply-templates/>
|
@@ -6876,13 +7127,17 @@
|
|
6876
7127
|
</xsl:call-template>
|
6877
7128
|
|
6878
7129
|
<fo:block>
|
7130
|
+
|
6879
7131
|
<xsl:apply-templates/>
|
6880
7132
|
</fo:block>
|
6881
7133
|
<xsl:call-template name="fn_display_figure"/>
|
6882
7134
|
<xsl:for-each select="*[local-name() = 'note']">
|
6883
7135
|
<xsl:call-template name="note"/>
|
6884
7136
|
</xsl:for-each>
|
6885
|
-
|
7137
|
+
|
7138
|
+
|
7139
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
7140
|
+
|
6886
7141
|
</fo:block-container>
|
6887
7142
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
6888
7143
|
<fo:block id="{@id}">
|
@@ -6995,21 +7250,249 @@
|
|
6995
7250
|
<xsl:param name="height"/>
|
6996
7251
|
<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; "/>
|
6997
7252
|
<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; "/>
|
7253
|
+
</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">
|
7254
|
+
<xsl:param name="name"/>
|
7255
|
+
|
7256
|
+
<xsl:variable name="svg_content">
|
7257
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
7258
|
+
</xsl:variable>
|
7259
|
+
|
7260
|
+
<xsl:variable name="alt-text">
|
7261
|
+
<xsl:choose>
|
7262
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
7263
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
7264
|
+
</xsl:when>
|
7265
|
+
<xsl:when test="normalize-space($name) != ''">
|
7266
|
+
<xsl:value-of select="$name"/>
|
7267
|
+
</xsl:when>
|
7268
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
7269
|
+
</xsl:choose>
|
7270
|
+
</xsl:variable>
|
7271
|
+
|
7272
|
+
<xsl:choose>
|
7273
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
7274
|
+
<fo:block>
|
7275
|
+
<xsl:variable name="width" select="@width"/>
|
7276
|
+
<xsl:variable name="height" select="@height"/>
|
7277
|
+
|
7278
|
+
<xsl:variable name="scale_x">
|
7279
|
+
<xsl:choose>
|
7280
|
+
<xsl:when test="$width > $width_effective_px">
|
7281
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
7282
|
+
</xsl:when>
|
7283
|
+
<xsl:otherwise>1</xsl:otherwise>
|
7284
|
+
</xsl:choose>
|
7285
|
+
</xsl:variable>
|
7286
|
+
|
7287
|
+
<xsl:variable name="scale_y">
|
7288
|
+
<xsl:choose>
|
7289
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
7290
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
7291
|
+
</xsl:when>
|
7292
|
+
<xsl:otherwise>1</xsl:otherwise>
|
7293
|
+
</xsl:choose>
|
7294
|
+
</xsl:variable>
|
7295
|
+
|
7296
|
+
<xsl:variable name="scale">
|
7297
|
+
<xsl:choose>
|
7298
|
+
<xsl:when test="$scale_y != 1">
|
7299
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
7300
|
+
</xsl:when>
|
7301
|
+
<xsl:otherwise>
|
7302
|
+
<xsl:value-of select="$scale_x"/>
|
7303
|
+
</xsl:otherwise>
|
7304
|
+
</xsl:choose>
|
7305
|
+
</xsl:variable>
|
7306
|
+
|
7307
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
7308
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
7309
|
+
|
7310
|
+
<fo:table table-layout="fixed" width="100%">
|
7311
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
7312
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
7313
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
7314
|
+
<fo:table-body>
|
7315
|
+
<fo:table-row>
|
7316
|
+
<fo:table-cell column-number="2">
|
7317
|
+
<fo:block>
|
7318
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
7319
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
7320
|
+
<fo:block line-height="0" font-size="0">
|
7321
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
7322
|
+
<xsl:call-template name="bookmark"/>
|
7323
|
+
</xsl:for-each>
|
7324
|
+
</fo:block>
|
7325
|
+
</xsl:if>
|
7326
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
7327
|
+
|
7328
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
7329
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7330
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7331
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7332
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
7333
|
+
|
7334
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
7335
|
+
</fo:instream-foreign-object>
|
7336
|
+
</fo:block>
|
7337
|
+
|
7338
|
+
<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">
|
7339
|
+
<xsl:with-param name="scale" select="$scale"/>
|
7340
|
+
</xsl:apply-templates>
|
7341
|
+
</fo:block-container>
|
7342
|
+
</fo:block>
|
7343
|
+
</fo:table-cell>
|
7344
|
+
</fo:table-row>
|
7345
|
+
</fo:table-body>
|
7346
|
+
</fo:table>
|
7347
|
+
</fo:block>
|
7348
|
+
|
7349
|
+
</xsl:when>
|
7350
|
+
<xsl:otherwise>
|
7351
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
7352
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
7353
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7354
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7355
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7356
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
7357
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
7358
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
7359
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
7360
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
7361
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
7362
|
+
</xsl:if>
|
7363
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
7364
|
+
<xsl:copy-of select="$svg_content"/>
|
7365
|
+
</fo:instream-foreign-object>
|
7366
|
+
</fo:block>
|
7367
|
+
</xsl:otherwise>
|
7368
|
+
</xsl:choose>
|
7369
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
7370
|
+
<xsl:copy>
|
7371
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
7372
|
+
</xsl:copy>
|
7373
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
7374
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
7375
|
+
<xsl:value-of select="."/>
|
7376
|
+
</xsl:attribute>
|
7377
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
7378
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
7379
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
7380
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
7381
|
+
<xsl:call-template name="image_svg">
|
7382
|
+
<xsl:with-param name="name" select="$name"/>
|
7383
|
+
</xsl:call-template>
|
7384
|
+
</xsl:for-each>
|
7385
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
7386
|
+
<xsl:copy>
|
7387
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
7388
|
+
</xsl:copy>
|
7389
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
7390
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
7391
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
7392
|
+
<xsl:param name="scale"/>
|
7393
|
+
<xsl:variable name="dest">
|
7394
|
+
<xsl:choose>
|
7395
|
+
<xsl:when test="starts-with(@href, '#')">
|
7396
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
7397
|
+
</xsl:when>
|
7398
|
+
<xsl:otherwise>
|
7399
|
+
<xsl:value-of select="@href"/>
|
7400
|
+
</xsl:otherwise>
|
7401
|
+
</xsl:choose>
|
7402
|
+
</xsl:variable>
|
7403
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
7404
|
+
<xsl:call-template name="insertSVGMapLink">
|
7405
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
7406
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
7407
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
7408
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
7409
|
+
<xsl:with-param name="dest" select="$dest"/>
|
7410
|
+
</xsl:call-template>
|
7411
|
+
</xsl:for-each>
|
7412
|
+
|
7413
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
7414
|
+
<xsl:variable name="points">
|
7415
|
+
<xsl:call-template name="split">
|
7416
|
+
<xsl:with-param name="pText" select="@points"/>
|
7417
|
+
</xsl:call-template>
|
7418
|
+
</xsl:variable>
|
7419
|
+
<xsl:variable name="x_coords">
|
7420
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
7421
|
+
<xsl:sort select="." data-type="number"/>
|
7422
|
+
<x><xsl:value-of select="."/></x>
|
7423
|
+
</xsl:for-each>
|
7424
|
+
</xsl:variable>
|
7425
|
+
<xsl:variable name="y_coords">
|
7426
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
7427
|
+
<xsl:sort select="." data-type="number"/>
|
7428
|
+
<y><xsl:value-of select="."/></y>
|
7429
|
+
</xsl:for-each>
|
7430
|
+
</xsl:variable>
|
7431
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
7432
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
7433
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
7434
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
7435
|
+
<xsl:call-template name="insertSVGMapLink">
|
7436
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
7437
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
7438
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
7439
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
7440
|
+
<xsl:with-param name="dest" select="$dest"/>
|
7441
|
+
</xsl:call-template>
|
7442
|
+
</xsl:for-each>
|
7443
|
+
|
7444
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
7445
|
+
<xsl:call-template name="insertSVGMapLink">
|
7446
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
7447
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
7448
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
7449
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
7450
|
+
<xsl:with-param name="dest" select="$dest"/>
|
7451
|
+
</xsl:call-template>
|
7452
|
+
</xsl:for-each>
|
7453
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
7454
|
+
<xsl:call-template name="insertSVGMapLink">
|
7455
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
7456
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
7457
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
7458
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
7459
|
+
<xsl:with-param name="dest" select="$dest"/>
|
7460
|
+
</xsl:call-template>
|
7461
|
+
</xsl:for-each>
|
7462
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
7463
|
+
<xsl:param name="left"/>
|
7464
|
+
<xsl:param name="top"/>
|
7465
|
+
<xsl:param name="width"/>
|
7466
|
+
<xsl:param name="height"/>
|
7467
|
+
<xsl:param name="dest"/>
|
7468
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
7469
|
+
<fo:block font-size="1pt">
|
7470
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
7471
|
+
<fo:inline-container inline-progression-dimension="100%">
|
7472
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
7473
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
7474
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
7475
|
+
</xsl:if> -->
|
7476
|
+
<fo:block> </fo:block></fo:block-container>
|
7477
|
+
</fo:inline-container>
|
7478
|
+
</fo:basic-link>
|
7479
|
+
</fo:block>
|
7480
|
+
</fo:block-container>
|
6998
7481
|
</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">
|
6999
7482
|
<xsl:apply-templates mode="contents"/>
|
7000
7483
|
<xsl:text> </xsl:text>
|
7001
7484
|
</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">
|
7002
7485
|
<xsl:apply-templates mode="bookmarks"/>
|
7003
7486
|
<xsl:text> </xsl:text>
|
7004
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
7487
|
+
</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">
|
7005
7488
|
<xsl:value-of select="."/>
|
7006
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
7489
|
+
</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">
|
7007
7490
|
<xsl:value-of select="."/>
|
7008
7491
|
</xsl:template><xsl:template match="node()" mode="contents">
|
7009
7492
|
<xsl:apply-templates mode="contents"/>
|
7010
7493
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
7011
7494
|
<xsl:apply-templates mode="bookmarks"/>
|
7012
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
7495
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
7013
7496
|
<xsl:apply-templates select="."/>
|
7014
7497
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
7015
7498
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -7023,28 +7506,39 @@
|
|
7023
7506
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
7024
7507
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
7025
7508
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
7509
|
+
<xsl:if test="@bundle = 'true'">
|
7510
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
7511
|
+
</xsl:if>
|
7026
7512
|
<fo:bookmark-title>
|
7027
|
-
<xsl:variable name="bookmark-title_">
|
7028
|
-
<xsl:call-template name="getLangVersion">
|
7029
|
-
<xsl:with-param name="lang" select="@lang"/>
|
7030
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
7031
|
-
<xsl:with-param name="title" select="@title-part"/>
|
7032
|
-
</xsl:call-template>
|
7033
|
-
</xsl:variable>
|
7034
7513
|
<xsl:choose>
|
7035
|
-
<xsl:when test="normalize-space(
|
7036
|
-
<xsl:
|
7037
|
-
|
7038
|
-
|
7514
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
7515
|
+
<xsl:variable name="bookmark-title_">
|
7516
|
+
<xsl:call-template name="getLangVersion">
|
7517
|
+
<xsl:with-param name="lang" select="@lang"/>
|
7518
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
7519
|
+
<xsl:with-param name="title" select="@title-part"/>
|
7520
|
+
</xsl:call-template>
|
7521
|
+
</xsl:variable>
|
7039
7522
|
<xsl:choose>
|
7040
|
-
<xsl:when test="
|
7041
|
-
|
7042
|
-
|
7043
|
-
<xsl:otherwise
|
7523
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
7524
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
7525
|
+
</xsl:when>
|
7526
|
+
<xsl:otherwise>
|
7527
|
+
<xsl:choose>
|
7528
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
7529
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
7530
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
7531
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
7532
|
+
</xsl:choose>
|
7533
|
+
</xsl:otherwise>
|
7044
7534
|
</xsl:choose>
|
7535
|
+
</xsl:when>
|
7536
|
+
<xsl:otherwise>
|
7537
|
+
<xsl:value-of select="@title-part"/>
|
7045
7538
|
</xsl:otherwise>
|
7046
7539
|
</xsl:choose>
|
7047
7540
|
</fo:bookmark-title>
|
7541
|
+
|
7048
7542
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
7049
7543
|
|
7050
7544
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -7157,20 +7651,28 @@
|
|
7157
7651
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
7158
7652
|
</xsl:choose>
|
7159
7653
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
7160
|
-
<
|
7161
|
-
|
7162
|
-
|
7163
|
-
|
7164
|
-
<xsl:
|
7165
|
-
|
7166
|
-
|
7167
|
-
|
7168
|
-
|
7169
|
-
|
7654
|
+
<xsl:choose>
|
7655
|
+
<xsl:when test="@id != ''">
|
7656
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
7657
|
+
<fo:bookmark-title>
|
7658
|
+
<xsl:if test="@section != ''">
|
7659
|
+
<xsl:value-of select="@section"/>
|
7660
|
+
<xsl:text> </xsl:text>
|
7661
|
+
</xsl:if>
|
7662
|
+
<xsl:value-of select="normalize-space(title)"/>
|
7663
|
+
</fo:bookmark-title>
|
7664
|
+
<xsl:apply-templates mode="bookmark"/>
|
7665
|
+
</fo:bookmark>
|
7666
|
+
</xsl:when>
|
7667
|
+
<xsl:otherwise>
|
7668
|
+
<xsl:apply-templates mode="bookmark"/>
|
7669
|
+
</xsl:otherwise>
|
7670
|
+
</xsl:choose>
|
7170
7671
|
</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">
|
7171
7672
|
<xsl:if test="normalize-space() != ''">
|
7172
7673
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
7173
7674
|
|
7675
|
+
|
7174
7676
|
<xsl:apply-templates/>
|
7175
7677
|
</fo:block>
|
7176
7678
|
</xsl:if>
|
@@ -7222,6 +7724,8 @@
|
|
7222
7724
|
</fo:list-item-body>
|
7223
7725
|
</fo:list-item>
|
7224
7726
|
</fo:list-block>
|
7727
|
+
</xsl:template><xsl:template name="extractSection">
|
7728
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
7225
7729
|
</xsl:template><xsl:template name="extractTitle">
|
7226
7730
|
<xsl:choose>
|
7227
7731
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -7248,6 +7752,8 @@
|
|
7248
7752
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
7249
7753
|
|
7250
7754
|
<fo:block-container margin-left="0mm">
|
7755
|
+
<xsl:copy-of select="@id"/>
|
7756
|
+
|
7251
7757
|
<xsl:if test="parent::*[local-name() = 'note']">
|
7252
7758
|
<xsl:attribute name="margin-left">
|
7253
7759
|
<xsl:choose>
|
@@ -7258,7 +7764,9 @@
|
|
7258
7764
|
|
7259
7765
|
</xsl:if>
|
7260
7766
|
<fo:block-container margin-left="0mm">
|
7261
|
-
|
7767
|
+
|
7768
|
+
|
7769
|
+
|
7262
7770
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
7263
7771
|
<xsl:variable name="_font-size">
|
7264
7772
|
|
@@ -7269,6 +7777,7 @@
|
|
7269
7777
|
|
7270
7778
|
|
7271
7779
|
|
7780
|
+
|
7272
7781
|
|
7273
7782
|
|
7274
7783
|
|
@@ -7286,10 +7795,14 @@
|
|
7286
7795
|
</xsl:choose>
|
7287
7796
|
</xsl:attribute>
|
7288
7797
|
</xsl:if>
|
7289
|
-
|
7290
|
-
|
7798
|
+
|
7799
|
+
<xsl:apply-templates/>
|
7800
|
+
</fo:block>
|
7801
|
+
|
7802
|
+
|
7291
7803
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
7292
7804
|
|
7805
|
+
|
7293
7806
|
</fo:block-container>
|
7294
7807
|
</fo:block-container>
|
7295
7808
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -7524,6 +8037,7 @@
|
|
7524
8037
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
7525
8038
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
7526
8039
|
|
8040
|
+
|
7527
8041
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
7528
8042
|
|
7529
8043
|
<xsl:variable name="element">
|
@@ -7591,7 +8105,7 @@
|
|
7591
8105
|
</fo:inline>
|
7592
8106
|
</xsl:otherwise>
|
7593
8107
|
</xsl:choose>
|
7594
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
8108
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
7595
8109
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
7596
8110
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
7597
8111
|
<xsl:variable name="termsource_text">
|
@@ -7600,13 +8114,15 @@
|
|
7600
8114
|
|
7601
8115
|
<xsl:choose>
|
7602
8116
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
7603
|
-
<xsl:apply-templates/>
|
8117
|
+
<!-- <xsl:apply-templates /> -->
|
8118
|
+
<xsl:copy-of select="$termsource_text"/>
|
7604
8119
|
</xsl:when>
|
7605
8120
|
<xsl:otherwise>
|
7606
8121
|
|
7607
8122
|
<xsl:text>[</xsl:text>
|
7608
8123
|
|
7609
|
-
<xsl:apply-templates/>
|
8124
|
+
<!-- <xsl:apply-templates /> -->
|
8125
|
+
<xsl:copy-of select="$termsource_text"/>
|
7610
8126
|
|
7611
8127
|
<xsl:text>]</xsl:text>
|
7612
8128
|
|
@@ -7617,20 +8133,27 @@
|
|
7617
8133
|
<xsl:if test="normalize-space() != ''">
|
7618
8134
|
<xsl:value-of select="."/>
|
7619
8135
|
</xsl:if>
|
7620
|
-
</xsl:template><xsl:
|
8136
|
+
</xsl:template><xsl:variable name="localized.source">
|
8137
|
+
<xsl:call-template name="getLocalizedString">
|
8138
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
8139
|
+
</xsl:call-template>
|
8140
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
7621
8141
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8142
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8143
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8144
|
+
</xsl:if>
|
7622
8145
|
|
7623
8146
|
<fo:inline>
|
7624
8147
|
|
7625
8148
|
|
7626
8149
|
|
7627
8150
|
|
7628
|
-
|
7629
|
-
|
7630
|
-
</xsl:
|
8151
|
+
|
8152
|
+
<xsl:value-of select="$localized.source"/>
|
8153
|
+
<xsl:text> </xsl:text>
|
8154
|
+
|
7631
8155
|
|
7632
8156
|
|
7633
|
-
<xsl:text>: </xsl:text>
|
7634
8157
|
</fo:inline>
|
7635
8158
|
|
7636
8159
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
@@ -7701,7 +8224,9 @@
|
|
7701
8224
|
|
7702
8225
|
|
7703
8226
|
</xsl:if>
|
7704
|
-
|
8227
|
+
|
8228
|
+
|
8229
|
+
|
7705
8230
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
7706
8231
|
<xsl:if test="normalize-space(@citeas) = ''">
|
7707
8232
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -7712,6 +8237,13 @@
|
|
7712
8237
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
7713
8238
|
|
7714
8239
|
|
8240
|
+
<xsl:if test="parent::*[local-name() = 'title']">
|
8241
|
+
<xsl:attribute name="color">inherit</xsl:attribute>
|
8242
|
+
<xsl:attribute name="text-decoration">inherit</xsl:attribute>
|
8243
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
8244
|
+
</xsl:if>
|
8245
|
+
|
8246
|
+
|
7715
8247
|
|
7716
8248
|
</xsl:if>
|
7717
8249
|
|
@@ -7751,6 +8283,7 @@
|
|
7751
8283
|
|
7752
8284
|
|
7753
8285
|
|
8286
|
+
|
7754
8287
|
<xsl:choose>
|
7755
8288
|
<xsl:when test="ancestor::bipm:annex">2</xsl:when>
|
7756
8289
|
<xsl:otherwise>8</xsl:otherwise>
|
@@ -7836,7 +8369,6 @@
|
|
7836
8369
|
|
7837
8370
|
|
7838
8371
|
|
7839
|
-
|
7840
8372
|
<xsl:apply-templates/>
|
7841
8373
|
</fo:block>
|
7842
8374
|
|
@@ -7855,6 +8387,7 @@
|
|
7855
8387
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
7856
8388
|
|
7857
8389
|
|
8390
|
+
|
7858
8391
|
<xsl:apply-templates/>
|
7859
8392
|
</fo:block>
|
7860
8393
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -7881,7 +8414,7 @@
|
|
7881
8414
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
7882
8415
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
7883
8416
|
<xsl:choose>
|
7884
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
8417
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
7885
8418
|
<fo:block-container>
|
7886
8419
|
<xsl:attribute name="margin-left">
|
7887
8420
|
<xsl:choose>
|
@@ -7893,6 +8426,7 @@
|
|
7893
8426
|
|
7894
8427
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
7895
8428
|
|
8429
|
+
|
7896
8430
|
<fo:block-container margin-left="0mm">
|
7897
8431
|
<fo:block>
|
7898
8432
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -8122,21 +8656,25 @@
|
|
8122
8656
|
|
8123
8657
|
|
8124
8658
|
|
8659
|
+
|
8660
|
+
|
8661
|
+
|
8662
|
+
|
8125
8663
|
</xsl:template><xsl:template name="processBibitemDocId">
|
8126
8664
|
<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')]"/>
|
8127
8665
|
<xsl:choose>
|
8128
8666
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
8129
|
-
<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"/>
|
8667
|
+
<!-- <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"/>
|
8130
8668
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
8131
8669
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
8132
|
-
</xsl:if>
|
8670
|
+
</xsl:if> -->
|
8133
8671
|
<xsl:value-of select="$_doc_ident"/>
|
8134
8672
|
</xsl:when>
|
8135
8673
|
<xsl:otherwise>
|
8136
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
8674
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
8137
8675
|
<xsl:if test="$type != ''">
|
8138
8676
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
8139
|
-
</xsl:if>
|
8677
|
+
</xsl:if> -->
|
8140
8678
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
8141
8679
|
</xsl:otherwise>
|
8142
8680
|
</xsl:choose>
|
@@ -8178,6 +8716,70 @@
|
|
8178
8716
|
<xsl:value-of select="substring(.,1,1)"/>
|
8179
8717
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
8180
8718
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
8719
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
8720
|
+
<fo:block>
|
8721
|
+
<xsl:apply-templates/>
|
8722
|
+
</fo:block>
|
8723
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
8724
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
8725
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
8726
|
+
<fo:inline>
|
8727
|
+
<xsl:call-template name="text_input"/>
|
8728
|
+
</fo:inline>
|
8729
|
+
</xsl:template><xsl:template name="text_input">
|
8730
|
+
<xsl:variable name="count">
|
8731
|
+
<xsl:choose>
|
8732
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
8733
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
8734
|
+
<xsl:otherwise>10</xsl:otherwise>
|
8735
|
+
</xsl:choose>
|
8736
|
+
</xsl:variable>
|
8737
|
+
<xsl:call-template name="repeat">
|
8738
|
+
<xsl:with-param name="char" select="'_'"/>
|
8739
|
+
<xsl:with-param name="count" select="$count"/>
|
8740
|
+
</xsl:call-template>
|
8741
|
+
<xsl:text> </xsl:text>
|
8742
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
8743
|
+
<xsl:variable name="caption">
|
8744
|
+
<xsl:choose>
|
8745
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
8746
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
8747
|
+
</xsl:choose>
|
8748
|
+
</xsl:variable>
|
8749
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
8750
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
8751
|
+
<fo:inline padding-right="1mm">
|
8752
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
8753
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
8754
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
8755
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
8756
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
8757
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
8758
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
8759
|
+
</svg>
|
8760
|
+
</fo:instream-foreign-object>
|
8761
|
+
</fo:inline>
|
8762
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
8763
|
+
<fo:inline padding-right="1mm">
|
8764
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
8765
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
8766
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
8767
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
8768
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
8769
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
8770
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
8771
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
8772
|
+
</svg>
|
8773
|
+
</fo:instream-foreign-object>
|
8774
|
+
</fo:inline>
|
8775
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
8776
|
+
<fo:inline>
|
8777
|
+
<xsl:call-template name="text_input"/>
|
8778
|
+
</fo:inline>
|
8779
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
8780
|
+
<fo:block-container border="1pt solid black" width="50%">
|
8781
|
+
<fo:block> </fo:block>
|
8782
|
+
</fo:block-container>
|
8181
8783
|
</xsl:template><xsl:template name="convertDate">
|
8182
8784
|
<xsl:param name="date"/>
|
8183
8785
|
<xsl:param name="format" select="'short'"/>
|
@@ -8385,6 +8987,9 @@
|
|
8385
8987
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
8386
8988
|
<xsl:value-of select="$level_total - 1"/>
|
8387
8989
|
</xsl:when>
|
8990
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
8991
|
+
<xsl:value-of select="$level_total - 1"/>
|
8992
|
+
</xsl:when>
|
8388
8993
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
8389
8994
|
<xsl:value-of select="$level_total - 2"/>
|
8390
8995
|
</xsl:when>
|
@@ -8449,6 +9054,7 @@
|
|
8449
9054
|
|
8450
9055
|
|
8451
9056
|
|
9057
|
+
|
8452
9058
|
|
8453
9059
|
|
8454
9060
|
|
@@ -8509,17 +9115,29 @@
|
|
8509
9115
|
</xsl:call-template>
|
8510
9116
|
</xsl:if>
|
8511
9117
|
</xsl:template><xsl:template name="getLocalizedString">
|
8512
|
-
<xsl:param name="key"/>
|
9118
|
+
<xsl:param name="key"/>
|
8513
9119
|
|
8514
9120
|
<xsl:variable name="curr_lang">
|
8515
9121
|
<xsl:call-template name="getLang"/>
|
8516
9122
|
</xsl:variable>
|
8517
9123
|
|
9124
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
9125
|
+
|
8518
9126
|
<xsl:choose>
|
9127
|
+
<xsl:when test="$data_value != ''">
|
9128
|
+
<xsl:value-of select="$data_value"/>
|
9129
|
+
</xsl:when>
|
8519
9130
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
8520
9131
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
8521
9132
|
</xsl:when>
|
8522
|
-
<xsl:otherwise
|
9133
|
+
<xsl:otherwise>
|
9134
|
+
<xsl:variable name="key_">
|
9135
|
+
<xsl:call-template name="capitalize">
|
9136
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
9137
|
+
</xsl:call-template>
|
9138
|
+
</xsl:variable>
|
9139
|
+
<xsl:value-of select="$key_"/>
|
9140
|
+
</xsl:otherwise>
|
8523
9141
|
</xsl:choose>
|
8524
9142
|
|
8525
9143
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
@@ -8562,4 +9180,110 @@
|
|
8562
9180
|
<xsl:value-of select="$align"/>
|
8563
9181
|
</xsl:when>
|
8564
9182
|
</xsl:choose>
|
9183
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
9184
|
+
<xsl:param name="default">left</xsl:param>
|
9185
|
+
<xsl:attribute name="text-align">
|
9186
|
+
<xsl:choose>
|
9187
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
9188
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
9189
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
9190
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
9191
|
+
</xsl:choose>
|
9192
|
+
</xsl:attribute>
|
9193
|
+
</xsl:template><xsl:template name="number-to-words">
|
9194
|
+
<xsl:param name="number"/>
|
9195
|
+
<xsl:param name="first"/>
|
9196
|
+
<xsl:if test="$number != ''">
|
9197
|
+
<xsl:variable name="words">
|
9198
|
+
<words>
|
9199
|
+
<word cardinal="1">One-</word>
|
9200
|
+
<word ordinal="1">First </word>
|
9201
|
+
<word cardinal="2">Two-</word>
|
9202
|
+
<word ordinal="2">Second </word>
|
9203
|
+
<word cardinal="3">Three-</word>
|
9204
|
+
<word ordinal="3">Third </word>
|
9205
|
+
<word cardinal="4">Four-</word>
|
9206
|
+
<word ordinal="4">Fourth </word>
|
9207
|
+
<word cardinal="5">Five-</word>
|
9208
|
+
<word ordinal="5">Fifth </word>
|
9209
|
+
<word cardinal="6">Six-</word>
|
9210
|
+
<word ordinal="6">Sixth </word>
|
9211
|
+
<word cardinal="7">Seven-</word>
|
9212
|
+
<word ordinal="7">Seventh </word>
|
9213
|
+
<word cardinal="8">Eight-</word>
|
9214
|
+
<word ordinal="8">Eighth </word>
|
9215
|
+
<word cardinal="9">Nine-</word>
|
9216
|
+
<word ordinal="9">Ninth </word>
|
9217
|
+
<word ordinal="10">Tenth </word>
|
9218
|
+
<word ordinal="11">Eleventh </word>
|
9219
|
+
<word ordinal="12">Twelfth </word>
|
9220
|
+
<word ordinal="13">Thirteenth </word>
|
9221
|
+
<word ordinal="14">Fourteenth </word>
|
9222
|
+
<word ordinal="15">Fifteenth </word>
|
9223
|
+
<word ordinal="16">Sixteenth </word>
|
9224
|
+
<word ordinal="17">Seventeenth </word>
|
9225
|
+
<word ordinal="18">Eighteenth </word>
|
9226
|
+
<word ordinal="19">Nineteenth </word>
|
9227
|
+
<word cardinal="20">Twenty-</word>
|
9228
|
+
<word ordinal="20">Twentieth </word>
|
9229
|
+
<word cardinal="30">Thirty-</word>
|
9230
|
+
<word ordinal="30">Thirtieth </word>
|
9231
|
+
<word cardinal="40">Forty-</word>
|
9232
|
+
<word ordinal="40">Fortieth </word>
|
9233
|
+
<word cardinal="50">Fifty-</word>
|
9234
|
+
<word ordinal="50">Fiftieth </word>
|
9235
|
+
<word cardinal="60">Sixty-</word>
|
9236
|
+
<word ordinal="60">Sixtieth </word>
|
9237
|
+
<word cardinal="70">Seventy-</word>
|
9238
|
+
<word ordinal="70">Seventieth </word>
|
9239
|
+
<word cardinal="80">Eighty-</word>
|
9240
|
+
<word ordinal="80">Eightieth </word>
|
9241
|
+
<word cardinal="90">Ninety-</word>
|
9242
|
+
<word ordinal="90">Ninetieth </word>
|
9243
|
+
<word cardinal="100">Hundred-</word>
|
9244
|
+
<word ordinal="100">Hundredth </word>
|
9245
|
+
</words>
|
9246
|
+
</xsl:variable>
|
9247
|
+
|
9248
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
9249
|
+
|
9250
|
+
<xsl:variable name="value">
|
9251
|
+
<xsl:choose>
|
9252
|
+
<xsl:when test="$ordinal != ''">
|
9253
|
+
<xsl:value-of select="$ordinal"/>
|
9254
|
+
</xsl:when>
|
9255
|
+
<xsl:otherwise>
|
9256
|
+
<xsl:choose>
|
9257
|
+
<xsl:when test="$number < 100">
|
9258
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
9259
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
9260
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
9261
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
9262
|
+
</xsl:when>
|
9263
|
+
<xsl:otherwise>
|
9264
|
+
<!-- more 100 -->
|
9265
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
9266
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
9267
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
9268
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
9269
|
+
<xsl:call-template name="number-to-words">
|
9270
|
+
<xsl:with-param name="number" select="$digits"/>
|
9271
|
+
</xsl:call-template>
|
9272
|
+
</xsl:otherwise>
|
9273
|
+
</xsl:choose>
|
9274
|
+
</xsl:otherwise>
|
9275
|
+
</xsl:choose>
|
9276
|
+
</xsl:variable>
|
9277
|
+
<xsl:choose>
|
9278
|
+
<xsl:when test="$first = 'true'">
|
9279
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
9280
|
+
<xsl:call-template name="capitalize">
|
9281
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
9282
|
+
</xsl:call-template>
|
9283
|
+
</xsl:when>
|
9284
|
+
<xsl:otherwise>
|
9285
|
+
<xsl:value-of select="$value"/>
|
9286
|
+
</xsl:otherwise>
|
9287
|
+
</xsl:choose>
|
9288
|
+
</xsl:if>
|
8565
9289
|
</xsl:template></xsl:stylesheet>
|