metanorma-un 0.3.8 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:un="https://www.metanorma.org/ns/un" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:un="https://www.metanorma.org/ns/un" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -25,8 +25,10 @@
25
25
 
26
26
  <xsl:variable name="doctype" select="/un:un-standard/un:bibdata/un:ext/un:doctype"/>
27
27
 
28
- <xsl:variable name="doctypenumber">
29
- <xsl:value-of select="translate(substring($doctype, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($doctype, 2)"/>
28
+ <xsl:variable name="doctypenumber">
29
+ <xsl:call-template name="capitalize">
30
+ <xsl:with-param name="str" select="$doctype"/>
31
+ </xsl:call-template>
30
32
  <xsl:text> No. </xsl:text>
31
33
  <xsl:value-of select="/un:un-standard/un:bibdata/un:docnumber"/>
32
34
  </xsl:variable>
@@ -76,42 +78,8 @@
76
78
 
77
79
  </fo:layout-master-set>
78
80
 
79
- <fo:declarations>
80
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
81
- <pdf:dictionary type="normal" key="ViewerPreferences">
82
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
83
- </pdf:dictionary>
84
- </pdf:catalog>
85
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
86
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
87
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
88
- <!-- Dublin Core properties go here -->
89
- <dc:title>
90
- <xsl:choose>
91
- <xsl:when test="$title != ''">
92
- <xsl:value-of select="$title"/>
93
- </xsl:when>
94
- <xsl:otherwise>
95
- <xsl:text> </xsl:text>
96
- </xsl:otherwise>
97
- </xsl:choose>
98
- </dc:title>
99
- <dc:creator/>
100
- <dc:description>
101
- <xsl:variable name="abstract">
102
- <xsl:copy-of select="/un:un-standard/un:preface/un:abstract//text()"/>
103
- </xsl:variable>
104
- <xsl:value-of select="normalize-space($abstract)"/>
105
- </dc:description>
106
- <pdf:Keywords/>
107
- </rdf:Description>
108
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
109
- <!-- XMP properties go here -->
110
- <xmp:CreatorTool/>
111
- </rdf:Description>
112
- </rdf:RDF>
113
- </x:xmpmeta>
114
- </fo:declarations>
81
+ <xsl:call-template name="addPDFUAmeta"/>
82
+
115
83
 
116
84
  <!-- Cover Page -->
117
85
  <fo:page-sequence master-reference="cover-page" force-page-count="even">
@@ -206,8 +174,18 @@
206
174
  <fo:page-sequence master-reference="document-preface-master" force-page-count="even" line-height="115%">
207
175
  <xsl:call-template name="insertHeaderPreface"/>
208
176
  <fo:flow flow-name="xsl-region-body" text-align="justify">
209
- <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt">Contents</fo:block>
210
- <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt">Page</fo:block>
177
+ <xsl:variable name="title-toc">
178
+ <xsl:call-template name="getTitle">
179
+ <xsl:with-param name="name" select="'title-toc'"/>
180
+ </xsl:call-template>
181
+ </xsl:variable>
182
+ <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt"><xsl:value-of select="$title-toc"/></fo:block>
183
+ <xsl:variable name="title-page">
184
+ <xsl:call-template name="getTitle">
185
+ <xsl:with-param name="name" select="'title-page'"/>
186
+ </xsl:call-template>
187
+ </xsl:variable>
188
+ <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
211
189
  <fo:block>
212
190
  <xsl:for-each select="xalan:nodeset($contents)//item[not(@type = 'table') and not(@type = 'figure') and not (@type = 'annex' or @parent = 'annex')]">
213
191
  <xsl:if test="@display = 'true' and @level &lt;= 3">
@@ -344,14 +322,7 @@
344
322
  <!-- Any node with title element - clause, definition, annex,... -->
345
323
  <xsl:template match="un:title | un:preferred" mode="contents">
346
324
  <xsl:variable name="id">
347
- <xsl:choose>
348
- <xsl:when test="../@id">
349
- <xsl:value-of select="../@id"/>
350
- </xsl:when>
351
- <xsl:otherwise>
352
- <xsl:value-of select="text()"/>
353
- </xsl:otherwise>
354
- </xsl:choose>
325
+ <xsl:call-template name="getId"/>
355
326
  </xsl:variable>
356
327
 
357
328
  <xsl:variable name="level">
@@ -398,7 +369,12 @@
398
369
  <xsl:when test="ancestor::un:annex">
399
370
  <xsl:choose>
400
371
  <xsl:when test="$level = 1">
401
- <xsl:text>Annex </xsl:text>
372
+ <xsl:variable name="title-annex">
373
+ <xsl:call-template name="getTitle">
374
+ <xsl:with-param name="name" select="'title-annex'"/>
375
+ </xsl:call-template>
376
+ </xsl:variable>
377
+ <xsl:value-of select="$title-annex"/>
402
378
  <xsl:number format="I" level="any" count="un:annex"/>
403
379
  </xsl:when>
404
380
  <xsl:otherwise>
@@ -431,7 +407,12 @@
431
407
  <xsl:template match="un:figure" mode="contents">
432
408
  <item level="" id="{@id}" type="figure">
433
409
  <xsl:attribute name="section">
434
- <xsl:text>Figure </xsl:text>
410
+ <xsl:variable name="title-figure">
411
+ <xsl:call-template name="getTitle">
412
+ <xsl:with-param name="name" select="'title-figure'"/>
413
+ </xsl:call-template>
414
+ </xsl:variable>
415
+ <xsl:value-of select="$title-figure"/>
435
416
  <xsl:choose>
436
417
  <xsl:when test="ancestor::un:annex">
437
418
  <xsl:choose>
@@ -463,7 +444,12 @@
463
444
  <xsl:variable name="annex-id" select="ancestor::un:annex/@id"/>
464
445
  <item level="" id="{@id}" display="false" type="table">
465
446
  <xsl:attribute name="section">
466
- <xsl:text>Table </xsl:text>
447
+ <xsl:variable name="title-table">
448
+ <xsl:call-template name="getTitle">
449
+ <xsl:with-param name="name" select="'title-table'"/>
450
+ </xsl:call-template>
451
+ </xsl:variable>
452
+ <xsl:value-of select="$title-table"/>
467
453
  <xsl:choose>
468
454
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
469
455
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
@@ -487,7 +473,12 @@
487
473
  <xsl:template match="un:formula" mode="contents">
488
474
  <item level="" id="{@id}" display="false">
489
475
  <xsl:attribute name="section">
490
- <xsl:text>Formula (</xsl:text><xsl:number format="A.1" level="multiple" count="un:annex | un:formula"/><xsl:text>)</xsl:text>
476
+ <xsl:variable name="title-formula">
477
+ <xsl:call-template name="getTitle">
478
+ <xsl:with-param name="name" select="'title-formula'"/>
479
+ </xsl:call-template>
480
+ </xsl:variable>
481
+ <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="un:annex | un:formula"/>
491
482
  </xsl:attribute>
492
483
  </item>
493
484
  </xsl:template>
@@ -516,7 +507,12 @@
516
507
  <item level="" id="{@id}" display="false" type="Terms">
517
508
  <xsl:if test="ancestor::un:annex">
518
509
  <xsl:attribute name="section">
519
- <xsl:text>Appendix </xsl:text><xsl:number format="A" count="un:annex"/>
510
+ <xsl:variable name="title-appendix">
511
+ <xsl:call-template name="getTitle">
512
+ <xsl:with-param name="name" select="'title-appendix'"/>
513
+ </xsl:call-template>
514
+ </xsl:variable>
515
+ <xsl:value-of select="$title-appendix"/><xsl:number format="A" count="un:annex"/>
520
516
  </xsl:attribute>
521
517
  </xsl:if>
522
518
  </item>
@@ -526,7 +522,12 @@
526
522
  <item level="" id="{@id}" display="false" type="References">
527
523
  <xsl:if test="ancestor::un:annex">
528
524
  <xsl:attribute name="section">
529
- <xsl:text>Appendix </xsl:text><xsl:number format="A" count="un:annex"/>
525
+ <xsl:variable name="title-appendix">
526
+ <xsl:call-template name="getTitle">
527
+ <xsl:with-param name="name" select="'title-appendix'"/>
528
+ </xsl:call-template>
529
+ </xsl:variable>
530
+ <xsl:value-of select="$title-appendix"/><xsl:number format="A" count="un:annex"/>
530
531
  </xsl:attribute>
531
532
  </xsl:if>
532
533
  </item>
@@ -538,7 +539,12 @@
538
539
  <xsl:variable name="num">
539
540
  <xsl:number/>
540
541
  </xsl:variable>
541
- <xsl:text>Box </xsl:text><xsl:value-of select="$num"/>
542
+ <xsl:variable name="title-box">
543
+ <xsl:call-template name="getTitle">
544
+ <xsl:with-param name="name" select="'title-box'"/>
545
+ </xsl:call-template>
546
+ </xsl:variable>
547
+ <xsl:value-of select="$title-box"/><xsl:value-of select="$num"/>
542
548
  </xsl:attribute>
543
549
  </item>
544
550
  </xsl:template>
@@ -756,7 +762,12 @@
756
762
  <xsl:template match="un:ul//un:note | un:ol//un:note"/>
757
763
  <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process">
758
764
  <fo:block font-size="11pt" margin-top="4pt">
759
- <xsl:text>NOTE </xsl:text>
765
+ <xsl:variable name="title-note">
766
+ <xsl:call-template name="getTitle">
767
+ <xsl:with-param name="name" select="'title-note'"/>
768
+ </xsl:call-template>
769
+ </xsl:variable>
770
+ <xsl:value-of select="$title-note"/>
760
771
  <xsl:if test="../following-sibling::un:note or ../preceding-sibling::un:note">
761
772
  <xsl:number count="un:note"/><xsl:text> </xsl:text>
762
773
  </xsl:if>
@@ -835,7 +846,12 @@
835
846
  <xsl:variable name="num">
836
847
  <xsl:number/>
837
848
  </xsl:variable>
838
- <xsl:text>Box </xsl:text><xsl:value-of select="$num"/><xsl:text>. </xsl:text><xsl:apply-templates select="un:name" mode="process"/>
849
+ <xsl:variable name="title-box">
850
+ <xsl:call-template name="getTitle">
851
+ <xsl:with-param name="name" select="'title-box'"/>
852
+ </xsl:call-template>
853
+ </xsl:variable>
854
+ <xsl:value-of select="$title-box"/><xsl:value-of select="$num"/><xsl:text>. </xsl:text><xsl:apply-templates select="un:name" mode="process"/>
839
855
  </fo:block>
840
856
  <fo:block margin-left="29mm" margin-right="34mm">
841
857
  <xsl:apply-templates/>
@@ -892,14 +908,7 @@
892
908
 
893
909
  <xsl:template match="un:title">
894
910
  <xsl:variable name="id">
895
- <xsl:choose>
896
- <xsl:when test="../@id">
897
- <xsl:value-of select="../@id"/>
898
- </xsl:when>
899
- <xsl:otherwise>
900
- <xsl:value-of select="text()"/>
901
- </xsl:otherwise>
902
- </xsl:choose>
911
+ <xsl:call-template name="getId"/>
903
912
  </xsl:variable>
904
913
 
905
914
  <xsl:variable name="level">
@@ -986,7 +995,12 @@
986
995
  <xsl:template match="un:recommendation">
987
996
  <fo:block margin-left="20mm">
988
997
  <fo:block font-weight="bold">
989
- <xsl:text>Recommendation </xsl:text>
998
+ <xsl:variable name="title-recommendation">
999
+ <xsl:call-template name="getTitle">
1000
+ <xsl:with-param name="name" select="'title-recommendation'"/>
1001
+ </xsl:call-template>
1002
+ </xsl:variable>
1003
+ <xsl:value-of select="$title-recommendation"/>
990
1004
  <xsl:choose>
991
1005
  <xsl:when test="ancestor::un:sections">
992
1006
  <xsl:number level="any" count="un:sections//un:recommendation"/>
@@ -1057,7 +1071,12 @@
1057
1071
  </xsl:if>
1058
1072
  <xsl:if test="un:name">
1059
1073
  <fo:block text-align="center" font-size="9pt" margin-bottom="6pt" keep-with-next="always" keep-together.within-column="always">
1060
- <xsl:text>Figure </xsl:text>
1074
+ <xsl:variable name="title-figure">
1075
+ <xsl:call-template name="getTitle">
1076
+ <xsl:with-param name="name" select="'title-figure'"/>
1077
+ </xsl:call-template>
1078
+ </xsl:variable>
1079
+ <xsl:value-of select="$title-figure"/>
1061
1080
  <xsl:choose>
1062
1081
  <xsl:when test="ancestor::un:annex">
1063
1082
  <xsl:choose>
@@ -1210,12 +1229,17 @@
1210
1229
 
1211
1230
  <xsl:template match="un:termnote">
1212
1231
  <fo:block margin-top="4pt">
1213
- <xsl:text>NOTE </xsl:text>
1214
- <xsl:if test="following-sibling::un:termnote or preceding-sibling::un:termnote">
1215
- <xsl:number/><xsl:text> </xsl:text>
1216
- </xsl:if>
1217
- <xsl:text>– </xsl:text>
1218
- <xsl:apply-templates/>
1232
+ <xsl:variable name="title-note">
1233
+ <xsl:call-template name="getTitle">
1234
+ <xsl:with-param name="name" select="'title-note'"/>
1235
+ </xsl:call-template>
1236
+ </xsl:variable>
1237
+ <xsl:value-of select="$title-note"/>
1238
+ <xsl:if test="following-sibling::un:termnote or preceding-sibling::un:termnote">
1239
+ <xsl:number/><xsl:text> </xsl:text>
1240
+ </xsl:if>
1241
+ <xsl:text>– </xsl:text>
1242
+ <xsl:apply-templates/>
1219
1243
  </fo:block>
1220
1244
  </xsl:template>
1221
1245
 
@@ -1243,7 +1267,7 @@
1243
1267
  <fo:table-cell> <!-- display-align="center" -->
1244
1268
  <fo:block text-align="right">
1245
1269
  <xsl:if test="not(ancestor::un:annex)">
1246
- <xsl:text>(</xsl:text><xsl:number level="any"/><xsl:text>)</xsl:text>
1270
+ <xsl:number format="(1)" level="any"/>
1247
1271
  </xsl:if>
1248
1272
  <xsl:if test="ancestor::un:annex">
1249
1273
  <xsl:variable name="annex-id" select="ancestor::un:annex/@id"/>
@@ -1267,7 +1291,12 @@
1267
1291
  </xsl:template>
1268
1292
 
1269
1293
  <xsl:template match="un:example">
1270
- <fo:block id="{@id}" font-size="10pt" font-weight="bold" margin-bottom="12pt">EXAMPLE</fo:block>
1294
+ <xsl:variable name="title-example">
1295
+ <xsl:call-template name="getTitle">
1296
+ <xsl:with-param name="name" select="'title-example'"/>
1297
+ </xsl:call-template>
1298
+ </xsl:variable>
1299
+ <fo:block id="{@id}" font-size="10pt" font-weight="bold" margin-bottom="12pt"><xsl:value-of select="$title-example"/></fo:block>
1271
1300
  <fo:block font-size="11pt" margin-top="12pt" margin-bottom="12pt" margin-left="15mm">
1272
1301
  <xsl:apply-templates/>
1273
1302
  </fo:block>
@@ -1293,15 +1322,25 @@
1293
1322
  <!-- <xsl:if test="@type = 'inline'">
1294
1323
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1295
1324
  </xsl:if> -->
1296
- <xsl:text>[</xsl:text><xsl:value-of select="@citeas" disable-output-escaping="yes"/><xsl:text>]</xsl:text>
1325
+ <xsl:text>[</xsl:text><xsl:value-of select="@citeas"/><xsl:text>]</xsl:text> <!-- disable-output-escaping="yes" -->
1297
1326
  <xsl:apply-templates select="un:localityStack"/>
1298
1327
  </fo:basic-link>
1299
1328
  </xsl:template>
1300
1329
 
1301
1330
  <xsl:template match="un:locality">
1331
+ <xsl:variable name="title-section">
1332
+ <xsl:call-template name="getTitle">
1333
+ <xsl:with-param name="name" select="'title-section'"/>
1334
+ </xsl:call-template>
1335
+ </xsl:variable>
1336
+ <xsl:variable name="title-clause">
1337
+ <xsl:call-template name="getTitle">
1338
+ <xsl:with-param name="name" select="'title-clause'"/>
1339
+ </xsl:call-template>
1340
+ </xsl:variable>
1302
1341
  <xsl:choose>
1303
- <xsl:when test="@type = 'section'">Section </xsl:when>
1304
- <xsl:when test="@type = 'clause'">Clause </xsl:when>
1342
+ <xsl:when test="@type = 'section'"><xsl:value-of select="$title-section"/></xsl:when>
1343
+ <xsl:when test="@type = 'clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1305
1344
  <xsl:otherwise/>
1306
1345
  </xsl:choose>
1307
1346
  <xsl:text> </xsl:text><xsl:value-of select="un:referenceFrom"/>
@@ -1320,7 +1359,7 @@
1320
1359
  </fo:block>
1321
1360
  </xsl:template>
1322
1361
  <xsl:template match="un:term" mode="table">
1323
- <fo:table-row>
1362
+ <fo:table-row id="{@id}">
1324
1363
  <fo:table-cell padding-right="1mm">
1325
1364
  <fo:block margin-bottom="12pt">
1326
1365
  <xsl:apply-templates select="un:preferred"/>
@@ -1334,7 +1373,7 @@
1334
1373
  </fo:table-row>
1335
1374
  </xsl:template>
1336
1375
  <xsl:template match="un:preferred">
1337
- <fo:inline id="{../@id}">
1376
+ <fo:inline>
1338
1377
  <xsl:apply-templates/>
1339
1378
  </fo:inline>
1340
1379
  </xsl:template>
@@ -1400,15 +1439,7 @@
1400
1439
  <xsl:apply-templates/>
1401
1440
  </fo:block>
1402
1441
  </xsl:template>
1403
-
1404
- <xsl:template match="un:sourcecode">
1405
- <fo:block font-family="Courier" font-size="10pt" margin-top="6pt" margin-bottom="6pt">
1406
- <xsl:attribute name="white-space">pre</xsl:attribute>
1407
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1408
- <xsl:apply-templates/>
1409
- </fo:block>
1410
- </xsl:template>
1411
-
1442
+
1412
1443
  <xsl:template match="un:references">
1413
1444
  <fo:block>
1414
1445
  <xsl:if test="not(un:title)">
@@ -1451,28 +1482,6 @@
1451
1482
  </xsl:template>
1452
1483
 
1453
1484
 
1454
- <xsl:template name="getLevel">
1455
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
1456
- <xsl:variable name="level">
1457
- <xsl:choose>
1458
- <xsl:when test="ancestor::un:preface">
1459
- <xsl:value-of select="$level_total - 2"/>
1460
- </xsl:when>
1461
- <xsl:when test="ancestor::un:sections">
1462
- <xsl:value-of select="$level_total - 2"/>
1463
- </xsl:when>
1464
- <xsl:when test="ancestor::un:bibliography">
1465
- <xsl:value-of select="$level_total - 2"/>
1466
- </xsl:when>
1467
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
1468
- <xsl:otherwise>
1469
- <xsl:value-of select="$level_total - 1"/>
1470
- </xsl:otherwise>
1471
- </xsl:choose>
1472
- </xsl:variable>
1473
- <xsl:value-of select="$level"/>
1474
- </xsl:template>
1475
-
1476
1485
  <xsl:template name="getSection">
1477
1486
  <xsl:variable name="level">
1478
1487
  <xsl:call-template name="getLevel"/>
@@ -1500,7 +1509,12 @@
1500
1509
  <xsl:when test="ancestor::un:annex">
1501
1510
  <xsl:choose>
1502
1511
  <xsl:when test="$level = 1">
1503
- <xsl:text>Annex </xsl:text>
1512
+ <xsl:variable name="title-annex">
1513
+ <xsl:call-template name="getTitle">
1514
+ <xsl:with-param name="name" select="'title-annex'"/>
1515
+ </xsl:call-template>
1516
+ </xsl:variable>
1517
+ <xsl:value-of select="$title-annex"/>
1504
1518
  <xsl:number format="I" level="any" count="un:annex"/>
1505
1519
  <!-- <xsl:text>: </xsl:text> -->
1506
1520
  </xsl:when>
@@ -11902,16 +11916,217 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
11902
11916
  </xsl:text>
11903
11917
  </xsl:variable>
11904
11918
 
11905
- <xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="link-style">
11919
+ <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
11920
+
11921
+ <title-table lang="en">Table </title-table>
11922
+ <title-table lang="fr">Tableau </title-table>
11923
+
11924
+ <title-table lang="zh">Table </title-table>
11925
+
11926
+
11927
+
11928
+ <title-note lang="en">NOTE </title-note>
11929
+ <title-note lang="fr">NOTE </title-note>
11930
+
11931
+ <title-note lang="zh">NOTE </title-note>
11932
+
11933
+
11934
+
11935
+ <title-figure lang="en">Figure </title-figure>
11936
+ <title-figure lang="fr">Figure </title-figure>
11937
+
11938
+ <title-figure lang="zh">Figure </title-figure>
11939
+
11940
+
11941
+
11942
+ <title-example lang="en">EXAMPLE </title-example>
11943
+ <title-example lang="fr">EXEMPLE </title-example>
11944
+
11945
+ <title-example lang="zh">EXAMPLE </title-example>
11946
+
11947
+
11948
+
11949
+ <title-example-xref lang="en">Example </title-example-xref>
11950
+ <title-example-xref lang="fr">Exemple </title-example-xref>
11951
+
11952
+ <title-section lang="en">Section </title-section>
11953
+ <title-section lang="fr">Section </title-section>
11954
+
11955
+ <title-inequality lang="en">Inequality </title-inequality>
11956
+ <title-inequality lang="fr">Inequality </title-inequality>
11957
+
11958
+ <title-equation lang="en">Equation </title-equation>
11959
+ <title-equation lang="fr">Equation </title-equation>
11960
+
11961
+ <title-annex lang="en">Annex </title-annex>
11962
+ <title-annex lang="fr">Annexe </title-annex>
11963
+
11964
+ <title-annex lang="zh">Annex </title-annex>
11965
+
11906
11966
 
11907
11967
 
11908
- </xsl:attribute-set><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
11968
+ <title-appendix lang="en">Appendix </title-appendix>
11969
+ <title-appendix lang="fr">Appendix </title-appendix>
11970
+
11971
+ <title-clause lang="en">Clause </title-clause>
11972
+ <title-clause lang="fr">Article </title-clause>
11973
+
11974
+ <title-clause lang="zh">Clause </title-clause>
11975
+
11976
+
11977
+
11978
+ <title-edition lang="en">
11979
+
11980
+ <xsl:text>Edition </xsl:text>
11981
+
11982
+
11983
+ </title-edition>
11984
+
11985
+ <title-formula lang="en">Formula </title-formula>
11986
+ <title-formula lang="fr">Formula </title-formula>
11987
+
11988
+ <title-toc lang="en">
11989
+
11990
+ <xsl:text>Contents</xsl:text>
11991
+
11992
+
11993
+
11994
+ </title-toc>
11995
+ <title-toc lang="fr">Sommaire</title-toc>
11996
+
11997
+ <title-toc lang="zh">Contents</title-toc>
11998
+
11999
+
12000
+
12001
+ <title-page lang="en">Page</title-page>
12002
+ <title-page lang="fr">Page</title-page>
12003
+
12004
+ <title-key lang="en">Key</title-key>
12005
+ <title-key lang="fr">Légende</title-key>
12006
+
12007
+ <title-where lang="en">where</title-where>
12008
+ <title-where lang="fr">où</title-where>
12009
+
12010
+ <title-descriptors lang="en">Descriptors</title-descriptors>
12011
+
12012
+ <title-part lang="en">
12013
+
12014
+
12015
+ </title-part>
12016
+ <title-part lang="fr">
12017
+
12018
+
12019
+ </title-part>
12020
+ <title-part lang="zh">第 # 部分:</title-part>
12021
+
12022
+ <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
12023
+ <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
12024
+
12025
+ <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
12026
+
12027
+
12028
+
12029
+ <title-modified lang="en">modified</title-modified>
12030
+ <title-modified lang="fr">modifiée</title-modified>
12031
+
12032
+ <title-modified lang="zh">modified</title-modified>
12033
+
12034
+
12035
+
12036
+ <title-source lang="en">SOURCE</title-source>
12037
+
12038
+ <title-keywords lang="en">Keywords</title-keywords>
12039
+
12040
+ <title-deprecated lang="en">DEPRECATED</title-deprecated>
12041
+ <title-deprecated lang="fr">DEPRECATED</title-deprecated>
12042
+
12043
+ <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
12044
+
12045
+ <title-list-tables lang="en">List of Tables</title-list-tables>
12046
+
12047
+ <title-list-figures lang="en">List of Figures</title-list-figures>
12048
+
12049
+ <title-recommendation lang="en">Recommendation </title-recommendation>
12050
+
12051
+ <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
12052
+
12053
+ <title-abstract lang="en">Abstract</title-abstract>
12054
+
12055
+ <title-summary lang="en">Summary</title-summary>
12056
+
12057
+ <title-in lang="en">in </title-in>
12058
+
12059
+ <title-box lang="en">Box </title-box>
12060
+
12061
+ <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
12062
+ <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
12063
+
12064
+ <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
12065
+ <title-completion-date lang="zh">本稿完成日期</title-completion-date>
12066
+
12067
+ <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
12068
+ <title-issuance-date lang="zh"># 发布</title-issuance-date>
12069
+
12070
+ <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
12071
+ <title-implementation-date lang="zh"># 实施</title-implementation-date>
12072
+
12073
+ <title-obligation-normative lang="en">normative</title-obligation-normative>
12074
+ <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
12075
+
12076
+ <title-caution lang="en">CAUTION</title-caution>
12077
+ <title-caution lang="zh">注意</title-caution>
12078
+
12079
+ <title-warning lang="en">WARNING</title-warning>
12080
+ <title-warning lang="zh">警告</title-warning>
12081
+
12082
+ <title-amendment lang="en">AMENDMENT</title-amendment>
12083
+ </xsl:variable><xsl:template name="getTitle">
12084
+ <xsl:param name="name"/>
12085
+ <xsl:variable name="lang">
12086
+ <xsl:call-template name="getLang"/>
12087
+ </xsl:variable>
12088
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
12089
+ <xsl:choose>
12090
+ <xsl:when test="normalize-space($title_) != ''">
12091
+ <xsl:value-of select="$title_"/>
12092
+ </xsl:when>
12093
+ <xsl:otherwise>
12094
+ <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
12095
+ </xsl:otherwise>
12096
+ </xsl:choose>
12097
+ </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">
12098
+
12099
+
12100
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
12101
+
12102
+
12103
+
12104
+
12105
+
12106
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
12107
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
12108
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
12109
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
12110
+
12111
+
12112
+
12113
+
12114
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
12115
+
12116
+
12117
+
12118
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
12119
+
12120
+
12121
+
12122
+ </xsl:attribute-set><xsl:template match="text()">
11909
12123
  <xsl:value-of select="."/>
11910
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='br']">
12124
+ </xsl:template><xsl:template match="*[local-name()='br']">
11911
12125
  <xsl:value-of select="$linebreak"/>
11912
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
11913
- <xsl:call-template name="add-zero-spaces"/>
11914
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']">
12126
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
12127
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
12128
+ <xsl:call-template name="add-zero-spaces-java"/>
12129
+ </xsl:template><xsl:template match="*[local-name()='table']">
11915
12130
 
11916
12131
  <xsl:variable name="simple-table">
11917
12132
  <!-- <xsl:copy> -->
@@ -11942,7 +12157,12 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
11942
12157
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
11943
12158
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11944
12159
 
11945
- <xsl:text>Table </xsl:text>
12160
+ <xsl:variable name="title-table">
12161
+ <xsl:call-template name="getTitle">
12162
+ <xsl:with-param name="name" select="'title-table'"/>
12163
+ </xsl:call-template>
12164
+ </xsl:variable>
12165
+ <xsl:value-of select="$title-table"/>
11946
12166
  <xsl:choose>
11947
12167
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
11948
12168
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
@@ -12032,6 +12252,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12032
12252
 
12033
12253
 
12034
12254
 
12255
+
12035
12256
  <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">
12036
12257
 
12037
12258
 
@@ -12051,9 +12272,10 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12051
12272
 
12052
12273
 
12053
12274
 
12275
+
12054
12276
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
12055
12277
  <xsl:choose>
12056
- <xsl:when test=". = 1">
12278
+ <xsl:when test=". = 1 or . = 0">
12057
12279
  <fo:table-column column-width="proportional-column-width(2)"/>
12058
12280
  </xsl:when>
12059
12281
  <xsl:otherwise>
@@ -12061,21 +12283,58 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12061
12283
  </xsl:otherwise>
12062
12284
  </xsl:choose>
12063
12285
  </xsl:for-each>
12064
- <xsl:apply-templates/>
12286
+
12287
+ <xsl:choose>
12288
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
12289
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
12290
+ </xsl:when>
12291
+ <xsl:otherwise>
12292
+ <xsl:apply-templates/>
12293
+ </xsl:otherwise>
12294
+ </xsl:choose>
12295
+
12065
12296
  </fo:table>
12066
12297
 
12067
12298
 
12068
12299
 
12069
12300
  </fo:block-container>
12070
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']" mode="process">
12301
+ </xsl:template><xsl:template name="getTableNumber">
12302
+ <xsl:choose>
12303
+ <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
12304
+ <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
12305
+ </xsl:when>
12306
+ <xsl:when test="ancestor::*[local-name()='annex']">
12307
+
12308
+
12309
+
12310
+
12311
+
12312
+
12313
+ <!-- <xsl:variable name="annex-id" select="ancestor::*[local-name()='annex']/@id"/>
12314
+ <xsl:number format="I." count="*[local-name()='annex']"/> -->
12315
+ <xsl:text>A</xsl:text> <!-- 'A' means Annex -->
12316
+ <xsl:number format="1" level="any" count="*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'][ancestor::*[local-name()='annex']]"/> <!-- [@id = $annex-id] -->
12317
+
12318
+
12319
+
12320
+ </xsl:when>
12321
+ <xsl:otherwise>
12322
+
12323
+
12324
+ <xsl:number format="A." count="*[local-name()='annex']"/>
12325
+ <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
12326
+
12327
+ </xsl:otherwise>
12328
+ </xsl:choose>
12329
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
12071
12330
  <xsl:apply-templates/>
12072
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="calculate-columns-numbers">
12331
+ </xsl:template><xsl:template name="calculate-columns-numbers">
12073
12332
  <xsl:param name="table-row"/>
12074
12333
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
12075
12334
  <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
12076
12335
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
12077
12336
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
12078
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="calculate-column-widths">
12337
+ </xsl:template><xsl:template name="calculate-column-widths">
12079
12338
  <xsl:param name="table"/>
12080
12339
  <xsl:param name="cols-count"/>
12081
12340
  <xsl:param name="curr-col" select="1"/>
@@ -12084,7 +12343,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12084
12343
  <xsl:if test="$curr-col &lt;= $cols-count">
12085
12344
  <xsl:variable name="widths">
12086
12345
  <xsl:choose>
12087
- <xsl:when test="not($table)">
12346
+ <xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
12088
12347
  <xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']">
12089
12348
  <xsl:variable name="words">
12090
12349
  <xsl:call-template name="tokenize">
@@ -12123,9 +12382,16 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12123
12382
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
12124
12383
  </xsl:variable>
12125
12384
  <xsl:variable name="words">
12385
+ <xsl:variable name="string_with_added_zerospaces">
12386
+ <xsl:call-template name="add-zero-spaces-java">
12387
+ <xsl:with-param name="text" select="$td_text"/>
12388
+ </xsl:call-template>
12389
+ </xsl:variable>
12126
12390
  <xsl:call-template name="tokenize">
12127
12391
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
12128
- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/>
12392
+ <!-- 2009 thinspace -->
12393
+ <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
12394
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​', ' '))"/>
12129
12395
  </xsl:call-template>
12130
12396
  </xsl:variable>
12131
12397
  <xsl:variable name="max_length">
@@ -12166,17 +12432,28 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12166
12432
  <xsl:with-param name="table" select="$table"/>
12167
12433
  </xsl:call-template>
12168
12434
  </xsl:if>
12169
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()" mode="td_text">
12435
+ </xsl:template><xsl:template match="text()" mode="td_text">
12170
12436
  <xsl:variable name="zero-space">​</xsl:variable>
12171
12437
  <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
12172
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table2']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']" mode="process">
12438
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
12439
+ <xsl:value-of select="*[local-name()='origin']/@citeas"/>
12440
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
12441
+ <xsl:value-of select="@target"/>
12442
+ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
12443
+ <xsl:param name="cols-count"/>
12173
12444
  <!-- font-weight="bold" -->
12174
- <fo:table-header>
12445
+ <fo:table-header>
12446
+
12175
12447
  <xsl:apply-templates/>
12176
12448
  </fo:table-header>
12177
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']" mode="process">
12449
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
12450
+ <fo:table-body>
12451
+ <xsl:apply-templates/>
12452
+ </fo:table-body>
12453
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
12178
12454
  <xsl:apply-templates/>
12179
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="insertTableFooter">
12455
+ </xsl:template><xsl:template name="insertTableFooter">
12456
+ <xsl:param name="cols-count"/>
12180
12457
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
12181
12458
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
12182
12459
 
@@ -12187,22 +12464,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12187
12464
  <!-- if there are note(s) or fn(s) then create footer row -->
12188
12465
  <xsl:if test="$isNoteOrFnExist = 'true'">
12189
12466
 
12190
- <xsl:variable name="cols-count">
12191
- <xsl:choose>
12192
- <xsl:when test="../*[local-name()='thead']">
12193
- <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
12194
- <xsl:call-template name="calculate-columns-numbers">
12195
- <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
12196
- </xsl:call-template>
12197
- </xsl:when>
12198
- <xsl:otherwise>
12199
- <!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
12200
- <xsl:call-template name="calculate-columns-numbers">
12201
- <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
12202
- </xsl:call-template>
12203
- </xsl:otherwise>
12204
- </xsl:choose>
12205
- </xsl:variable>
12467
+
12206
12468
 
12207
12469
  <fo:table-row>
12208
12470
  <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
@@ -12230,11 +12492,30 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12230
12492
  </fo:table-footer>
12231
12493
 
12232
12494
  </xsl:if>
12233
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tbody']">
12495
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
12234
12496
 
12235
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
12497
+ <xsl:variable name="cols-count">
12498
+ <xsl:choose>
12499
+ <xsl:when test="../*[local-name()='thead']">
12500
+ <xsl:call-template name="calculate-columns-numbers">
12501
+ <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
12502
+ </xsl:call-template>
12503
+ </xsl:when>
12504
+ <xsl:otherwise>
12505
+ <xsl:call-template name="calculate-columns-numbers">
12506
+ <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
12507
+ </xsl:call-template>
12508
+ </xsl:otherwise>
12509
+ </xsl:choose>
12510
+ </xsl:variable>
12511
+
12512
+ <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
12513
+ <xsl:with-param name="cols-count" select="$cols-count"/>
12514
+ </xsl:apply-templates>
12236
12515
 
12237
- <xsl:call-template name="insertTableFooter"/>
12516
+ <xsl:call-template name="insertTableFooter">
12517
+ <xsl:with-param name="cols-count" select="$cols-count"/>
12518
+ </xsl:call-template>
12238
12519
 
12239
12520
  <fo:table-body>
12240
12521
  <xsl:apply-templates/>
@@ -12242,7 +12523,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12242
12523
 
12243
12524
  </fo:table-body>
12244
12525
 
12245
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tr']">
12526
+ </xsl:template><xsl:template match="*[local-name()='tr']">
12246
12527
  <xsl:variable name="parent-name" select="local-name(..)"/>
12247
12528
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
12248
12529
  <fo:table-row min-height="4mm">
@@ -12262,7 +12543,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12262
12543
 
12263
12544
  <xsl:apply-templates/>
12264
12545
  </fo:table-row>
12265
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='th']">
12546
+ </xsl:template><xsl:template match="*[local-name()='th']">
12266
12547
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
12267
12548
 
12268
12549
 
@@ -12301,7 +12582,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12301
12582
  <xsl:apply-templates/>
12302
12583
  </fo:block>
12303
12584
  </fo:table-cell>
12304
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']">
12585
+ </xsl:template><xsl:template match="*[local-name()='td']">
12305
12586
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
12306
12587
 
12307
12588
 
@@ -12328,6 +12609,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12328
12609
  </xsl:attribute>
12329
12610
  </xsl:if>
12330
12611
  <fo:block>
12612
+
12331
12613
  <xsl:apply-templates/>
12332
12614
  </fo:block>
12333
12615
  <!-- <xsl:choose>
@@ -12343,16 +12625,23 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12343
12625
 
12344
12626
 
12345
12627
  </fo:table-cell>
12346
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='note']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='note']" mode="process">
12628
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
12347
12629
 
12348
12630
 
12349
12631
  <fo:block font-size="10pt" margin-bottom="12pt">
12350
12632
 
12351
12633
 
12352
12634
 
12635
+
12353
12636
  <fo:inline padding-right="2mm">
12354
12637
 
12355
- <xsl:text>NOTE </xsl:text>
12638
+
12639
+ <xsl:variable name="title-note">
12640
+ <xsl:call-template name="getTitle">
12641
+ <xsl:with-param name="name" select="'title-note'"/>
12642
+ </xsl:call-template>
12643
+ </xsl:variable>
12644
+ <xsl:value-of select="$title-note"/>
12356
12645
 
12357
12646
 
12358
12647
 
@@ -12362,9 +12651,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12362
12651
  <xsl:apply-templates mode="process"/>
12363
12652
  </fo:block>
12364
12653
 
12365
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
12654
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
12366
12655
  <xsl:apply-templates/>
12367
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="fn_display">
12656
+ </xsl:template><xsl:template name="fn_display">
12368
12657
  <xsl:variable name="references">
12369
12658
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
12370
12659
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -12381,6 +12670,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12381
12670
 
12382
12671
 
12383
12672
 
12673
+
12384
12674
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
12385
12675
 
12386
12676
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -12400,7 +12690,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12400
12690
  </fo:block>
12401
12691
  </xsl:if>
12402
12692
  </xsl:for-each>
12403
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="fn_name_display">
12693
+ </xsl:template><xsl:template name="fn_name_display">
12404
12694
  <!-- <xsl:variable name="references">
12405
12695
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
12406
12696
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -12416,7 +12706,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12416
12706
  <xsl:apply-templates/>
12417
12707
  </fo:block>
12418
12708
  </xsl:for-each>
12419
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="fn_display_figure">
12709
+ </xsl:template><xsl:template name="fn_display_figure">
12420
12710
  <xsl:variable name="key_iso">
12421
12711
  <!-- and (not(@class) or @class !='pseudocode') -->
12422
12712
  </xsl:variable>
@@ -12427,6 +12717,36 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12427
12717
  </fn>
12428
12718
  </xsl:for-each>
12429
12719
  </xsl:variable>
12720
+
12721
+ <!-- current hierarchy is 'figure' element -->
12722
+ <xsl:variable name="following_dl_colwidths">
12723
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
12724
+ <xsl:variable name="html-table">
12725
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
12726
+ <xsl:element name="{$ns}:table">
12727
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
12728
+ <tbody>
12729
+ <xsl:apply-templates mode="dl"/>
12730
+ </tbody>
12731
+ </xsl:for-each>
12732
+ </xsl:element>
12733
+ </xsl:variable>
12734
+
12735
+ <xsl:call-template name="calculate-column-widths">
12736
+ <xsl:with-param name="cols-count" select="2"/>
12737
+ <xsl:with-param name="table" select="$html-table"/>
12738
+ </xsl:call-template>
12739
+
12740
+ </xsl:if>
12741
+ </xsl:variable>
12742
+
12743
+
12744
+ <xsl:variable name="maxlength_dt">
12745
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
12746
+ <xsl:call-template name="getMaxLength_dt"/>
12747
+ </xsl:for-each>
12748
+ </xsl:variable>
12749
+
12430
12750
  <xsl:if test="xalan:nodeset($references)//fn">
12431
12751
  <fo:block>
12432
12752
  <fo:table width="95%" table-layout="fixed">
@@ -12434,8 +12754,19 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12434
12754
  <xsl:attribute name="font-size">10pt</xsl:attribute>
12435
12755
 
12436
12756
  </xsl:if>
12437
- <fo:table-column column-width="15%"/>
12438
- <fo:table-column column-width="85%"/>
12757
+ <xsl:choose>
12758
+ <!-- if there 'dl', then set same columns width -->
12759
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
12760
+ <xsl:call-template name="setColumnWidth_dl">
12761
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
12762
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
12763
+ </xsl:call-template>
12764
+ </xsl:when>
12765
+ <xsl:otherwise>
12766
+ <fo:table-column column-width="15%"/>
12767
+ <fo:table-column column-width="85%"/>
12768
+ </xsl:otherwise>
12769
+ </xsl:choose>
12439
12770
  <fo:table-body>
12440
12771
  <xsl:for-each select="xalan:nodeset($references)//fn">
12441
12772
  <xsl:variable name="reference" select="@reference"/>
@@ -12467,7 +12798,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12467
12798
  </fo:block>
12468
12799
  </xsl:if>
12469
12800
 
12470
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='fn']">
12801
+ </xsl:template><xsl:template match="*[local-name()='fn']">
12471
12802
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
12472
12803
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
12473
12804
 
@@ -12479,11 +12810,11 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12479
12810
  <xsl:value-of select="@reference"/>
12480
12811
  </fo:basic-link>
12481
12812
  </fo:inline>
12482
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='fn']/*[local-name()='p']">
12813
+ </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
12483
12814
  <fo:inline>
12484
12815
  <xsl:apply-templates/>
12485
12816
  </fo:inline>
12486
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dl']">
12817
+ </xsl:template><xsl:template match="*[local-name()='dl']">
12487
12818
  <xsl:variable name="parent" select="local-name(..)"/>
12488
12819
 
12489
12820
  <xsl:variable name="key_iso">
@@ -12495,8 +12826,13 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12495
12826
 
12496
12827
 
12497
12828
  <fo:block margin-bottom="12pt" text-align="left">
12498
-
12499
- <xsl:text>where </xsl:text>
12829
+
12830
+ <xsl:variable name="title-where">
12831
+ <xsl:call-template name="getTitle">
12832
+ <xsl:with-param name="name" select="'title-where'"/>
12833
+ </xsl:call-template>
12834
+ </xsl:variable>
12835
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
12500
12836
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
12501
12837
  <xsl:text/>
12502
12838
  <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
@@ -12509,15 +12845,25 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12509
12845
 
12510
12846
 
12511
12847
 
12512
- <xsl:text>where</xsl:text>
12848
+ <xsl:variable name="title-where">
12849
+ <xsl:call-template name="getTitle">
12850
+ <xsl:with-param name="name" select="'title-where'"/>
12851
+ </xsl:call-template>
12852
+ </xsl:variable>
12853
+ <xsl:value-of select="$title-where"/>
12513
12854
  </fo:block>
12514
12855
  </xsl:when>
12515
12856
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
12516
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
12857
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
12517
12858
 
12518
12859
 
12519
12860
 
12520
- <xsl:text>Key</xsl:text>
12861
+ <xsl:variable name="title-key">
12862
+ <xsl:call-template name="getTitle">
12863
+ <xsl:with-param name="name" select="'title-key'"/>
12864
+ </xsl:call-template>
12865
+ </xsl:variable>
12866
+ <xsl:value-of select="$title-key"/>
12521
12867
  </fo:block>
12522
12868
  </xsl:when>
12523
12869
  </xsl:choose>
@@ -12528,26 +12874,11 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12528
12874
 
12529
12875
 
12530
12876
 
12877
+
12531
12878
  <fo:block>
12532
12879
 
12533
12880
 
12534
- <!-- create virtual html table for dl/[dt and dd] -->
12535
- <xsl:variable name="html-table">
12536
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
12537
- <xsl:element name="{$ns}:table">
12538
- <tbody>
12539
- <xsl:apply-templates mode="dl"/>
12540
- </tbody>
12541
- </xsl:element>
12542
- </xsl:variable>
12543
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
12544
- <xsl:variable name="colwidths">
12545
- <xsl:call-template name="calculate-column-widths">
12546
- <xsl:with-param name="cols-count" select="2"/>
12547
- <xsl:with-param name="table" select="$html-table"/>
12548
- </xsl:call-template>
12549
- </xsl:variable>
12550
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
12881
+
12551
12882
 
12552
12883
  <fo:table width="95%" table-layout="fixed">
12553
12884
 
@@ -12560,42 +12891,30 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12560
12891
 
12561
12892
  </xsl:when>
12562
12893
  </xsl:choose>
12563
- <xsl:choose>
12564
- <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
12565
- <fo:table-column column-width="50%"/>
12566
- <fo:table-column column-width="50%"/>
12567
- </xsl:when>
12568
- <xsl:otherwise>
12569
- <xsl:choose>
12570
- <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
12571
- <fo:table-column column-width="60%"/>
12572
- <fo:table-column column-width="40%"/>
12573
- </xsl:when> -->
12574
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
12575
- <fo:table-column column-width="50%"/>
12576
- <fo:table-column column-width="50%"/>
12577
- </xsl:when>
12578
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
12579
- <fo:table-column column-width="40%"/>
12580
- <fo:table-column column-width="60%"/>
12581
- </xsl:when>
12582
- <xsl:otherwise>
12583
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
12584
- <xsl:choose>
12585
- <xsl:when test=". = 1">
12586
- <fo:table-column column-width="proportional-column-width(2)"/>
12587
- </xsl:when>
12588
- <xsl:otherwise>
12589
- <fo:table-column column-width="proportional-column-width({.})"/>
12590
- </xsl:otherwise>
12591
- </xsl:choose>
12592
- </xsl:for-each>
12593
- </xsl:otherwise>
12594
- </xsl:choose>
12595
- <!-- <fo:table-column column-width="15%"/>
12596
- <fo:table-column column-width="85%"/> -->
12597
- </xsl:otherwise>
12598
- </xsl:choose>
12894
+ <!-- create virtual html table for dl/[dt and dd] -->
12895
+ <xsl:variable name="html-table">
12896
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
12897
+ <xsl:element name="{$ns}:table">
12898
+ <tbody>
12899
+ <xsl:apply-templates mode="dl"/>
12900
+ </tbody>
12901
+ </xsl:element>
12902
+ </xsl:variable>
12903
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
12904
+ <xsl:variable name="colwidths">
12905
+ <xsl:call-template name="calculate-column-widths">
12906
+ <xsl:with-param name="cols-count" select="2"/>
12907
+ <xsl:with-param name="table" select="$html-table"/>
12908
+ </xsl:call-template>
12909
+ </xsl:variable>
12910
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
12911
+ <xsl:variable name="maxlength_dt">
12912
+ <xsl:call-template name="getMaxLength_dt"/>
12913
+ </xsl:variable>
12914
+ <xsl:call-template name="setColumnWidth_dl">
12915
+ <xsl:with-param name="colwidths" select="$colwidths"/>
12916
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
12917
+ </xsl:call-template>
12599
12918
  <fo:table-body>
12600
12919
  <xsl:apply-templates>
12601
12920
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -12605,7 +12924,61 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12605
12924
  </fo:block>
12606
12925
  </fo:block>
12607
12926
  </xsl:if>
12608
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dl']/*[local-name()='note']">
12927
+ </xsl:template><xsl:template name="setColumnWidth_dl">
12928
+ <xsl:param name="colwidths"/>
12929
+ <xsl:param name="maxlength_dt"/>
12930
+ <xsl:choose>
12931
+ <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
12932
+ <fo:table-column column-width="50%"/>
12933
+ <fo:table-column column-width="50%"/>
12934
+ </xsl:when>
12935
+ <xsl:otherwise>
12936
+ <xsl:choose>
12937
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
12938
+ <fo:table-column column-width="5%"/>
12939
+ <fo:table-column column-width="95%"/>
12940
+ </xsl:when>
12941
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
12942
+ <fo:table-column column-width="10%"/>
12943
+ <fo:table-column column-width="90%"/>
12944
+ </xsl:when>
12945
+ <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
12946
+ <fo:table-column column-width="60%"/>
12947
+ <fo:table-column column-width="40%"/>
12948
+ </xsl:when> -->
12949
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
12950
+ <fo:table-column column-width="50%"/>
12951
+ <fo:table-column column-width="50%"/>
12952
+ </xsl:when>
12953
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
12954
+ <fo:table-column column-width="40%"/>
12955
+ <fo:table-column column-width="60%"/>
12956
+ </xsl:when>
12957
+ <xsl:otherwise>
12958
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
12959
+ <xsl:choose>
12960
+ <xsl:when test=". = 1 or . = 0">
12961
+ <fo:table-column column-width="proportional-column-width(2)"/>
12962
+ </xsl:when>
12963
+ <xsl:otherwise>
12964
+ <fo:table-column column-width="proportional-column-width({.})"/>
12965
+ </xsl:otherwise>
12966
+ </xsl:choose>
12967
+ </xsl:for-each>
12968
+ </xsl:otherwise>
12969
+ </xsl:choose>
12970
+ <!-- <fo:table-column column-width="15%"/>
12971
+ <fo:table-column column-width="85%"/> -->
12972
+ </xsl:otherwise>
12973
+ </xsl:choose>
12974
+ </xsl:template><xsl:template name="getMaxLength_dt">
12975
+ <xsl:for-each select="*[local-name()='dt']">
12976
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
12977
+ <xsl:if test="position() = 1">
12978
+ <xsl:value-of select="string-length(normalize-space(.))"/>
12979
+ </xsl:if>
12980
+ </xsl:for-each>
12981
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
12609
12982
  <xsl:param name="key_iso"/>
12610
12983
 
12611
12984
  <!-- <tr>
@@ -12621,7 +12994,12 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12621
12994
  <xsl:if test="normalize-space($key_iso) = 'true'">
12622
12995
  <xsl:attribute name="margin-top">0</xsl:attribute>
12623
12996
  </xsl:if>
12624
- NOTE
12997
+ <xsl:variable name="title-note">
12998
+ <xsl:call-template name="getTitle">
12999
+ <xsl:with-param name="name" select="'title-note'"/>
13000
+ </xsl:call-template>
13001
+ </xsl:variable>
13002
+ <xsl:value-of select="$title-note"/>
12625
13003
  </fo:block>
12626
13004
  </fo:table-cell>
12627
13005
  <fo:table-cell>
@@ -12630,7 +13008,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12630
13008
  </fo:block>
12631
13009
  </fo:table-cell>
12632
13010
  </fo:table-row>
12633
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dt']" mode="dl">
13011
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
12634
13012
  <tr>
12635
13013
  <td>
12636
13014
  <xsl:apply-templates/>
@@ -12643,11 +13021,12 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12643
13021
  </td>
12644
13022
  </tr>
12645
13023
 
12646
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dt']">
13024
+ </xsl:template><xsl:template match="*[local-name()='dt']">
12647
13025
  <xsl:param name="key_iso"/>
12648
13026
 
12649
13027
  <fo:table-row>
12650
13028
  <fo:table-cell>
13029
+
12651
13030
  <fo:block margin-top="6pt">
12652
13031
 
12653
13032
 
@@ -12657,8 +13036,15 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12657
13036
  </xsl:if>
12658
13037
 
12659
13038
 
12660
- <xsl:apply-templates/>
12661
13039
 
13040
+
13041
+
13042
+ <xsl:apply-templates/>
13043
+ <!-- <xsl:if test="$namespace = 'gb'">
13044
+ <xsl:if test="ancestor::*[local-name()='formula']">
13045
+ <xsl:text>—</xsl:text>
13046
+ </xsl:if>
13047
+ </xsl:if> -->
12662
13048
  </fo:block>
12663
13049
  </fo:table-cell>
12664
13050
  <fo:table-cell>
@@ -12672,37 +13058,37 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12672
13058
  </fo:table-cell>
12673
13059
  </fo:table-row>
12674
13060
 
12675
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']" mode="dl"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']" mode="dl_process">
13061
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
12676
13062
  <xsl:apply-templates/>
12677
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']" mode="process">
13063
+ </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
12678
13064
  <xsl:apply-templates/>
12679
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
13065
+ </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
12680
13066
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
12681
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='em']">
13067
+ </xsl:template><xsl:template match="*[local-name()='em']">
12682
13068
  <fo:inline font-style="italic">
12683
13069
  <xsl:apply-templates/>
12684
13070
  </fo:inline>
12685
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='strong']">
13071
+ </xsl:template><xsl:template match="*[local-name()='strong']">
12686
13072
  <fo:inline font-weight="bold">
12687
13073
  <xsl:apply-templates/>
12688
13074
  </fo:inline>
12689
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='sup']">
13075
+ </xsl:template><xsl:template match="*[local-name()='sup']">
12690
13076
  <fo:inline font-size="80%" vertical-align="super">
12691
13077
  <xsl:apply-templates/>
12692
13078
  </fo:inline>
12693
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='sub']">
13079
+ </xsl:template><xsl:template match="*[local-name()='sub']">
12694
13080
  <fo:inline font-size="80%" vertical-align="sub">
12695
13081
  <xsl:apply-templates/>
12696
13082
  </fo:inline>
12697
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tt']">
12698
- <fo:inline font-family="Courier" font-size="10pt">
13083
+ </xsl:template><xsl:template match="*[local-name()='tt']">
13084
+ <fo:inline font-family="Courier" font-size="10pt">
12699
13085
  <xsl:apply-templates/>
12700
13086
  </fo:inline>
12701
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='del']">
13087
+ </xsl:template><xsl:template match="*[local-name()='del']">
12702
13088
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
12703
13089
  <xsl:apply-templates/>
12704
13090
  </fo:inline>
12705
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()[ancestor::*[local-name()='smallcap']]">
13091
+ </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
12706
13092
  <xsl:variable name="text" select="normalize-space(.)"/>
12707
13093
  <fo:inline font-size="75%">
12708
13094
  <xsl:if test="string-length($text) &gt; 0">
@@ -12711,10 +13097,11 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12711
13097
  </xsl:call-template>
12712
13098
  </xsl:if>
12713
13099
  </fo:inline>
12714
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="recursiveSmallCaps">
13100
+ </xsl:template><xsl:template name="recursiveSmallCaps">
12715
13101
  <xsl:param name="text"/>
12716
13102
  <xsl:variable name="char" select="substring($text,1,1)"/>
12717
- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
13103
+ <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
13104
+ <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
12718
13105
  <xsl:choose>
12719
13106
  <xsl:when test="$char=$upperCase">
12720
13107
  <fo:inline font-size="{100 div 0.75}%">
@@ -12730,7 +13117,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12730
13117
  <xsl:with-param name="text" select="substring($text,2)"/>
12731
13118
  </xsl:call-template>
12732
13119
  </xsl:if>
12733
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="tokenize">
13120
+ </xsl:template><xsl:template name="tokenize">
12734
13121
  <xsl:param name="text"/>
12735
13122
  <xsl:param name="separator" select="' '"/>
12736
13123
  <xsl:choose>
@@ -12778,7 +13165,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12778
13165
  </xsl:call-template>
12779
13166
  </xsl:otherwise>
12780
13167
  </xsl:choose>
12781
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="max_length">
13168
+ </xsl:template><xsl:template name="max_length">
12782
13169
  <xsl:param name="words"/>
12783
13170
  <xsl:for-each select="$words//word">
12784
13171
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -12786,7 +13173,11 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12786
13173
  <xsl:value-of select="."/>
12787
13174
  </xsl:if>
12788
13175
  </xsl:for-each>
12789
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="add-zero-spaces">
13176
+ </xsl:template><xsl:template name="add-zero-spaces-java">
13177
+ <xsl:param name="text" select="."/>
13178
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
13179
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
13180
+ </xsl:template><xsl:template name="add-zero-spaces">
12790
13181
  <xsl:param name="text" select="."/>
12791
13182
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
12792
13183
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
@@ -12839,7 +13230,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12839
13230
  <xsl:value-of select="$text"/>
12840
13231
  </xsl:otherwise>
12841
13232
  </xsl:choose>
12842
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="add-zero-spaces-equal">
13233
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
12843
13234
  <xsl:param name="text" select="."/>
12844
13235
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
12845
13236
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
@@ -12865,7 +13256,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12865
13256
  <xsl:value-of select="$text"/>
12866
13257
  </xsl:otherwise>
12867
13258
  </xsl:choose>
12868
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="getSimpleTable">
13259
+ </xsl:template><xsl:template name="getSimpleTable">
12869
13260
  <xsl:variable name="simple-table">
12870
13261
 
12871
13262
  <!-- Step 1. colspan processing -->
@@ -12892,9 +13283,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12892
13283
  </xsl:choose> -->
12893
13284
  </xsl:variable>
12894
13285
  <xsl:copy-of select="$simple-table"/>
12895
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
13286
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
12896
13287
  <xsl:apply-templates mode="simple-table-colspan"/>
12897
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
13288
+ </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
12898
13289
  <xsl:choose>
12899
13290
  <xsl:when test="@colspan">
12900
13291
  <xsl:variable name="td">
@@ -12916,16 +13307,16 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12916
13307
  </xsl:element>
12917
13308
  </xsl:otherwise>
12918
13309
  </xsl:choose>
12919
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="@colspan" mode="simple-table-colspan"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tr']" mode="simple-table-colspan">
13310
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
12920
13311
  <xsl:element name="tr">
12921
13312
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
12922
13313
  <xsl:apply-templates mode="simple-table-colspan"/>
12923
13314
  </xsl:element>
12924
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="@*|node()" mode="simple-table-colspan">
13315
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
12925
13316
  <xsl:copy>
12926
13317
  <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
12927
13318
  </xsl:copy>
12928
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="repeatNode">
13319
+ </xsl:template><xsl:template name="repeatNode">
12929
13320
  <xsl:param name="count"/>
12930
13321
  <xsl:param name="node"/>
12931
13322
 
@@ -12936,18 +13327,18 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12936
13327
  </xsl:call-template>
12937
13328
  <xsl:copy-of select="$node"/>
12938
13329
  </xsl:if>
12939
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="@*|node()" mode="simple-table-rowspan">
13330
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
12940
13331
  <xsl:copy>
12941
13332
  <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
12942
13333
  </xsl:copy>
12943
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="tbody" mode="simple-table-rowspan">
13334
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
12944
13335
  <xsl:copy>
12945
13336
  <xsl:copy-of select="tr[1]"/>
12946
13337
  <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
12947
13338
  <xsl:with-param name="previousRow" select="tr[1]"/>
12948
13339
  </xsl:apply-templates>
12949
13340
  </xsl:copy>
12950
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="tr" mode="simple-table-rowspan">
13341
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
12951
13342
  <xsl:param name="previousRow"/>
12952
13343
  <xsl:variable name="currentRow" select="."/>
12953
13344
 
@@ -12981,43 +13372,53 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12981
13372
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
12982
13373
  <xsl:with-param name="previousRow" select="$newRow"/>
12983
13374
  </xsl:apply-templates>
12984
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="getLang">
13375
+ </xsl:template><xsl:template name="getLang">
12985
13376
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
12986
13377
  <xsl:choose>
12987
13378
  <xsl:when test="$language = 'English'">en</xsl:when>
12988
13379
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
12989
13380
  </xsl:choose>
12990
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="capitalizeWords">
13381
+ </xsl:template><xsl:template name="capitalizeWords">
12991
13382
  <xsl:param name="str"/>
12992
13383
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
12993
13384
  <xsl:choose>
12994
13385
  <xsl:when test="contains($str2, ' ')">
12995
13386
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
12996
- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
12997
- <xsl:value-of select="substring($substr, 2)"/>
13387
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
13388
+ <xsl:value-of select="substring($substr, 2)"/> -->
13389
+ <xsl:call-template name="capitalize">
13390
+ <xsl:with-param name="str" select="$substr"/>
13391
+ </xsl:call-template>
12998
13392
  <xsl:text> </xsl:text>
12999
13393
  <xsl:call-template name="capitalizeWords">
13000
13394
  <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
13001
13395
  </xsl:call-template>
13002
13396
  </xsl:when>
13003
13397
  <xsl:otherwise>
13004
- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
13005
- <xsl:value-of select="substring($str2, 2)"/>
13398
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
13399
+ <xsl:value-of select="substring($str2, 2)"/> -->
13400
+ <xsl:call-template name="capitalize">
13401
+ <xsl:with-param name="str" select="$str2"/>
13402
+ </xsl:call-template>
13006
13403
  </xsl:otherwise>
13007
13404
  </xsl:choose>
13008
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="mathml:math">
13405
+ </xsl:template><xsl:template name="capitalize">
13406
+ <xsl:param name="str"/>
13407
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
13408
+ <xsl:value-of select="substring($str, 2)"/>
13409
+ </xsl:template><xsl:template match="mathml:math">
13009
13410
  <fo:inline font-family="STIX2Math">
13010
13411
  <fo:instream-foreign-object fox:alt-text="Math">
13011
13412
  <xsl:copy-of select="."/>
13012
13413
  </fo:instream-foreign-object>
13013
13414
  </fo:inline>
13014
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='localityStack']">
13415
+ </xsl:template><xsl:template match="*[local-name()='localityStack']">
13015
13416
  <xsl:for-each select="*[local-name()='locality']">
13016
13417
  <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
13017
13418
  <xsl:apply-templates select="."/>
13018
13419
  <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
13019
13420
  </xsl:for-each>
13020
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='link']" name="link">
13421
+ </xsl:template><xsl:template match="*[local-name()='link']" name="link">
13021
13422
  <xsl:variable name="target">
13022
13423
  <xsl:choose>
13023
13424
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -13047,4 +13448,244 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
13047
13448
  </xsl:otherwise>
13048
13449
  </xsl:choose>
13049
13450
  </fo:inline>
13451
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
13452
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
13453
+ <!-- <xsl:choose>
13454
+ <xsl:when test="@lang = 'en'"></xsl:when>
13455
+ <xsl:otherwise> -->
13456
+ <xsl:attribute name="white-space">pre</xsl:attribute>
13457
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
13458
+ <!-- </xsl:otherwise>
13459
+ </xsl:choose> -->
13460
+ <xsl:apply-templates/>
13461
+ </fo:block>
13462
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
13463
+ <fo:inline id="{@id}"/>
13464
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
13465
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
13466
+ <xsl:variable name="title-appendix">
13467
+ <xsl:call-template name="getTitle">
13468
+ <xsl:with-param name="name" select="'title-appendix'"/>
13469
+ </xsl:call-template>
13470
+ </xsl:variable>
13471
+ <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
13472
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
13473
+ </fo:block>
13474
+ <xsl:apply-templates/>
13475
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
13476
+ <fo:inline><xsl:apply-templates/></fo:inline>
13477
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
13478
+ <fo:block xsl:use-attribute-sets="appendix-example-style">
13479
+ <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
13480
+ <xsl:variable name="title-example">
13481
+ <xsl:call-template name="getTitle">
13482
+ <xsl:with-param name="name" select="'title-example'"/>
13483
+ </xsl:call-template>
13484
+ </xsl:variable>
13485
+ <xsl:value-of select="$title-example"/>
13486
+ <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
13487
+ <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
13488
+ </xsl:if>
13489
+ <xsl:if test="*[local-name()='name']">
13490
+ <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
13491
+ </xsl:if>
13492
+ </fo:block>
13493
+ <xsl:apply-templates/>
13494
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
13495
+ <fo:inline><xsl:apply-templates/></fo:inline>
13496
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
13497
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
13498
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
13499
+ <xsl:variable name="annotation-id" select="@id"/>
13500
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
13501
+ <fo:block id="{$annotation-id}" white-space="nowrap">
13502
+ <fo:inline>
13503
+ <xsl:apply-templates>
13504
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
13505
+ </xsl:apply-templates>
13506
+ </fo:inline>
13507
+ </fo:block>
13508
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
13509
+ <xsl:param name="callout"/>
13510
+ <fo:inline id="{@id}">
13511
+ <!-- for first p in annotation, put <x> -->
13512
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
13513
+ <xsl:apply-templates/>
13514
+ </fo:inline>
13515
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
13516
+ <xsl:variable name="title-modified">
13517
+ <xsl:call-template name="getTitle">
13518
+ <xsl:with-param name="name" select="'title-modified'"/>
13519
+ </xsl:call-template>
13520
+ </xsl:variable>
13521
+ <xsl:choose>
13522
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
13523
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
13524
+ </xsl:choose>
13525
+ <xsl:apply-templates/>
13526
+ </xsl:template><xsl:template name="convertDate">
13527
+ <xsl:param name="date"/>
13528
+ <xsl:param name="format" select="'short'"/>
13529
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
13530
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
13531
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
13532
+ <xsl:variable name="monthStr">
13533
+ <xsl:choose>
13534
+ <xsl:when test="$month = '01'">January</xsl:when>
13535
+ <xsl:when test="$month = '02'">February</xsl:when>
13536
+ <xsl:when test="$month = '03'">March</xsl:when>
13537
+ <xsl:when test="$month = '04'">April</xsl:when>
13538
+ <xsl:when test="$month = '05'">May</xsl:when>
13539
+ <xsl:when test="$month = '06'">June</xsl:when>
13540
+ <xsl:when test="$month = '07'">July</xsl:when>
13541
+ <xsl:when test="$month = '08'">August</xsl:when>
13542
+ <xsl:when test="$month = '09'">September</xsl:when>
13543
+ <xsl:when test="$month = '10'">October</xsl:when>
13544
+ <xsl:when test="$month = '11'">November</xsl:when>
13545
+ <xsl:when test="$month = '12'">December</xsl:when>
13546
+ </xsl:choose>
13547
+ </xsl:variable>
13548
+ <xsl:variable name="result">
13549
+ <xsl:choose>
13550
+ <xsl:when test="$format = 'short' or $day = ''">
13551
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
13552
+ </xsl:when>
13553
+ <xsl:otherwise>
13554
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
13555
+ </xsl:otherwise>
13556
+ </xsl:choose>
13557
+ </xsl:variable>
13558
+ <xsl:value-of select="$result"/>
13559
+ </xsl:template><xsl:template name="insertKeywords">
13560
+ <xsl:param name="sorting" select="'true'"/>
13561
+ <xsl:param name="charAtEnd" select="'.'"/>
13562
+ <xsl:param name="charDelim" select="', '"/>
13563
+ <xsl:choose>
13564
+ <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
13565
+ <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13566
+ <xsl:sort data-type="text" order="ascending"/>
13567
+ <xsl:call-template name="insertKeyword">
13568
+ <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
13569
+ <xsl:with-param name="charDelim" select="$charDelim"/>
13570
+ </xsl:call-template>
13571
+ </xsl:for-each>
13572
+ </xsl:when>
13573
+ <xsl:otherwise>
13574
+ <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13575
+ <xsl:call-template name="insertKeyword">
13576
+ <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
13577
+ <xsl:with-param name="charDelim" select="$charDelim"/>
13578
+ </xsl:call-template>
13579
+ </xsl:for-each>
13580
+ </xsl:otherwise>
13581
+ </xsl:choose>
13582
+ </xsl:template><xsl:template name="insertKeyword">
13583
+ <xsl:param name="charAtEnd"/>
13584
+ <xsl:param name="charDelim"/>
13585
+ <xsl:apply-templates/>
13586
+ <xsl:choose>
13587
+ <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
13588
+ <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
13589
+ </xsl:choose>
13590
+ </xsl:template><xsl:template name="addPDFUAmeta">
13591
+ <fo:declarations>
13592
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
13593
+ <pdf:dictionary type="normal" key="ViewerPreferences">
13594
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
13595
+ </pdf:dictionary>
13596
+ </pdf:catalog>
13597
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
13598
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
13599
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
13600
+ <!-- Dublin Core properties go here -->
13601
+ <dc:title>
13602
+ <xsl:variable name="title">
13603
+
13604
+ <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
13605
+
13606
+
13607
+
13608
+
13609
+ </xsl:variable>
13610
+ <xsl:choose>
13611
+ <xsl:when test="normalize-space($title) != ''">
13612
+ <xsl:value-of select="$title"/>
13613
+ </xsl:when>
13614
+ <xsl:otherwise>
13615
+ <xsl:text> </xsl:text>
13616
+ </xsl:otherwise>
13617
+ </xsl:choose>
13618
+ </dc:title>
13619
+ <dc:creator>
13620
+
13621
+
13622
+ </dc:creator>
13623
+ <dc:description>
13624
+ <xsl:variable name="abstract">
13625
+
13626
+
13627
+
13628
+ <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
13629
+
13630
+
13631
+ </xsl:variable>
13632
+ <xsl:value-of select="normalize-space($abstract)"/>
13633
+ </dc:description>
13634
+ <pdf:Keywords>
13635
+ <xsl:call-template name="insertKeywords"/>
13636
+ </pdf:Keywords>
13637
+ </rdf:Description>
13638
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
13639
+ <!-- XMP properties go here -->
13640
+ <xmp:CreatorTool/>
13641
+ </rdf:Description>
13642
+ </rdf:RDF>
13643
+ </x:xmpmeta>
13644
+ </fo:declarations>
13645
+ </xsl:template><xsl:template name="getId">
13646
+ <xsl:choose>
13647
+ <xsl:when test="../@id">
13648
+ <xsl:value-of select="../@id"/>
13649
+ </xsl:when>
13650
+ <xsl:otherwise>
13651
+ <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
13652
+ <xsl:value-of select="concat(generate-id(..), '_', text())"/>
13653
+ </xsl:otherwise>
13654
+ </xsl:choose>
13655
+ </xsl:template><xsl:template name="getLevel">
13656
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
13657
+ <xsl:variable name="level">
13658
+ <xsl:choose>
13659
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
13660
+ <xsl:value-of select="$level_total - 2"/>
13661
+ </xsl:when>
13662
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
13663
+ <xsl:value-of select="$level_total - 2"/>
13664
+ </xsl:when>
13665
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
13666
+ <xsl:value-of select="$level_total - 2"/>
13667
+ </xsl:when>
13668
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
13669
+ <xsl:otherwise>
13670
+ <xsl:value-of select="$level_total - 1"/>
13671
+ </xsl:otherwise>
13672
+ </xsl:choose>
13673
+ </xsl:variable>
13674
+ <xsl:value-of select="$level"/>
13675
+ </xsl:template><xsl:template name="getSubSection">
13676
+ <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
13677
+ </xsl:template><xsl:template name="split">
13678
+ <xsl:param name="pText" select="."/>
13679
+ <xsl:param name="sep" select="','"/>
13680
+ <xsl:if test="string-length($pText) &gt;0">
13681
+ <item>
13682
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
13683
+ </item>
13684
+ <xsl:call-template name="split">
13685
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
13686
+ <xsl:with-param name="sep" select="$sep"/>
13687
+ </xsl:call-template>
13688
+ </xsl:if>
13689
+ </xsl:template><xsl:template name="getDocumentId">
13690
+ <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
13050
13691
  </xsl:template></xsl:stylesheet>