metanorma-un 0.5.2 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,14 @@
16
16
 
17
17
  <xsl:variable name="contents">
18
18
  <contents>
19
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
20
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
21
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
22
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
23
+
24
+ <xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/>
25
+ <xsl:apply-templates select="/un:un-standard/un:annex" mode="contents"/>
26
+ <xsl:apply-templates select="/un:un-standard/un:bibliography/un:references" mode="contents"/>
19
27
  </contents>
20
28
  </xsl:variable>
21
29
 
@@ -29,7 +37,7 @@
29
37
 
30
38
  <xsl:template match="/">
31
39
  <xsl:call-template name="namespaceCheck"/>
32
- <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10pt" xml:lang="{$lang}">
40
+ <fo:root font-family="Times New Roman, STIX Two Math, HanSans" font-size="10pt" xml:lang="{$lang}">
33
41
  <fo:layout-master-set>
34
42
  <!-- Cover page -->
35
43
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -66,6 +74,10 @@
66
74
 
67
75
  <xsl:call-template name="addPDFUAmeta"/>
68
76
 
77
+ <xsl:call-template name="addBookmarks">
78
+ <xsl:with-param name="contents" select="$contents"/>
79
+ </xsl:call-template>
80
+
69
81
  <!-- Cover Page -->
70
82
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
71
83
  <fo:flow flow-name="xsl-region-body">
@@ -150,7 +162,40 @@
150
162
  <fo:block margin-left="-20mm">
151
163
  <fo:block font-size="17pt" margin-bottom="16pt">
152
164
  <xsl:value-of select="$title"/>
165
+
166
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
167
+ <xsl:variable name="number" select="position()"/>
168
+ <fo:inline font-size="14pt" baseline-shift="15%" font-weight="normal">
169
+ <xsl:if test="$number = 1">
170
+ <xsl:text> </xsl:text>
171
+ </xsl:if>
172
+ <fo:basic-link internal-destination="title-footnote_{$number}" fox:alt-text="title footnote">
173
+ <xsl:call-template name="repeat">
174
+ <xsl:with-param name="char" select="'*'"/>
175
+ <xsl:with-param name="count" select="$number"/>
176
+ </xsl:call-template>
177
+ </fo:basic-link>
178
+ <xsl:if test="position() != last()"><fo:inline baseline-shift="20%">,</fo:inline></xsl:if>
179
+ </fo:inline>
180
+ </xsl:for-each>
181
+
182
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
183
+ <xsl:variable name="number" select="position()"/>
184
+ <fo:block id="title-footnote_{$number}" font-size="14pt" font-weight="normal">
185
+ <xsl:if test="$number = 1">
186
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
187
+ </xsl:if>
188
+ <xsl:call-template name="repeat">
189
+ <xsl:with-param name="char" select="'*'"/>
190
+ <xsl:with-param name="count" select="$number"/>
191
+ </xsl:call-template>
192
+ <xsl:text> </xsl:text>
193
+ <xsl:apply-templates/>
194
+ </fo:block>
195
+ </xsl:for-each>
196
+
153
197
  </fo:block>
198
+
154
199
  <fo:block font-size="14pt" margin-bottom="16pt">
155
200
  <xsl:value-of select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'subtitle']"/>
156
201
  </fo:block>
@@ -164,7 +209,7 @@
164
209
 
165
210
  <xsl:apply-templates select="/un:un-standard/un:preface/un:abstract"/>
166
211
 
167
- <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+')"/>
212
+ <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+:')"/>
168
213
  <xsl:variable name="code" select="translate(/un:un-standard/un:bibdata/un:docidentifier, $charsToRemove,'')"/>
169
214
 
170
215
  <fo:block-container absolute-position="fixed" left="20mm" top="258mm" width="30mm" text-align="center">
@@ -173,20 +218,22 @@
173
218
  </fo:block>
174
219
 
175
220
  <fo:block padding-top="1mm">
176
- <fo:instream-foreign-object fox:alt-text="Barcode">
177
- <barcode:barcode message="{$code}">
178
- <barcode:code39>
179
- <barcode:height>8.5mm</barcode:height>
180
- <barcode:module-width>0.24mm</barcode:module-width>
181
- <barcode:human-readable>
182
- <barcode:placement>none</barcode:placement>
183
- <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
184
- <barcode:font-name>Arial</barcode:font-name>
185
- <barcode:font-size>9.7pt</barcode:font-size> -->
186
- </barcode:human-readable>
187
- </barcode:code39>
188
- </barcode:barcode>
189
- </fo:instream-foreign-object>
221
+ <xsl:if test="normalize-space($code) != ''">
222
+ <fo:instream-foreign-object fox:alt-text="Barcode">
223
+ <barcode:barcode message="{$code}">
224
+ <barcode:code39>
225
+ <barcode:height>8.5mm</barcode:height>
226
+ <barcode:module-width>0.24mm</barcode:module-width>
227
+ <barcode:human-readable>
228
+ <barcode:placement>none</barcode:placement>
229
+ <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
230
+ <barcode:font-name>Arial</barcode:font-name>
231
+ <barcode:font-size>9.7pt</barcode:font-size> -->
232
+ </barcode:human-readable>
233
+ </barcode:code39>
234
+ </barcode:barcode>
235
+ </fo:instream-foreign-object>
236
+ </xsl:if>
190
237
  </fo:block>
191
238
  <fo:block padding-top="-0.8mm" text-align="left" font-family="Arial" font-size="8pt" letter-spacing="1.8mm">
192
239
  <xsl:value-of select="concat('*', $code, '*')"/>
@@ -200,14 +247,16 @@
200
247
  </fo:block-container>
201
248
  <fo:block-container absolute-position="fixed" left="170mm" top="253mm">
202
249
  <fo:block>
203
- <fo:instream-foreign-object fox:alt-text="Barcode">
204
- <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
205
- <barcode:qr>
206
- <barcode:module-width>0.55mm</barcode:module-width>
207
- <barcode:ec-level>M</barcode:ec-level>
208
- </barcode:qr>
209
- </barcode:barcode>
210
- </fo:instream-foreign-object>
250
+ <xsl:if test="normalize-space(/un:un-standard/un:bibdata/un:ext/un:session/un:id) != ''">
251
+ <fo:instream-foreign-object fox:alt-text="Barcode">
252
+ <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
253
+ <barcode:qr>
254
+ <barcode:module-width>0.55mm</barcode:module-width>
255
+ <barcode:ec-level>M</barcode:ec-level>
256
+ </barcode:qr>
257
+ </barcode:barcode>
258
+ </fo:instream-foreign-object>
259
+ </xsl:if>
211
260
  </fo:block>
212
261
  </fo:block-container>
213
262
 
@@ -262,6 +311,65 @@
262
311
  </xsl:template>
263
312
 
264
313
 
314
+
315
+ <!-- ============================= -->
316
+ <!-- CONTENTS -->
317
+ <!-- ============================= -->
318
+ <xsl:template match="node()" mode="contents">
319
+ <xsl:apply-templates mode="contents"/>
320
+ </xsl:template>
321
+
322
+ <!-- element with title -->
323
+ <xsl:template match="*[un:title]" mode="contents">
324
+ <xsl:variable name="level">
325
+ <xsl:call-template name="getLevel">
326
+ <xsl:with-param name="depth" select="un:title/@depth"/>
327
+ </xsl:call-template>
328
+ </xsl:variable>
329
+
330
+ <xsl:variable name="display">
331
+ <xsl:choose>
332
+ <xsl:when test="$level &gt; 3">false</xsl:when>
333
+ <xsl:otherwise>true</xsl:otherwise>
334
+ </xsl:choose>
335
+ </xsl:variable>
336
+
337
+ <xsl:variable name="skip">
338
+ <xsl:choose>
339
+ <xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when>
340
+ <xsl:when test="ancestor-or-self::un:term">true</xsl:when>
341
+ <xsl:when test="@inline-header = 'true'">true</xsl:when>
342
+ <xsl:otherwise>false</xsl:otherwise>
343
+ </xsl:choose>
344
+ </xsl:variable>
345
+
346
+ <xsl:if test="$skip = 'false'">
347
+
348
+ <xsl:variable name="section">
349
+ <xsl:call-template name="getSection"/>
350
+ </xsl:variable>
351
+
352
+ <xsl:variable name="title">
353
+ <xsl:call-template name="getName"/>
354
+ </xsl:variable>
355
+
356
+ <xsl:variable name="type">
357
+ <xsl:value-of select="local-name()"/>
358
+ </xsl:variable>
359
+
360
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
361
+ <title>
362
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
363
+ </title>
364
+ <xsl:apply-templates mode="contents"/>
365
+ </item>
366
+ </xsl:if>
367
+
368
+ </xsl:template>
369
+ <xsl:template match="un:references[not(@normative='true')]/un:bibitem" mode="contents"/>
370
+ <!-- ============================= -->
371
+ <!-- ============================= -->
372
+
265
373
 
266
374
  <!-- ============================= -->
267
375
  <!-- PARAGRAPHS -->
@@ -465,7 +573,7 @@
465
573
  </fo:block>
466
574
  </xsl:template>
467
575
 
468
- <xsl:template match="un:ul | un:ol">
576
+ <xsl:template match="un:ul | un:ol" mode="ul_ol">
469
577
  <fo:block-container margin-left="8mm" text-indent="0mm">
470
578
  <fo:list-block provisional-distance-between-starts="4mm" margin-left="-8mm">
471
579
  <xsl:apply-templates/>
@@ -475,13 +583,18 @@
475
583
  </xsl:template>
476
584
 
477
585
  <xsl:template match="un:ul//un:note | un:ol//un:note" priority="2"/>
478
- <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process">
479
- <fo:block font-size="11pt" margin-top="4pt">
586
+ <xsl:template match="un:ul//un:note/un:name | un:ol//un:note/un:name" mode="process" priority="2"/>
587
+ <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process" priority="2">
588
+ <fo:block margin-top="4pt">
480
589
  <xsl:apply-templates select="../un:name" mode="presentation"/>
481
590
  <xsl:apply-templates/>
482
591
  </fo:block>
483
592
  </xsl:template>
484
593
 
594
+ <xsl:template match="un:ul//un:note/* | un:ol//un:note/*" mode="process">
595
+ <xsl:apply-templates select="."/>
596
+ </xsl:template>
597
+
485
598
  <xsl:template match="un:li">
486
599
  <xsl:variable name="level">
487
600
  <xsl:call-template name="getLevel"/>
@@ -829,31 +942,45 @@
829
942
  <xsl:template match="un:docidentifier"/>
830
943
 
831
944
 
832
- <xsl:template match="un:formula" name="formula-un" priority="2">
833
- <fo:block id="{@id}" margin-top="6pt">
834
- <fo:table table-layout="fixed" width="100%">
835
- <fo:table-column column-width="95%"/>
836
- <fo:table-column column-width="5%"/>
837
- <fo:table-body>
838
- <fo:table-row>
839
- <fo:table-cell>
840
- <fo:block text-align="center">
841
- <xsl:if test="ancestor::un:annex">
842
- <xsl:attribute name="text-align">left</xsl:attribute>
843
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
844
- </xsl:if>
845
- <xsl:apply-templates/>
846
- </fo:block>
847
- </fo:table-cell>
848
- <fo:table-cell> <!-- display-align="center" -->
849
- <fo:block text-align="right">
850
- <xsl:apply-templates select="un:name" mode="presentation"/>
851
- </fo:block>
852
- </fo:table-cell>
853
- </fo:table-row>
854
- </fo:table-body>
855
- </fo:table>
856
- </fo:block>
945
+ <xsl:template match="un:formula" name="formula-un" priority="2">
946
+ <fo:block-container margin-left="0mm">
947
+ <xsl:if test="parent::*[local-name() = 'note']">
948
+ <xsl:attribute name="margin-left">
949
+ <xsl:choose>
950
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
951
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
952
+ </xsl:choose>
953
+ </xsl:attribute>
954
+ </xsl:if>
955
+ <fo:block-container margin-left="0mm">
956
+
957
+ <fo:block id="{@id}" margin-top="6pt">
958
+ <fo:table table-layout="fixed" width="100%">
959
+ <fo:table-column column-width="95%"/>
960
+ <fo:table-column column-width="5%"/>
961
+ <fo:table-body>
962
+ <fo:table-row>
963
+ <fo:table-cell>
964
+ <fo:block text-align="center">
965
+ <xsl:if test="ancestor::un:annex">
966
+ <xsl:attribute name="text-align">left</xsl:attribute>
967
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
968
+ </xsl:if>
969
+ <xsl:apply-templates/>
970
+ </fo:block>
971
+ </fo:table-cell>
972
+ <fo:table-cell> <!-- display-align="center" -->
973
+ <fo:block text-align="right">
974
+ <xsl:apply-templates select="un:name" mode="presentation"/>
975
+ </fo:block>
976
+ </fo:table-cell>
977
+ </fo:table-row>
978
+ </fo:table-body>
979
+ </fo:table>
980
+ </fo:block>
981
+
982
+ </fo:block-container>
983
+ </fo:block-container>
857
984
  </xsl:template>
858
985
 
859
986
 
@@ -873,9 +1000,23 @@
873
1000
  </xsl:template>
874
1001
 
875
1002
  <xsl:template match="un:dl" priority="2">
876
- <fo:block line-height="122%" margin-bottom="6pt" text-indent="0mm" text-align="justify">
877
- <xsl:apply-templates/>
878
- </fo:block>
1003
+ <fo:block-container margin-left="0mm">
1004
+ <xsl:if test="parent::*[local-name() = 'note']">
1005
+ <xsl:attribute name="margin-left">
1006
+ <xsl:choose>
1007
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
1008
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
1009
+ </xsl:choose>
1010
+ </xsl:attribute>
1011
+ </xsl:if>
1012
+ <fo:block-container margin-left="0mm">
1013
+
1014
+ <fo:block line-height="122%" margin-bottom="6pt" text-indent="0mm" text-align="justify">
1015
+ <xsl:apply-templates/>
1016
+ </fo:block>
1017
+
1018
+ </fo:block-container>
1019
+ </fo:block-container>
879
1020
  </xsl:template>
880
1021
 
881
1022
  <xsl:template match="un:dt" priority="2">
@@ -1071,13 +1212,22 @@
1071
1212
 
1072
1213
  </title-edition>
1073
1214
 
1215
+ <title-edition lang="fr">
1216
+
1217
+ <xsl:text>Édition </xsl:text>
1218
+
1219
+ </title-edition>
1220
+
1074
1221
 
1075
1222
  <title-toc lang="en">
1076
1223
 
1077
1224
 
1078
1225
 
1079
1226
  </title-toc>
1080
- <title-toc lang="fr">Sommaire</title-toc>
1227
+ <title-toc lang="fr">
1228
+
1229
+
1230
+ </title-toc>
1081
1231
 
1082
1232
  <title-toc lang="zh">Contents</title-toc>
1083
1233
 
@@ -1097,13 +1247,22 @@
1097
1247
  <title-part lang="en">
1098
1248
 
1099
1249
 
1250
+
1100
1251
  </title-part>
1101
1252
  <title-part lang="fr">
1102
1253
 
1103
1254
 
1255
+
1104
1256
  </title-part>
1105
1257
  <title-part lang="zh">第 # 部分:</title-part>
1106
1258
 
1259
+ <title-subpart lang="en">
1260
+
1261
+ </title-subpart>
1262
+ <title-subpart lang="fr">
1263
+
1264
+ </title-subpart>
1265
+
1107
1266
  <title-modified lang="en">modified</title-modified>
1108
1267
  <title-modified lang="fr">modifiée</title-modified>
1109
1268
 
@@ -1111,7 +1270,12 @@
1111
1270
 
1112
1271
 
1113
1272
 
1114
- <title-source lang="en">SOURCE</title-source>
1273
+ <title-source lang="en">
1274
+
1275
+ <xsl:text>SOURCE</xsl:text>
1276
+
1277
+
1278
+ </title-source>
1115
1279
 
1116
1280
  <title-keywords lang="en">Keywords</title-keywords>
1117
1281
 
@@ -1154,12 +1318,25 @@
1154
1318
  <title-warning lang="zh">警告</title-warning>
1155
1319
 
1156
1320
  <title-amendment lang="en">AMENDMENT</title-amendment>
1321
+
1322
+ <title-continued lang="en">(continued)</title-continued>
1323
+ <title-continued lang="fr">(continué)</title-continued>
1324
+
1157
1325
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1158
1326
  <xsl:param name="name"/>
1159
- <xsl:variable name="lang">
1160
- <xsl:call-template name="getLang"/>
1327
+ <xsl:param name="lang"/>
1328
+ <xsl:variable name="lang_">
1329
+ <xsl:choose>
1330
+ <xsl:when test="$lang != ''">
1331
+ <xsl:value-of select="$lang"/>
1332
+ </xsl:when>
1333
+ <xsl:otherwise>
1334
+ <xsl:call-template name="getLang"/>
1335
+ </xsl:otherwise>
1336
+ </xsl:choose>
1161
1337
  </xsl:variable>
1162
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1338
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1339
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1163
1340
  <xsl:choose>
1164
1341
  <xsl:when test="normalize-space($title_) != ''">
1165
1342
  <xsl:value-of select="$title_"/>
@@ -1168,7 +1345,10 @@
1168
1345
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1169
1346
  </xsl:otherwise>
1170
1347
  </xsl:choose>
1171
- </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">
1348
+ </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">
1349
+
1350
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1351
+
1172
1352
 
1173
1353
 
1174
1354
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
@@ -1179,14 +1359,14 @@
1179
1359
 
1180
1360
 
1181
1361
 
1182
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1183
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1362
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1184
1363
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1185
1364
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1186
1365
 
1187
1366
 
1188
1367
 
1189
1368
 
1369
+
1190
1370
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1191
1371
 
1192
1372
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1228,6 +1408,7 @@
1228
1408
 
1229
1409
 
1230
1410
 
1411
+
1231
1412
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1232
1413
 
1233
1414
 
@@ -1247,6 +1428,7 @@
1247
1428
 
1248
1429
 
1249
1430
 
1431
+
1250
1432
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1251
1433
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1252
1434
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1299,6 +1481,7 @@
1299
1481
 
1300
1482
 
1301
1483
 
1484
+
1302
1485
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1303
1486
 
1304
1487
 
@@ -1309,11 +1492,13 @@
1309
1492
 
1310
1493
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1311
1494
 
1312
-
1495
+
1496
+
1313
1497
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1314
1498
 
1315
1499
 
1316
1500
 
1501
+
1317
1502
  <xsl:attribute name="color">blue</xsl:attribute>
1318
1503
 
1319
1504
  </xsl:attribute-set><xsl:attribute-set name="note-style">
@@ -1327,14 +1512,15 @@
1327
1512
 
1328
1513
 
1329
1514
 
1515
+
1330
1516
 
1331
1517
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1332
1518
 
1333
1519
 
1334
1520
 
1521
+ </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">
1335
1522
 
1336
1523
 
1337
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1338
1524
 
1339
1525
 
1340
1526
 
@@ -1343,10 +1529,10 @@
1343
1529
 
1344
1530
 
1345
1531
 
1346
-
1347
1532
 
1348
1533
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
1349
1534
 
1535
+
1350
1536
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1351
1537
 
1352
1538
 
@@ -1372,6 +1558,8 @@
1372
1558
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
1373
1559
 
1374
1560
 
1561
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1562
+
1375
1563
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1376
1564
 
1377
1565
 
@@ -1392,6 +1580,7 @@
1392
1580
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1393
1581
 
1394
1582
 
1583
+
1395
1584
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1396
1585
 
1397
1586
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1408,6 +1597,7 @@
1408
1597
 
1409
1598
 
1410
1599
 
1600
+
1411
1601
  <xsl:attribute name="text-align">center</xsl:attribute>
1412
1602
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1413
1603
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -1444,11 +1634,14 @@
1444
1634
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1445
1635
 
1446
1636
 
1637
+
1447
1638
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1448
1639
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1449
1640
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1450
1641
  <xsl:attribute name="text-align">center</xsl:attribute>
1451
1642
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1643
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1644
+
1452
1645
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1453
1646
 
1454
1647
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1512,6 +1705,12 @@
1512
1705
 
1513
1706
 
1514
1707
 
1708
+ <!-- <xsl:if test="$namespace = 'bipm'">
1709
+ <fo:block>&#xA0;</fo:block>
1710
+ </xsl:if> -->
1711
+
1712
+ <!-- $namespace = 'iso' or -->
1713
+
1515
1714
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1516
1715
 
1517
1716
 
@@ -1547,6 +1746,7 @@
1547
1746
  <xsl:with-param name="table" select="$simple-table"/>
1548
1747
  </xsl:call-template>
1549
1748
  </xsl:variable>
1749
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1550
1750
 
1551
1751
  <!-- <xsl:variable name="colwidths2">
1552
1752
  <xsl:call-template name="calculate-column-widths">
@@ -1568,30 +1768,54 @@
1568
1768
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1569
1769
 
1570
1770
 
1571
-
1771
+
1772
+
1572
1773
 
1573
1774
  <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
1775
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1776
+
1777
+
1574
1778
 
1779
+
1575
1780
 
1576
1781
 
1577
1782
 
1578
1783
 
1579
1784
 
1580
- <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">
1581
-
1582
-
1583
-
1785
+
1786
+
1787
+ <xsl:variable name="table_attributes">
1788
+ <attribute name="table-layout">fixed</attribute>
1789
+ <attribute name="width">100%</attribute>
1790
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1791
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1584
1792
 
1585
1793
 
1586
1794
 
1587
1795
 
1796
+
1797
+
1588
1798
 
1589
- <xsl:attribute name="border-top">0.5pt solid black</xsl:attribute>
1590
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1799
+ <attribute name="border-top">0.5pt solid black</attribute>
1800
+
1591
1801
 
1802
+
1592
1803
 
1804
+ </xsl:variable>
1805
+
1806
+
1807
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1593
1808
 
1809
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1810
+ <xsl:attribute name="{@name}">
1811
+ <xsl:value-of select="."/>
1812
+ </xsl:attribute>
1813
+ </xsl:for-each>
1594
1814
 
1815
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1816
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1817
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1818
+ </xsl:if>
1595
1819
 
1596
1820
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1597
1821
  <xsl:choose>
@@ -1615,6 +1839,33 @@
1615
1839
 
1616
1840
  </fo:table>
1617
1841
 
1842
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1843
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1844
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1845
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1846
+ </xsl:call-template>
1847
+ </xsl:for-each>
1848
+
1849
+ <!-- insert footer as table -->
1850
+ <!-- <fo:table>
1851
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1852
+ <xsl:attribute name="{@name}">
1853
+ <xsl:value-of select="."/>
1854
+ </xsl:attribute>
1855
+ </xsl:for-each>
1856
+
1857
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1858
+ <xsl:choose>
1859
+ <xsl:when test=". = 1 or . = 0">
1860
+ <fo:table-column column-width="proportional-column-width(2)"/>
1861
+ </xsl:when>
1862
+ <xsl:otherwise>
1863
+ <fo:table-column column-width="proportional-column-width({.})"/>
1864
+ </xsl:otherwise>
1865
+ </xsl:choose>
1866
+ </xsl:for-each>
1867
+ </fo:table>-->
1868
+
1618
1869
 
1619
1870
 
1620
1871
 
@@ -1623,8 +1874,10 @@
1623
1874
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1624
1875
  <xsl:if test="normalize-space() != ''">
1625
1876
  <fo:block xsl:use-attribute-sets="table-name-style">
1626
- <xsl:apply-templates/>
1627
- </fo:block>
1877
+
1878
+
1879
+ <xsl:apply-templates/>
1880
+ </fo:block>
1628
1881
  </xsl:if>
1629
1882
  </xsl:template><xsl:template name="calculate-columns-numbers">
1630
1883
  <xsl:param name="table-row"/>
@@ -1678,6 +1931,13 @@
1678
1931
  <xsl:for-each select="xalan:nodeset($table)//tr">
1679
1932
  <xsl:variable name="td_text">
1680
1933
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1934
+
1935
+ <!-- <xsl:if test="$namespace = 'bipm'">
1936
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1937
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1938
+ </xsl:for-each>
1939
+ </xsl:if> -->
1940
+
1681
1941
  </xsl:variable>
1682
1942
  <xsl:variable name="words">
1683
1943
  <xsl:variable name="string_with_added_zerospaces">
@@ -1737,13 +1997,31 @@
1737
1997
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1738
1998
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1739
1999
  <xsl:value-of select="@target"/>
2000
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2001
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
2002
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1740
2003
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1741
2004
  <xsl:param name="cols-count"/>
1742
2005
  <!-- font-weight="bold" -->
1743
- <fo:table-header>
2006
+ <fo:table-header>
1744
2007
 
1745
2008
  <xsl:apply-templates/>
1746
2009
  </fo:table-header>
2010
+ </xsl:template><xsl:template name="table-header-title">
2011
+ <xsl:param name="cols-count"/>
2012
+ <!-- row for title -->
2013
+ <fo:table-row>
2014
+ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
2015
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2016
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2017
+ <xsl:call-template name="fn_name_display"/>
2018
+ </xsl:for-each>
2019
+ <fo:block text-align="right" font-style="italic">
2020
+ <xsl:text> </xsl:text>
2021
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2022
+ </fo:block>
2023
+ </fo:table-cell>
2024
+ </fo:table-row>
1747
2025
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1748
2026
  <fo:table-body>
1749
2027
  <xsl:apply-templates/>
@@ -1751,6 +2029,13 @@
1751
2029
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1752
2030
  <xsl:apply-templates/>
1753
2031
  </xsl:template><xsl:template name="insertTableFooter">
2032
+ <xsl:param name="cols-count"/>
2033
+ <xsl:if test="../*[local-name()='tfoot']">
2034
+ <fo:table-footer>
2035
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2036
+ </fo:table-footer>
2037
+ </xsl:if>
2038
+ </xsl:template><xsl:template name="insertTableFooter2">
1754
2039
  <xsl:param name="cols-count"/>
1755
2040
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1756
2041
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1772,11 +2057,29 @@
1772
2057
  <!-- fn will be processed inside 'note' processing -->
1773
2058
 
1774
2059
 
2060
+
2061
+
2062
+
2063
+
1775
2064
  <!-- except gb -->
1776
2065
 
1777
2066
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1778
2067
 
1779
2068
 
2069
+ <!-- show Note under table in preface (ex. abstract) sections -->
2070
+ <!-- empty, because notes show at page side in main sections -->
2071
+ <!-- <xsl:if test="$namespace = 'bipm'">
2072
+ <xsl:choose>
2073
+ <xsl:when test="ancestor::*[local-name()='preface']">
2074
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2075
+ </xsl:when>
2076
+ <xsl:otherwise>
2077
+ <fo:block/>
2078
+ </xsl:otherwise>
2079
+ </xsl:choose>
2080
+ </xsl:if> -->
2081
+
2082
+
1780
2083
  <!-- horizontal row separator -->
1781
2084
 
1782
2085
 
@@ -1790,6 +2093,88 @@
1790
2093
  </fo:table-footer>
1791
2094
 
1792
2095
  </xsl:if>
2096
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2097
+ <xsl:param name="table_attributes"/>
2098
+ <xsl:param name="colwidths"/>
2099
+
2100
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2101
+
2102
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2103
+
2104
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2105
+
2106
+ <fo:table keep-with-previous="always">
2107
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2108
+ <xsl:choose>
2109
+ <xsl:when test="@name = 'border-top'">
2110
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2111
+ </xsl:when>
2112
+ <xsl:when test="@name = 'border'">
2113
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2114
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2115
+ </xsl:when>
2116
+ <xsl:otherwise>
2117
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2118
+ </xsl:otherwise>
2119
+ </xsl:choose>
2120
+ </xsl:for-each>
2121
+
2122
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2123
+ <xsl:choose>
2124
+ <xsl:when test=". = 1 or . = 0">
2125
+ <fo:table-column column-width="proportional-column-width(2)"/>
2126
+ </xsl:when>
2127
+ <xsl:otherwise>
2128
+ <fo:table-column column-width="proportional-column-width({.})"/>
2129
+ </xsl:otherwise>
2130
+ </xsl:choose>
2131
+ </xsl:for-each>
2132
+
2133
+ <fo:table-body>
2134
+ <fo:table-row>
2135
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2136
+
2137
+
2138
+
2139
+ <!-- fn will be processed inside 'note' processing -->
2140
+
2141
+
2142
+
2143
+
2144
+
2145
+
2146
+
2147
+ <!-- except gb -->
2148
+
2149
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2150
+
2151
+
2152
+ <!-- <xsl:if test="$namespace = 'bipm'">
2153
+ <xsl:choose>
2154
+ <xsl:when test="ancestor::*[local-name()='preface']">
2155
+ show Note under table in preface (ex. abstract) sections
2156
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2157
+ </xsl:when>
2158
+ <xsl:otherwise>
2159
+ empty, because notes show at page side in main sections
2160
+ <fo:block/>
2161
+ </xsl:otherwise>
2162
+ </xsl:choose>
2163
+ </xsl:if> -->
2164
+
2165
+
2166
+ <!-- horizontal row separator -->
2167
+
2168
+
2169
+ <!-- fn processing -->
2170
+ <xsl:call-template name="fn_display"/>
2171
+
2172
+ </fo:table-cell>
2173
+ </fo:table-row>
2174
+ </fo:table-body>
2175
+
2176
+ </fo:table>
2177
+ </xsl:if>
1793
2178
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1794
2179
 
1795
2180
  <xsl:variable name="cols-count">
@@ -1807,6 +2192,8 @@
1807
2192
  </xsl:choose>
1808
2193
  </xsl:variable>
1809
2194
 
2195
+
2196
+
1810
2197
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1811
2198
  <xsl:with-param name="cols-count" select="$cols-count"/>
1812
2199
  </xsl:apply-templates>
@@ -1816,6 +2203,8 @@
1816
2203
  </xsl:call-template>
1817
2204
 
1818
2205
  <fo:table-body>
2206
+
2207
+
1819
2208
  <xsl:apply-templates/>
1820
2209
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1821
2210
 
@@ -1843,6 +2232,12 @@
1843
2232
  <xsl:attribute name="min-height">8mm</xsl:attribute>
1844
2233
  </xsl:if>
1845
2234
 
2235
+
2236
+
2237
+ <!-- <xsl:if test="$namespace = 'bipm'">
2238
+ <xsl:attribute name="height">8mm</xsl:attribute>
2239
+ </xsl:if> -->
2240
+
1846
2241
  <xsl:apply-templates/>
1847
2242
  </fo:table-row>
1848
2243
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1863,6 +2258,7 @@
1863
2258
 
1864
2259
 
1865
2260
 
2261
+
1866
2262
  <xsl:attribute name="display-align">center</xsl:attribute>
1867
2263
  <xsl:attribute name="font-style">italic</xsl:attribute>
1868
2264
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -1874,6 +2270,7 @@
1874
2270
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1875
2271
 
1876
2272
 
2273
+
1877
2274
  <xsl:if test="@colspan">
1878
2275
  <xsl:attribute name="number-columns-spanned">
1879
2276
  <xsl:value-of select="@colspan"/>
@@ -1884,12 +2281,24 @@
1884
2281
  <xsl:value-of select="@rowspan"/>
1885
2282
  </xsl:attribute>
1886
2283
  </xsl:if>
2284
+ <xsl:call-template name="display-align"/>
1887
2285
  <fo:block>
1888
2286
  <xsl:apply-templates/>
1889
2287
  </fo:block>
1890
2288
  </fo:table-cell>
1891
- </xsl:template><xsl:template match="*[local-name()='td']">
1892
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2289
+ </xsl:template><xsl:template name="display-align">
2290
+ <xsl:if test="@valign">
2291
+ <xsl:attribute name="display-align">
2292
+ <xsl:choose>
2293
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2294
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2295
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2296
+ <xsl:otherwise>before</xsl:otherwise>
2297
+ </xsl:choose>
2298
+ </xsl:attribute>
2299
+ </xsl:if>
2300
+ </xsl:template><xsl:template match="*[local-name()='td']">
2301
+ <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1893
2302
  <xsl:attribute name="text-align">
1894
2303
  <xsl:choose>
1895
2304
  <xsl:when test="@align">
@@ -1901,7 +2310,8 @@
1901
2310
 
1902
2311
 
1903
2312
 
1904
-
2313
+
2314
+
1905
2315
 
1906
2316
 
1907
2317
 
@@ -1915,6 +2325,7 @@
1915
2325
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1916
2326
 
1917
2327
 
2328
+
1918
2329
  <xsl:if test="@colspan">
1919
2330
  <xsl:attribute name="number-columns-spanned">
1920
2331
  <xsl:value-of select="@colspan"/>
@@ -1925,6 +2336,7 @@
1925
2336
  <xsl:value-of select="@rowspan"/>
1926
2337
  </xsl:attribute>
1927
2338
  </xsl:if>
2339
+ <xsl:call-template name="display-align"/>
1928
2340
  <fo:block>
1929
2341
 
1930
2342
  <xsl:apply-templates/>
@@ -1938,6 +2350,8 @@
1938
2350
 
1939
2351
 
1940
2352
 
2353
+
2354
+
1941
2355
  <fo:inline padding-right="2mm">
1942
2356
 
1943
2357
 
@@ -1952,10 +2366,11 @@
1952
2366
  </fo:inline> -->
1953
2367
  </xsl:if>
1954
2368
 
1955
-
2369
+
1956
2370
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1957
2371
 
1958
2372
  </fo:inline>
2373
+
1959
2374
  <xsl:apply-templates mode="process"/>
1960
2375
  </fo:block>
1961
2376
 
@@ -1979,6 +2394,7 @@
1979
2394
 
1980
2395
 
1981
2396
 
2397
+
1982
2398
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1983
2399
 
1984
2400
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1988,12 +2404,15 @@
1988
2404
 
1989
2405
 
1990
2406
 
2407
+
1991
2408
  <xsl:value-of select="@reference"/>
1992
2409
 
2410
+
1993
2411
  </fo:inline>
1994
2412
  <fo:inline>
1995
2413
 
1996
- <xsl:apply-templates/>
2414
+ <!-- <xsl:apply-templates /> -->
2415
+ <xsl:copy-of select="./node()"/>
1997
2416
  </fo:inline>
1998
2417
  </fo:block>
1999
2418
  </xsl:if>
@@ -2030,7 +2449,20 @@
2030
2449
  <xsl:variable name="following_dl_colwidths">
2031
2450
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2032
2451
  <xsl:variable name="html-table">
2033
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2452
+ <xsl:variable name="doc_ns">
2453
+
2454
+ </xsl:variable>
2455
+ <xsl:variable name="ns">
2456
+ <xsl:choose>
2457
+ <xsl:when test="normalize-space($doc_ns) != ''">
2458
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2459
+ </xsl:when>
2460
+ <xsl:otherwise>
2461
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2462
+ </xsl:otherwise>
2463
+ </xsl:choose>
2464
+ </xsl:variable>
2465
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2034
2466
  <xsl:element name="{$ns}:table">
2035
2467
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2036
2468
  <tbody>
@@ -2095,7 +2527,8 @@
2095
2527
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2096
2528
  </xsl:if>
2097
2529
 
2098
- <xsl:apply-templates/>
2530
+ <!-- <xsl:apply-templates /> -->
2531
+ <xsl:copy-of select="./node()"/>
2099
2532
  </fo:block>
2100
2533
  </fo:table-cell>
2101
2534
  </fo:table-row>
@@ -2113,9 +2546,13 @@
2113
2546
 
2114
2547
 
2115
2548
 
2549
+
2550
+
2116
2551
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2117
2552
 
2553
+
2118
2554
  <xsl:value-of select="@reference"/>
2555
+
2119
2556
  </fo:basic-link>
2120
2557
  </fo:inline>
2121
2558
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2123,115 +2560,158 @@
2123
2560
  <xsl:apply-templates/>
2124
2561
  </fo:inline>
2125
2562
  </xsl:template><xsl:template match="*[local-name()='dl']">
2126
- <xsl:variable name="parent" select="local-name(..)"/>
2127
-
2128
- <xsl:variable name="key_iso">
2129
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2130
- </xsl:variable>
2131
-
2132
- <xsl:choose>
2133
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2563
+ <fo:block-container>
2564
+
2565
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2566
+
2567
+
2568
+ <xsl:if test="parent::*[local-name() = 'note']">
2569
+ <xsl:attribute name="margin-left">
2570
+ <xsl:choose>
2571
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2572
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2573
+ </xsl:choose>
2574
+ </xsl:attribute>
2134
2575
 
2576
+ </xsl:if>
2577
+ <fo:block-container>
2135
2578
 
2136
- <fo:block margin-bottom="12pt" text-align="left">
2137
-
2138
- <xsl:variable name="title-where">
2139
- <xsl:call-template name="getTitle">
2140
- <xsl:with-param name="name" select="'title-where'"/>
2141
- </xsl:call-template>
2142
- </xsl:variable>
2143
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2144
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2145
- <xsl:text/>
2146
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2147
- </fo:block>
2579
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2148
2580
 
2149
- </xsl:when>
2150
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2151
- <fo:block margin-bottom="12pt" text-align="left">
2152
-
2153
-
2154
-
2155
-
2156
- <xsl:variable name="title-where">
2157
- <xsl:call-template name="getTitle">
2158
- <xsl:with-param name="name" select="'title-where'"/>
2159
- </xsl:call-template>
2160
- </xsl:variable>
2161
- <xsl:value-of select="$title-where"/>
2162
- </fo:block>
2163
- </xsl:when>
2164
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2165
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2166
-
2167
-
2168
-
2169
- <xsl:variable name="title-key">
2170
- <xsl:call-template name="getTitle">
2171
- <xsl:with-param name="name" select="'title-key'"/>
2172
- </xsl:call-template>
2173
- </xsl:variable>
2174
- <xsl:value-of select="$title-key"/>
2175
- </fo:block>
2176
- </xsl:when>
2177
- </xsl:choose>
2178
-
2179
- <!-- a few components -->
2180
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2181
- <fo:block>
2182
2581
 
2582
+ <xsl:variable name="parent" select="local-name(..)"/>
2183
2583
 
2584
+ <xsl:variable name="key_iso">
2585
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2586
+ </xsl:variable>
2184
2587
 
2588
+ <xsl:choose>
2589
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2590
+
2591
+
2592
+ <fo:block margin-bottom="12pt" text-align="left">
2593
+
2594
+ <xsl:variable name="title-where">
2595
+
2596
+
2597
+ <xsl:call-template name="getTitle">
2598
+ <xsl:with-param name="name" select="'title-where'"/>
2599
+ </xsl:call-template>
2600
+
2601
+ </xsl:variable>
2602
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2603
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2604
+ <xsl:text/>
2605
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2606
+ </fo:block>
2607
+
2608
+ </xsl:when>
2609
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2610
+ <fo:block margin-bottom="12pt" text-align="left">
2611
+
2612
+
2613
+
2614
+
2615
+ <xsl:variable name="title-where">
2616
+
2617
+
2618
+ <xsl:call-template name="getTitle">
2619
+ <xsl:with-param name="name" select="'title-where'"/>
2620
+ </xsl:call-template>
2621
+
2622
+ </xsl:variable>
2623
+ <xsl:value-of select="$title-where"/>
2624
+ </fo:block>
2625
+ </xsl:when>
2626
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2627
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2628
+
2629
+
2630
+
2631
+ <xsl:variable name="title-key">
2632
+
2633
+
2634
+ <xsl:call-template name="getTitle">
2635
+ <xsl:with-param name="name" select="'title-key'"/>
2636
+ </xsl:call-template>
2637
+
2638
+ </xsl:variable>
2639
+ <xsl:value-of select="$title-key"/>
2640
+ </fo:block>
2641
+ </xsl:when>
2642
+ </xsl:choose>
2185
2643
 
2186
- <fo:block>
2187
-
2188
-
2189
-
2190
-
2191
- <fo:table width="95%" table-layout="fixed">
2644
+ <!-- a few components -->
2645
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2646
+ <fo:block>
2192
2647
 
2193
- <xsl:choose>
2194
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2195
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2196
- </xsl:when>
2197
- <xsl:when test="normalize-space($key_iso) = 'true'">
2198
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2648
+
2649
+
2650
+
2651
+ <fo:block>
2652
+
2653
+
2654
+
2655
+
2656
+ <fo:table width="95%" table-layout="fixed">
2199
2657
 
2200
- </xsl:when>
2201
- </xsl:choose>
2202
- <!-- create virtual html table for dl/[dt and dd] -->
2203
- <xsl:variable name="html-table">
2204
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2205
- <xsl:element name="{$ns}:table">
2206
- <tbody>
2207
- <xsl:apply-templates mode="dl"/>
2208
- </tbody>
2209
- </xsl:element>
2210
- </xsl:variable>
2211
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2212
- <xsl:variable name="colwidths">
2213
- <xsl:call-template name="calculate-column-widths">
2214
- <xsl:with-param name="cols-count" select="2"/>
2215
- <xsl:with-param name="table" select="$html-table"/>
2216
- </xsl:call-template>
2217
- </xsl:variable>
2218
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2219
- <xsl:variable name="maxlength_dt">
2220
- <xsl:call-template name="getMaxLength_dt"/>
2221
- </xsl:variable>
2222
- <xsl:call-template name="setColumnWidth_dl">
2223
- <xsl:with-param name="colwidths" select="$colwidths"/>
2224
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2225
- </xsl:call-template>
2226
- <fo:table-body>
2227
- <xsl:apply-templates>
2228
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2229
- </xsl:apply-templates>
2230
- </fo:table-body>
2231
- </fo:table>
2232
- </fo:block>
2233
- </fo:block>
2234
- </xsl:if>
2658
+ <xsl:choose>
2659
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2660
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2661
+ </xsl:when>
2662
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2663
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2664
+
2665
+ </xsl:when>
2666
+ </xsl:choose>
2667
+ <!-- create virtual html table for dl/[dt and dd] -->
2668
+ <xsl:variable name="html-table">
2669
+ <xsl:variable name="doc_ns">
2670
+
2671
+ </xsl:variable>
2672
+ <xsl:variable name="ns">
2673
+ <xsl:choose>
2674
+ <xsl:when test="normalize-space($doc_ns) != ''">
2675
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2676
+ </xsl:when>
2677
+ <xsl:otherwise>
2678
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2679
+ </xsl:otherwise>
2680
+ </xsl:choose>
2681
+ </xsl:variable>
2682
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2683
+ <xsl:element name="{$ns}:table">
2684
+ <tbody>
2685
+ <xsl:apply-templates mode="dl"/>
2686
+ </tbody>
2687
+ </xsl:element>
2688
+ </xsl:variable>
2689
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2690
+ <xsl:variable name="colwidths">
2691
+ <xsl:call-template name="calculate-column-widths">
2692
+ <xsl:with-param name="cols-count" select="2"/>
2693
+ <xsl:with-param name="table" select="$html-table"/>
2694
+ </xsl:call-template>
2695
+ </xsl:variable>
2696
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2697
+ <xsl:variable name="maxlength_dt">
2698
+ <xsl:call-template name="getMaxLength_dt"/>
2699
+ </xsl:variable>
2700
+ <xsl:call-template name="setColumnWidth_dl">
2701
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2702
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2703
+ </xsl:call-template>
2704
+ <fo:table-body>
2705
+ <xsl:apply-templates>
2706
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2707
+ </xsl:apply-templates>
2708
+ </fo:table-body>
2709
+ </fo:table>
2710
+ </fo:block>
2711
+ </fo:block>
2712
+ </xsl:if>
2713
+ </fo:block-container>
2714
+ </fo:block-container>
2235
2715
  </xsl:template><xsl:template name="setColumnWidth_dl">
2236
2716
  <xsl:param name="colwidths"/>
2237
2717
  <xsl:param name="maxlength_dt"/>
@@ -2328,6 +2808,7 @@
2328
2808
  <xsl:param name="key_iso"/>
2329
2809
 
2330
2810
  <fo:table-row>
2811
+
2331
2812
  <fo:table-cell>
2332
2813
 
2333
2814
  <fo:block margin-top="6pt">
@@ -2342,6 +2823,7 @@
2342
2823
 
2343
2824
 
2344
2825
 
2826
+
2345
2827
  <xsl:apply-templates/>
2346
2828
  <!-- <xsl:if test="$namespace = 'gb'">
2347
2829
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2407,6 +2889,31 @@
2407
2889
  </fo:inline>
2408
2890
  </xsl:template><xsl:template match="*[local-name()='tt']">
2409
2891
  <fo:inline xsl:use-attribute-sets="tt-style">
2892
+ <xsl:variable name="_font-size">
2893
+
2894
+
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+
2901
+
2902
+
2903
+
2904
+
2905
+
2906
+
2907
+ </xsl:variable>
2908
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2909
+ <xsl:if test="$font-size != ''">
2910
+ <xsl:attribute name="font-size">
2911
+ <xsl:choose>
2912
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2913
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2914
+ </xsl:choose>
2915
+ </xsl:attribute>
2916
+ </xsl:if>
2410
2917
  <xsl:apply-templates/>
2411
2918
  </fo:inline>
2412
2919
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2698,7 +3205,18 @@
2698
3205
  <xsl:with-param name="previousRow" select="$newRow"/>
2699
3206
  </xsl:apply-templates>
2700
3207
  </xsl:template><xsl:template name="getLang">
2701
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3208
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3209
+ <xsl:variable name="language">
3210
+ <xsl:choose>
3211
+ <xsl:when test="$language_current != ''">
3212
+ <xsl:value-of select="$language_current"/>
3213
+ </xsl:when>
3214
+ <xsl:otherwise>
3215
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3216
+ </xsl:otherwise>
3217
+ </xsl:choose>
3218
+ </xsl:variable>
3219
+
2702
3220
  <xsl:choose>
2703
3221
  <xsl:when test="$language = 'English'">en</xsl:when>
2704
3222
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2732,11 +3250,25 @@
2732
3250
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2733
3251
  <xsl:value-of select="substring($str, 2)"/>
2734
3252
  </xsl:template><xsl:template match="mathml:math">
2735
- <fo:inline font-family="STIX2Math">
2736
- <fo:instream-foreign-object fox:alt-text="Math">
2737
- <xsl:copy-of select="."/>
2738
- </fo:instream-foreign-object>
3253
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3254
+
3255
+ <xsl:variable name="mathml">
3256
+ <xsl:apply-templates select="." mode="mathml"/>
3257
+ </xsl:variable>
3258
+ <fo:instream-foreign-object fox:alt-text="Math">
3259
+ <!-- <xsl:copy-of select="."/> -->
3260
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3261
+ </fo:instream-foreign-object>
2739
3262
  </fo:inline>
3263
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3264
+ <xsl:copy>
3265
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3266
+ </xsl:copy>
3267
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3268
+ <xsl:copy>
3269
+ <!-- replace start and end spaces to non-break space -->
3270
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3271
+ </xsl:copy>
2740
3272
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2741
3273
  <xsl:variable name="target">
2742
3274
  <xsl:choose>
@@ -2802,10 +3334,14 @@
2802
3334
  </fo:inline>
2803
3335
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2804
3336
  <xsl:variable name="title-modified">
2805
- <xsl:call-template name="getTitle">
2806
- <xsl:with-param name="name" select="'title-modified'"/>
2807
- </xsl:call-template>
3337
+
3338
+
3339
+ <xsl:call-template name="getTitle">
3340
+ <xsl:with-param name="name" select="'title-modified'"/>
3341
+ </xsl:call-template>
3342
+
2808
3343
  </xsl:variable>
3344
+
2809
3345
  <xsl:choose>
2810
3346
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2811
3347
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2813,13 +3349,26 @@
2813
3349
  <xsl:apply-templates/>
2814
3350
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2815
3351
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2816
-
3352
+
2817
3353
  <xsl:apply-templates/>
2818
3354
  </fo:basic-link>
2819
3355
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2820
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2821
- <xsl:apply-templates/>
2822
- </fo:block>
3356
+ <fo:block-container margin-left="0mm">
3357
+ <xsl:if test="parent::*[local-name() = 'note']">
3358
+ <xsl:attribute name="margin-left">
3359
+ <xsl:choose>
3360
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3361
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3362
+ </xsl:choose>
3363
+ </xsl:attribute>
3364
+
3365
+ </xsl:if>
3366
+ <fo:block-container margin-left="0mm">
3367
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3368
+ <xsl:apply-templates/>
3369
+ </fo:block>
3370
+ </fo:block-container>
3371
+ </fo:block-container>
2823
3372
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2824
3373
  <fo:inline>
2825
3374
  <xsl:apply-templates/>
@@ -2862,6 +3411,8 @@
2862
3411
 
2863
3412
 
2864
3413
 
3414
+
3415
+
2865
3416
  <fo:inline xsl:use-attribute-sets="note-name-style">
2866
3417
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2867
3418
  </fo:inline>
@@ -2888,7 +3439,9 @@
2888
3439
  </xsl:choose>
2889
3440
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2890
3441
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2891
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3442
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3443
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3444
+ </fo:inline>
2892
3445
  <xsl:apply-templates/>
2893
3446
  </fo:block>
2894
3447
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
@@ -2987,15 +3540,109 @@
2987
3540
 
2988
3541
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2989
3542
  </fo:block>
2990
- </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">
3543
+ </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">
2991
3544
  <xsl:apply-templates mode="contents"/>
2992
3545
  <xsl:text> </xsl:text>
2993
- </xsl:template><xsl:template match="text()" mode="contents">
3546
+ </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">
3547
+ <xsl:apply-templates mode="bookmarks"/>
3548
+ <xsl:text> </xsl:text>
3549
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3550
+ <xsl:value-of select="."/>
3551
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2994
3552
  <xsl:value-of select="."/>
2995
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3553
+ </xsl:template><xsl:template match="node()" mode="contents">
3554
+ <xsl:apply-templates mode="contents"/>
3555
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3556
+ <xsl:apply-templates mode="bookmarks"/>
3557
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3558
+ <xsl:apply-templates select="."/>
3559
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3560
+ <xsl:apply-templates mode="bookmarks"/>
3561
+ </xsl:template><xsl:template name="addBookmarks">
3562
+ <xsl:param name="contents"/>
3563
+ <xsl:if test="xalan:nodeset($contents)//item">
3564
+ <fo:bookmark-tree>
3565
+ <xsl:choose>
3566
+ <xsl:when test="xalan:nodeset($contents)/doc">
3567
+ <xsl:choose>
3568
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3569
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3570
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3571
+ <fo:bookmark-title>
3572
+ <xsl:variable name="bookmark-title_">
3573
+ <xsl:call-template name="getLangVersion">
3574
+ <xsl:with-param name="lang" select="@lang"/>
3575
+ </xsl:call-template>
3576
+ </xsl:variable>
3577
+ <xsl:choose>
3578
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3579
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3580
+ </xsl:when>
3581
+ <xsl:otherwise>
3582
+ <xsl:choose>
3583
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3584
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3585
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3586
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3587
+ </xsl:choose>
3588
+ </xsl:otherwise>
3589
+ </xsl:choose>
3590
+ </fo:bookmark-title>
3591
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3592
+ </fo:bookmark>
3593
+
3594
+ </xsl:for-each>
3595
+ </xsl:when>
3596
+ <xsl:otherwise>
3597
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3598
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3599
+ </xsl:for-each>
3600
+ </xsl:otherwise>
3601
+ </xsl:choose>
3602
+ </xsl:when>
3603
+ <xsl:otherwise>
3604
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3605
+ </xsl:otherwise>
3606
+ </xsl:choose>
3607
+
3608
+
3609
+
3610
+
3611
+
3612
+
3613
+
3614
+
3615
+ </fo:bookmark-tree>
3616
+ </xsl:if>
3617
+ </xsl:template><xsl:template name="getLangVersion">
3618
+ <xsl:param name="lang"/>
3619
+ <xsl:choose>
3620
+ <xsl:when test="$lang = 'en'">
3621
+
3622
+
3623
+ </xsl:when>
3624
+ <xsl:when test="$lang = 'fr'">
3625
+
3626
+
3627
+ </xsl:when>
3628
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3629
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3630
+ </xsl:choose>
3631
+ </xsl:template><xsl:template match="item" mode="bookmark">
3632
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3633
+ <fo:bookmark-title>
3634
+ <xsl:if test="@section != ''">
3635
+ <xsl:value-of select="@section"/>
3636
+ <xsl:text> </xsl:text>
3637
+ </xsl:if>
3638
+ <xsl:value-of select="normalize-space(title)"/>
3639
+ </fo:bookmark-title>
3640
+ <xsl:apply-templates mode="bookmark"/>
3641
+ </fo:bookmark>
3642
+ </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">
2996
3643
  <xsl:if test="normalize-space() != ''">
2997
3644
  <fo:block xsl:use-attribute-sets="figure-name-style">
2998
-
3645
+
2999
3646
  <xsl:apply-templates/>
3000
3647
  </fo:block>
3001
3648
  </xsl:if>
@@ -3050,7 +3697,7 @@
3050
3697
  <xsl:apply-templates/>
3051
3698
  </xsl:otherwise>
3052
3699
  </xsl:choose>
3053
- </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">
3700
+ </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">
3054
3701
  <xsl:text> </xsl:text>
3055
3702
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3056
3703
  <xsl:copy>
@@ -3059,21 +3706,61 @@
3059
3706
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3060
3707
  <xsl:text> </xsl:text>
3061
3708
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3062
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3063
- <xsl:apply-templates/>
3064
- </fo:block>
3065
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3066
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3709
+
3710
+ <fo:block-container margin-left="0mm">
3711
+ <xsl:if test="parent::*[local-name() = 'note']">
3712
+ <xsl:attribute name="margin-left">
3713
+ <xsl:choose>
3714
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3715
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3716
+ </xsl:choose>
3717
+ </xsl:attribute>
3718
+
3719
+ </xsl:if>
3720
+ <fo:block-container margin-left="0mm">
3721
+
3722
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3723
+ <xsl:variable name="_font-size">
3724
+
3725
+
3726
+
3727
+
3728
+
3729
+
3730
+
3731
+
3732
+
3733
+
3734
+
3735
+
3736
+
3737
+ 10
3738
+ </xsl:variable>
3739
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3740
+ <xsl:if test="$font-size != ''">
3741
+ <xsl:attribute name="font-size">
3742
+ <xsl:choose>
3743
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3744
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3745
+ </xsl:choose>
3746
+ </xsl:attribute>
3747
+ </xsl:if>
3748
+ <xsl:apply-templates/>
3749
+ </fo:block>
3750
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3751
+
3752
+ </fo:block-container>
3753
+ </fo:block-container>
3754
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3067
3755
  <xsl:variable name="text">
3068
3756
  <xsl:call-template name="add-zero-spaces-equal"/>
3069
3757
  </xsl:variable>
3070
- <xsl:call-template name="add-zero-spaces">
3758
+ <xsl:call-template name="add-zero-spaces-java">
3071
3759
  <xsl:with-param name="text" select="$text"/>
3072
3760
  </xsl:call-template>
3073
3761
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3074
3762
  <xsl:if test="normalize-space() != ''">
3075
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3076
-
3763
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3077
3764
  <xsl:apply-templates/>
3078
3765
  </fo:block>
3079
3766
  </xsl:if>
@@ -3147,9 +3834,9 @@
3147
3834
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3148
3835
  </xsl:if>
3149
3836
  <fo:block-container margin-left="0mm" margin-right="0mm">
3150
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3837
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3151
3838
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3152
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3839
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3153
3840
  </xsl:if>
3154
3841
  <xsl:variable name="simple-table">
3155
3842
  <xsl:call-template name="getSimpleTable"/>
@@ -3158,8 +3845,8 @@
3158
3845
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3159
3846
  <!-- <fo:table-column column-width="35mm"/>
3160
3847
  <fo:table-column column-width="115mm"/> -->
3161
- <fo:table-column column-width="25%"/>
3162
- <fo:table-column column-width="75%"/>
3848
+ <fo:table-column column-width="30%"/>
3849
+ <fo:table-column column-width="70%"/>
3163
3850
  </xsl:if>
3164
3851
  <xsl:apply-templates mode="requirement"/>
3165
3852
  </fo:table>
@@ -3182,14 +3869,21 @@
3182
3869
  <xsl:apply-templates mode="requirement"/>
3183
3870
  </fo:table-body>
3184
3871
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3185
- <fo:table-row height="7mm">
3186
- <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
3187
- <xsl:attribute name="border">1pt solid black</xsl:attribute>
3872
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3873
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3874
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3875
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3876
+ </xsl:if>
3877
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3878
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3879
+ </xsl:if>
3880
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3881
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3188
3882
  </xsl:if>
3189
3883
  <xsl:apply-templates mode="requirement"/>
3190
3884
  </fo:table-row>
3191
3885
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3192
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3886
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3193
3887
  <xsl:attribute name="text-align">
3194
3888
  <xsl:choose>
3195
3889
  <xsl:when test="@align">
@@ -3208,6 +3902,7 @@
3208
3902
  <xsl:value-of select="@rowspan"/>
3209
3903
  </xsl:attribute>
3210
3904
  </xsl:if>
3905
+ <xsl:call-template name="display-align"/>
3211
3906
 
3212
3907
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3213
3908
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -3223,7 +3918,7 @@
3223
3918
  </fo:block>
3224
3919
  </fo:table-cell>
3225
3920
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3226
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3921
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3227
3922
  <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3228
3923
  <xsl:attribute name="padding">0mm</xsl:attribute>
3229
3924
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -3236,6 +3931,9 @@
3236
3931
  <xsl:otherwise>left</xsl:otherwise>
3237
3932
  </xsl:choose>
3238
3933
  </xsl:attribute>
3934
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3935
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3936
+ </xsl:if>
3239
3937
  <xsl:if test="@colspan">
3240
3938
  <xsl:attribute name="number-columns-spanned">
3241
3939
  <xsl:value-of select="@colspan"/>
@@ -3246,6 +3944,7 @@
3246
3944
  <xsl:value-of select="@rowspan"/>
3247
3945
  </xsl:attribute>
3248
3946
  </xsl:if>
3947
+ <xsl:call-template name="display-align"/>
3249
3948
 
3250
3949
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3251
3950
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
@@ -3261,7 +3960,7 @@
3261
3960
  </fo:block>
3262
3961
  </fo:table-cell>
3263
3962
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3264
- <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3963
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3265
3964
  <xsl:apply-templates/>
3266
3965
  </fo:block>
3267
3966
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -3287,12 +3986,13 @@
3287
3986
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3288
3987
 
3289
3988
  <xsl:variable name="element">
3290
- block
3989
+ block
3291
3990
 
3991
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3292
3992
  </xsl:variable>
3293
3993
 
3294
3994
  <xsl:choose>
3295
- <xsl:when test="normalize-space($element) = 'block'">
3995
+ <xsl:when test="contains(normalize-space($element), 'block')">
3296
3996
  <fo:block xsl:use-attribute-sets="example-body-style">
3297
3997
  <xsl:apply-templates/>
3298
3998
  </fo:block>
@@ -3329,30 +4029,49 @@
3329
4029
  </xsl:otherwise>
3330
4030
  </xsl:choose>
3331
4031
 
3332
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3333
- <fo:block xsl:use-attribute-sets="example-p-style">
3334
-
3335
- <xsl:variable name="num"><xsl:number/></xsl:variable>
3336
- <xsl:if test="$num = 1">
3337
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
3338
- </xsl:if>
4032
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4033
+
4034
+ <xsl:variable name="element">
4035
+ block
3339
4036
 
3340
- <xsl:apply-templates/>
3341
- </fo:block>
4037
+ </xsl:variable>
4038
+ <xsl:choose>
4039
+ <xsl:when test="normalize-space($element) = 'block'">
4040
+ <fo:block xsl:use-attribute-sets="example-p-style">
4041
+
4042
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4043
+ <xsl:if test="$num = 1">
4044
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
4045
+ </xsl:if>
4046
+
4047
+ <xsl:apply-templates/>
4048
+ </fo:block>
4049
+ </xsl:when>
4050
+ <xsl:otherwise>
4051
+ <fo:inline xsl:use-attribute-sets="example-p-style">
4052
+ <xsl:apply-templates/>
4053
+ </fo:inline>
4054
+ </xsl:otherwise>
4055
+ </xsl:choose>
3342
4056
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3343
4057
  <fo:block xsl:use-attribute-sets="termsource-style">
3344
4058
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3345
4059
  <xsl:variable name="termsource_text">
3346
4060
  <xsl:apply-templates/>
3347
4061
  </xsl:variable>
4062
+
3348
4063
  <xsl:choose>
3349
4064
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3350
4065
  <xsl:apply-templates/>
3351
4066
  </xsl:when>
3352
- <xsl:otherwise>
3353
- <xsl:text>[</xsl:text>
3354
- <xsl:apply-templates/>
3355
- <xsl:text>]</xsl:text>
4067
+ <xsl:otherwise>
4068
+
4069
+ <xsl:text>[</xsl:text>
4070
+
4071
+ <xsl:apply-templates/>
4072
+
4073
+ <xsl:text>]</xsl:text>
4074
+
3356
4075
  </xsl:otherwise>
3357
4076
  </xsl:choose>
3358
4077
  </fo:block>
@@ -3373,18 +4092,29 @@
3373
4092
  <xsl:if test="normalize-space() != ''">
3374
4093
  <xsl:value-of select="."/>
3375
4094
  </xsl:if>
3376
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
4095
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
4096
+ <fo:block-container margin-left="0mm">
4097
+ <xsl:if test="parent::*[local-name() = 'note']">
4098
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
4099
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
4100
+ </xsl:if>
4101
+ </xsl:if>
4102
+
4103
+ <fo:block-container margin-left="0mm">
3377
4104
 
3378
- <fo:block xsl:use-attribute-sets="quote-style">
3379
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3380
- </fo:block>
3381
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3382
- <fo:block xsl:use-attribute-sets="quote-source-style">
3383
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3384
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3385
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3386
- </fo:block>
3387
- </xsl:if>
4105
+ <fo:block xsl:use-attribute-sets="quote-style">
4106
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4107
+ </fo:block>
4108
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4109
+ <fo:block xsl:use-attribute-sets="quote-source-style">
4110
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
4111
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
4112
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
4113
+ </fo:block>
4114
+ </xsl:if>
4115
+
4116
+ </fo:block-container>
4117
+ </fo:block-container>
3388
4118
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3389
4119
  <xsl:if test="../*[local-name() = 'author']">
3390
4120
  <xsl:text>, </xsl:text>
@@ -3412,6 +4142,7 @@
3412
4142
  <xsl:if test="@type = 'inline'">
3413
4143
 
3414
4144
 
4145
+
3415
4146
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3416
4147
 
3417
4148
  </xsl:if>
@@ -3443,6 +4174,7 @@
3443
4174
 
3444
4175
 
3445
4176
 
4177
+
3446
4178
  <xsl:choose>
3447
4179
  <xsl:when test="ancestor::un:sections and $depth = 1">12</xsl:when>
3448
4180
  <xsl:when test="ancestor::un:sections">8</xsl:when>
@@ -3497,9 +4229,12 @@
3497
4229
  </fo:block>
3498
4230
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3499
4231
  <xsl:variable name="title-deprecated">
3500
- <xsl:call-template name="getTitle">
3501
- <xsl:with-param name="name" select="'title-deprecated'"/>
3502
- </xsl:call-template>
4232
+
4233
+
4234
+ <xsl:call-template name="getTitle">
4235
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4236
+ </xsl:call-template>
4237
+
3503
4238
  </xsl:variable>
3504
4239
  <fo:block xsl:use-attribute-sets="deprecates-style">
3505
4240
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3546,6 +4281,7 @@
3546
4281
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3547
4282
  <fo:block>
3548
4283
  <xsl:call-template name="setId"/>
4284
+
3549
4285
  <xsl:apply-templates/>
3550
4286
  </fo:block>
3551
4287
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3575,6 +4311,31 @@
3575
4311
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3576
4312
  <!-- 0xA0 to space replacement -->
3577
4313
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4314
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4315
+ <xsl:choose>
4316
+ <xsl:when test="parent::*[local-name() = 'note']">
4317
+ <fo:block-container>
4318
+ <xsl:attribute name="margin-left">
4319
+ <xsl:choose>
4320
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4321
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4322
+ </xsl:choose>
4323
+ </xsl:attribute>
4324
+
4325
+
4326
+ <fo:block-container margin-left="0mm">
4327
+ <fo:block>
4328
+ <xsl:apply-templates select="." mode="ul_ol"/>
4329
+ </fo:block>
4330
+ </fo:block-container>
4331
+ </fo:block-container>
4332
+ </xsl:when>
4333
+ <xsl:otherwise>
4334
+ <fo:block>
4335
+ <xsl:apply-templates select="." mode="ul_ol"/>
4336
+ </fo:block>
4337
+ </xsl:otherwise>
4338
+ </xsl:choose>
3578
4339
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3579
4340
  <!-- <row>
3580
4341
  <date>05-07-2013</date>
@@ -3607,7 +4368,28 @@
3607
4368
  <fo:block><xsl:apply-templates/></fo:block>
3608
4369
  </fo:table-cell>
3609
4370
  </xsl:template><xsl:template name="processBibitem">
4371
+
4372
+
3610
4373
 
4374
+
4375
+ </xsl:template><xsl:template name="processBibitemDocId">
4376
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4377
+ <xsl:choose>
4378
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4379
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4380
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4381
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4382
+ </xsl:if>
4383
+ <xsl:value-of select="$_doc_ident"/>
4384
+ </xsl:when>
4385
+ <xsl:otherwise>
4386
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4387
+ <xsl:if test="$type != ''">
4388
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4389
+ </xsl:if>
4390
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4391
+ </xsl:otherwise>
4392
+ </xsl:choose>
3611
4393
  </xsl:template><xsl:template name="processPersonalAuthor">
3612
4394
  <xsl:choose>
3613
4395
  <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
@@ -3726,6 +4508,7 @@
3726
4508
 
3727
4509
 
3728
4510
 
4511
+
3729
4512
 
3730
4513
  </xsl:variable>
3731
4514
  <xsl:choose>
@@ -3740,6 +4523,7 @@
3740
4523
  <dc:creator>
3741
4524
 
3742
4525
 
4526
+
3743
4527
  </dc:creator>
3744
4528
  <dc:description>
3745
4529
  <xsl:variable name="abstract">
@@ -3749,6 +4533,7 @@
3749
4533
  <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
3750
4534
 
3751
4535
 
4536
+
3752
4537
  </xsl:variable>
3753
4538
  <xsl:value-of select="normalize-space($abstract)"/>
3754
4539
  </dc:description>
@@ -3820,13 +4605,22 @@
3820
4605
  </xsl:template><xsl:template name="split">
3821
4606
  <xsl:param name="pText" select="."/>
3822
4607
  <xsl:param name="sep" select="','"/>
4608
+ <xsl:param name="normalize-space" select="'true'"/>
3823
4609
  <xsl:if test="string-length($pText) &gt;0">
3824
4610
  <item>
3825
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4611
+ <xsl:choose>
4612
+ <xsl:when test="$normalize-space = 'true'">
4613
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4614
+ </xsl:when>
4615
+ <xsl:otherwise>
4616
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4617
+ </xsl:otherwise>
4618
+ </xsl:choose>
3826
4619
  </item>
3827
4620
  <xsl:call-template name="split">
3828
4621
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3829
4622
  <xsl:with-param name="sep" select="$sep"/>
4623
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3830
4624
  </xsl:call-template>
3831
4625
  </xsl:if>
3832
4626
  </xsl:template><xsl:template name="getDocumentId">
@@ -3849,6 +4643,7 @@
3849
4643
 
3850
4644
 
3851
4645
 
4646
+
3852
4647
  </xsl:variable>
3853
4648
  <xsl:if test="$documentNS != $XSLNS">
3854
4649
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3874,4 +4669,40 @@
3874
4669
  </xsl:otherwise>
3875
4670
  </xsl:choose>
3876
4671
  </xsl:attribute>
4672
+ </xsl:template><xsl:template name="add-letter-spacing">
4673
+ <xsl:param name="text"/>
4674
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4675
+ <xsl:if test="string-length($text) &gt; 0">
4676
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4677
+ <fo:inline padding-right="{$letter-spacing}mm">
4678
+ <xsl:if test="$char = '®'">
4679
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4680
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4681
+ </xsl:if>
4682
+ <xsl:value-of select="$char"/>
4683
+ </fo:inline>
4684
+ <xsl:call-template name="add-letter-spacing">
4685
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4686
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4687
+ </xsl:call-template>
4688
+ </xsl:if>
4689
+ </xsl:template><xsl:template name="repeat">
4690
+ <xsl:param name="char" select="'*'"/>
4691
+ <xsl:param name="count"/>
4692
+ <xsl:if test="$count &gt; 0">
4693
+ <xsl:value-of select="$char"/>
4694
+ <xsl:call-template name="repeat">
4695
+ <xsl:with-param name="char" select="$char"/>
4696
+ <xsl:with-param name="count" select="$count - 1"/>
4697
+ </xsl:call-template>
4698
+ </xsl:if>
4699
+ </xsl:template><xsl:template name="getLocalizedString">
4700
+ <xsl:param name="key"/>
4701
+
4702
+ <xsl:variable name="curr_lang">
4703
+ <xsl:call-template name="getLang"/>
4704
+ </xsl:variable>
4705
+
4706
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4707
+
3877
4708
  </xsl:template></xsl:stylesheet>