metanorma-bipm 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf1b38fcb74e9bae79ffb3ebb3d6cb878d65f233f5cd50b6ca766028f273ed04
4
- data.tar.gz: a34688db4dc19969f3749c84eb1c1055210e0791e836618de89ba82c9a80a2bc
3
+ metadata.gz: ce04d9fdc61d348dfd6047b1ea0ceb1baa3e19ce43234eba3e4e34cd4b919e25
4
+ data.tar.gz: 4a17c9886bb369033e5abed5f4d1b287d3aca8e7bb18e1b3f2b489ee5806b14f
5
5
  SHA512:
6
- metadata.gz: a41a0b7673959052e0dd0f1b8e6873018b0e1ee4846939ea74bf489c586b8cd387cf683b870bbd230d5b5d267babd0b3a603f2d2168a5c93c62aa0fc90a21ce0
7
- data.tar.gz: 7a276e2c67a62742d61df4c3e85158123ff63d1bbbeaeea55945076a1f384a96794aeb8d60eeee3e37a242ab1436bdb5ee9b8386ee2d8036b7c4cefa320cfd45
6
+ metadata.gz: 5ae9001cd216cf9b16e3561e41707424027a8844a250d5af55ba4f1c1197877f947091877db0d6363932583cd9ea3f7361996facc3124d077dacc5470cd44ea0
7
+ data.tar.gz: 5f3057a4a8666527a916251a659d2f49cd43ebd2d45a9f2e1b280eded7af3c94d2ea9fae8aeed358f4ae0cda4d64f5dcc9e58b6c46444ed6f97283f27cd3f1a8
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  steps:
@@ -204,6 +204,18 @@
204
204
  </zeroOrMore>
205
205
  </element>
206
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
207
219
  <define name="example">
208
220
  <element name="example">
209
221
  <attribute name="id">
@@ -899,7 +911,7 @@
899
911
  </include>
900
912
  <!-- end overrides -->
901
913
  <define name="docsubtype">
902
- <element name="docsubtype">
914
+ <element name="subdoctype">
903
915
  <ref name="DocumentSubtype"/>
904
916
  </element>
905
917
  </define>
@@ -955,7 +967,34 @@
955
967
  <define name="concept">
956
968
  <element name="concept">
957
969
  <optional>
958
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
959
998
  </optional>
960
999
  <choice>
961
1000
  <ref name="eref"/>
@@ -981,6 +1020,9 @@
981
1020
  </attribute>
982
1021
  <attribute name="name"/>
983
1022
  <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
984
1026
  <zeroOrMore>
985
1027
  <choice>
986
1028
  <ref name="TextElement"/>
@@ -1473,26 +1515,26 @@
1473
1515
  <optional>
1474
1516
  <ref name="section-title"/>
1475
1517
  </optional>
1476
- <group>
1518
+ <choice>
1477
1519
  <choice>
1478
1520
  <group>
1479
- <zeroOrMore>
1521
+ <oneOrMore>
1480
1522
  <ref name="BasicBlock"/>
1481
- </zeroOrMore>
1523
+ </oneOrMore>
1482
1524
  <zeroOrMore>
1483
1525
  <ref name="note"/>
1484
1526
  </zeroOrMore>
1485
1527
  </group>
1486
1528
  <ref name="amend"/>
1487
1529
  </choice>
1488
- <zeroOrMore>
1530
+ <oneOrMore>
1489
1531
  <choice>
1490
1532
  <ref name="clause-subsection"/>
1491
1533
  <ref name="terms"/>
1492
1534
  <ref name="definitions"/>
1493
1535
  </choice>
1494
- </zeroOrMore>
1495
- </group>
1536
+ </oneOrMore>
1537
+ </choice>
1496
1538
  </define>
1497
1539
  <define name="Annex-Section">
1498
1540
  <optional>
@@ -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="'210mm'"/>
19
- <xsl:variable name="pageHeight" select="'297mm'"/>
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
239
- <fo:region-before region-name="header-odd" extent="25.4mm"/>
240
- <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
246
- <fo:region-before region-name="header-even" extent="25.4mm"/>
247
- <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
261
- <fo:region-before region-name="header-odd" extent="25.4mm"/>
262
- <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
268
- <fo:region-before region-name="header-even" extent="25.4mm"/>
269
- <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="41.7mm" column-count="2" column-gap="10mm"/>
283
- <fo:region-before region-name="header-odd" extent="25.4mm"/>
284
- <fo:region-after region-name="footer" extent="22mm"/>
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="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="41.7mm" column-count="2" column-gap="10mm"/>
290
- <fo:region-before region-name="header-even" extent="25.4mm"/>
291
- <fo:region-after region-name="footer" extent="22mm"/>
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="." mode="flatxml"/>
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="." mode="flatxml"/>
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) -->
@@ -1709,9 +1746,9 @@
1709
1746
  <!-- background color -->
1710
1747
  <fo:block-container absolute-position="fixed" left="0" top="-1mm">
1711
1748
  <fo:block>
1712
- <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
1713
- <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
1714
- <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"/>
1715
1752
  </svg>
1716
1753
  </fo:instream-foreign-object>
1717
1754
  </fo:block>
@@ -2271,7 +2308,7 @@
2271
2308
  <xsl:when test="$level = 2 and ancestor::bipm:annex">10.5pt</xsl:when>
2272
2309
  <xsl:when test="$level = 2">14pt</xsl:when>
2273
2310
  <xsl:when test="$level = 3 and ancestor::bipm:annex">10pt</xsl:when>
2274
- <xsl:when test="$level = 4 and ancestor::bipm:annex">9pt</xsl:when>
2311
+ <xsl:when test="$level &gt;= 4 and ancestor::bipm:annex">9pt</xsl:when>
2275
2312
  <xsl:when test="$level = 3">12pt</xsl:when>
2276
2313
  <xsl:otherwise>11pt</xsl:otherwise>
2277
2314
  </xsl:choose>
@@ -2367,8 +2404,10 @@
2367
2404
  </xsl:if> -->
2368
2405
  <xsl:choose>
2369
2406
  <xsl:when test="ancestor::bipm:annex and $level &gt;= 2">
2370
- <xsl:if test="$level = 3">
2407
+ <xsl:if test="$level &gt;= 3">
2371
2408
  <xsl:attribute name="margin-left">14mm</xsl:attribute>
2409
+ </xsl:if>
2410
+ <xsl:if test="$level = 3">
2372
2411
  <fo:inline padding-right="2.5mm" baseline-shift="15%">
2373
2412
  <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
2374
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">
@@ -2378,7 +2417,6 @@
2378
2417
  </fo:inline>
2379
2418
  </xsl:if>
2380
2419
  <xsl:if test="$level = 4">
2381
- <xsl:attribute name="margin-left">14mm</xsl:attribute>
2382
2420
  <xsl:attribute name="text-align">center</xsl:attribute>
2383
2421
  </xsl:if>
2384
2422
  <xsl:call-template name="extractTitle"/>
@@ -2409,17 +2447,8 @@
2409
2447
 
2410
2448
  </xsl:template>
2411
2449
 
2412
- <!-- <xsl:variable name="zero-width-space" select="'&#x200b;'"/> -->
2413
2450
  <xsl:template match="*" mode="header">
2414
2451
  <xsl:apply-templates mode="header"/>
2415
- <!-- <xsl:choose>
2416
- <xsl:when test="contains(preceding-sibling::node()[1], $zero-width-space)"> -->
2417
- <!-- stop further processing -->
2418
- <!-- </xsl:when>
2419
- <xsl:otherwise>
2420
- <xsl:apply-templates mode="header"/>
2421
- </xsl:otherwise>
2422
- </xsl:choose> -->
2423
2452
  </xsl:template>
2424
2453
 
2425
2454
  <xsl:template match="*[local-name() = 'stem']" mode="header">
@@ -2430,11 +2459,6 @@
2430
2459
  <xsl:text> </xsl:text>
2431
2460
  </xsl:template>
2432
2461
 
2433
- <!-- zero-width space - separator for full/short titles. Short titles using in headers -->
2434
- <!-- <xsl:template match="text()[contains(., $zero-width-space)]" mode="header">
2435
- <xsl:value-of select="substring-before(., $zero-width-space)"/>
2436
- </xsl:template> -->
2437
-
2438
2462
  <!-- ====== -->
2439
2463
  <!-- ====== -->
2440
2464
 
@@ -3095,9 +3119,10 @@
3095
3119
  <fo:inline>
3096
3120
  <!-- <xsl:if test="@list_type = 'ul'">
3097
3121
  <xsl:attribute name="font-size">15pt</xsl:attribute> -->
3098
- <xsl:if test="@font-size">
3099
- <xsl:attribute name="font-size"><xsl:value-of select="@font-size"/></xsl:attribute>
3100
- <!-- <xsl:attribute name="baseline-shift">-10%</xsl:attribute> -->
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>
3101
3126
  </xsl:if>
3102
3127
  <xsl:value-of select="@label"/>
3103
3128
  </fo:inline>
@@ -3195,7 +3220,7 @@
3195
3220
  </xsl:template>
3196
3221
 
3197
3222
  <xsl:template match="bipm:example" priority="2">
3198
- <fo:block margin-top="6pt" margin-bottom="6pt">
3223
+ <fo:block margin-top="6pt" margin-bottom="6pt" keep-together.within-column="1">
3199
3224
  <fo:table table-layout="fixed" width="100%">
3200
3225
  <fo:table-column column-width="27.5mm"/>
3201
3226
  <fo:table-column column-width="108mm"/>
@@ -3341,6 +3366,11 @@
3341
3366
 
3342
3367
  <xsl:template match="bipm:xref" priority="2">
3343
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
+
3344
3374
  <xsl:choose>
3345
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). -->
3346
3376
  <fo:inline> <!-- font-weight="bold" -->
@@ -4159,7 +4189,7 @@
4159
4189
  <!-- grey opacity -->
4160
4190
  <fo:block-container absolute-position="fixed" left="0" top="0">
4161
4191
  <fo:block>
4162
- <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">
4163
4193
  <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
4164
4194
  <rect width="215.9mm" height="279.4mm" style="fill:rgb(255,255,255);stroke-width:0;fill-opacity:0.73"/>
4165
4195
  </svg>
@@ -4584,6 +4614,7 @@
4584
4614
 
4585
4615
 
4586
4616
 
4617
+
4587
4618
  </xsl:attribute-set><xsl:attribute-set name="note-style">
4588
4619
 
4589
4620
 
@@ -4779,14 +4810,15 @@
4779
4810
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
4780
4811
 
4781
4812
  <!-- Normative references -->
4782
- <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"/>
4783
4814
  <!-- Terms and definitions -->
4784
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"/>
4785
4816
  <!-- Another main sections -->
4786
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"/>
4787
4818
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
4788
4819
  <!-- Bibliography -->
4789
- <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
+
4790
4822
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
4791
4823
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
4792
4824
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -5402,6 +5434,7 @@
5402
5434
 
5403
5435
 
5404
5436
 
5437
+
5405
5438
  <!-- fn will be processed inside 'note' processing -->
5406
5439
 
5407
5440
 
@@ -5422,6 +5455,10 @@
5422
5455
 
5423
5456
 
5424
5457
 
5458
+
5459
+ <!-- for BSI (not PAS) display Notes before footnotes -->
5460
+
5461
+
5425
5462
  <!-- except gb -->
5426
5463
 
5427
5464
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -5447,6 +5484,10 @@
5447
5484
  <!-- fn processing -->
5448
5485
  <xsl:call-template name="fn_display"/>
5449
5486
 
5487
+
5488
+ <!-- for PAS display Notes after footnotes -->
5489
+
5490
+
5450
5491
  </fo:table-cell>
5451
5492
  </fo:table-row>
5452
5493
  </fo:table-body>
@@ -5504,6 +5545,7 @@
5504
5545
  <xsl:if test="$parent-name = 'tfoot'">
5505
5546
 
5506
5547
 
5548
+
5507
5549
  </xsl:if>
5508
5550
 
5509
5551
 
@@ -5627,6 +5669,7 @@
5627
5669
 
5628
5670
 
5629
5671
 
5672
+
5630
5673
  <xsl:attribute name="border">solid 0pt white</xsl:attribute>
5631
5674
  <xsl:variable name="rownum"><xsl:number count="*[local-name()='tr']"/></xsl:variable>
5632
5675
  <xsl:if test="$rownum = 1">
@@ -5678,6 +5721,7 @@
5678
5721
 
5679
5722
 
5680
5723
 
5724
+
5681
5725
 
5682
5726
  <xsl:attribute name="text-align">justify</xsl:attribute>
5683
5727
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -5685,11 +5729,15 @@
5685
5729
  <xsl:attribute name="margin-top">18pt</xsl:attribute>
5686
5730
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5687
5731
  </xsl:if>
5688
-
5689
5732
 
5690
5733
 
5734
+
5735
+ <!-- Table's note name (NOTE, for example) -->
5736
+
5691
5737
  <fo:inline padding-right="2mm">
5692
5738
 
5739
+
5740
+
5693
5741
 
5694
5742
 
5695
5743
 
@@ -5702,10 +5750,12 @@
5702
5750
 
5703
5751
  </fo:inline>
5704
5752
 
5753
+
5705
5754
  <xsl:if test="ancestor::bipm:preface">
5706
5755
  <fo:block> </fo:block>
5707
5756
  </xsl:if>
5708
5757
 
5758
+
5709
5759
  <xsl:apply-templates mode="process"/>
5710
5760
  </fo:block>
5711
5761
 
@@ -5725,6 +5775,8 @@
5725
5775
  <xsl:variable name="reference" select="@reference"/>
5726
5776
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
5727
5777
  <fo:block margin-bottom="12pt">
5778
+
5779
+
5728
5780
 
5729
5781
 
5730
5782
 
@@ -5743,6 +5795,7 @@
5743
5795
 
5744
5796
 
5745
5797
 
5798
+
5746
5799
  <xsl:attribute name="font-style">italic</xsl:attribute>
5747
5800
 
5748
5801
  <xsl:attribute name="padding-right">2.5mm</xsl:attribute>
@@ -5753,6 +5806,7 @@
5753
5806
  <fo:inline font-style="normal">)</fo:inline>
5754
5807
 
5755
5808
 
5809
+
5756
5810
  </fo:inline>
5757
5811
  <fo:inline>
5758
5812
 
@@ -5893,6 +5947,9 @@
5893
5947
 
5894
5948
 
5895
5949
 
5950
+
5951
+
5952
+
5896
5953
  <xsl:attribute name="font-size">70%</xsl:attribute>
5897
5954
  <xsl:attribute name="vertical-align">super</xsl:attribute>
5898
5955
  <xsl:attribute name="font-style">italic</xsl:attribute>
@@ -5907,6 +5964,7 @@
5907
5964
 
5908
5965
  <fo:inline font-style="normal">)</fo:inline>
5909
5966
 
5967
+
5910
5968
  </fo:basic-link>
5911
5969
  </fo:inline>
5912
5970
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -6822,6 +6880,7 @@
6822
6880
  <fo:inline xsl:use-attribute-sets="link-style">
6823
6881
 
6824
6882
 
6883
+
6825
6884
  <xsl:choose>
6826
6885
  <xsl:when test="$target_text = ''">
6827
6886
  <xsl:apply-templates/>
@@ -6930,6 +6989,12 @@
6930
6989
 
6931
6990
 
6932
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
+
6933
6998
  <fo:block-container margin-left="0mm">
6934
6999
 
6935
7000
 
@@ -7185,6 +7250,234 @@
7185
7250
  <xsl:param name="height"/>
7186
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; "/>
7187
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 &gt; $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 &gt; $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 &gt; (@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>
7188
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">
7189
7482
  <xsl:apply-templates mode="contents"/>
7190
7483
  <xsl:text> </xsl:text>
@@ -7213,28 +7506,39 @@
7213
7506
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
7214
7507
  <xsl:for-each select="xalan:nodeset($contents)/doc">
7215
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>
7216
7512
  <fo:bookmark-title>
7217
- <xsl:variable name="bookmark-title_">
7218
- <xsl:call-template name="getLangVersion">
7219
- <xsl:with-param name="lang" select="@lang"/>
7220
- <xsl:with-param name="doctype" select="@doctype"/>
7221
- <xsl:with-param name="title" select="@title-part"/>
7222
- </xsl:call-template>
7223
- </xsl:variable>
7224
7513
  <xsl:choose>
7225
- <xsl:when test="normalize-space($bookmark-title_) != ''">
7226
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
7227
- </xsl:when>
7228
- <xsl:otherwise>
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>
7229
7522
  <xsl:choose>
7230
- <xsl:when test="@lang = 'en'">English</xsl:when>
7231
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
7232
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
7233
- <xsl:otherwise><xsl:value-of select="@lang"/> version</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>
7234
7534
  </xsl:choose>
7535
+ </xsl:when>
7536
+ <xsl:otherwise>
7537
+ <xsl:value-of select="@title-part"/>
7235
7538
  </xsl:otherwise>
7236
7539
  </xsl:choose>
7237
7540
  </fo:bookmark-title>
7541
+
7238
7542
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
7239
7543
 
7240
7544
  <xsl:call-template name="insertFigureBookmarks">
@@ -7347,16 +7651,23 @@
7347
7651
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
7348
7652
  </xsl:choose>
7349
7653
  </xsl:template><xsl:template match="item" mode="bookmark">
7350
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
7351
- <fo:bookmark-title>
7352
- <xsl:if test="@section != ''">
7353
- <xsl:value-of select="@section"/>
7354
- <xsl:text> </xsl:text>
7355
- </xsl:if>
7356
- <xsl:value-of select="normalize-space(title)"/>
7357
- </fo:bookmark-title>
7358
- <xsl:apply-templates mode="bookmark"/>
7359
- </fo:bookmark>
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>
7360
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">
7361
7672
  <xsl:if test="normalize-space() != ''">
7362
7673
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -7913,7 +8224,9 @@
7913
8224
 
7914
8225
 
7915
8226
  </xsl:if>
7916
-
8227
+
8228
+
8229
+
7917
8230
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
7918
8231
  <xsl:if test="normalize-space(@citeas) = ''">
7919
8232
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
@@ -7924,6 +8237,13 @@
7924
8237
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
7925
8238
 
7926
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
+
7927
8247
 
7928
8248
  </xsl:if>
7929
8249
 
@@ -8870,4 +9190,100 @@
8870
9190
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
8871
9191
  </xsl:choose>
8872
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 &lt; 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>
8873
9289
  </xsl:template></xsl:stylesheet>