metanorma-un 0.3.7 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +8 -0
- data/.github/workflows/ubuntu.yml +10 -0
- data/.github/workflows/windows.yml +8 -0
- data/lib/asciidoctor/un/biblio.rng +36 -6
- data/lib/asciidoctor/un/boilerplate.xml +1 -1
- data/lib/asciidoctor/un/converter.rb +28 -18
- data/lib/asciidoctor/un/isodoc.rng +450 -4
- data/lib/asciidoctor/un/reqt.rng +23 -0
- data/lib/asciidoctor/un/un.rng +111 -0
- data/lib/isodoc/un.rb +1 -0
- data/lib/isodoc/un/base_convert.rb +23 -172
- data/lib/isodoc/un/html/scripts.html +10 -7
- data/lib/isodoc/un/html/word_unece_plenary_titlepage.html +9187 -101
- data/lib/isodoc/un/html_convert.rb +6 -5
- data/lib/isodoc/un/metadata.rb +4 -1
- data/lib/isodoc/un/pdf_convert.rb +7 -12
- data/lib/isodoc/un/presentation_xml_convert.rb +10 -0
- data/lib/isodoc/un/un.plenary-attachment.xsl +4241 -0
- data/lib/isodoc/un/un.plenary.xsl +1057 -336
- data/lib/isodoc/un/un.recommendation.xsl +1030 -301
- data/lib/isodoc/un/word_convert.rb +3 -7
- data/lib/isodoc/un/xref.rb +186 -0
- data/lib/metanorma/un/processor.rb +12 -6
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -2
- metadata +13 -12
- data/lib/isodoc/un/html/scripts.pdf.html +0 -72
@@ -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" xmlns:barcode="http://barcode4j.krysalis.org/ns" 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:barcode="http://barcode4j.krysalis.org/ns" 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
|
|
@@ -9,6 +9,8 @@
|
|
9
9
|
<xsl:variable name="pageWidth" select="'210mm'"/>
|
10
10
|
<xsl:variable name="pageHeight" select="'297mm'"/>
|
11
11
|
|
12
|
+
<xsl:variable name="debug">false</xsl:variable>
|
13
|
+
|
12
14
|
<xsl:variable name="contents">
|
13
15
|
<contents>
|
14
16
|
<xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/>
|
@@ -60,42 +62,7 @@
|
|
60
62
|
</fo:page-sequence-master>
|
61
63
|
</fo:layout-master-set>
|
62
64
|
|
63
|
-
<
|
64
|
-
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
65
|
-
<pdf:dictionary type="normal" key="ViewerPreferences">
|
66
|
-
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
67
|
-
</pdf:dictionary>
|
68
|
-
</pdf:catalog>
|
69
|
-
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
70
|
-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
71
|
-
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
72
|
-
<!-- Dublin Core properties go here -->
|
73
|
-
<dc:title>
|
74
|
-
<xsl:choose>
|
75
|
-
<xsl:when test="$title != ''">
|
76
|
-
<xsl:value-of select="$title"/>
|
77
|
-
</xsl:when>
|
78
|
-
<xsl:otherwise>
|
79
|
-
<xsl:text> </xsl:text>
|
80
|
-
</xsl:otherwise>
|
81
|
-
</xsl:choose>
|
82
|
-
</dc:title>
|
83
|
-
<dc:creator/>
|
84
|
-
<dc:description>
|
85
|
-
<xsl:variable name="abstract">
|
86
|
-
<xsl:copy-of select="/un:un-standard/un:preface/un:abstract//text()"/>
|
87
|
-
</xsl:variable>
|
88
|
-
<xsl:value-of select="normalize-space($abstract)"/>
|
89
|
-
</dc:description>
|
90
|
-
<pdf:Keywords/>
|
91
|
-
</rdf:Description>
|
92
|
-
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
93
|
-
<!-- XMP properties go here -->
|
94
|
-
<xmp:CreatorTool/>
|
95
|
-
</rdf:Description>
|
96
|
-
</rdf:RDF>
|
97
|
-
</x:xmpmeta>
|
98
|
-
</fo:declarations>
|
65
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
99
66
|
|
100
67
|
<!-- Cover Page -->
|
101
68
|
<fo:page-sequence master-reference="cover-page" force-page-count="no-force">
|
@@ -166,7 +133,7 @@
|
|
166
133
|
<xsl:value-of select="/un:un-standard/un:bibdata/un:ext/un:session/un:date"/>
|
167
134
|
</fo:block>
|
168
135
|
<fo:block font-weight="normal">
|
169
|
-
<xsl:text>Item 1 of the </xsl:text><xsl:value-of select="
|
136
|
+
<xsl:text>Item 1 of the </xsl:text><xsl:value-of select="java:toLowerCase(java:java.lang.String.new(/un:un-standard/un:sections/un:clause[1]/un:title))"/>
|
170
137
|
</fo:block>
|
171
138
|
<fo:block>
|
172
139
|
<xsl:value-of select="translate(/un:un-standard/un:sections/un:clause[1]/un:ol[1]/un:li[1]/un:p[1], '.', '')"/>
|
@@ -259,10 +226,12 @@
|
|
259
226
|
<xsl:call-template name="insertHeaderFooter"/>
|
260
227
|
<fo:flow flow-name="xsl-region-body">
|
261
228
|
|
262
|
-
<xsl:
|
263
|
-
|
264
|
-
|
265
|
-
|
229
|
+
<xsl:if test="$debug = 'true'">
|
230
|
+
<xsl:text disable-output-escaping="yes"><!--</xsl:text>
|
231
|
+
DEBUG
|
232
|
+
contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
|
233
|
+
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
234
|
+
</xsl:if>
|
266
235
|
|
267
236
|
<fo:block>
|
268
237
|
<xsl:apply-templates select="/un:un-standard/un:sections/*"/>
|
@@ -295,14 +264,7 @@
|
|
295
264
|
<!-- Any node with title element - clause, definition, annex,... -->
|
296
265
|
<xsl:template match="un:title | un:preferred" mode="contents">
|
297
266
|
<xsl:variable name="id">
|
298
|
-
<xsl:
|
299
|
-
<xsl:when test="../@id">
|
300
|
-
<xsl:value-of select="../@id"/>
|
301
|
-
</xsl:when>
|
302
|
-
<xsl:otherwise>
|
303
|
-
<xsl:value-of select="text()"/>
|
304
|
-
</xsl:otherwise>
|
305
|
-
</xsl:choose>
|
267
|
+
<xsl:call-template name="getId"/>
|
306
268
|
</xsl:variable>
|
307
269
|
|
308
270
|
<xsl:variable name="level">
|
@@ -325,7 +287,12 @@
|
|
325
287
|
<item id="{$id}" level="{$level}" section="{$section}" display="false" type="{$type}">
|
326
288
|
<xsl:if test="$type = 'clause'">
|
327
289
|
<xsl:attribute name="section">
|
328
|
-
<xsl:
|
290
|
+
<xsl:variable name="title-clause">
|
291
|
+
<xsl:call-template name="getTitle">
|
292
|
+
<xsl:with-param name="name" select="'title-clause'"/>
|
293
|
+
</xsl:call-template>
|
294
|
+
</xsl:variable>
|
295
|
+
<xsl:value-of select="$title-clause"/>
|
329
296
|
<xsl:choose>
|
330
297
|
<xsl:when test="ancestor::un:sections">
|
331
298
|
<!-- 1, 2, 3, 4, ... from main section (not annex ...) -->
|
@@ -349,7 +316,12 @@
|
|
349
316
|
<xsl:when test="ancestor::un:annex">
|
350
317
|
<xsl:choose>
|
351
318
|
<xsl:when test="$level = 1">
|
352
|
-
<xsl:
|
319
|
+
<xsl:variable name="title-annex">
|
320
|
+
<xsl:call-template name="getTitle">
|
321
|
+
<xsl:with-param name="name" select="'title-annex'"/>
|
322
|
+
</xsl:call-template>
|
323
|
+
</xsl:variable>
|
324
|
+
<xsl:value-of select="$title-annex"/>
|
353
325
|
<xsl:number format="A" level="any" count="un:annex"/>
|
354
326
|
</xsl:when>
|
355
327
|
<xsl:otherwise>
|
@@ -380,7 +352,12 @@
|
|
380
352
|
<xsl:template match="un:figure" mode="contents">
|
381
353
|
<item level="" id="{@id}" type="figure">
|
382
354
|
<xsl:attribute name="section">
|
383
|
-
<xsl:
|
355
|
+
<xsl:variable name="title-figure">
|
356
|
+
<xsl:call-template name="getTitle">
|
357
|
+
<xsl:with-param name="name" select="'title-figure'"/>
|
358
|
+
</xsl:call-template>
|
359
|
+
</xsl:variable>
|
360
|
+
<xsl:value-of select="$title-figure"/>
|
384
361
|
<xsl:choose>
|
385
362
|
<xsl:when test="ancestor::un:annex">
|
386
363
|
<xsl:choose>
|
@@ -412,7 +389,12 @@
|
|
412
389
|
<xsl:variable name="annex-id" select="ancestor::un:annex/@id"/>
|
413
390
|
<item level="" id="{@id}" display="false" type="table">
|
414
391
|
<xsl:attribute name="section">
|
415
|
-
<xsl:
|
392
|
+
<xsl:variable name="title-table">
|
393
|
+
<xsl:call-template name="getTitle">
|
394
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
395
|
+
</xsl:call-template>
|
396
|
+
</xsl:variable>
|
397
|
+
<xsl:value-of select="$title-table"/>
|
416
398
|
<xsl:choose>
|
417
399
|
<xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
|
418
400
|
<xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
|
@@ -435,7 +417,12 @@
|
|
435
417
|
<xsl:template match="un:formula" mode="contents">
|
436
418
|
<item level="" id="{@id}" display="false">
|
437
419
|
<xsl:attribute name="section">
|
438
|
-
<xsl:
|
420
|
+
<xsl:variable name="title-formula">
|
421
|
+
<xsl:call-template name="getTitle">
|
422
|
+
<xsl:with-param name="name" select="'title-formula'"/>
|
423
|
+
</xsl:call-template>
|
424
|
+
</xsl:variable>
|
425
|
+
<xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="un:annex | un:formula"/>
|
439
426
|
</xsl:attribute>
|
440
427
|
</item>
|
441
428
|
</xsl:template>
|
@@ -464,7 +451,12 @@
|
|
464
451
|
<item level="" id="{@id}" display="false" type="Terms">
|
465
452
|
<xsl:if test="ancestor::un:annex">
|
466
453
|
<xsl:attribute name="section">
|
467
|
-
<xsl:
|
454
|
+
<xsl:variable name="title-appendix">
|
455
|
+
<xsl:call-template name="getTitle">
|
456
|
+
<xsl:with-param name="name" select="'title-appendix'"/>
|
457
|
+
</xsl:call-template>
|
458
|
+
</xsl:variable>
|
459
|
+
<xsl:value-of select="$title-appendix"/><xsl:number format="A" count="un:annex"/>
|
468
460
|
</xsl:attribute>
|
469
461
|
</xsl:if>
|
470
462
|
</item>
|
@@ -474,7 +466,12 @@
|
|
474
466
|
<item level="" id="{@id}" display="false" type="References">
|
475
467
|
<xsl:if test="ancestor::un:annex">
|
476
468
|
<xsl:attribute name="section">
|
477
|
-
<xsl:
|
469
|
+
<xsl:variable name="title-appendix">
|
470
|
+
<xsl:call-template name="getTitle">
|
471
|
+
<xsl:with-param name="name" select="'title-appendix'"/>
|
472
|
+
</xsl:call-template>
|
473
|
+
</xsl:variable>
|
474
|
+
<xsl:value-of select="$title-appendix"/><xsl:number format="A" count="un:annex"/>
|
478
475
|
</xsl:attribute>
|
479
476
|
</xsl:if>
|
480
477
|
</item>
|
@@ -486,7 +483,12 @@
|
|
486
483
|
<xsl:variable name="num">
|
487
484
|
<xsl:number/>
|
488
485
|
</xsl:variable>
|
489
|
-
<xsl:
|
486
|
+
<xsl:variable name="title-box">
|
487
|
+
<xsl:call-template name="getTitle">
|
488
|
+
<xsl:with-param name="name" select="'title-box'"/>
|
489
|
+
</xsl:call-template>
|
490
|
+
</xsl:variable>
|
491
|
+
<xsl:value-of select="$title-box"/><xsl:value-of select="$num"/>
|
490
492
|
</xsl:attribute>
|
491
493
|
</item>
|
492
494
|
</xsl:template>
|
@@ -508,7 +510,12 @@
|
|
508
510
|
<fo:table-body>
|
509
511
|
<fo:table-row>
|
510
512
|
<fo:table-cell padding-left="6mm" padding-top="2.5mm">
|
511
|
-
<
|
513
|
+
<xsl:variable name="title-summary">
|
514
|
+
<xsl:call-template name="getTitle">
|
515
|
+
<xsl:with-param name="name" select="'title-summary'"/>
|
516
|
+
</xsl:call-template>
|
517
|
+
</xsl:variable>
|
518
|
+
<fo:block font-size="12pt" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-summary"/></fo:block>
|
512
519
|
</fo:table-cell>
|
513
520
|
<fo:table-cell>
|
514
521
|
<fo:block> </fo:block>
|
@@ -655,7 +662,12 @@
|
|
655
662
|
<xsl:template match="un:ul//un:note | un:ol//un:note"/>
|
656
663
|
<xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process">
|
657
664
|
<fo:block font-size="11pt" margin-top="4pt">
|
658
|
-
<xsl:
|
665
|
+
<xsl:variable name="title-note">
|
666
|
+
<xsl:call-template name="getTitle">
|
667
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
668
|
+
</xsl:call-template>
|
669
|
+
</xsl:variable>
|
670
|
+
<xsl:value-of select="$title-note"/>
|
659
671
|
<xsl:if test="../following-sibling::un:note or ../preceding-sibling::un:note">
|
660
672
|
<xsl:number count="un:note"/><xsl:text> </xsl:text>
|
661
673
|
</xsl:if>
|
@@ -716,20 +728,13 @@
|
|
716
728
|
</fo:block>
|
717
729
|
</xsl:template>
|
718
730
|
|
719
|
-
<xsl:template match="un:link">
|
720
|
-
<fo:
|
731
|
+
<xsl:template match="un:link" priority="2">
|
732
|
+
<fo:inline>
|
721
733
|
<xsl:if test="ancestor::un:fn and string-length(@target) > 110">
|
722
734
|
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
723
735
|
</xsl:if>
|
724
|
-
<xsl:
|
725
|
-
|
726
|
-
<xsl:value-of select="@target"/>
|
727
|
-
</xsl:when>
|
728
|
-
<xsl:otherwise>
|
729
|
-
<xsl:apply-templates/>
|
730
|
-
</xsl:otherwise>
|
731
|
-
</xsl:choose>
|
732
|
-
</fo:basic-link>
|
736
|
+
<xsl:call-template name="link"/>
|
737
|
+
</fo:inline>
|
733
738
|
</xsl:template>
|
734
739
|
|
735
740
|
<xsl:template match="un:xref">
|
@@ -744,12 +749,17 @@
|
|
744
749
|
</xsl:template>
|
745
750
|
|
746
751
|
<xsl:template match="un:admonition">
|
752
|
+
<xsl:variable name="title-box">
|
753
|
+
<xsl:call-template name="getTitle">
|
754
|
+
<xsl:with-param name="name" select="'title-box'"/>
|
755
|
+
</xsl:call-template>
|
756
|
+
</xsl:variable>
|
747
757
|
<fo:block text-align="center" font-style="italic" keep-with-next="always" margin-bottom="6pt">
|
748
|
-
<xsl:
|
758
|
+
<xsl:value-of select="$title-box"/><xsl:number/><xsl:text>: </xsl:text><xsl:apply-templates select="un:name" mode="process"/>
|
749
759
|
</fo:block>
|
750
760
|
<fo:block-container border="0.25pt solid black" margin-left="-3mm" margin-right="-3mm" padding-top="4mm">
|
751
761
|
<fo:block id="{@id}" font-weight="bold" margin-left="6mm" margin-right="6mm" keep-with-next="always">
|
752
|
-
<xsl:
|
762
|
+
<xsl:value-of select="$title-box"/><xsl:number/><xsl:text>: </xsl:text><xsl:apply-templates select="un:name" mode="process"/>
|
753
763
|
</fo:block>
|
754
764
|
<fo:block margin-left="5mm" margin-right="5mm">
|
755
765
|
<xsl:apply-templates/>
|
@@ -816,14 +826,7 @@
|
|
816
826
|
|
817
827
|
<xsl:template match="un:title">
|
818
828
|
<xsl:variable name="id">
|
819
|
-
<xsl:
|
820
|
-
<xsl:when test="../@id">
|
821
|
-
<xsl:value-of select="../@id"/>
|
822
|
-
</xsl:when>
|
823
|
-
<xsl:otherwise>
|
824
|
-
<xsl:value-of select="text()"/>
|
825
|
-
</xsl:otherwise>
|
826
|
-
</xsl:choose>
|
829
|
+
<xsl:call-template name="getId"/>
|
827
830
|
</xsl:variable>
|
828
831
|
|
829
832
|
<xsl:variable name="level">
|
@@ -934,7 +937,12 @@
|
|
934
937
|
<xsl:template match="un:recommendation">
|
935
938
|
<fo:block margin-left="20mm">
|
936
939
|
<fo:block font-weight="bold">
|
937
|
-
<xsl:
|
940
|
+
<xsl:variable name="title-recommendation">
|
941
|
+
<xsl:call-template name="getTitle">
|
942
|
+
<xsl:with-param name="name" select="'title-recommendation'"/>
|
943
|
+
</xsl:call-template>
|
944
|
+
</xsl:variable>
|
945
|
+
<xsl:value-of select="$title-recommendation"/>
|
938
946
|
<xsl:choose>
|
939
947
|
<xsl:when test="ancestor::un:sections">
|
940
948
|
<xsl:number level="any" count="un:sections//un:recommendation"/>
|
@@ -1004,7 +1012,12 @@
|
|
1004
1012
|
</fo:block>
|
1005
1013
|
<xsl:if test="un:name">
|
1006
1014
|
<fo:block text-align="center" margin-bottom="6pt" keep-with-previous="always">
|
1007
|
-
<xsl:
|
1015
|
+
<xsl:variable name="title-figure">
|
1016
|
+
<xsl:call-template name="getTitle">
|
1017
|
+
<xsl:with-param name="name" select="'title-figure'"/>
|
1018
|
+
</xsl:call-template>
|
1019
|
+
</xsl:variable>
|
1020
|
+
<xsl:value-of select="$title-figure"/>
|
1008
1021
|
<xsl:choose>
|
1009
1022
|
<xsl:when test="ancestor::un:annex">
|
1010
1023
|
<xsl:choose>
|
@@ -1135,7 +1148,12 @@
|
|
1135
1148
|
|
1136
1149
|
<xsl:template match="un:note/un:p | un:annex//un:note/un:p" name="note">
|
1137
1150
|
<fo:block font-size="10pt" space-after="12pt" text-indent="0">
|
1138
|
-
<
|
1151
|
+
<xsl:variable name="title-note">
|
1152
|
+
<xsl:call-template name="getTitle">
|
1153
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
1154
|
+
</xsl:call-template>
|
1155
|
+
</xsl:variable>
|
1156
|
+
<fo:inline padding-right="4mm"><xsl:value-of select="$title-note"/>
|
1139
1157
|
<xsl:if test="../following-sibling::un:note or ../preceding-sibling::un:note">
|
1140
1158
|
<xsl:number count="un:note"/><xsl:text> </xsl:text>
|
1141
1159
|
</xsl:if>
|
@@ -1146,12 +1164,17 @@
|
|
1146
1164
|
|
1147
1165
|
<xsl:template match="un:termnote">
|
1148
1166
|
<fo:block margin-top="4pt">
|
1149
|
-
<xsl:
|
1150
|
-
<xsl:
|
1151
|
-
<xsl:
|
1152
|
-
</xsl:
|
1153
|
-
|
1154
|
-
|
1167
|
+
<xsl:variable name="title-note">
|
1168
|
+
<xsl:call-template name="getTitle">
|
1169
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
1170
|
+
</xsl:call-template>
|
1171
|
+
</xsl:variable>
|
1172
|
+
<xsl:value-of select="$title-note"/>
|
1173
|
+
<xsl:if test="following-sibling::un:termnote or preceding-sibling::un:termnote">
|
1174
|
+
<xsl:number/><xsl:text> </xsl:text>
|
1175
|
+
</xsl:if>
|
1176
|
+
<xsl:text>– </xsl:text>
|
1177
|
+
<xsl:apply-templates/>
|
1155
1178
|
</fo:block>
|
1156
1179
|
</xsl:template>
|
1157
1180
|
|
@@ -1179,7 +1202,7 @@
|
|
1179
1202
|
<fo:table-cell> <!-- display-align="center" -->
|
1180
1203
|
<fo:block text-align="right">
|
1181
1204
|
<xsl:if test="not(ancestor::un:annex)">
|
1182
|
-
<xsl:
|
1205
|
+
<xsl:number format="(1)" level="any"/>
|
1183
1206
|
</xsl:if>
|
1184
1207
|
<xsl:if test="ancestor::un:annex">
|
1185
1208
|
<xsl:variable name="annex-id" select="ancestor::un:annex/@id"/>
|
@@ -1203,7 +1226,12 @@
|
|
1203
1226
|
</xsl:template>
|
1204
1227
|
|
1205
1228
|
<xsl:template match="un:example">
|
1206
|
-
<
|
1229
|
+
<xsl:variable name="title-example">
|
1230
|
+
<xsl:call-template name="getTitle">
|
1231
|
+
<xsl:with-param name="name" select="'title-example'"/>
|
1232
|
+
</xsl:call-template>
|
1233
|
+
</xsl:variable>
|
1234
|
+
<fo:block id="{@id}" font-size="10pt" font-weight="bold" margin-bottom="12pt"><xsl:value-of select="$title-example"/></fo:block>
|
1207
1235
|
<fo:block font-size="11pt" margin-top="12pt" margin-bottom="12pt" margin-left="15mm">
|
1208
1236
|
<xsl:apply-templates/>
|
1209
1237
|
</fo:block>
|
@@ -1230,20 +1258,33 @@
|
|
1230
1258
|
<xsl:if test="@type = 'inline'">
|
1231
1259
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1232
1260
|
</xsl:if>
|
1233
|
-
<xsl:text>[</xsl:text><xsl:value-of select="@citeas"
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
<xsl:when test="un:locality/@type = 'section'">Section </xsl:when>
|
1238
|
-
<xsl:when test="un:locality/@type = 'clause'">Clause </xsl:when>
|
1239
|
-
<xsl:otherwise/>
|
1240
|
-
</xsl:choose>
|
1241
|
-
<xsl:apply-templates select="un:locality"/>
|
1242
|
-
</xsl:if>
|
1261
|
+
<xsl:text>[</xsl:text><xsl:value-of select="@citeas"/><xsl:text>]</xsl:text> <!-- disable-output-escaping="yes" -->
|
1262
|
+
|
1263
|
+
<xsl:apply-templates select="un:localityStack"/>
|
1264
|
+
|
1243
1265
|
</fo:basic-link>
|
1244
1266
|
<!-- </fo:inline> -->
|
1245
1267
|
</xsl:template>
|
1246
1268
|
|
1269
|
+
<xsl:template match="un:locality">
|
1270
|
+
<xsl:variable name="title-section">
|
1271
|
+
<xsl:call-template name="getTitle">
|
1272
|
+
<xsl:with-param name="name" select="'title-section'"/>
|
1273
|
+
</xsl:call-template>
|
1274
|
+
</xsl:variable>
|
1275
|
+
<xsl:variable name="title-clause">
|
1276
|
+
<xsl:call-template name="getTitle">
|
1277
|
+
<xsl:with-param name="name" select="'title-clause'"/>
|
1278
|
+
</xsl:call-template>
|
1279
|
+
</xsl:variable>
|
1280
|
+
<xsl:choose>
|
1281
|
+
<xsl:when test="@type = 'section'"><xsl:value-of select="$title-section"/></xsl:when>
|
1282
|
+
<xsl:when test="@type = 'clause'"><xsl:value-of select="$title-clause"/></xsl:when>
|
1283
|
+
<xsl:otherwise/>
|
1284
|
+
</xsl:choose>
|
1285
|
+
<xsl:text> </xsl:text><xsl:value-of select="un:referenceFrom"/>
|
1286
|
+
</xsl:template>
|
1287
|
+
|
1247
1288
|
|
1248
1289
|
<xsl:template match="un:terms[un:term[un:preferred and un:definition]]">
|
1249
1290
|
<fo:block id="{@id}">
|
@@ -1257,7 +1298,7 @@
|
|
1257
1298
|
</fo:block>
|
1258
1299
|
</xsl:template>
|
1259
1300
|
<xsl:template match="un:term" mode="table">
|
1260
|
-
<fo:table-row>
|
1301
|
+
<fo:table-row id="{@id}">
|
1261
1302
|
<fo:table-cell padding-right="1mm">
|
1262
1303
|
<fo:block margin-bottom="12pt">
|
1263
1304
|
<xsl:apply-templates select="un:preferred"/>
|
@@ -1271,7 +1312,7 @@
|
|
1271
1312
|
</fo:table-row>
|
1272
1313
|
</xsl:template>
|
1273
1314
|
<xsl:template match="un:preferred">
|
1274
|
-
<fo:inline
|
1315
|
+
<fo:inline>
|
1275
1316
|
<xsl:apply-templates/>
|
1276
1317
|
</fo:inline>
|
1277
1318
|
</xsl:template>
|
@@ -1337,15 +1378,7 @@
|
|
1337
1378
|
<xsl:apply-templates/>
|
1338
1379
|
</fo:block>
|
1339
1380
|
</xsl:template>
|
1340
|
-
|
1341
|
-
<xsl:template match="un:sourcecode">
|
1342
|
-
<fo:block font-family="Courier" font-size="10pt" margin-top="6pt" margin-bottom="6pt">
|
1343
|
-
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1344
|
-
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
1345
|
-
<xsl:apply-templates/>
|
1346
|
-
</fo:block>
|
1347
|
-
</xsl:template>
|
1348
|
-
|
1381
|
+
|
1349
1382
|
<xsl:template match="un:references">
|
1350
1383
|
<fo:block>
|
1351
1384
|
<xsl:if test="not(un:title)">
|
@@ -1406,29 +1439,6 @@
|
|
1406
1439
|
</fo:static-content>
|
1407
1440
|
</xsl:template>
|
1408
1441
|
|
1409
|
-
|
1410
|
-
<xsl:template name="getLevel">
|
1411
|
-
<xsl:variable name="level_total" select="count(ancestor::*)"/>
|
1412
|
-
<xsl:variable name="level">
|
1413
|
-
<xsl:choose>
|
1414
|
-
<xsl:when test="ancestor::un:preface">
|
1415
|
-
<xsl:value-of select="$level_total - 2"/>
|
1416
|
-
</xsl:when>
|
1417
|
-
<xsl:when test="ancestor::un:sections">
|
1418
|
-
<xsl:value-of select="$level_total - 2"/>
|
1419
|
-
</xsl:when>
|
1420
|
-
<xsl:when test="ancestor::un:bibliography">
|
1421
|
-
<xsl:value-of select="$level_total - 2"/>
|
1422
|
-
</xsl:when>
|
1423
|
-
<xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
|
1424
|
-
<xsl:otherwise>
|
1425
|
-
<xsl:value-of select="$level_total - 1"/>
|
1426
|
-
</xsl:otherwise>
|
1427
|
-
</xsl:choose>
|
1428
|
-
</xsl:variable>
|
1429
|
-
<xsl:value-of select="$level"/>
|
1430
|
-
</xsl:template>
|
1431
|
-
|
1432
1442
|
<xsl:template name="getSection">
|
1433
1443
|
<xsl:variable name="level">
|
1434
1444
|
<xsl:call-template name="getLevel"/>
|
@@ -1456,12 +1466,17 @@
|
|
1456
1466
|
<xsl:when test="ancestor::un:annex">
|
1457
1467
|
<xsl:choose>
|
1458
1468
|
<xsl:when test="$level = 1">
|
1469
|
+
<xsl:variable name="title-annex">
|
1470
|
+
<xsl:call-template name="getTitle">
|
1471
|
+
<xsl:with-param name="name" select="'title-annex'"/>
|
1472
|
+
</xsl:call-template>
|
1473
|
+
</xsl:variable>
|
1459
1474
|
<xsl:choose>
|
1460
1475
|
<xsl:when test="local-name() = 'title'">
|
1461
|
-
<xsl:
|
1476
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title-annex))"/>
|
1462
1477
|
<xsl:number format="A" level="any" count="un:annex"/>
|
1463
1478
|
</xsl:when>
|
1464
|
-
<xsl:otherwise
|
1479
|
+
<xsl:otherwise><xsl:value-of select="normalize-space($title-annex)"/></xsl:otherwise>
|
1465
1480
|
</xsl:choose>
|
1466
1481
|
</xsl:when>
|
1467
1482
|
<xsl:otherwise>
|
@@ -1562,8 +1577,10 @@
|
|
1562
1577
|
</xsl:choose>
|
1563
1578
|
</xsl:variable>
|
1564
1579
|
<xsl:choose>
|
1565
|
-
<xsl:when test="$first = 'true'">
|
1566
|
-
<xsl:
|
1580
|
+
<xsl:when test="$first = 'true'">
|
1581
|
+
<xsl:call-template name="capitalize">
|
1582
|
+
<xsl:with-param name="str" select="$value"/>
|
1583
|
+
</xsl:call-template>
|
1567
1584
|
</xsl:when>
|
1568
1585
|
<xsl:otherwise>
|
1569
1586
|
<xsl:value-of select="$value"/>
|
@@ -1599,8 +1616,8 @@
|
|
1599
1616
|
</xsl:template>
|
1600
1617
|
|
1601
1618
|
<xsl:template name="getLanguage">
|
1602
|
-
<xsl:param name="lang"/>
|
1603
|
-
<xsl:variable name="language" select="
|
1619
|
+
<xsl:param name="lang"/>
|
1620
|
+
<xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
|
1604
1621
|
<xsl:choose>
|
1605
1622
|
<xsl:when test="$language = 'en'">English</xsl:when>
|
1606
1623
|
<xsl:when test="$language = 'de'">Deutsch</xsl:when>
|
@@ -2467,13 +2484,215 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2467
2484
|
</xsl:text>
|
2468
2485
|
</xsl:variable>
|
2469
2486
|
|
2470
|
-
<xsl:variable
|
2487
|
+
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
|
2488
|
+
|
2489
|
+
<title-table lang="en">Table </title-table>
|
2490
|
+
<title-table lang="fr">Tableau </title-table>
|
2491
|
+
|
2492
|
+
<title-table lang="zh">Table </title-table>
|
2493
|
+
|
2494
|
+
|
2495
|
+
|
2496
|
+
<title-note lang="en">NOTE </title-note>
|
2497
|
+
<title-note lang="fr">NOTE </title-note>
|
2498
|
+
|
2499
|
+
<title-note lang="zh">NOTE </title-note>
|
2500
|
+
|
2501
|
+
|
2502
|
+
|
2503
|
+
<title-figure lang="en">Figure </title-figure>
|
2504
|
+
<title-figure lang="fr">Figure </title-figure>
|
2505
|
+
|
2506
|
+
<title-figure lang="zh">Figure </title-figure>
|
2507
|
+
|
2508
|
+
|
2509
|
+
|
2510
|
+
<title-example lang="en">EXAMPLE </title-example>
|
2511
|
+
<title-example lang="fr">EXEMPLE </title-example>
|
2512
|
+
|
2513
|
+
<title-example lang="zh">EXAMPLE </title-example>
|
2514
|
+
|
2515
|
+
|
2516
|
+
|
2517
|
+
<title-example-xref lang="en">Example </title-example-xref>
|
2518
|
+
<title-example-xref lang="fr">Exemple </title-example-xref>
|
2519
|
+
|
2520
|
+
<title-section lang="en">Section </title-section>
|
2521
|
+
<title-section lang="fr">Section </title-section>
|
2522
|
+
|
2523
|
+
<title-inequality lang="en">Inequality </title-inequality>
|
2524
|
+
<title-inequality lang="fr">Inequality </title-inequality>
|
2525
|
+
|
2526
|
+
<title-equation lang="en">Equation </title-equation>
|
2527
|
+
<title-equation lang="fr">Equation </title-equation>
|
2528
|
+
|
2529
|
+
<title-annex lang="en">Annex </title-annex>
|
2530
|
+
<title-annex lang="fr">Annexe </title-annex>
|
2531
|
+
|
2532
|
+
<title-annex lang="zh">Annex </title-annex>
|
2533
|
+
|
2534
|
+
|
2535
|
+
|
2536
|
+
<title-appendix lang="en">Appendix </title-appendix>
|
2537
|
+
<title-appendix lang="fr">Appendix </title-appendix>
|
2538
|
+
|
2539
|
+
<title-clause lang="en">Clause </title-clause>
|
2540
|
+
<title-clause lang="fr">Article </title-clause>
|
2541
|
+
|
2542
|
+
<title-clause lang="zh">Clause </title-clause>
|
2543
|
+
|
2544
|
+
|
2545
|
+
|
2546
|
+
<title-edition lang="en">
|
2547
|
+
|
2548
|
+
<xsl:text>Edition </xsl:text>
|
2549
|
+
|
2550
|
+
|
2551
|
+
</title-edition>
|
2552
|
+
|
2553
|
+
<title-formula lang="en">Formula </title-formula>
|
2554
|
+
<title-formula lang="fr">Formula </title-formula>
|
2555
|
+
|
2556
|
+
<title-toc lang="en">
|
2557
|
+
|
2558
|
+
|
2559
|
+
|
2560
|
+
</title-toc>
|
2561
|
+
<title-toc lang="fr">Sommaire</title-toc>
|
2562
|
+
|
2563
|
+
<title-toc lang="zh">Contents</title-toc>
|
2564
|
+
|
2565
|
+
|
2566
|
+
|
2567
|
+
<title-page lang="en">Page</title-page>
|
2568
|
+
<title-page lang="fr">Page</title-page>
|
2569
|
+
|
2570
|
+
<title-key lang="en">Key</title-key>
|
2571
|
+
<title-key lang="fr">Légende</title-key>
|
2572
|
+
|
2573
|
+
<title-where lang="en">where</title-where>
|
2574
|
+
<title-where lang="fr">où</title-where>
|
2575
|
+
|
2576
|
+
<title-descriptors lang="en">Descriptors</title-descriptors>
|
2577
|
+
|
2578
|
+
<title-part lang="en">
|
2579
|
+
|
2580
|
+
|
2581
|
+
</title-part>
|
2582
|
+
<title-part lang="fr">
|
2583
|
+
|
2584
|
+
|
2585
|
+
</title-part>
|
2586
|
+
<title-part lang="zh">第 # 部分:</title-part>
|
2587
|
+
|
2588
|
+
<title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
|
2589
|
+
<title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
|
2590
|
+
|
2591
|
+
<title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
|
2592
|
+
|
2593
|
+
|
2594
|
+
|
2595
|
+
<title-modified lang="en">modified</title-modified>
|
2596
|
+
<title-modified lang="fr">modifiée</title-modified>
|
2597
|
+
|
2598
|
+
<title-modified lang="zh">modified</title-modified>
|
2599
|
+
|
2600
|
+
|
2601
|
+
|
2602
|
+
<title-source lang="en">SOURCE</title-source>
|
2603
|
+
|
2604
|
+
<title-keywords lang="en">Keywords</title-keywords>
|
2605
|
+
|
2606
|
+
<title-deprecated lang="en">DEPRECATED</title-deprecated>
|
2607
|
+
<title-deprecated lang="fr">DEPRECATED</title-deprecated>
|
2608
|
+
|
2609
|
+
<title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
|
2610
|
+
|
2611
|
+
<title-list-tables lang="en">List of Tables</title-list-tables>
|
2612
|
+
|
2613
|
+
<title-list-figures lang="en">List of Figures</title-list-figures>
|
2614
|
+
|
2615
|
+
<title-recommendation lang="en">Recommendation </title-recommendation>
|
2616
|
+
|
2617
|
+
<title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
|
2618
|
+
|
2619
|
+
<title-abstract lang="en">Abstract</title-abstract>
|
2620
|
+
|
2621
|
+
<title-summary lang="en">Summary</title-summary>
|
2622
|
+
|
2623
|
+
<title-in lang="en">in </title-in>
|
2624
|
+
|
2625
|
+
<title-box lang="en">Box </title-box>
|
2626
|
+
|
2627
|
+
<title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
|
2628
|
+
<title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
|
2629
|
+
|
2630
|
+
<title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
|
2631
|
+
<title-completion-date lang="zh">本稿完成日期</title-completion-date>
|
2632
|
+
|
2633
|
+
<title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
|
2634
|
+
<title-issuance-date lang="zh"># 发布</title-issuance-date>
|
2635
|
+
|
2636
|
+
<title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
|
2637
|
+
<title-implementation-date lang="zh"># 实施</title-implementation-date>
|
2638
|
+
|
2639
|
+
<title-obligation-normative lang="en">normative</title-obligation-normative>
|
2640
|
+
<title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
|
2641
|
+
|
2642
|
+
<title-caution lang="en">CAUTION</title-caution>
|
2643
|
+
<title-caution lang="zh">注意</title-caution>
|
2644
|
+
|
2645
|
+
<title-warning lang="en">WARNING</title-warning>
|
2646
|
+
<title-warning lang="zh">警告</title-warning>
|
2647
|
+
|
2648
|
+
<title-amendment lang="en">AMENDMENT</title-amendment>
|
2649
|
+
</xsl:variable><xsl:template name="getTitle">
|
2650
|
+
<xsl:param name="name"/>
|
2651
|
+
<xsl:variable name="lang">
|
2652
|
+
<xsl:call-template name="getLang"/>
|
2653
|
+
</xsl:variable>
|
2654
|
+
<xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
|
2655
|
+
<xsl:choose>
|
2656
|
+
<xsl:when test="normalize-space($title_) != ''">
|
2657
|
+
<xsl:value-of select="$title_"/>
|
2658
|
+
</xsl:when>
|
2659
|
+
<xsl:otherwise>
|
2660
|
+
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
2661
|
+
</xsl:otherwise>
|
2662
|
+
</xsl:choose>
|
2663
|
+
</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="'
'"/><xsl:attribute-set name="link-style">
|
2664
|
+
|
2665
|
+
|
2666
|
+
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
2667
|
+
|
2668
|
+
|
2669
|
+
|
2670
|
+
|
2671
|
+
|
2672
|
+
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
2673
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2674
|
+
<xsl:attribute name="margin-top">6pt</xsl:attribute>
|
2675
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
2676
|
+
|
2677
|
+
|
2678
|
+
|
2679
|
+
|
2680
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2681
|
+
|
2682
|
+
|
2683
|
+
|
2684
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
|
2685
|
+
|
2686
|
+
|
2687
|
+
|
2688
|
+
</xsl:attribute-set><xsl:template match="text()">
|
2471
2689
|
<xsl:value-of select="."/>
|
2472
|
-
</xsl:template><xsl:template
|
2690
|
+
</xsl:template><xsl:template match="*[local-name()='br']">
|
2473
2691
|
<xsl:value-of select="$linebreak"/>
|
2474
|
-
</xsl:template><xsl:template
|
2475
|
-
<xsl:call-template name="add-zero-spaces"/>
|
2476
|
-
|
2692
|
+
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
2693
|
+
<!-- <xsl:call-template name="add-zero-spaces"/> -->
|
2694
|
+
<xsl:call-template name="add-zero-spaces-java"/>
|
2695
|
+
</xsl:template><xsl:template match="*[local-name()='table']">
|
2477
2696
|
|
2478
2697
|
<xsl:variable name="simple-table">
|
2479
2698
|
<!-- <xsl:copy> -->
|
@@ -2487,7 +2706,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2487
2706
|
|
2488
2707
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
2489
2708
|
|
2490
|
-
|
2709
|
+
<!-- <xsl:if test="$namespace = 'iso'">
|
2710
|
+
<fo:block space-before="6pt"> </fo:block>
|
2711
|
+
</xsl:if> -->
|
2491
2712
|
|
2492
2713
|
<xsl:choose>
|
2493
2714
|
<xsl:when test="@unnumbered = 'true'"/>
|
@@ -2500,37 +2721,25 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2500
2721
|
|
2501
2722
|
|
2502
2723
|
|
2724
|
+
|
2503
2725
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
2504
2726
|
<xsl:attribute name="font-style">italic</xsl:attribute>
|
2505
2727
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2506
2728
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
2507
2729
|
|
2508
2730
|
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
<xsl:number format="I." count="*[local-name()='annex']"/>
|
2522
|
-
<xsl:number format="1" level="any" count="*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'][ancestor::*[local-name()='annex'][@id = $annex-id]]"/>
|
2523
|
-
|
2524
|
-
|
2525
|
-
</xsl:when>
|
2526
|
-
<xsl:otherwise>
|
2527
|
-
|
2528
|
-
|
2529
|
-
<xsl:number format="A." count="*[local-name()='annex']"/>
|
2530
|
-
<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']"/>
|
2531
|
-
|
2532
|
-
</xsl:otherwise>
|
2533
|
-
</xsl:choose>
|
2731
|
+
|
2732
|
+
|
2733
|
+
<xsl:variable name="title-table">
|
2734
|
+
<xsl:call-template name="getTitle">
|
2735
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
2736
|
+
</xsl:call-template>
|
2737
|
+
</xsl:variable>
|
2738
|
+
<xsl:value-of select="$title-table"/>
|
2739
|
+
|
2740
|
+
<xsl:call-template name="getTableNumber"/>
|
2741
|
+
|
2742
|
+
|
2534
2743
|
<xsl:if test="*[local-name()='name']">
|
2535
2744
|
|
2536
2745
|
:
|
@@ -2573,11 +2782,11 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2573
2782
|
</xsl:call-template>
|
2574
2783
|
</xsl:variable>
|
2575
2784
|
|
2576
|
-
<xsl:variable name="colwidths2">
|
2785
|
+
<!-- <xsl:variable name="colwidths2">
|
2577
2786
|
<xsl:call-template name="calculate-column-widths">
|
2578
2787
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2579
2788
|
</xsl:call-template>
|
2580
|
-
</xsl:variable>
|
2789
|
+
</xsl:variable> -->
|
2581
2790
|
|
2582
2791
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
2583
2792
|
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
@@ -2599,7 +2808,10 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2599
2808
|
|
2600
2809
|
|
2601
2810
|
|
2602
|
-
|
2811
|
+
|
2812
|
+
|
2813
|
+
<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">
|
2814
|
+
|
2603
2815
|
|
2604
2816
|
|
2605
2817
|
|
@@ -2612,9 +2824,10 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2612
2824
|
|
2613
2825
|
|
2614
2826
|
|
2827
|
+
|
2615
2828
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2616
2829
|
<xsl:choose>
|
2617
|
-
<xsl:when test=". = 1">
|
2830
|
+
<xsl:when test=". = 1 or . = 0">
|
2618
2831
|
<fo:table-column column-width="proportional-column-width(2)"/>
|
2619
2832
|
</xsl:when>
|
2620
2833
|
<xsl:otherwise>
|
@@ -2622,27 +2835,66 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2622
2835
|
</xsl:otherwise>
|
2623
2836
|
</xsl:choose>
|
2624
2837
|
</xsl:for-each>
|
2625
|
-
|
2838
|
+
|
2839
|
+
<xsl:choose>
|
2840
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
2841
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
2842
|
+
</xsl:when>
|
2843
|
+
<xsl:otherwise>
|
2844
|
+
<xsl:apply-templates/>
|
2845
|
+
</xsl:otherwise>
|
2846
|
+
</xsl:choose>
|
2847
|
+
|
2626
2848
|
</fo:table>
|
2849
|
+
|
2850
|
+
|
2851
|
+
|
2627
2852
|
</fo:block-container>
|
2628
|
-
</xsl:template><xsl:template
|
2629
|
-
<xsl:
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2853
|
+
</xsl:template><xsl:template name="getTableNumber">
|
2854
|
+
<xsl:choose>
|
2855
|
+
<xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
|
2856
|
+
<xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
|
2857
|
+
</xsl:when>
|
2858
|
+
<xsl:when test="ancestor::*[local-name()='annex']">
|
2859
|
+
|
2860
|
+
|
2861
|
+
|
2862
|
+
|
2863
|
+
|
2864
|
+
|
2865
|
+
|
2866
|
+
<xsl:variable name="annex-id" select="ancestor::*[local-name()='annex']/@id"/>
|
2867
|
+
<xsl:number format="I." count="*[local-name()='annex']"/>
|
2868
|
+
<xsl:number format="1" level="any" count="*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'][ancestor::*[local-name()='annex'][@id = $annex-id]]"/>
|
2869
|
+
|
2870
|
+
|
2871
|
+
</xsl:when>
|
2872
|
+
<xsl:otherwise>
|
2873
|
+
|
2874
|
+
|
2875
|
+
<xsl:number format="A." count="*[local-name()='annex']"/>
|
2876
|
+
<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']"/>
|
2877
|
+
|
2878
|
+
</xsl:otherwise>
|
2879
|
+
</xsl:choose>
|
2880
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
|
2881
|
+
<xsl:apply-templates/>
|
2882
|
+
</xsl:template><xsl:template name="calculate-columns-numbers">
|
2883
|
+
<xsl:param name="table-row"/>
|
2884
|
+
<xsl:variable name="columns-count" select="count($table-row/*)"/>
|
2885
|
+
<xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
|
2886
|
+
<xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
|
2887
|
+
<xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
|
2888
|
+
</xsl:template><xsl:template name="calculate-column-widths">
|
2889
|
+
<xsl:param name="table"/>
|
2890
|
+
<xsl:param name="cols-count"/>
|
2639
2891
|
<xsl:param name="curr-col" select="1"/>
|
2640
2892
|
<xsl:param name="width" select="0"/>
|
2641
2893
|
|
2642
2894
|
<xsl:if test="$curr-col <= $cols-count">
|
2643
2895
|
<xsl:variable name="widths">
|
2644
2896
|
<xsl:choose>
|
2645
|
-
<xsl:when test="not($table)"
|
2897
|
+
<xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
|
2646
2898
|
<xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']">
|
2647
2899
|
<xsl:variable name="words">
|
2648
2900
|
<xsl:call-template name="tokenize">
|
@@ -2677,9 +2929,20 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2677
2929
|
</xsl:when>
|
2678
2930
|
<xsl:otherwise>
|
2679
2931
|
<xsl:for-each select="xalan:nodeset($table)//tr">
|
2932
|
+
<xsl:variable name="td_text">
|
2933
|
+
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
2934
|
+
</xsl:variable>
|
2680
2935
|
<xsl:variable name="words">
|
2936
|
+
<xsl:variable name="string_with_added_zerospaces">
|
2937
|
+
<xsl:call-template name="add-zero-spaces-java">
|
2938
|
+
<xsl:with-param name="text" select="$td_text"/>
|
2939
|
+
</xsl:call-template>
|
2940
|
+
</xsl:variable>
|
2681
2941
|
<xsl:call-template name="tokenize">
|
2682
|
-
<xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/>
|
2942
|
+
<!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
|
2943
|
+
<!-- 2009 thinspace -->
|
2944
|
+
<!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
|
2945
|
+
<xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
|
2683
2946
|
</xsl:call-template>
|
2684
2947
|
</xsl:variable>
|
2685
2948
|
<xsl:variable name="max_length">
|
@@ -2720,59 +2983,98 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2720
2983
|
<xsl:with-param name="table" select="$table"/>
|
2721
2984
|
</xsl:call-template>
|
2722
2985
|
</xsl:if>
|
2723
|
-
</xsl:template><xsl:template
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
<xsl:
|
2728
|
-
</xsl:template><xsl:template
|
2986
|
+
</xsl:template><xsl:template match="text()" mode="td_text">
|
2987
|
+
<xsl:variable name="zero-space"></xsl:variable>
|
2988
|
+
<xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
|
2989
|
+
</xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
|
2990
|
+
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
2991
|
+
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
2992
|
+
<xsl:value-of select="@target"/>
|
2993
|
+
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
2994
|
+
<xsl:param name="cols-count"/>
|
2995
|
+
<!-- font-weight="bold" -->
|
2996
|
+
<fo:table-header>
|
2997
|
+
|
2998
|
+
<xsl:apply-templates/>
|
2999
|
+
</fo:table-header>
|
3000
|
+
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
3001
|
+
<fo:table-body>
|
3002
|
+
<xsl:apply-templates/>
|
3003
|
+
</fo:table-body>
|
3004
|
+
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
2729
3005
|
<xsl:apply-templates/>
|
2730
|
-
</xsl:template><xsl:template
|
3006
|
+
</xsl:template><xsl:template name="insertTableFooter">
|
3007
|
+
<xsl:param name="cols-count"/>
|
3008
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
3009
|
+
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
3010
|
+
|
3011
|
+
<fo:table-footer>
|
3012
|
+
|
3013
|
+
<xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
|
3014
|
+
|
3015
|
+
<!-- if there are note(s) or fn(s) then create footer row -->
|
3016
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
3017
|
+
|
3018
|
+
|
3019
|
+
|
3020
|
+
<fo:table-row>
|
3021
|
+
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3022
|
+
|
3023
|
+
|
3024
|
+
|
3025
|
+
<!-- fn will be processed inside 'note' processing -->
|
3026
|
+
|
3027
|
+
|
3028
|
+
<!-- except gb -->
|
3029
|
+
|
3030
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
3031
|
+
|
3032
|
+
|
3033
|
+
<!-- horizontal row separator -->
|
3034
|
+
|
3035
|
+
|
3036
|
+
<!-- fn processing -->
|
3037
|
+
<xsl:call-template name="fn_display"/>
|
3038
|
+
|
3039
|
+
</fo:table-cell>
|
3040
|
+
</fo:table-row>
|
3041
|
+
|
3042
|
+
</xsl:if>
|
3043
|
+
</fo:table-footer>
|
3044
|
+
|
3045
|
+
</xsl:if>
|
3046
|
+
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
3047
|
+
|
2731
3048
|
<xsl:variable name="cols-count">
|
2732
3049
|
<xsl:choose>
|
2733
|
-
<xsl:when test="../*[local-name()='thead']">
|
2734
|
-
<!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
|
3050
|
+
<xsl:when test="../*[local-name()='thead']">
|
2735
3051
|
<xsl:call-template name="calculate-columns-numbers">
|
2736
3052
|
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
2737
3053
|
</xsl:call-template>
|
2738
3054
|
</xsl:when>
|
2739
|
-
<xsl:otherwise>
|
2740
|
-
<!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
|
3055
|
+
<xsl:otherwise>
|
2741
3056
|
<xsl:call-template name="calculate-columns-numbers">
|
2742
3057
|
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
|
2743
3058
|
</xsl:call-template>
|
2744
3059
|
</xsl:otherwise>
|
2745
3060
|
</xsl:choose>
|
2746
3061
|
</xsl:variable>
|
2747
|
-
|
3062
|
+
|
3063
|
+
<xsl:apply-templates select="../*[local-name()='thead']" mode="process">
|
3064
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3065
|
+
</xsl:apply-templates>
|
3066
|
+
|
3067
|
+
<xsl:call-template name="insertTableFooter">
|
3068
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3069
|
+
</xsl:call-template>
|
3070
|
+
|
2748
3071
|
<fo:table-body>
|
2749
|
-
<xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
|
2750
3072
|
<xsl:apply-templates/>
|
2751
|
-
<xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
|
2752
|
-
|
2753
|
-
<xsl:if test="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']">
|
2754
|
-
<fo:table-row>
|
2755
|
-
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
<!-- fn will be processed inside 'note' processing -->
|
2760
|
-
|
2761
|
-
|
2762
|
-
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2763
|
-
|
2764
|
-
<!-- horizontal row separator -->
|
2765
|
-
|
2766
|
-
|
2767
|
-
<!-- fn processing -->
|
2768
|
-
<xsl:call-template name="fn_display"/>
|
2769
|
-
|
2770
|
-
</fo:table-cell>
|
2771
|
-
</fo:table-row>
|
2772
|
-
|
2773
|
-
</xsl:if>
|
3073
|
+
<!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
|
3074
|
+
|
2774
3075
|
</fo:table-body>
|
2775
|
-
|
3076
|
+
|
3077
|
+
</xsl:template><xsl:template match="*[local-name()='tr']">
|
2776
3078
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
2777
3079
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
2778
3080
|
<fo:table-row min-height="4mm">
|
@@ -2789,13 +3091,14 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2789
3091
|
|
2790
3092
|
</xsl:if>
|
2791
3093
|
|
3094
|
+
|
2792
3095
|
<xsl:if test="not(*[local-name()='th'])">
|
2793
3096
|
<xsl:attribute name="min-height">8mm</xsl:attribute>
|
2794
3097
|
</xsl:if>
|
2795
3098
|
|
2796
3099
|
<xsl:apply-templates/>
|
2797
3100
|
</fo:table-row>
|
2798
|
-
</xsl:template><xsl:template
|
3101
|
+
</xsl:template><xsl:template match="*[local-name()='th']">
|
2799
3102
|
<fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
|
2800
3103
|
|
2801
3104
|
|
@@ -2827,7 +3130,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2827
3130
|
<xsl:apply-templates/>
|
2828
3131
|
</fo:block>
|
2829
3132
|
</fo:table-cell>
|
2830
|
-
</xsl:template><xsl:template
|
3133
|
+
</xsl:template><xsl:template match="*[local-name()='td']">
|
2831
3134
|
<fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
|
2832
3135
|
|
2833
3136
|
|
@@ -2835,6 +3138,8 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2835
3138
|
|
2836
3139
|
|
2837
3140
|
|
3141
|
+
|
3142
|
+
|
2838
3143
|
<xsl:attribute name="display-align">before</xsl:attribute>
|
2839
3144
|
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
2840
3145
|
<xsl:attribute name="padding-top">2mm</xsl:attribute>
|
@@ -2854,6 +3159,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2854
3159
|
</xsl:attribute>
|
2855
3160
|
</xsl:if>
|
2856
3161
|
<fo:block>
|
3162
|
+
|
2857
3163
|
<xsl:apply-templates/>
|
2858
3164
|
</fo:block>
|
2859
3165
|
<!-- <xsl:choose>
|
@@ -2869,14 +3175,24 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2869
3175
|
|
2870
3176
|
|
2871
3177
|
</fo:table-cell>
|
2872
|
-
</xsl:template><xsl:template
|
3178
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
|
2873
3179
|
|
2874
3180
|
|
2875
3181
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
2876
3182
|
|
2877
3183
|
|
3184
|
+
|
3185
|
+
|
2878
3186
|
<fo:inline padding-right="2mm">
|
2879
|
-
|
3187
|
+
|
3188
|
+
|
3189
|
+
<xsl:variable name="title-note">
|
3190
|
+
<xsl:call-template name="getTitle">
|
3191
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
3192
|
+
</xsl:call-template>
|
3193
|
+
</xsl:variable>
|
3194
|
+
<xsl:value-of select="$title-note"/>
|
3195
|
+
|
2880
3196
|
|
2881
3197
|
|
2882
3198
|
<xsl:number format="1 "/>
|
@@ -2885,9 +3201,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2885
3201
|
<xsl:apply-templates mode="process"/>
|
2886
3202
|
</fo:block>
|
2887
3203
|
|
2888
|
-
</xsl:template><xsl:template
|
3204
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
2889
3205
|
<xsl:apply-templates/>
|
2890
|
-
</xsl:template><xsl:template
|
3206
|
+
</xsl:template><xsl:template name="fn_display">
|
2891
3207
|
<xsl:variable name="references">
|
2892
3208
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
2893
3209
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -2903,6 +3219,8 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2903
3219
|
<fo:block margin-bottom="12pt">
|
2904
3220
|
|
2905
3221
|
|
3222
|
+
|
3223
|
+
|
2906
3224
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
2907
3225
|
|
2908
3226
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
@@ -2911,6 +3229,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2911
3229
|
|
2912
3230
|
|
2913
3231
|
|
3232
|
+
|
2914
3233
|
<xsl:value-of select="@reference"/>
|
2915
3234
|
|
2916
3235
|
</fo:inline>
|
@@ -2921,7 +3240,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2921
3240
|
</fo:block>
|
2922
3241
|
</xsl:if>
|
2923
3242
|
</xsl:for-each>
|
2924
|
-
</xsl:template><xsl:template
|
3243
|
+
</xsl:template><xsl:template name="fn_name_display">
|
2925
3244
|
<!-- <xsl:variable name="references">
|
2926
3245
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
2927
3246
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -2937,7 +3256,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2937
3256
|
<xsl:apply-templates/>
|
2938
3257
|
</fo:block>
|
2939
3258
|
</xsl:for-each>
|
2940
|
-
</xsl:template><xsl:template
|
3259
|
+
</xsl:template><xsl:template name="fn_display_figure">
|
2941
3260
|
<xsl:variable name="key_iso">
|
2942
3261
|
<!-- and (not(@class) or @class !='pseudocode') -->
|
2943
3262
|
</xsl:variable>
|
@@ -2948,6 +3267,36 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2948
3267
|
</fn>
|
2949
3268
|
</xsl:for-each>
|
2950
3269
|
</xsl:variable>
|
3270
|
+
|
3271
|
+
<!-- current hierarchy is 'figure' element -->
|
3272
|
+
<xsl:variable name="following_dl_colwidths">
|
3273
|
+
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
3274
|
+
<xsl:variable name="html-table">
|
3275
|
+
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
3276
|
+
<xsl:element name="{$ns}:table">
|
3277
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
3278
|
+
<tbody>
|
3279
|
+
<xsl:apply-templates mode="dl"/>
|
3280
|
+
</tbody>
|
3281
|
+
</xsl:for-each>
|
3282
|
+
</xsl:element>
|
3283
|
+
</xsl:variable>
|
3284
|
+
|
3285
|
+
<xsl:call-template name="calculate-column-widths">
|
3286
|
+
<xsl:with-param name="cols-count" select="2"/>
|
3287
|
+
<xsl:with-param name="table" select="$html-table"/>
|
3288
|
+
</xsl:call-template>
|
3289
|
+
|
3290
|
+
</xsl:if>
|
3291
|
+
</xsl:variable>
|
3292
|
+
|
3293
|
+
|
3294
|
+
<xsl:variable name="maxlength_dt">
|
3295
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
3296
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
3297
|
+
</xsl:for-each>
|
3298
|
+
</xsl:variable>
|
3299
|
+
|
2951
3300
|
<xsl:if test="xalan:nodeset($references)//fn">
|
2952
3301
|
<fo:block>
|
2953
3302
|
<fo:table width="95%" table-layout="fixed">
|
@@ -2955,8 +3304,19 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2955
3304
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2956
3305
|
|
2957
3306
|
</xsl:if>
|
2958
|
-
<
|
2959
|
-
|
3307
|
+
<xsl:choose>
|
3308
|
+
<!-- if there 'dl', then set same columns width -->
|
3309
|
+
<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
|
3310
|
+
<xsl:call-template name="setColumnWidth_dl">
|
3311
|
+
<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
|
3312
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
3313
|
+
</xsl:call-template>
|
3314
|
+
</xsl:when>
|
3315
|
+
<xsl:otherwise>
|
3316
|
+
<fo:table-column column-width="15%"/>
|
3317
|
+
<fo:table-column column-width="85%"/>
|
3318
|
+
</xsl:otherwise>
|
3319
|
+
</xsl:choose>
|
2960
3320
|
<fo:table-body>
|
2961
3321
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
2962
3322
|
<xsl:variable name="reference" select="@reference"/>
|
@@ -2988,22 +3348,23 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
2988
3348
|
</fo:block>
|
2989
3349
|
</xsl:if>
|
2990
3350
|
|
2991
|
-
</xsl:template><xsl:template
|
3351
|
+
</xsl:template><xsl:template match="*[local-name()='fn']">
|
2992
3352
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
2993
3353
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
2994
3354
|
|
2995
3355
|
|
2996
3356
|
|
3357
|
+
|
2997
3358
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
2998
3359
|
|
2999
3360
|
<xsl:value-of select="@reference"/>
|
3000
3361
|
</fo:basic-link>
|
3001
3362
|
</fo:inline>
|
3002
|
-
</xsl:template><xsl:template
|
3363
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
3003
3364
|
<fo:inline>
|
3004
3365
|
<xsl:apply-templates/>
|
3005
3366
|
</fo:inline>
|
3006
|
-
</xsl:template><xsl:template
|
3367
|
+
</xsl:template><xsl:template match="*[local-name()='dl']">
|
3007
3368
|
<xsl:variable name="parent" select="local-name(..)"/>
|
3008
3369
|
|
3009
3370
|
<xsl:variable name="key_iso">
|
@@ -3016,7 +3377,12 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3016
3377
|
|
3017
3378
|
<fo:block margin-bottom="12pt" text-align="left">
|
3018
3379
|
|
3019
|
-
<xsl:
|
3380
|
+
<xsl:variable name="title-where">
|
3381
|
+
<xsl:call-template name="getTitle">
|
3382
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
3383
|
+
</xsl:call-template>
|
3384
|
+
</xsl:variable>
|
3385
|
+
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
3020
3386
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3021
3387
|
<xsl:text/>
|
3022
3388
|
<xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
|
@@ -3028,14 +3394,26 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3028
3394
|
|
3029
3395
|
|
3030
3396
|
|
3031
|
-
|
3397
|
+
|
3398
|
+
<xsl:variable name="title-where">
|
3399
|
+
<xsl:call-template name="getTitle">
|
3400
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
3401
|
+
</xsl:call-template>
|
3402
|
+
</xsl:variable>
|
3403
|
+
<xsl:value-of select="$title-where"/>
|
3032
3404
|
</fo:block>
|
3033
3405
|
</xsl:when>
|
3034
3406
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
|
3035
|
-
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
|
3407
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
3408
|
+
|
3036
3409
|
|
3037
3410
|
|
3038
|
-
<xsl:
|
3411
|
+
<xsl:variable name="title-key">
|
3412
|
+
<xsl:call-template name="getTitle">
|
3413
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
3414
|
+
</xsl:call-template>
|
3415
|
+
</xsl:variable>
|
3416
|
+
<xsl:value-of select="$title-key"/>
|
3039
3417
|
</fo:block>
|
3040
3418
|
</xsl:when>
|
3041
3419
|
</xsl:choose>
|
@@ -3049,25 +3427,11 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3049
3427
|
|
3050
3428
|
<fo:block>
|
3051
3429
|
|
3052
|
-
|
3053
|
-
|
3054
|
-
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
3055
|
-
<xsl:element name="{$ns}:table">
|
3056
|
-
<tbody>
|
3057
|
-
<xsl:apply-templates mode="dl"/>
|
3058
|
-
</tbody>
|
3059
|
-
</xsl:element>
|
3060
|
-
</xsl:variable>
|
3061
|
-
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
3062
|
-
<xsl:variable name="colwidths">
|
3063
|
-
<xsl:call-template name="calculate-column-widths">
|
3064
|
-
<xsl:with-param name="cols-count" select="2"/>
|
3065
|
-
<xsl:with-param name="table" select="$html-table"/>
|
3066
|
-
</xsl:call-template>
|
3067
|
-
</xsl:variable>
|
3068
|
-
<!-- colwidths=<xsl:value-of select="$colwidths"/> -->
|
3430
|
+
|
3431
|
+
|
3069
3432
|
|
3070
3433
|
<fo:table width="95%" table-layout="fixed">
|
3434
|
+
|
3071
3435
|
<xsl:choose>
|
3072
3436
|
<xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
|
3073
3437
|
<!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
|
@@ -3077,42 +3441,30 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3077
3441
|
|
3078
3442
|
</xsl:when>
|
3079
3443
|
</xsl:choose>
|
3080
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
3089
|
-
|
3090
|
-
|
3091
|
-
|
3092
|
-
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
</xsl:when>
|
3105
|
-
<xsl:otherwise>
|
3106
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
3107
|
-
</xsl:otherwise>
|
3108
|
-
</xsl:choose>
|
3109
|
-
</xsl:for-each>
|
3110
|
-
</xsl:otherwise>
|
3111
|
-
</xsl:choose>
|
3112
|
-
<!-- <fo:table-column column-width="15%"/>
|
3113
|
-
<fo:table-column column-width="85%"/> -->
|
3114
|
-
</xsl:otherwise>
|
3115
|
-
</xsl:choose>
|
3444
|
+
<!-- create virtual html table for dl/[dt and dd] -->
|
3445
|
+
<xsl:variable name="html-table">
|
3446
|
+
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
3447
|
+
<xsl:element name="{$ns}:table">
|
3448
|
+
<tbody>
|
3449
|
+
<xsl:apply-templates mode="dl"/>
|
3450
|
+
</tbody>
|
3451
|
+
</xsl:element>
|
3452
|
+
</xsl:variable>
|
3453
|
+
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
3454
|
+
<xsl:variable name="colwidths">
|
3455
|
+
<xsl:call-template name="calculate-column-widths">
|
3456
|
+
<xsl:with-param name="cols-count" select="2"/>
|
3457
|
+
<xsl:with-param name="table" select="$html-table"/>
|
3458
|
+
</xsl:call-template>
|
3459
|
+
</xsl:variable>
|
3460
|
+
<!-- colwidths=<xsl:value-of select="$colwidths"/> -->
|
3461
|
+
<xsl:variable name="maxlength_dt">
|
3462
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
3463
|
+
</xsl:variable>
|
3464
|
+
<xsl:call-template name="setColumnWidth_dl">
|
3465
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
3466
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
3467
|
+
</xsl:call-template>
|
3116
3468
|
<fo:table-body>
|
3117
3469
|
<xsl:apply-templates>
|
3118
3470
|
<xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
|
@@ -3122,7 +3474,61 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3122
3474
|
</fo:block>
|
3123
3475
|
</fo:block>
|
3124
3476
|
</xsl:if>
|
3125
|
-
</xsl:template><xsl:template
|
3477
|
+
</xsl:template><xsl:template name="setColumnWidth_dl">
|
3478
|
+
<xsl:param name="colwidths"/>
|
3479
|
+
<xsl:param name="maxlength_dt"/>
|
3480
|
+
<xsl:choose>
|
3481
|
+
<xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
|
3482
|
+
<fo:table-column column-width="50%"/>
|
3483
|
+
<fo:table-column column-width="50%"/>
|
3484
|
+
</xsl:when>
|
3485
|
+
<xsl:otherwise>
|
3486
|
+
<xsl:choose>
|
3487
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
3488
|
+
<fo:table-column column-width="5%"/>
|
3489
|
+
<fo:table-column column-width="95%"/>
|
3490
|
+
</xsl:when>
|
3491
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like t90, a, etc -->
|
3492
|
+
<fo:table-column column-width="10%"/>
|
3493
|
+
<fo:table-column column-width="90%"/>
|
3494
|
+
</xsl:when>
|
3495
|
+
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
3496
|
+
<fo:table-column column-width="60%"/>
|
3497
|
+
<fo:table-column column-width="40%"/>
|
3498
|
+
</xsl:when> -->
|
3499
|
+
<xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.3">
|
3500
|
+
<fo:table-column column-width="50%"/>
|
3501
|
+
<fo:table-column column-width="50%"/>
|
3502
|
+
</xsl:when>
|
3503
|
+
<xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 0.5">
|
3504
|
+
<fo:table-column column-width="40%"/>
|
3505
|
+
<fo:table-column column-width="60%"/>
|
3506
|
+
</xsl:when>
|
3507
|
+
<xsl:otherwise>
|
3508
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3509
|
+
<xsl:choose>
|
3510
|
+
<xsl:when test=". = 1 or . = 0">
|
3511
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
3512
|
+
</xsl:when>
|
3513
|
+
<xsl:otherwise>
|
3514
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
3515
|
+
</xsl:otherwise>
|
3516
|
+
</xsl:choose>
|
3517
|
+
</xsl:for-each>
|
3518
|
+
</xsl:otherwise>
|
3519
|
+
</xsl:choose>
|
3520
|
+
<!-- <fo:table-column column-width="15%"/>
|
3521
|
+
<fo:table-column column-width="85%"/> -->
|
3522
|
+
</xsl:otherwise>
|
3523
|
+
</xsl:choose>
|
3524
|
+
</xsl:template><xsl:template name="getMaxLength_dt">
|
3525
|
+
<xsl:for-each select="*[local-name()='dt']">
|
3526
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
3527
|
+
<xsl:if test="position() = 1">
|
3528
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
3529
|
+
</xsl:if>
|
3530
|
+
</xsl:for-each>
|
3531
|
+
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
|
3126
3532
|
<xsl:param name="key_iso"/>
|
3127
3533
|
|
3128
3534
|
<!-- <tr>
|
@@ -3138,7 +3544,12 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3138
3544
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
3139
3545
|
<xsl:attribute name="margin-top">0</xsl:attribute>
|
3140
3546
|
</xsl:if>
|
3141
|
-
|
3547
|
+
<xsl:variable name="title-note">
|
3548
|
+
<xsl:call-template name="getTitle">
|
3549
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
3550
|
+
</xsl:call-template>
|
3551
|
+
</xsl:variable>
|
3552
|
+
<xsl:value-of select="$title-note"/>
|
3142
3553
|
</fo:block>
|
3143
3554
|
</fo:table-cell>
|
3144
3555
|
<fo:table-cell>
|
@@ -3147,7 +3558,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3147
3558
|
</fo:block>
|
3148
3559
|
</fo:table-cell>
|
3149
3560
|
</fo:table-row>
|
3150
|
-
</xsl:template><xsl:template
|
3561
|
+
</xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
|
3151
3562
|
<tr>
|
3152
3563
|
<td>
|
3153
3564
|
<xsl:apply-templates/>
|
@@ -3160,20 +3571,30 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3160
3571
|
</td>
|
3161
3572
|
</tr>
|
3162
3573
|
|
3163
|
-
</xsl:template><xsl:template
|
3574
|
+
</xsl:template><xsl:template match="*[local-name()='dt']">
|
3164
3575
|
<xsl:param name="key_iso"/>
|
3165
3576
|
|
3166
3577
|
<fo:table-row>
|
3167
3578
|
<fo:table-cell>
|
3579
|
+
|
3168
3580
|
<fo:block margin-top="6pt">
|
3169
3581
|
|
3582
|
+
|
3170
3583
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
3171
3584
|
<xsl:attribute name="margin-top">0</xsl:attribute>
|
3172
3585
|
|
3173
3586
|
</xsl:if>
|
3174
3587
|
|
3175
3588
|
|
3589
|
+
|
3590
|
+
|
3591
|
+
|
3176
3592
|
<xsl:apply-templates/>
|
3593
|
+
<!-- <xsl:if test="$namespace = 'gb'">
|
3594
|
+
<xsl:if test="ancestor::*[local-name()='formula']">
|
3595
|
+
<xsl:text>—</xsl:text>
|
3596
|
+
</xsl:if>
|
3597
|
+
</xsl:if> -->
|
3177
3598
|
</fo:block>
|
3178
3599
|
</fo:table-cell>
|
3179
3600
|
<fo:table-cell>
|
@@ -3187,37 +3608,37 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3187
3608
|
</fo:table-cell>
|
3188
3609
|
</fo:table-row>
|
3189
3610
|
|
3190
|
-
</xsl:template><xsl:template
|
3611
|
+
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
3191
3612
|
<xsl:apply-templates/>
|
3192
|
-
</xsl:template><xsl:template
|
3613
|
+
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
3193
3614
|
<xsl:apply-templates/>
|
3194
|
-
</xsl:template><xsl:template
|
3195
|
-
<fo:inline><xsl:apply-templates/></fo:inline>
|
3196
|
-
</xsl:template><xsl:template
|
3615
|
+
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
3616
|
+
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
3617
|
+
</xsl:template><xsl:template match="*[local-name()='em']">
|
3197
3618
|
<fo:inline font-style="italic">
|
3198
3619
|
<xsl:apply-templates/>
|
3199
3620
|
</fo:inline>
|
3200
|
-
</xsl:template><xsl:template
|
3621
|
+
</xsl:template><xsl:template match="*[local-name()='strong']">
|
3201
3622
|
<fo:inline font-weight="bold">
|
3202
3623
|
<xsl:apply-templates/>
|
3203
3624
|
</fo:inline>
|
3204
|
-
</xsl:template><xsl:template
|
3625
|
+
</xsl:template><xsl:template match="*[local-name()='sup']">
|
3205
3626
|
<fo:inline font-size="80%" vertical-align="super">
|
3206
3627
|
<xsl:apply-templates/>
|
3207
3628
|
</fo:inline>
|
3208
|
-
</xsl:template><xsl:template
|
3629
|
+
</xsl:template><xsl:template match="*[local-name()='sub']">
|
3209
3630
|
<fo:inline font-size="80%" vertical-align="sub">
|
3210
3631
|
<xsl:apply-templates/>
|
3211
3632
|
</fo:inline>
|
3212
|
-
</xsl:template><xsl:template
|
3213
|
-
<fo:inline font-family="Courier" font-size="10pt">
|
3633
|
+
</xsl:template><xsl:template match="*[local-name()='tt']">
|
3634
|
+
<fo:inline font-family="Courier" font-size="10pt">
|
3214
3635
|
<xsl:apply-templates/>
|
3215
3636
|
</fo:inline>
|
3216
|
-
</xsl:template><xsl:template
|
3637
|
+
</xsl:template><xsl:template match="*[local-name()='del']">
|
3217
3638
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
3218
3639
|
<xsl:apply-templates/>
|
3219
3640
|
</fo:inline>
|
3220
|
-
</xsl:template><xsl:template
|
3641
|
+
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
3221
3642
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
3222
3643
|
<fo:inline font-size="75%">
|
3223
3644
|
<xsl:if test="string-length($text) > 0">
|
@@ -3226,10 +3647,11 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3226
3647
|
</xsl:call-template>
|
3227
3648
|
</xsl:if>
|
3228
3649
|
</fo:inline>
|
3229
|
-
</xsl:template><xsl:template
|
3650
|
+
</xsl:template><xsl:template name="recursiveSmallCaps">
|
3230
3651
|
<xsl:param name="text"/>
|
3231
3652
|
<xsl:variable name="char" select="substring($text,1,1)"/>
|
3232
|
-
<xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
|
3653
|
+
<!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
|
3654
|
+
<xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
|
3233
3655
|
<xsl:choose>
|
3234
3656
|
<xsl:when test="$char=$upperCase">
|
3235
3657
|
<fo:inline font-size="{100 div 0.75}%">
|
@@ -3245,7 +3667,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3245
3667
|
<xsl:with-param name="text" select="substring($text,2)"/>
|
3246
3668
|
</xsl:call-template>
|
3247
3669
|
</xsl:if>
|
3248
|
-
</xsl:template><xsl:template
|
3670
|
+
</xsl:template><xsl:template name="tokenize">
|
3249
3671
|
<xsl:param name="text"/>
|
3250
3672
|
<xsl:param name="separator" select="' '"/>
|
3251
3673
|
<xsl:choose>
|
@@ -3293,7 +3715,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3293
3715
|
</xsl:call-template>
|
3294
3716
|
</xsl:otherwise>
|
3295
3717
|
</xsl:choose>
|
3296
|
-
</xsl:template><xsl:template
|
3718
|
+
</xsl:template><xsl:template name="max_length">
|
3297
3719
|
<xsl:param name="words"/>
|
3298
3720
|
<xsl:for-each select="$words//word">
|
3299
3721
|
<xsl:sort select="." data-type="number" order="descending"/>
|
@@ -3301,12 +3723,17 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3301
3723
|
<xsl:value-of select="."/>
|
3302
3724
|
</xsl:if>
|
3303
3725
|
</xsl:for-each>
|
3304
|
-
</xsl:template><xsl:template
|
3726
|
+
</xsl:template><xsl:template name="add-zero-spaces-java">
|
3727
|
+
<xsl:param name="text" select="."/>
|
3728
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
3729
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
3730
|
+
</xsl:template><xsl:template name="add-zero-spaces">
|
3305
3731
|
<xsl:param name="text" select="."/>
|
3306
3732
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
3307
3733
|
<xsl:variable name="zero-space-after-dot">.</xsl:variable>
|
3308
3734
|
<xsl:variable name="zero-space-after-colon">:</xsl:variable>
|
3309
3735
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
3736
|
+
<xsl:variable name="zero-space-after-underscore">_</xsl:variable>
|
3310
3737
|
<xsl:variable name="zero-space"></xsl:variable>
|
3311
3738
|
<xsl:choose>
|
3312
3739
|
<xsl:when test="contains($text, $zero-space-after-chars)">
|
@@ -3341,11 +3768,19 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3341
3768
|
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
|
3342
3769
|
</xsl:call-template>
|
3343
3770
|
</xsl:when>
|
3771
|
+
<xsl:when test="contains($text, $zero-space-after-underscore)">
|
3772
|
+
<xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
|
3773
|
+
<xsl:value-of select="$zero-space-after-underscore"/>
|
3774
|
+
<xsl:value-of select="$zero-space"/>
|
3775
|
+
<xsl:call-template name="add-zero-spaces">
|
3776
|
+
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
|
3777
|
+
</xsl:call-template>
|
3778
|
+
</xsl:when>
|
3344
3779
|
<xsl:otherwise>
|
3345
3780
|
<xsl:value-of select="$text"/>
|
3346
3781
|
</xsl:otherwise>
|
3347
3782
|
</xsl:choose>
|
3348
|
-
</xsl:template><xsl:template
|
3783
|
+
</xsl:template><xsl:template name="add-zero-spaces-equal">
|
3349
3784
|
<xsl:param name="text" select="."/>
|
3350
3785
|
<xsl:variable name="zero-space-after-equals">==========</xsl:variable>
|
3351
3786
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
@@ -3371,7 +3806,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3371
3806
|
<xsl:value-of select="$text"/>
|
3372
3807
|
</xsl:otherwise>
|
3373
3808
|
</xsl:choose>
|
3374
|
-
</xsl:template><xsl:template
|
3809
|
+
</xsl:template><xsl:template name="getSimpleTable">
|
3375
3810
|
<xsl:variable name="simple-table">
|
3376
3811
|
|
3377
3812
|
<!-- Step 1. colspan processing -->
|
@@ -3398,9 +3833,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3398
3833
|
</xsl:choose> -->
|
3399
3834
|
</xsl:variable>
|
3400
3835
|
<xsl:copy-of select="$simple-table"/>
|
3401
|
-
</xsl:template><xsl:template
|
3836
|
+
</xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
|
3402
3837
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
3403
|
-
</xsl:template><xsl:template
|
3838
|
+
</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">
|
3404
3839
|
<xsl:choose>
|
3405
3840
|
<xsl:when test="@colspan">
|
3406
3841
|
<xsl:variable name="td">
|
@@ -3422,16 +3857,16 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3422
3857
|
</xsl:element>
|
3423
3858
|
</xsl:otherwise>
|
3424
3859
|
</xsl:choose>
|
3425
|
-
</xsl:template><xsl:template
|
3860
|
+
</xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
|
3426
3861
|
<xsl:element name="tr">
|
3427
3862
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
3428
3863
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
3429
3864
|
</xsl:element>
|
3430
|
-
</xsl:template><xsl:template
|
3865
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
|
3431
3866
|
<xsl:copy>
|
3432
3867
|
<xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
|
3433
3868
|
</xsl:copy>
|
3434
|
-
</xsl:template><xsl:template
|
3869
|
+
</xsl:template><xsl:template name="repeatNode">
|
3435
3870
|
<xsl:param name="count"/>
|
3436
3871
|
<xsl:param name="node"/>
|
3437
3872
|
|
@@ -3442,18 +3877,18 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3442
3877
|
</xsl:call-template>
|
3443
3878
|
<xsl:copy-of select="$node"/>
|
3444
3879
|
</xsl:if>
|
3445
|
-
</xsl:template><xsl:template
|
3880
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
|
3446
3881
|
<xsl:copy>
|
3447
3882
|
<xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
|
3448
3883
|
</xsl:copy>
|
3449
|
-
</xsl:template><xsl:template
|
3884
|
+
</xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
|
3450
3885
|
<xsl:copy>
|
3451
3886
|
<xsl:copy-of select="tr[1]"/>
|
3452
3887
|
<xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
|
3453
3888
|
<xsl:with-param name="previousRow" select="tr[1]"/>
|
3454
3889
|
</xsl:apply-templates>
|
3455
3890
|
</xsl:copy>
|
3456
|
-
</xsl:template><xsl:template
|
3891
|
+
</xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
|
3457
3892
|
<xsl:param name="previousRow"/>
|
3458
3893
|
<xsl:variable name="currentRow" select="."/>
|
3459
3894
|
|
@@ -3487,34 +3922,320 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
|
|
3487
3922
|
<xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
|
3488
3923
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
3489
3924
|
</xsl:apply-templates>
|
3490
|
-
</xsl:template><xsl:template
|
3925
|
+
</xsl:template><xsl:template name="getLang">
|
3491
3926
|
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3492
3927
|
<xsl:choose>
|
3493
3928
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
3494
3929
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
3495
3930
|
</xsl:choose>
|
3496
|
-
</xsl:template><xsl:template
|
3931
|
+
</xsl:template><xsl:template name="capitalizeWords">
|
3497
3932
|
<xsl:param name="str"/>
|
3498
3933
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
3499
3934
|
<xsl:choose>
|
3500
3935
|
<xsl:when test="contains($str2, ' ')">
|
3501
3936
|
<xsl:variable name="substr" select="substring-before($str2, ' ')"/>
|
3502
|
-
<xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
|
3503
|
-
<xsl:value-of select="substring($substr, 2)"/>
|
3937
|
+
<!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
|
3938
|
+
<xsl:value-of select="substring($substr, 2)"/> -->
|
3939
|
+
<xsl:call-template name="capitalize">
|
3940
|
+
<xsl:with-param name="str" select="$substr"/>
|
3941
|
+
</xsl:call-template>
|
3504
3942
|
<xsl:text> </xsl:text>
|
3505
3943
|
<xsl:call-template name="capitalizeWords">
|
3506
3944
|
<xsl:with-param name="str" select="substring-after($str2, ' ')"/>
|
3507
3945
|
</xsl:call-template>
|
3508
3946
|
</xsl:when>
|
3509
3947
|
<xsl:otherwise>
|
3510
|
-
<xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
|
3511
|
-
<xsl:value-of select="substring($str2, 2)"/>
|
3948
|
+
<!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
|
3949
|
+
<xsl:value-of select="substring($str2, 2)"/> -->
|
3950
|
+
<xsl:call-template name="capitalize">
|
3951
|
+
<xsl:with-param name="str" select="$str2"/>
|
3952
|
+
</xsl:call-template>
|
3512
3953
|
</xsl:otherwise>
|
3513
3954
|
</xsl:choose>
|
3514
|
-
</xsl:template><xsl:template
|
3955
|
+
</xsl:template><xsl:template name="capitalize">
|
3956
|
+
<xsl:param name="str"/>
|
3957
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
3958
|
+
<xsl:value-of select="substring($str, 2)"/>
|
3959
|
+
</xsl:template><xsl:template match="mathml:math">
|
3515
3960
|
<fo:inline font-family="STIX2Math">
|
3516
3961
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3517
3962
|
<xsl:copy-of select="."/>
|
3518
3963
|
</fo:instream-foreign-object>
|
3519
3964
|
</fo:inline>
|
3965
|
+
</xsl:template><xsl:template match="*[local-name()='localityStack']">
|
3966
|
+
<xsl:for-each select="*[local-name()='locality']">
|
3967
|
+
<xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
|
3968
|
+
<xsl:apply-templates select="."/>
|
3969
|
+
<xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
|
3970
|
+
</xsl:for-each>
|
3971
|
+
</xsl:template><xsl:template match="*[local-name()='link']" name="link">
|
3972
|
+
<xsl:variable name="target">
|
3973
|
+
<xsl:choose>
|
3974
|
+
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
3975
|
+
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
3976
|
+
</xsl:when>
|
3977
|
+
<xsl:otherwise>
|
3978
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
3979
|
+
</xsl:otherwise>
|
3980
|
+
</xsl:choose>
|
3981
|
+
</xsl:variable>
|
3982
|
+
<fo:inline xsl:use-attribute-sets="link-style">
|
3983
|
+
<xsl:choose>
|
3984
|
+
<xsl:when test="$target = ''">
|
3985
|
+
<xsl:apply-templates/>
|
3986
|
+
</xsl:when>
|
3987
|
+
<xsl:otherwise>
|
3988
|
+
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
3989
|
+
<xsl:choose>
|
3990
|
+
<xsl:when test="normalize-space(.) = ''">
|
3991
|
+
<xsl:value-of select="$target"/>
|
3992
|
+
</xsl:when>
|
3993
|
+
<xsl:otherwise>
|
3994
|
+
<xsl:apply-templates/>
|
3995
|
+
</xsl:otherwise>
|
3996
|
+
</xsl:choose>
|
3997
|
+
</fo:basic-link>
|
3998
|
+
</xsl:otherwise>
|
3999
|
+
</xsl:choose>
|
4000
|
+
</fo:inline>
|
4001
|
+
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
4002
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4003
|
+
<!-- <xsl:choose>
|
4004
|
+
<xsl:when test="@lang = 'en'"></xsl:when>
|
4005
|
+
<xsl:otherwise> -->
|
4006
|
+
<xsl:attribute name="white-space">pre</xsl:attribute>
|
4007
|
+
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
4008
|
+
<!-- </xsl:otherwise>
|
4009
|
+
</xsl:choose> -->
|
4010
|
+
<xsl:apply-templates/>
|
4011
|
+
</fo:block>
|
4012
|
+
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
4013
|
+
<fo:inline id="{@id}"/>
|
4014
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
4015
|
+
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
4016
|
+
<xsl:variable name="title-appendix">
|
4017
|
+
<xsl:call-template name="getTitle">
|
4018
|
+
<xsl:with-param name="name" select="'title-appendix'"/>
|
4019
|
+
</xsl:call-template>
|
4020
|
+
</xsl:variable>
|
4021
|
+
<fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
|
4022
|
+
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
4023
|
+
</fo:block>
|
4024
|
+
<xsl:apply-templates/>
|
4025
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
4026
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4027
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
|
4028
|
+
<fo:block xsl:use-attribute-sets="appendix-example-style">
|
4029
|
+
<xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
|
4030
|
+
<xsl:variable name="title-example">
|
4031
|
+
<xsl:call-template name="getTitle">
|
4032
|
+
<xsl:with-param name="name" select="'title-example'"/>
|
4033
|
+
</xsl:call-template>
|
4034
|
+
</xsl:variable>
|
4035
|
+
<xsl:value-of select="$title-example"/>
|
4036
|
+
<xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) > 1">
|
4037
|
+
<xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
|
4038
|
+
</xsl:if>
|
4039
|
+
<xsl:if test="*[local-name()='name']">
|
4040
|
+
<xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
|
4041
|
+
</xsl:if>
|
4042
|
+
</fo:block>
|
4043
|
+
<xsl:apply-templates/>
|
4044
|
+
</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">
|
4045
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4046
|
+
</xsl:template><xsl:template match="*[local-name() = 'callout']">
|
4047
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"><<xsl:apply-templates/>></fo:basic-link>
|
4048
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']">
|
4049
|
+
<xsl:variable name="annotation-id" select="@id"/>
|
4050
|
+
<xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
|
4051
|
+
<fo:block id="{$annotation-id}" white-space="nowrap">
|
4052
|
+
<fo:inline>
|
4053
|
+
<xsl:apply-templates>
|
4054
|
+
<xsl:with-param name="callout" select="concat('<', $callout, '> ')"/>
|
4055
|
+
</xsl:apply-templates>
|
4056
|
+
</fo:inline>
|
4057
|
+
</fo:block>
|
4058
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
4059
|
+
<xsl:param name="callout"/>
|
4060
|
+
<fo:inline id="{@id}">
|
4061
|
+
<!-- for first p in annotation, put <x> -->
|
4062
|
+
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
4063
|
+
<xsl:apply-templates/>
|
4064
|
+
</fo:inline>
|
4065
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4066
|
+
<xsl:variable name="title-modified">
|
4067
|
+
<xsl:call-template name="getTitle">
|
4068
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4069
|
+
</xsl:call-template>
|
4070
|
+
</xsl:variable>
|
4071
|
+
<xsl:choose>
|
4072
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
4073
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
4074
|
+
</xsl:choose>
|
4075
|
+
<xsl:apply-templates/>
|
4076
|
+
</xsl:template><xsl:template name="convertDate">
|
4077
|
+
<xsl:param name="date"/>
|
4078
|
+
<xsl:param name="format" select="'short'"/>
|
4079
|
+
<xsl:variable name="year" select="substring($date, 1, 4)"/>
|
4080
|
+
<xsl:variable name="month" select="substring($date, 6, 2)"/>
|
4081
|
+
<xsl:variable name="day" select="substring($date, 9, 2)"/>
|
4082
|
+
<xsl:variable name="monthStr">
|
4083
|
+
<xsl:choose>
|
4084
|
+
<xsl:when test="$month = '01'">January</xsl:when>
|
4085
|
+
<xsl:when test="$month = '02'">February</xsl:when>
|
4086
|
+
<xsl:when test="$month = '03'">March</xsl:when>
|
4087
|
+
<xsl:when test="$month = '04'">April</xsl:when>
|
4088
|
+
<xsl:when test="$month = '05'">May</xsl:when>
|
4089
|
+
<xsl:when test="$month = '06'">June</xsl:when>
|
4090
|
+
<xsl:when test="$month = '07'">July</xsl:when>
|
4091
|
+
<xsl:when test="$month = '08'">August</xsl:when>
|
4092
|
+
<xsl:when test="$month = '09'">September</xsl:when>
|
4093
|
+
<xsl:when test="$month = '10'">October</xsl:when>
|
4094
|
+
<xsl:when test="$month = '11'">November</xsl:when>
|
4095
|
+
<xsl:when test="$month = '12'">December</xsl:when>
|
4096
|
+
</xsl:choose>
|
4097
|
+
</xsl:variable>
|
4098
|
+
<xsl:variable name="result">
|
4099
|
+
<xsl:choose>
|
4100
|
+
<xsl:when test="$format = 'short' or $day = ''">
|
4101
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4102
|
+
</xsl:when>
|
4103
|
+
<xsl:otherwise>
|
4104
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
|
4105
|
+
</xsl:otherwise>
|
4106
|
+
</xsl:choose>
|
4107
|
+
</xsl:variable>
|
4108
|
+
<xsl:value-of select="$result"/>
|
4109
|
+
</xsl:template><xsl:template name="insertKeywords">
|
4110
|
+
<xsl:param name="sorting" select="'true'"/>
|
4111
|
+
<xsl:param name="charAtEnd" select="'.'"/>
|
4112
|
+
<xsl:param name="charDelim" select="', '"/>
|
4113
|
+
<xsl:choose>
|
4114
|
+
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4115
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4116
|
+
<xsl:sort data-type="text" order="ascending"/>
|
4117
|
+
<xsl:call-template name="insertKeyword">
|
4118
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4119
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4120
|
+
</xsl:call-template>
|
4121
|
+
</xsl:for-each>
|
4122
|
+
</xsl:when>
|
4123
|
+
<xsl:otherwise>
|
4124
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4125
|
+
<xsl:call-template name="insertKeyword">
|
4126
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4127
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4128
|
+
</xsl:call-template>
|
4129
|
+
</xsl:for-each>
|
4130
|
+
</xsl:otherwise>
|
4131
|
+
</xsl:choose>
|
4132
|
+
</xsl:template><xsl:template name="insertKeyword">
|
4133
|
+
<xsl:param name="charAtEnd"/>
|
4134
|
+
<xsl:param name="charDelim"/>
|
4135
|
+
<xsl:apply-templates/>
|
4136
|
+
<xsl:choose>
|
4137
|
+
<xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
|
4138
|
+
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4139
|
+
</xsl:choose>
|
4140
|
+
</xsl:template><xsl:template name="addPDFUAmeta">
|
4141
|
+
<fo:declarations>
|
4142
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4143
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4144
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4145
|
+
</pdf:dictionary>
|
4146
|
+
</pdf:catalog>
|
4147
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4148
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4149
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4150
|
+
<!-- Dublin Core properties go here -->
|
4151
|
+
<dc:title>
|
4152
|
+
<xsl:variable name="title">
|
4153
|
+
|
4154
|
+
<xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
|
4155
|
+
|
4156
|
+
|
4157
|
+
|
4158
|
+
|
4159
|
+
</xsl:variable>
|
4160
|
+
<xsl:choose>
|
4161
|
+
<xsl:when test="normalize-space($title) != ''">
|
4162
|
+
<xsl:value-of select="$title"/>
|
4163
|
+
</xsl:when>
|
4164
|
+
<xsl:otherwise>
|
4165
|
+
<xsl:text> </xsl:text>
|
4166
|
+
</xsl:otherwise>
|
4167
|
+
</xsl:choose>
|
4168
|
+
</dc:title>
|
4169
|
+
<dc:creator>
|
4170
|
+
|
4171
|
+
|
4172
|
+
</dc:creator>
|
4173
|
+
<dc:description>
|
4174
|
+
<xsl:variable name="abstract">
|
4175
|
+
|
4176
|
+
|
4177
|
+
|
4178
|
+
<xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4179
|
+
|
4180
|
+
|
4181
|
+
</xsl:variable>
|
4182
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
4183
|
+
</dc:description>
|
4184
|
+
<pdf:Keywords>
|
4185
|
+
<xsl:call-template name="insertKeywords"/>
|
4186
|
+
</pdf:Keywords>
|
4187
|
+
</rdf:Description>
|
4188
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
4189
|
+
<!-- XMP properties go here -->
|
4190
|
+
<xmp:CreatorTool/>
|
4191
|
+
</rdf:Description>
|
4192
|
+
</rdf:RDF>
|
4193
|
+
</x:xmpmeta>
|
4194
|
+
</fo:declarations>
|
4195
|
+
</xsl:template><xsl:template name="getId">
|
4196
|
+
<xsl:choose>
|
4197
|
+
<xsl:when test="../@id">
|
4198
|
+
<xsl:value-of select="../@id"/>
|
4199
|
+
</xsl:when>
|
4200
|
+
<xsl:otherwise>
|
4201
|
+
<!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
|
4202
|
+
<xsl:value-of select="concat(generate-id(..), '_', text())"/>
|
4203
|
+
</xsl:otherwise>
|
4204
|
+
</xsl:choose>
|
4205
|
+
</xsl:template><xsl:template name="getLevel">
|
4206
|
+
<xsl:variable name="level_total" select="count(ancestor::*)"/>
|
4207
|
+
<xsl:variable name="level">
|
4208
|
+
<xsl:choose>
|
4209
|
+
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
4210
|
+
<xsl:value-of select="$level_total - 2"/>
|
4211
|
+
</xsl:when>
|
4212
|
+
<xsl:when test="ancestor::*[local-name() = 'sections']">
|
4213
|
+
<xsl:value-of select="$level_total - 2"/>
|
4214
|
+
</xsl:when>
|
4215
|
+
<xsl:when test="ancestor::*[local-name() = 'bibliography']">
|
4216
|
+
<xsl:value-of select="$level_total - 2"/>
|
4217
|
+
</xsl:when>
|
4218
|
+
<xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
|
4219
|
+
<xsl:otherwise>
|
4220
|
+
<xsl:value-of select="$level_total - 1"/>
|
4221
|
+
</xsl:otherwise>
|
4222
|
+
</xsl:choose>
|
4223
|
+
</xsl:variable>
|
4224
|
+
<xsl:value-of select="$level"/>
|
4225
|
+
</xsl:template><xsl:template name="getSubSection">
|
4226
|
+
<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']"/>
|
4227
|
+
</xsl:template><xsl:template name="split">
|
4228
|
+
<xsl:param name="pText" select="."/>
|
4229
|
+
<xsl:param name="sep" select="','"/>
|
4230
|
+
<xsl:if test="string-length($pText) >0">
|
4231
|
+
<item>
|
4232
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
|
4233
|
+
</item>
|
4234
|
+
<xsl:call-template name="split">
|
4235
|
+
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4236
|
+
<xsl:with-param name="sep" select="$sep"/>
|
4237
|
+
</xsl:call-template>
|
4238
|
+
</xsl:if>
|
4239
|
+
</xsl:template><xsl:template name="getDocumentId">
|
4240
|
+
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
3520
4241
|
</xsl:template></xsl:stylesheet>
|