metanorma-ribose 1.6.3 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,7 +55,7 @@
55
55
 
56
56
  <xsl:template match="/">
57
57
  <xsl:call-template name="namespaceCheck"/>
58
- <fo:root font-family="SourceSansPro-Light, STIX2Math" font-size="10.5pt" xml:lang="{$lang}">
58
+ <fo:root font-family="Source Sans Pro, STIX Two Math" font-weight="300" font-size="10.5pt" xml:lang="{$lang}">
59
59
  <fo:layout-master-set>
60
60
 
61
61
  <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -91,6 +91,10 @@
91
91
 
92
92
  <xsl:call-template name="addPDFUAmeta"/>
93
93
 
94
+ <xsl:call-template name="addBookmarks">
95
+ <xsl:with-param name="contents" select="$contents"/>
96
+ </xsl:call-template>
97
+
94
98
  <fo:page-sequence master-reference="document" format="i" force-page-count="end-on-even">
95
99
  <fo:static-content flow-name="xsl-footnote-separator">
96
100
  <fo:block>
@@ -103,12 +107,12 @@
103
107
  <fo:flow flow-name="xsl-region-body">
104
108
  <fo:block font-size="16pt" margin-bottom="16pt"> </fo:block>
105
109
  <fo:block font-size="16pt" margin-bottom="16pt"> </fo:block>
106
- <fo:block font-size="22pt" font-weight="bold" margin-bottom="12pt"><xsl:value-of select="$doctitle"/></fo:block>
110
+ <fo:block font-size="22pt" font-weight="normal" margin-bottom="12pt"><xsl:value-of select="$doctitle"/></fo:block>
107
111
  <fo:block font-size="22pt" margin-bottom="14pt"> </fo:block>
108
112
  <fo:block font-size="22pt" margin-bottom="14pt"> </fo:block>
109
113
  <fo:block font-size="22pt" margin-bottom="6pt"> </fo:block>
110
114
 
111
- <fo:block font-family="SourceSerifPro" font-size="12pt" line-height="230%">
115
+ <fo:block font-family="Source Serif Pro" font-size="12pt" line-height="230%">
112
116
  <fo:block>Ronald Tse</fo:block>
113
117
  <fo:block>Wai Kit Wong</fo:block>
114
118
  <fo:block>Daniel Wyatt</fo:block>
@@ -140,7 +144,7 @@
140
144
  </xsl:call-template>
141
145
  </fo:block>
142
146
 
143
- <fo:block font-size="12pt" font-weight="bold" font-style="italic" margin-bottom="12pt">
147
+ <fo:block font-size="12pt" font-weight="normal" font-style="italic" margin-bottom="12pt">
144
148
  <xsl:text>Unrestricted</xsl:text>
145
149
  </fo:block>
146
150
 
@@ -161,9 +165,9 @@
161
165
  <xsl:with-param name="name" select="'title-toc'"/>
162
166
  </xsl:call-template>
163
167
  </xsl:variable>
164
- <fo:block font-size="14pt" font-weight="bold" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
165
- <fo:block font-weight="bold" line-height="125%">
166
- <xsl:for-each select="xalan:nodeset($contents)//item">
168
+ <fo:block font-size="14pt" font-weight="normal" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
169
+ <fo:block font-weight="normal" line-height="125%">
170
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
167
171
  <fo:block>
168
172
  <xsl:if test="@level = 1">
169
173
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -184,9 +188,9 @@
184
188
  </fo:list-item-label>
185
189
  <fo:list-item-body start-indent="body-start()">
186
190
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
187
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
191
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
188
192
 
189
- <xsl:apply-templates/>
193
+ <xsl:apply-templates select="title"/>
190
194
 
191
195
  <fo:inline keep-together.within-line="always">
192
196
  <fo:leader leader-pattern="dots"/>
@@ -221,7 +225,7 @@
221
225
 
222
226
  <fo:block line-height="130%">
223
227
 
224
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt"><xsl:value-of select="$doctitle"/></fo:block>
228
+ <fo:block font-size="16pt" font-weight="normal" margin-bottom="18pt"><xsl:value-of select="$doctitle"/></fo:block>
225
229
 
226
230
  <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract"/>
227
231
  <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:foreword"/>
@@ -261,16 +265,22 @@
261
265
  </xsl:variable>
262
266
 
263
267
  <xsl:variable name="display">
264
- <xsl:choose>
265
- <xsl:when test="ancestor-or-self::rsd:bibitem">false</xsl:when>
266
- <xsl:when test="ancestor-or-self::rsd:term">false</xsl:when>
268
+ <xsl:choose>
267
269
  <xsl:when test="$level &gt;= 3">false</xsl:when>
268
270
  <xsl:otherwise>true</xsl:otherwise>
269
271
  </xsl:choose>
270
272
  </xsl:variable>
271
273
 
274
+ <xsl:variable name="skip">
275
+ <xsl:choose>
276
+ <xsl:when test="ancestor-or-self::rsd:bibitem">true</xsl:when>
277
+ <xsl:when test="ancestor-or-self::rsd:term">true</xsl:when>
278
+ <xsl:otherwise>false</xsl:otherwise>
279
+ </xsl:choose>
280
+ </xsl:variable>
272
281
 
273
- <xsl:if test="$display = 'true'">
282
+
283
+ <xsl:if test="$skip = 'false'">
274
284
 
275
285
  <xsl:variable name="section">
276
286
  <xsl:call-template name="getSection"/>
@@ -284,10 +294,13 @@
284
294
  <xsl:value-of select="local-name()"/>
285
295
  </xsl:variable>
286
296
 
287
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
288
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
297
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
298
+ <title>
299
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
300
+ </title>
301
+ <xsl:apply-templates mode="contents"/>
289
302
  </item>
290
- <xsl:apply-templates mode="contents"/>
303
+
291
304
  </xsl:if>
292
305
 
293
306
  </xsl:template>
@@ -315,7 +328,7 @@
315
328
  </xsl:template>
316
329
 
317
330
  <xsl:template match="rsd:license-statement//rsd:title">
318
- <fo:block text-align="center" font-weight="bold" margin-top="4pt">
331
+ <fo:block text-align="center" font-weight="normal" margin-top="4pt">
319
332
  <xsl:apply-templates/>
320
333
  </fo:block>
321
334
  </xsl:template>
@@ -336,7 +349,7 @@
336
349
  </xsl:template>
337
350
 
338
351
  <xsl:template match="rsd:copyright-statement//rsd:title">
339
- <fo:block font-weight="bold" text-align="center">
352
+ <fo:block font-weight="normal" text-align="center">
340
353
  <xsl:apply-templates/>
341
354
  </fo:block>
342
355
  </xsl:template>
@@ -360,7 +373,7 @@
360
373
  </xsl:template>
361
374
 
362
375
  <xsl:template match="rsd:legal-statement//rsd:title">
363
- <fo:block font-weight="bold" padding-top="2mm" margin-bottom="6pt">
376
+ <fo:block font-weight="normal" padding-top="2mm" margin-bottom="6pt">
364
377
  <xsl:apply-templates/>
365
378
  </fo:block>
366
379
  </xsl:template>
@@ -421,7 +434,7 @@
421
434
 
422
435
  <xsl:element name="{$element-name}">
423
436
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
424
- <xsl:attribute name="font-weight">bold</xsl:attribute>
437
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
425
438
  <xsl:attribute name="space-before">13.5pt</xsl:attribute>
426
439
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
427
440
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -516,7 +529,7 @@
516
529
 
517
530
 
518
531
  <xsl:template match="rsd:bibitem">
519
- <fo:block font-family="SourceSansPro" font-size="11pt" id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm">
532
+ <fo:block font-family="Source Sans Pro" font-size="11pt" id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm">
520
533
  <xsl:if test=".//rsd:fn">
521
534
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
522
535
  </xsl:if>
@@ -714,10 +727,10 @@
714
727
  </xsl:choose>
715
728
  </xsl:variable>
716
729
  <fo:block font-size="{$font-size}">
717
- <fo:block font-weight="bold" keep-with-next="always">
730
+ <fo:block font-weight="normal" keep-with-next="always">
718
731
  <xsl:apply-templates select="ancestor::rsd:term/rsd:name" mode="presentation"/>
719
732
  </fo:block>
720
- <fo:block font-weight="bold" keep-with-next="always" line-height="1">
733
+ <fo:block font-weight="normal" keep-with-next="always" line-height="1">
721
734
  <xsl:apply-templates/>
722
735
  </fo:block>
723
736
  </fo:block>
@@ -761,7 +774,7 @@
761
774
  <xsl:template match="rsd:admonition">
762
775
  <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt">
763
776
  <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
764
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
777
+ <fo:block font-size="11pt" margin-bottom="6pt" font-weight="normal" font-style="italic" text-align="center">
765
778
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
766
779
  </fo:block>
767
780
  <fo:block font-style="italic">
@@ -807,7 +820,7 @@
807
820
  </xsl:template>
808
821
 
809
822
  <xsl:template name="insertHeaderFooter">
810
- <xsl:param name="font-weight" select="'bold'"/>
823
+ <xsl:param name="font-weight" select="'normal'"/>
811
824
  <fo:static-content flow-name="header-odd">
812
825
  <fo:block-container height="100%" display-align="after">
813
826
  <fo:block text-align="right">
@@ -898,6 +911,12 @@
898
911
 
899
912
  </title-edition>
900
913
 
914
+ <title-edition lang="fr">
915
+
916
+ <xsl:text>Édition </xsl:text>
917
+
918
+ </title-edition>
919
+
901
920
 
902
921
  <title-toc lang="en">
903
922
 
@@ -906,7 +925,12 @@
906
925
 
907
926
 
908
927
  </title-toc>
909
- <title-toc lang="fr">Sommaire</title-toc>
928
+ <title-toc lang="fr">
929
+
930
+ <xsl:text>Sommaire</xsl:text>
931
+
932
+
933
+ </title-toc>
910
934
 
911
935
  <title-toc lang="zh">Contents</title-toc>
912
936
 
@@ -926,13 +950,22 @@
926
950
  <title-part lang="en">
927
951
 
928
952
 
953
+
929
954
  </title-part>
930
955
  <title-part lang="fr">
931
956
 
932
957
 
958
+
933
959
  </title-part>
934
960
  <title-part lang="zh">第 # 部分:</title-part>
935
961
 
962
+ <title-subpart lang="en">
963
+
964
+ </title-subpart>
965
+ <title-subpart lang="fr">
966
+
967
+ </title-subpart>
968
+
936
969
  <title-modified lang="en">modified</title-modified>
937
970
  <title-modified lang="fr">modifiée</title-modified>
938
971
 
@@ -994,10 +1027,19 @@
994
1027
 
995
1028
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
996
1029
  <xsl:param name="name"/>
997
- <xsl:variable name="lang">
998
- <xsl:call-template name="getLang"/>
1030
+ <xsl:param name="lang"/>
1031
+ <xsl:variable name="lang_">
1032
+ <xsl:choose>
1033
+ <xsl:when test="$lang != ''">
1034
+ <xsl:value-of select="$lang"/>
1035
+ </xsl:when>
1036
+ <xsl:otherwise>
1037
+ <xsl:call-template name="getLang"/>
1038
+ </xsl:otherwise>
1039
+ </xsl:choose>
999
1040
  </xsl:variable>
1000
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1041
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1042
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1001
1043
  <xsl:choose>
1002
1044
  <xsl:when test="normalize-space($title_) != ''">
1003
1045
  <xsl:value-of select="$title_"/>
@@ -1006,7 +1048,9 @@
1006
1048
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1007
1049
  </xsl:otherwise>
1008
1050
  </xsl:choose>
1009
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1051
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1052
+
1053
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1010
1054
 
1011
1055
  <xsl:attribute name="color">blue</xsl:attribute>
1012
1056
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1018,7 +1062,7 @@
1018
1062
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1019
1063
 
1020
1064
 
1021
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1065
+ <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
1022
1066
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1023
1067
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1024
1068
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1058,8 +1102,8 @@
1058
1102
 
1059
1103
 
1060
1104
 
1061
-
1062
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1105
+
1106
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1063
1107
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1064
1108
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1065
1109
 
@@ -1098,11 +1142,10 @@
1098
1142
 
1099
1143
 
1100
1144
 
1101
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1102
1145
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1103
1146
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1104
1147
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1105
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1148
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1106
1149
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1107
1150
 
1108
1151
 
@@ -1146,12 +1189,13 @@
1146
1189
 
1147
1190
 
1148
1191
 
1192
+
1149
1193
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1150
1194
 
1151
1195
 
1152
1196
 
1153
1197
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1154
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1198
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1155
1199
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1156
1200
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1157
1201
 
@@ -1159,7 +1203,7 @@
1159
1203
 
1160
1204
 
1161
1205
 
1162
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1206
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1163
1207
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1164
1208
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1165
1209
 
@@ -1197,6 +1241,7 @@
1197
1241
 
1198
1242
 
1199
1243
 
1244
+
1200
1245
  </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">
1201
1246
 
1202
1247
 
@@ -1277,6 +1322,7 @@
1277
1322
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1278
1323
 
1279
1324
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1325
+
1280
1326
 
1281
1327
 
1282
1328
 
@@ -1289,9 +1335,8 @@
1289
1335
 
1290
1336
 
1291
1337
 
1292
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1293
1338
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1294
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1339
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1295
1340
  <xsl:attribute name="text-align">center</xsl:attribute>
1296
1341
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1297
1342
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1325,7 +1370,7 @@
1325
1370
 
1326
1371
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1327
1372
 
1328
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1373
+ <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
1329
1374
 
1330
1375
 
1331
1376
 
@@ -1337,7 +1382,7 @@
1337
1382
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1338
1383
 
1339
1384
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1340
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1385
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1341
1386
 
1342
1387
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1343
1388
 
@@ -1404,6 +1449,10 @@
1404
1449
 
1405
1450
 
1406
1451
 
1452
+ <!-- <xsl:if test="$namespace = 'bipm'">
1453
+ <fo:block>&#xA0;</fo:block>
1454
+ </xsl:if> -->
1455
+
1407
1456
  <!-- $namespace = 'iso' or -->
1408
1457
 
1409
1458
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1439,6 +1488,7 @@
1439
1488
  <xsl:with-param name="table" select="$simple-table"/>
1440
1489
  </xsl:call-template>
1441
1490
  </xsl:variable>
1491
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1442
1492
 
1443
1493
  <!-- <xsl:variable name="colwidths2">
1444
1494
  <xsl:call-template name="calculate-column-widths">
@@ -1460,27 +1510,49 @@
1460
1510
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1461
1511
 
1462
1512
 
1513
+
1514
+
1515
+
1463
1516
 
1464
1517
 
1518
+
1465
1519
 
1466
-
1467
1520
 
1468
1521
 
1469
1522
 
1470
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1471
-
1472
-
1473
-
1474
-
1475
-
1523
+
1524
+
1525
+
1526
+ <xsl:variable name="table_attributes">
1527
+ <attribute name="table-layout">fixed</attribute>
1528
+ <attribute name="width">100%</attribute>
1529
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1530
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1476
1531
 
1477
1532
 
1478
1533
 
1479
1534
 
1535
+
1536
+
1537
+
1480
1538
 
1539
+
1481
1540
 
1541
+ </xsl:variable>
1542
+
1543
+
1544
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1482
1545
 
1546
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1547
+ <xsl:attribute name="{@name}">
1548
+ <xsl:value-of select="."/>
1549
+ </xsl:attribute>
1550
+ </xsl:for-each>
1483
1551
 
1552
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1553
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1554
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1555
+ </xsl:if>
1484
1556
 
1485
1557
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1486
1558
  <xsl:choose>
@@ -1504,6 +1576,33 @@
1504
1576
 
1505
1577
  </fo:table>
1506
1578
 
1579
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1580
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1581
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1582
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1583
+ </xsl:call-template>
1584
+ </xsl:for-each>
1585
+
1586
+ <!-- insert footer as table -->
1587
+ <!-- <fo:table>
1588
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1589
+ <xsl:attribute name="{@name}">
1590
+ <xsl:value-of select="."/>
1591
+ </xsl:attribute>
1592
+ </xsl:for-each>
1593
+
1594
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1595
+ <xsl:choose>
1596
+ <xsl:when test=". = 1 or . = 0">
1597
+ <fo:table-column column-width="proportional-column-width(2)"/>
1598
+ </xsl:when>
1599
+ <xsl:otherwise>
1600
+ <fo:table-column column-width="proportional-column-width({.})"/>
1601
+ </xsl:otherwise>
1602
+ </xsl:choose>
1603
+ </xsl:for-each>
1604
+ </fo:table>-->
1605
+
1507
1606
 
1508
1607
 
1509
1608
 
@@ -1513,6 +1612,7 @@
1513
1612
  <xsl:if test="normalize-space() != ''">
1514
1613
  <fo:block xsl:use-attribute-sets="table-name-style">
1515
1614
 
1615
+
1516
1616
  <xsl:apply-templates/>
1517
1617
  </fo:block>
1518
1618
  </xsl:if>
@@ -1568,6 +1668,13 @@
1568
1668
  <xsl:for-each select="xalan:nodeset($table)//tr">
1569
1669
  <xsl:variable name="td_text">
1570
1670
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1671
+
1672
+ <!-- <xsl:if test="$namespace = 'bipm'">
1673
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1674
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1675
+ </xsl:for-each>
1676
+ </xsl:if> -->
1677
+
1571
1678
  </xsl:variable>
1572
1679
  <xsl:variable name="words">
1573
1680
  <xsl:variable name="string_with_added_zerospaces">
@@ -1627,11 +1734,14 @@
1627
1734
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1628
1735
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1629
1736
  <xsl:value-of select="@target"/>
1737
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1738
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1739
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1630
1740
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1631
1741
  <xsl:param name="cols-count"/>
1632
1742
  <!-- font-weight="bold" -->
1633
1743
  <fo:table-header>
1634
-
1744
+
1635
1745
  <xsl:apply-templates/>
1636
1746
  </fo:table-header>
1637
1747
  </xsl:template><xsl:template name="table-header-title">
@@ -1656,6 +1766,13 @@
1656
1766
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1657
1767
  <xsl:apply-templates/>
1658
1768
  </xsl:template><xsl:template name="insertTableFooter">
1769
+ <xsl:param name="cols-count"/>
1770
+ <xsl:if test="../*[local-name()='tfoot']">
1771
+ <fo:table-footer>
1772
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1773
+ </fo:table-footer>
1774
+ </xsl:if>
1775
+ </xsl:template><xsl:template name="insertTableFooter2">
1659
1776
  <xsl:param name="cols-count"/>
1660
1777
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1661
1778
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1677,11 +1794,29 @@
1677
1794
  <!-- fn will be processed inside 'note' processing -->
1678
1795
 
1679
1796
 
1797
+
1798
+
1799
+
1800
+
1680
1801
  <!-- except gb -->
1681
1802
 
1682
1803
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1683
1804
 
1684
1805
 
1806
+ <!-- show Note under table in preface (ex. abstract) sections -->
1807
+ <!-- empty, because notes show at page side in main sections -->
1808
+ <!-- <xsl:if test="$namespace = 'bipm'">
1809
+ <xsl:choose>
1810
+ <xsl:when test="ancestor::*[local-name()='preface']">
1811
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1812
+ </xsl:when>
1813
+ <xsl:otherwise>
1814
+ <fo:block/>
1815
+ </xsl:otherwise>
1816
+ </xsl:choose>
1817
+ </xsl:if> -->
1818
+
1819
+
1685
1820
  <!-- horizontal row separator -->
1686
1821
 
1687
1822
 
@@ -1695,6 +1830,88 @@
1695
1830
  </fo:table-footer>
1696
1831
 
1697
1832
  </xsl:if>
1833
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1834
+ <xsl:param name="table_attributes"/>
1835
+ <xsl:param name="colwidths"/>
1836
+
1837
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1838
+
1839
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1840
+
1841
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1842
+
1843
+ <fo:table keep-with-previous="always">
1844
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1845
+ <xsl:choose>
1846
+ <xsl:when test="@name = 'border-top'">
1847
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1848
+ </xsl:when>
1849
+ <xsl:when test="@name = 'border'">
1850
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1851
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1852
+ </xsl:when>
1853
+ <xsl:otherwise>
1854
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1855
+ </xsl:otherwise>
1856
+ </xsl:choose>
1857
+ </xsl:for-each>
1858
+
1859
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1860
+ <xsl:choose>
1861
+ <xsl:when test=". = 1 or . = 0">
1862
+ <fo:table-column column-width="proportional-column-width(2)"/>
1863
+ </xsl:when>
1864
+ <xsl:otherwise>
1865
+ <fo:table-column column-width="proportional-column-width({.})"/>
1866
+ </xsl:otherwise>
1867
+ </xsl:choose>
1868
+ </xsl:for-each>
1869
+
1870
+ <fo:table-body>
1871
+ <fo:table-row>
1872
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1873
+
1874
+
1875
+
1876
+ <!-- fn will be processed inside 'note' processing -->
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+
1884
+ <!-- except gb -->
1885
+
1886
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1887
+
1888
+
1889
+ <!-- <xsl:if test="$namespace = 'bipm'">
1890
+ <xsl:choose>
1891
+ <xsl:when test="ancestor::*[local-name()='preface']">
1892
+ show Note under table in preface (ex. abstract) sections
1893
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1894
+ </xsl:when>
1895
+ <xsl:otherwise>
1896
+ empty, because notes show at page side in main sections
1897
+ <fo:block/>
1898
+ </xsl:otherwise>
1899
+ </xsl:choose>
1900
+ </xsl:if> -->
1901
+
1902
+
1903
+ <!-- horizontal row separator -->
1904
+
1905
+
1906
+ <!-- fn processing -->
1907
+ <xsl:call-template name="fn_display"/>
1908
+
1909
+ </fo:table-cell>
1910
+ </fo:table-row>
1911
+ </fo:table-body>
1912
+
1913
+ </fo:table>
1914
+ </xsl:if>
1698
1915
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1699
1916
 
1700
1917
  <xsl:variable name="cols-count">
@@ -1747,8 +1964,12 @@
1747
1964
 
1748
1965
  </xsl:if>
1749
1966
 
1750
-
1751
-
1967
+
1968
+
1969
+
1970
+ <!-- <xsl:if test="$namespace = 'bipm'">
1971
+ <xsl:attribute name="height">8mm</xsl:attribute>
1972
+ </xsl:if> -->
1752
1973
 
1753
1974
  <xsl:apply-templates/>
1754
1975
  </fo:table-row>
@@ -1772,6 +1993,7 @@
1772
1993
 
1773
1994
 
1774
1995
 
1996
+
1775
1997
  <xsl:if test="@colspan">
1776
1998
  <xsl:attribute name="number-columns-spanned">
1777
1999
  <xsl:value-of select="@colspan"/>
@@ -1811,7 +2033,8 @@
1811
2033
 
1812
2034
 
1813
2035
 
1814
-
2036
+
2037
+
1815
2038
 
1816
2039
 
1817
2040
 
@@ -1829,7 +2052,8 @@
1829
2052
  </xsl:attribute>
1830
2053
  </xsl:if>
1831
2054
  <xsl:call-template name="display-align"/>
1832
- <fo:block>
2055
+ <fo:block>
2056
+
1833
2057
  <xsl:apply-templates/>
1834
2058
  </fo:block>
1835
2059
  </fo:table-cell>
@@ -1841,14 +2065,17 @@
1841
2065
 
1842
2066
 
1843
2067
 
2068
+
2069
+
1844
2070
  <fo:inline padding-right="2mm">
1845
2071
 
1846
2072
 
1847
2073
 
1848
-
2074
+
1849
2075
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1850
2076
 
1851
2077
  </fo:inline>
2078
+
1852
2079
  <xsl:apply-templates mode="process"/>
1853
2080
  </fo:block>
1854
2081
 
@@ -1872,6 +2099,7 @@
1872
2099
 
1873
2100
 
1874
2101
 
2102
+
1875
2103
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1876
2104
 
1877
2105
 
@@ -1879,12 +2107,15 @@
1879
2107
 
1880
2108
 
1881
2109
 
2110
+
1882
2111
  <xsl:value-of select="@reference"/>
1883
2112
 
2113
+
1884
2114
  </fo:inline>
1885
2115
  <fo:inline>
1886
2116
 
1887
- <xsl:apply-templates/>
2117
+ <!-- <xsl:apply-templates /> -->
2118
+ <xsl:copy-of select="./node()"/>
1888
2119
  </fo:inline>
1889
2120
  </fo:block>
1890
2121
  </xsl:if>
@@ -1921,7 +2152,20 @@
1921
2152
  <xsl:variable name="following_dl_colwidths">
1922
2153
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1923
2154
  <xsl:variable name="html-table">
1924
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2155
+ <xsl:variable name="doc_ns">
2156
+
2157
+ </xsl:variable>
2158
+ <xsl:variable name="ns">
2159
+ <xsl:choose>
2160
+ <xsl:when test="normalize-space($doc_ns) != ''">
2161
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2162
+ </xsl:when>
2163
+ <xsl:otherwise>
2164
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2165
+ </xsl:otherwise>
2166
+ </xsl:choose>
2167
+ </xsl:variable>
2168
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1925
2169
  <xsl:element name="{$ns}:table">
1926
2170
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1927
2171
  <tbody>
@@ -1986,7 +2230,8 @@
1986
2230
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1987
2231
  </xsl:if>
1988
2232
 
1989
- <xsl:apply-templates/>
2233
+ <!-- <xsl:apply-templates /> -->
2234
+ <xsl:copy-of select="./node()"/>
1990
2235
  </fo:block>
1991
2236
  </fo:table-cell>
1992
2237
  </fo:table-row>
@@ -2005,9 +2250,12 @@
2005
2250
 
2006
2251
 
2007
2252
 
2253
+
2008
2254
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2009
2255
 
2256
+
2010
2257
  <xsl:value-of select="@reference"/>
2258
+
2011
2259
  </fo:basic-link>
2012
2260
  </fo:inline>
2013
2261
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2015,7 +2263,11 @@
2015
2263
  <xsl:apply-templates/>
2016
2264
  </fo:inline>
2017
2265
  </xsl:template><xsl:template match="*[local-name()='dl']">
2018
- <fo:block-container margin-left="0mm">
2266
+ <fo:block-container>
2267
+
2268
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2269
+
2270
+
2019
2271
  <xsl:if test="parent::*[local-name() = 'note']">
2020
2272
  <xsl:attribute name="margin-left">
2021
2273
  <xsl:choose>
@@ -2025,8 +2277,11 @@
2025
2277
  </xsl:attribute>
2026
2278
 
2027
2279
  </xsl:if>
2028
- <fo:block-container margin-left="0mm">
2029
-
2280
+ <fo:block-container>
2281
+
2282
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2283
+
2284
+
2030
2285
  <xsl:variable name="parent" select="local-name(..)"/>
2031
2286
 
2032
2287
  <xsl:variable name="key_iso">
@@ -2040,9 +2295,12 @@
2040
2295
  <fo:block margin-bottom="12pt" text-align="left">
2041
2296
 
2042
2297
  <xsl:variable name="title-where">
2043
- <xsl:call-template name="getTitle">
2044
- <xsl:with-param name="name" select="'title-where'"/>
2045
- </xsl:call-template>
2298
+
2299
+
2300
+ <xsl:call-template name="getTitle">
2301
+ <xsl:with-param name="name" select="'title-where'"/>
2302
+ </xsl:call-template>
2303
+
2046
2304
  </xsl:variable>
2047
2305
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2048
2306
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2058,9 +2316,12 @@
2058
2316
 
2059
2317
 
2060
2318
  <xsl:variable name="title-where">
2061
- <xsl:call-template name="getTitle">
2062
- <xsl:with-param name="name" select="'title-where'"/>
2063
- </xsl:call-template>
2319
+
2320
+
2321
+ <xsl:call-template name="getTitle">
2322
+ <xsl:with-param name="name" select="'title-where'"/>
2323
+ </xsl:call-template>
2324
+
2064
2325
  </xsl:variable>
2065
2326
  <xsl:value-of select="$title-where"/>
2066
2327
  </fo:block>
@@ -2071,9 +2332,12 @@
2071
2332
 
2072
2333
 
2073
2334
  <xsl:variable name="title-key">
2074
- <xsl:call-template name="getTitle">
2075
- <xsl:with-param name="name" select="'title-key'"/>
2076
- </xsl:call-template>
2335
+
2336
+
2337
+ <xsl:call-template name="getTitle">
2338
+ <xsl:with-param name="name" select="'title-key'"/>
2339
+ </xsl:call-template>
2340
+
2077
2341
  </xsl:variable>
2078
2342
  <xsl:value-of select="$title-key"/>
2079
2343
  </fo:block>
@@ -2105,7 +2369,20 @@
2105
2369
  </xsl:choose>
2106
2370
  <!-- create virtual html table for dl/[dt and dd] -->
2107
2371
  <xsl:variable name="html-table">
2108
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2372
+ <xsl:variable name="doc_ns">
2373
+
2374
+ </xsl:variable>
2375
+ <xsl:variable name="ns">
2376
+ <xsl:choose>
2377
+ <xsl:when test="normalize-space($doc_ns) != ''">
2378
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2379
+ </xsl:when>
2380
+ <xsl:otherwise>
2381
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2382
+ </xsl:otherwise>
2383
+ </xsl:choose>
2384
+ </xsl:variable>
2385
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2109
2386
  <xsl:element name="{$ns}:table">
2110
2387
  <tbody>
2111
2388
  <xsl:apply-templates mode="dl"/>
@@ -2249,6 +2526,7 @@
2249
2526
 
2250
2527
 
2251
2528
 
2529
+
2252
2530
  <xsl:apply-templates/>
2253
2531
  <!-- <xsl:if test="$namespace = 'gb'">
2254
2532
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2302,6 +2580,9 @@
2302
2580
  </fo:inline>
2303
2581
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2304
2582
  <fo:inline font-weight="bold">
2583
+
2584
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2585
+
2305
2586
  <xsl:apply-templates/>
2306
2587
  </fo:inline>
2307
2588
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2315,18 +2596,18 @@
2315
2596
  </xsl:template><xsl:template match="*[local-name()='tt']">
2316
2597
  <fo:inline xsl:use-attribute-sets="tt-style">
2317
2598
  <xsl:variable name="_font-size">
2318
-
2319
-
2320
-
2321
2599
 
2322
2600
 
2323
2601
 
2324
2602
 
2325
2603
 
2326
2604
 
2327
-
2328
2605
 
2329
-
2606
+
2607
+
2608
+
2609
+
2610
+
2330
2611
  10
2331
2612
 
2332
2613
  </xsl:variable>
@@ -2630,7 +2911,18 @@
2630
2911
  <xsl:with-param name="previousRow" select="$newRow"/>
2631
2912
  </xsl:apply-templates>
2632
2913
  </xsl:template><xsl:template name="getLang">
2633
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2914
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2915
+ <xsl:variable name="language">
2916
+ <xsl:choose>
2917
+ <xsl:when test="$language_current != ''">
2918
+ <xsl:value-of select="$language_current"/>
2919
+ </xsl:when>
2920
+ <xsl:otherwise>
2921
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2922
+ </xsl:otherwise>
2923
+ </xsl:choose>
2924
+ </xsl:variable>
2925
+
2634
2926
  <xsl:choose>
2635
2927
  <xsl:when test="$language = 'English'">en</xsl:when>
2636
2928
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2664,7 +2956,8 @@
2664
2956
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2665
2957
  <xsl:value-of select="substring($str, 2)"/>
2666
2958
  </xsl:template><xsl:template match="mathml:math">
2667
- <fo:inline font-family="STIX2Math">
2959
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2960
+
2668
2961
  <xsl:variable name="mathml">
2669
2962
  <xsl:apply-templates select="." mode="mathml"/>
2670
2963
  </xsl:variable>
@@ -2694,6 +2987,7 @@
2694
2987
  </xsl:choose>
2695
2988
  </xsl:variable>
2696
2989
  <fo:inline xsl:use-attribute-sets="link-style">
2990
+
2697
2991
  <xsl:choose>
2698
2992
  <xsl:when test="$target = ''">
2699
2993
  <xsl:apply-templates/>
@@ -2747,10 +3041,14 @@
2747
3041
  </fo:inline>
2748
3042
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2749
3043
  <xsl:variable name="title-modified">
2750
- <xsl:call-template name="getTitle">
2751
- <xsl:with-param name="name" select="'title-modified'"/>
2752
- </xsl:call-template>
3044
+
3045
+
3046
+ <xsl:call-template name="getTitle">
3047
+ <xsl:with-param name="name" select="'title-modified'"/>
3048
+ </xsl:call-template>
3049
+
2753
3050
  </xsl:variable>
3051
+
2754
3052
  <xsl:choose>
2755
3053
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2756
3054
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2758,7 +3056,7 @@
2758
3056
  <xsl:apply-templates/>
2759
3057
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2760
3058
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2761
-
3059
+
2762
3060
  <xsl:apply-templates/>
2763
3061
  </fo:basic-link>
2764
3062
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -2815,6 +3113,8 @@
2815
3113
 
2816
3114
 
2817
3115
 
3116
+
3117
+
2818
3118
  <fo:inline xsl:use-attribute-sets="note-name-style">
2819
3119
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2820
3120
  </fo:inline>
@@ -2907,7 +3207,8 @@
2907
3207
  </fo:inline>
2908
3208
  </xsl:if>
2909
3209
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
2910
- <fo:block-container id="{@id}">
3210
+ <fo:block-container id="{@id}">
3211
+
2911
3212
  <fo:block>
2912
3213
  <xsl:apply-templates/>
2913
3214
  </fo:block>
@@ -2942,15 +3243,109 @@
2942
3243
 
2943
3244
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2944
3245
  </fo:block>
2945
- </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">
3246
+ </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">
2946
3247
  <xsl:apply-templates mode="contents"/>
2947
3248
  <xsl:text> </xsl:text>
2948
- </xsl:template><xsl:template match="text()" mode="contents">
3249
+ </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">
3250
+ <xsl:apply-templates mode="bookmarks"/>
3251
+ <xsl:text> </xsl:text>
3252
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2949
3253
  <xsl:value-of select="."/>
2950
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3254
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3255
+ <xsl:value-of select="."/>
3256
+ </xsl:template><xsl:template match="node()" mode="contents">
3257
+ <xsl:apply-templates mode="contents"/>
3258
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3259
+ <xsl:apply-templates mode="bookmarks"/>
3260
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3261
+ <xsl:apply-templates select="."/>
3262
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3263
+ <xsl:apply-templates mode="bookmarks"/>
3264
+ </xsl:template><xsl:template name="addBookmarks">
3265
+ <xsl:param name="contents"/>
3266
+ <xsl:if test="xalan:nodeset($contents)//item">
3267
+ <fo:bookmark-tree>
3268
+ <xsl:choose>
3269
+ <xsl:when test="xalan:nodeset($contents)/doc">
3270
+ <xsl:choose>
3271
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3272
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3273
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3274
+ <fo:bookmark-title>
3275
+ <xsl:variable name="bookmark-title_">
3276
+ <xsl:call-template name="getLangVersion">
3277
+ <xsl:with-param name="lang" select="@lang"/>
3278
+ </xsl:call-template>
3279
+ </xsl:variable>
3280
+ <xsl:choose>
3281
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3282
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3283
+ </xsl:when>
3284
+ <xsl:otherwise>
3285
+ <xsl:choose>
3286
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3287
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3288
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3289
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3290
+ </xsl:choose>
3291
+ </xsl:otherwise>
3292
+ </xsl:choose>
3293
+ </fo:bookmark-title>
3294
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3295
+ </fo:bookmark>
3296
+
3297
+ </xsl:for-each>
3298
+ </xsl:when>
3299
+ <xsl:otherwise>
3300
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3301
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3302
+ </xsl:for-each>
3303
+ </xsl:otherwise>
3304
+ </xsl:choose>
3305
+ </xsl:when>
3306
+ <xsl:otherwise>
3307
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3308
+ </xsl:otherwise>
3309
+ </xsl:choose>
3310
+
3311
+
3312
+
3313
+
3314
+
3315
+
3316
+
3317
+
3318
+ </fo:bookmark-tree>
3319
+ </xsl:if>
3320
+ </xsl:template><xsl:template name="getLangVersion">
3321
+ <xsl:param name="lang"/>
3322
+ <xsl:choose>
3323
+ <xsl:when test="$lang = 'en'">
3324
+
3325
+
3326
+ </xsl:when>
3327
+ <xsl:when test="$lang = 'fr'">
3328
+
3329
+
3330
+ </xsl:when>
3331
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3332
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3333
+ </xsl:choose>
3334
+ </xsl:template><xsl:template match="item" mode="bookmark">
3335
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3336
+ <fo:bookmark-title>
3337
+ <xsl:if test="@section != ''">
3338
+ <xsl:value-of select="@section"/>
3339
+ <xsl:text> </xsl:text>
3340
+ </xsl:if>
3341
+ <xsl:value-of select="normalize-space(title)"/>
3342
+ </fo:bookmark-title>
3343
+ <xsl:apply-templates mode="bookmark"/>
3344
+ </fo:bookmark>
3345
+ </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">
2951
3346
  <xsl:if test="normalize-space() != ''">
2952
3347
  <fo:block xsl:use-attribute-sets="figure-name-style">
2953
-
3348
+
2954
3349
  <xsl:apply-templates/>
2955
3350
  </fo:block>
2956
3351
  </xsl:if>
@@ -3005,7 +3400,7 @@
3005
3400
  <xsl:apply-templates/>
3006
3401
  </xsl:otherwise>
3007
3402
  </xsl:choose>
3008
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3403
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3009
3404
  <xsl:text> </xsl:text>
3010
3405
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3011
3406
  <xsl:copy>
@@ -3387,9 +3782,14 @@
3387
3782
 
3388
3783
  <fo:inline>
3389
3784
 
3390
- <xsl:call-template name="getTitle">
3391
- <xsl:with-param name="name" select="'title-source'"/>
3392
- </xsl:call-template>
3785
+
3786
+
3787
+
3788
+ <xsl:call-template name="getTitle">
3789
+ <xsl:with-param name="name" select="'title-source'"/>
3790
+ </xsl:call-template>
3791
+
3792
+
3393
3793
  <xsl:text>: </xsl:text>
3394
3794
  </fo:inline>
3395
3795
 
@@ -3533,9 +3933,12 @@
3533
3933
  </fo:block>
3534
3934
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3535
3935
  <xsl:variable name="title-deprecated">
3536
- <xsl:call-template name="getTitle">
3537
- <xsl:with-param name="name" select="'title-deprecated'"/>
3538
- </xsl:call-template>
3936
+
3937
+
3938
+ <xsl:call-template name="getTitle">
3939
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3940
+ </xsl:call-template>
3941
+
3539
3942
  </xsl:variable>
3540
3943
  <fo:block xsl:use-attribute-sets="deprecates-style">
3541
3944
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3582,13 +3985,14 @@
3582
3985
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3583
3986
  <fo:block>
3584
3987
  <xsl:call-template name="setId"/>
3988
+
3585
3989
  <xsl:apply-templates/>
3586
3990
  </fo:block>
3587
3991
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3588
3992
  <fo:block id="{@id}">
3589
3993
  <xsl:apply-templates/>
3590
3994
  </fo:block>
3591
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3995
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3592
3996
 
3593
3997
  <fo:block id="{@id}">
3594
3998
  <xsl:apply-templates/>
@@ -3607,20 +4011,30 @@
3607
4011
  <!-- 0xA0 to space replacement -->
3608
4012
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3609
4013
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3610
- <fo:block-container margin-left="0mm">
3611
- <xsl:if test="parent::*[local-name() = 'note']">
3612
- <xsl:attribute name="margin-left">
3613
- <xsl:choose>
3614
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3615
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3616
- </xsl:choose>
3617
- </xsl:attribute>
3618
-
3619
- </xsl:if>
3620
- <fo:block-container margin-left="0mm">
3621
- <xsl:apply-templates select="." mode="ul_ol"/>
3622
- </fo:block-container>
3623
- </fo:block-container>
4014
+ <xsl:choose>
4015
+ <xsl:when test="parent::*[local-name() = 'note']">
4016
+ <fo:block-container>
4017
+ <xsl:attribute name="margin-left">
4018
+ <xsl:choose>
4019
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4020
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4021
+ </xsl:choose>
4022
+ </xsl:attribute>
4023
+
4024
+
4025
+ <fo:block-container margin-left="0mm">
4026
+ <fo:block>
4027
+ <xsl:apply-templates select="." mode="ul_ol"/>
4028
+ </fo:block>
4029
+ </fo:block-container>
4030
+ </fo:block-container>
4031
+ </xsl:when>
4032
+ <xsl:otherwise>
4033
+ <fo:block>
4034
+ <xsl:apply-templates select="." mode="ul_ol"/>
4035
+ </fo:block>
4036
+ </xsl:otherwise>
4037
+ </xsl:choose>
3624
4038
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3625
4039
  <!-- <row>
3626
4040
  <date>05-07-2013</date>
@@ -3789,6 +4203,7 @@
3789
4203
  <dc:title>
3790
4204
  <xsl:variable name="title">
3791
4205
 
4206
+
3792
4207
 
3793
4208
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3794
4209
 
@@ -3807,6 +4222,7 @@
3807
4222
  <dc:creator>
3808
4223
 
3809
4224
 
4225
+
3810
4226
  </dc:creator>
3811
4227
  <dc:description>
3812
4228
  <xsl:variable name="abstract">
@@ -3816,6 +4232,7 @@
3816
4232
 
3817
4233
  <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3818
4234
 
4235
+
3819
4236
  </xsl:variable>
3820
4237
  <xsl:value-of select="normalize-space($abstract)"/>
3821
4238
  </dc:description>
@@ -3887,13 +4304,22 @@
3887
4304
  </xsl:template><xsl:template name="split">
3888
4305
  <xsl:param name="pText" select="."/>
3889
4306
  <xsl:param name="sep" select="','"/>
4307
+ <xsl:param name="normalize-space" select="'true'"/>
3890
4308
  <xsl:if test="string-length($pText) &gt;0">
3891
4309
  <item>
3892
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4310
+ <xsl:choose>
4311
+ <xsl:when test="$normalize-space = 'true'">
4312
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4313
+ </xsl:when>
4314
+ <xsl:otherwise>
4315
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4316
+ </xsl:otherwise>
4317
+ </xsl:choose>
3893
4318
  </item>
3894
4319
  <xsl:call-template name="split">
3895
4320
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3896
4321
  <xsl:with-param name="sep" select="$sep"/>
4322
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3897
4323
  </xsl:call-template>
3898
4324
  </xsl:if>
3899
4325
  </xsl:template><xsl:template name="getDocumentId">
@@ -3916,6 +4342,7 @@
3916
4342
 
3917
4343
 
3918
4344
 
4345
+
3919
4346
  </xsl:variable>
3920
4347
  <xsl:if test="$documentNS != $XSLNS">
3921
4348
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3941,4 +4368,40 @@
3941
4368
  </xsl:otherwise>
3942
4369
  </xsl:choose>
3943
4370
  </xsl:attribute>
4371
+ </xsl:template><xsl:template name="add-letter-spacing">
4372
+ <xsl:param name="text"/>
4373
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4374
+ <xsl:if test="string-length($text) &gt; 0">
4375
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4376
+ <fo:inline padding-right="{$letter-spacing}mm">
4377
+ <xsl:if test="$char = '®'">
4378
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4379
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4380
+ </xsl:if>
4381
+ <xsl:value-of select="$char"/>
4382
+ </fo:inline>
4383
+ <xsl:call-template name="add-letter-spacing">
4384
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4385
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4386
+ </xsl:call-template>
4387
+ </xsl:if>
4388
+ </xsl:template><xsl:template name="repeat">
4389
+ <xsl:param name="char" select="'*'"/>
4390
+ <xsl:param name="count"/>
4391
+ <xsl:if test="$count &gt; 0">
4392
+ <xsl:value-of select="$char"/>
4393
+ <xsl:call-template name="repeat">
4394
+ <xsl:with-param name="char" select="$char"/>
4395
+ <xsl:with-param name="count" select="$count - 1"/>
4396
+ </xsl:call-template>
4397
+ </xsl:if>
4398
+ </xsl:template><xsl:template name="getLocalizedString">
4399
+ <xsl:param name="key"/>
4400
+
4401
+ <xsl:variable name="curr_lang">
4402
+ <xsl:call-template name="getLang"/>
4403
+ </xsl:variable>
4404
+
4405
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4406
+
3944
4407
  </xsl:template></xsl:stylesheet>