metanorma-iso 1.3.25 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iso/base.rb +6 -0
- data/lib/asciidoctor/iso/biblio.rng +13 -3
- data/lib/asciidoctor/iso/front.rb +3 -155
- data/lib/asciidoctor/iso/front_id.rb +196 -0
- data/lib/asciidoctor/iso/isodoc.rng +17 -1
- data/lib/asciidoctor/iso/isostandard.rng +7 -1
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +5 -8
- data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
- data/lib/asciidoctor/iso/validate_style.rb +6 -5
- data/lib/isodoc/iso/base_convert.rb +1 -33
- data/lib/isodoc/iso/html/header.html +5 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +9 -0
- data/lib/isodoc/iso/html/isodoc.scss +21 -0
- data/lib/isodoc/iso/html/style-human.scss +5 -1
- data/lib/isodoc/iso/html/style-iso.scss +5 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +4 -4
- data/lib/isodoc/iso/html/wordstyle.scss +20 -6
- data/lib/isodoc/iso/iso.amendment.xsl +4597 -0
- data/lib/isodoc/iso/iso.international-standard.xsl +494 -283
- data/lib/isodoc/iso/metadata.rb +30 -26
- data/lib/isodoc/iso/pdf_convert.rb +9 -2
- data/lib/isodoc/iso/sections.rb +66 -0
- data/lib/isodoc/iso/sts_convert.rb +29 -0
- data/lib/metanorma-iso.rb +1 -0
- data/lib/metanorma/iso/processor.rb +4 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -1
- data/spec/asciidoctor-iso/amd_spec.rb +412 -4
- data/spec/asciidoctor-iso/base_spec.rb +15 -13
- data/spec/asciidoctor-iso/macros_spec.rb +15 -13
- data/spec/isodoc/amd_spec.rb +606 -0
- data/spec/isodoc/metadata_spec.rb +4 -2
- data/spec/isodoc/postproc_spec.rb +8 -8
- data/spec/isodoc/ref_spec.rb +1 -1
- data/spec/isodoc/section_spec.rb +28 -1
- data/spec/metanorma/processor_spec.rb +1 -1
- metadata +51 -4
@@ -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:iso="https://www.metanorma.org/ns/iso" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" version="1.0">
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
@@ -31,8 +31,8 @@
|
|
31
31
|
<xsl:variable name="title-main" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-main']"/>
|
32
32
|
<xsl:variable name="title-main-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-main']"/>
|
33
33
|
<xsl:variable name="part" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@part"/>
|
34
|
-
|
35
|
-
|
34
|
+
|
35
|
+
|
36
36
|
|
37
37
|
<xsl:variable name="doctype_uppercased" select="translate(translate(/iso:iso-standard/iso:bibdata/iso:ext/iso:doctype,'-',' '), $lower,$upper)"/>
|
38
38
|
|
@@ -144,10 +144,6 @@
|
|
144
144
|
</xsl:variable>
|
145
145
|
|
146
146
|
<xsl:variable name="proof-text">PROOF/ÉPREUVE</xsl:variable>
|
147
|
-
|
148
|
-
<xsl:variable name="title-figure">
|
149
|
-
<xsl:text>Figure </xsl:text>
|
150
|
-
</xsl:variable>
|
151
147
|
|
152
148
|
<!-- Example:
|
153
149
|
<item level="1" id="Foreword" display="true">Foreword</item>
|
@@ -333,7 +329,9 @@
|
|
333
329
|
</xsl:variable>
|
334
330
|
<xsl:value-of select="normalize-space($abstract)"/>
|
335
331
|
</dc:description>
|
336
|
-
<pdf:Keywords
|
332
|
+
<pdf:Keywords>
|
333
|
+
<xsl:call-template name="insertKeywords"/>
|
334
|
+
</pdf:Keywords>
|
337
335
|
</rdf:Description>
|
338
336
|
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
339
337
|
<!-- XMP properties go here -->
|
@@ -518,8 +516,10 @@
|
|
518
516
|
</xsl:if>
|
519
517
|
|
520
518
|
<xsl:value-of select="$title-main"/>
|
519
|
+
|
520
|
+
<xsl:call-template name="printTitlePartEn"/>
|
521
521
|
|
522
|
-
<xsl:if test="normalize-space($title-part) != ''">
|
522
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
523
523
|
<xsl:if test="$part != ''">
|
524
524
|
<xsl:text> — </xsl:text>
|
525
525
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -528,7 +528,7 @@
|
|
528
528
|
</fo:block>
|
529
529
|
</xsl:if>
|
530
530
|
<xsl:value-of select="$title-part"/>
|
531
|
-
</xsl:if>
|
531
|
+
</xsl:if> -->
|
532
532
|
</fo:block>
|
533
533
|
|
534
534
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -540,16 +540,9 @@
|
|
540
540
|
</xsl:if>
|
541
541
|
|
542
542
|
<xsl:value-of select="$title-main-fr"/>
|
543
|
+
|
544
|
+
<xsl:call-template name="printTitlePartFr"/>
|
543
545
|
|
544
|
-
<xsl:if test="normalize-space($title-part-fr) != ''">
|
545
|
-
<xsl:if test="$part != ''">
|
546
|
-
<xsl:text> — </xsl:text>
|
547
|
-
<xsl:text>Partie </xsl:text>
|
548
|
-
<xsl:value-of select="$part"/>
|
549
|
-
<xsl:text>:</xsl:text>
|
550
|
-
</xsl:if>
|
551
|
-
<xsl:value-of select="$title-part-fr"/>
|
552
|
-
</xsl:if>
|
553
546
|
</fo:block>
|
554
547
|
</fo:block>
|
555
548
|
<fo:block margin-top="10mm">
|
@@ -681,7 +674,8 @@
|
|
681
674
|
|
682
675
|
<xsl:value-of select="$title-main"/>
|
683
676
|
|
684
|
-
<xsl:
|
677
|
+
<xsl:call-template name="printTitlePartEn"/>
|
678
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
685
679
|
<xsl:if test="$part != ''">
|
686
680
|
<xsl:text> — </xsl:text>
|
687
681
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -690,7 +684,7 @@
|
|
690
684
|
</fo:block>
|
691
685
|
</xsl:if>
|
692
686
|
<xsl:value-of select="$title-part"/>
|
693
|
-
</xsl:if>
|
687
|
+
</xsl:if> -->
|
694
688
|
</fo:block>
|
695
689
|
|
696
690
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -703,15 +697,8 @@
|
|
703
697
|
|
704
698
|
<xsl:value-of select="$title-main-fr"/>
|
705
699
|
|
706
|
-
<xsl:
|
707
|
-
|
708
|
-
<xsl:text> — </xsl:text>
|
709
|
-
<xsl:text>Partie </xsl:text>
|
710
|
-
<xsl:value-of select="$part"/>
|
711
|
-
<xsl:text>:</xsl:text>
|
712
|
-
</xsl:if>
|
713
|
-
<xsl:value-of select="$title-part-fr"/>
|
714
|
-
</xsl:if>
|
700
|
+
<xsl:call-template name="printTitlePartFr"/>
|
701
|
+
|
715
702
|
</fo:block>
|
716
703
|
</fo:block>
|
717
704
|
</fo:block-container>
|
@@ -801,7 +788,8 @@
|
|
801
788
|
|
802
789
|
<xsl:value-of select="$title-main"/>
|
803
790
|
|
804
|
-
<xsl:
|
791
|
+
<xsl:call-template name="printTitlePartEn"/>
|
792
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
805
793
|
<xsl:if test="$part != ''">
|
806
794
|
<xsl:text> — </xsl:text>
|
807
795
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -810,7 +798,7 @@
|
|
810
798
|
</fo:block>
|
811
799
|
</xsl:if>
|
812
800
|
<xsl:value-of select="$title-part"/>
|
813
|
-
</xsl:if>
|
801
|
+
</xsl:if> -->
|
814
802
|
</fo:block>
|
815
803
|
|
816
804
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -823,15 +811,8 @@
|
|
823
811
|
|
824
812
|
<xsl:value-of select="$title-main-fr"/>
|
825
813
|
|
826
|
-
<xsl:
|
827
|
-
|
828
|
-
<xsl:text> — </xsl:text>
|
829
|
-
<xsl:text>Partie </xsl:text>
|
830
|
-
<xsl:value-of select="$part"/>
|
831
|
-
<xsl:text>:</xsl:text>
|
832
|
-
</xsl:if>
|
833
|
-
<xsl:value-of select="$title-part-fr"/>
|
834
|
-
</xsl:if>
|
814
|
+
<xsl:call-template name="printTitlePartFr"/>
|
815
|
+
|
835
816
|
</fo:block>
|
836
817
|
</fo:block>
|
837
818
|
</fo:block-container>
|
@@ -920,7 +901,8 @@
|
|
920
901
|
|
921
902
|
<xsl:value-of select="$title-main"/>
|
922
903
|
|
923
|
-
<xsl:
|
904
|
+
<xsl:call-template name="printTitlePartEn"/>
|
905
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
924
906
|
<xsl:if test="$part != ''">
|
925
907
|
<xsl:text> — </xsl:text>
|
926
908
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -929,7 +911,7 @@
|
|
929
911
|
</fo:block>
|
930
912
|
</xsl:if>
|
931
913
|
<xsl:value-of select="$title-part"/>
|
932
|
-
</xsl:if>
|
914
|
+
</xsl:if> -->
|
933
915
|
</fo:block>
|
934
916
|
|
935
917
|
<fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -941,15 +923,16 @@
|
|
941
923
|
|
942
924
|
<xsl:value-of select="$title-main-fr"/>
|
943
925
|
|
944
|
-
<xsl:
|
926
|
+
<xsl:variable name="part-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-part']"/>
|
927
|
+
<xsl:if test="normalize-space($part-fr) != ''">
|
945
928
|
<xsl:if test="$part != ''">
|
946
929
|
<xsl:text> — </xsl:text>
|
947
930
|
<fo:block margin-top="6pt" font-weight="normal">
|
948
|
-
<xsl:
|
931
|
+
<xsl:value-of select="$title-part-fr"/><xsl:value-of select="$part"/>
|
949
932
|
<xsl:text>:</xsl:text>
|
950
933
|
</fo:block>
|
951
934
|
</xsl:if>
|
952
|
-
<xsl:value-of select="$
|
935
|
+
<xsl:value-of select="$part-fr"/>
|
953
936
|
</xsl:if>
|
954
937
|
</fo:block>
|
955
938
|
</fo:block-container>
|
@@ -1088,6 +1071,7 @@
|
|
1088
1071
|
</fo:block>
|
1089
1072
|
-->
|
1090
1073
|
<fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
|
1074
|
+
<xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
|
1091
1075
|
<fo:block>
|
1092
1076
|
<xsl:if test="normalize-space($title-intro) != ''">
|
1093
1077
|
<xsl:value-of select="$title-intro"/>
|
@@ -1096,18 +1080,19 @@
|
|
1096
1080
|
|
1097
1081
|
<xsl:value-of select="$title-main"/>
|
1098
1082
|
|
1099
|
-
<xsl:if test="normalize-space($
|
1083
|
+
<xsl:if test="normalize-space($part-en) != ''">
|
1100
1084
|
<xsl:if test="$part != ''">
|
1101
1085
|
<xsl:text> — </xsl:text>
|
1102
1086
|
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
|
1103
|
-
<xsl:
|
1087
|
+
<xsl:value-of select="$title-part-en"/>
|
1088
|
+
<xsl:value-of select="$part"/>
|
1104
1089
|
<xsl:text>:</xsl:text>
|
1105
1090
|
</fo:block>
|
1106
1091
|
</xsl:if>
|
1107
1092
|
</xsl:if>
|
1108
1093
|
</fo:block>
|
1109
1094
|
<fo:block>
|
1110
|
-
<xsl:value-of select="$
|
1095
|
+
<xsl:value-of select="$part-en"/>
|
1111
1096
|
</fo:block>
|
1112
1097
|
</fo:block>
|
1113
1098
|
|
@@ -1187,6 +1172,14 @@
|
|
1187
1172
|
<xsl:otherwise>ICS  67.060</xsl:otherwise>
|
1188
1173
|
</xsl:choose> -->
|
1189
1174
|
</fo:block>
|
1175
|
+
<xsl:if test="/iso:iso-standard/iso:bibdata/iso:keyword">
|
1176
|
+
<fo:block font-size="9pt" margin-bottom="6pt">
|
1177
|
+
<fo:inline font-weight="bold"><xsl:value-of select="$title-descriptors"/>: </fo:inline>
|
1178
|
+
<xsl:call-template name="insertKeywords">
|
1179
|
+
<xsl:with-param name="sorting">no</xsl:with-param>
|
1180
|
+
</xsl:call-template>
|
1181
|
+
</fo:block>
|
1182
|
+
</xsl:if>
|
1190
1183
|
<fo:block font-size="9pt">Price based on <fo:page-number-citation ref-id="lastBlock"/> pages</fo:block>
|
1191
1184
|
</fo:block-container>
|
1192
1185
|
</fo:block-container>
|
@@ -1314,21 +1307,9 @@
|
|
1314
1307
|
<xsl:param name="sectionNum"/>
|
1315
1308
|
<xsl:variable name="annex-id" select="ancestor::iso:annex/@id"/>
|
1316
1309
|
<item level="" id="{@id}" display="false" type="table">
|
1317
|
-
<xsl:attribute name="section">
|
1318
|
-
<xsl:
|
1319
|
-
<xsl:
|
1320
|
-
<xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
|
1321
|
-
<xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
|
1322
|
-
</xsl:when>
|
1323
|
-
<xsl:when test="ancestor::*[local-name()='annex']">
|
1324
|
-
<xsl:number format="A-" count="iso:annex"/>
|
1325
|
-
<xsl:number format="1" level="any" count="iso:table[ancestor::iso:annex[@id = $annex-id]]"/>
|
1326
|
-
</xsl:when>
|
1327
|
-
<xsl:otherwise>
|
1328
|
-
<!-- <xsl:number format="1"/> -->
|
1329
|
-
<xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table']"/>
|
1330
|
-
</xsl:otherwise>
|
1331
|
-
</xsl:choose>
|
1310
|
+
<xsl:attribute name="section">
|
1311
|
+
<xsl:value-of select="$title-table"/>
|
1312
|
+
<xsl:call-template name="getTableNumber"/>
|
1332
1313
|
</xsl:attribute>
|
1333
1314
|
<xsl:value-of select="iso:name/text()"/>
|
1334
1315
|
</item>
|
@@ -1443,7 +1424,7 @@
|
|
1443
1424
|
<xsl:param name="sectionNum"/>
|
1444
1425
|
<xsl:param name="sectionNumSkew" select="0"/>
|
1445
1426
|
<fo:block>
|
1446
|
-
<xsl:variable name="pos"><xsl:number count="iso:sections/iso:clause | iso:sections/iso:terms
|
1427
|
+
<xsl:variable name="pos"><xsl:number count="*"/></xsl:variable> <!-- iso:sections/iso:clause | iso:sections/iso:terms | iso:sections/iso:definitions -->
|
1447
1428
|
<xsl:if test="$pos >= 2">
|
1448
1429
|
<xsl:attribute name="space-before">18pt</xsl:attribute>
|
1449
1430
|
</xsl:if>
|
@@ -1452,7 +1433,7 @@
|
|
1452
1433
|
<xsl:choose>
|
1453
1434
|
<xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
|
1454
1435
|
<xsl:when test="$sectionNumSkew != 0">
|
1455
|
-
<xsl:variable name="number"><xsl:number count="iso:sections/iso:clause | iso:sections/iso:terms
|
1436
|
+
<xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!--iso:sections/iso:clause | iso:sections/iso:terms | iso:sections/iso:definitions -->
|
1456
1437
|
<xsl:value-of select="$number + $sectionNumSkew"/>
|
1457
1438
|
</xsl:when>
|
1458
1439
|
</xsl:choose>
|
@@ -1793,15 +1774,17 @@
|
|
1793
1774
|
|
1794
1775
|
<xsl:template match="iso:bibitem">
|
1795
1776
|
<fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
<xsl:
|
1777
|
+
<xsl:variable name="docidentifier">
|
1778
|
+
<xsl:if test="iso:docidentifier">
|
1779
|
+
<xsl:choose>
|
1780
|
+
<xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
|
1781
|
+
<xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
|
1782
|
+
</xsl:choose>
|
1783
|
+
</xsl:if>
|
1784
|
+
</xsl:variable>
|
1785
|
+
<xsl:value-of select="$docidentifier"/>
|
1786
|
+
<xsl:apply-templates select="iso:note"/>
|
1787
|
+
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
1805
1788
|
<fo:inline font-style="italic">
|
1806
1789
|
<xsl:choose>
|
1807
1790
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
@@ -1921,7 +1904,9 @@
|
|
1921
1904
|
<fo:block margin-bottom="8pt"> <!-- keep-with-previous="always" -->
|
1922
1905
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
1923
1906
|
<fo:basic-link internal-destination="{iso:origin/@bibitemid}" fox:alt-text="{iso:origin/@citeas}">
|
1924
|
-
<xsl:text>[
|
1907
|
+
<xsl:text>[</xsl:text>
|
1908
|
+
<xsl:value-of select="$title-source"/>
|
1909
|
+
<xsl:text>: </xsl:text>
|
1925
1910
|
<xsl:value-of select="iso:origin/@citeas"/>
|
1926
1911
|
|
1927
1912
|
<xsl:apply-templates select="iso:origin/iso:localityStack"/>
|
@@ -1936,7 +1921,7 @@
|
|
1936
1921
|
</xsl:template>
|
1937
1922
|
|
1938
1923
|
<xsl:template match="iso:modification">
|
1939
|
-
<xsl:text>, modified — </xsl:text>
|
1924
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text>
|
1940
1925
|
<xsl:apply-templates/>
|
1941
1926
|
</xsl:template>
|
1942
1927
|
<xsl:template match="iso:modification/iso:p">
|
@@ -1945,9 +1930,11 @@
|
|
1945
1930
|
|
1946
1931
|
<xsl:template match="iso:termnote">
|
1947
1932
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt" text-align="justify">
|
1948
|
-
<xsl:text>Note </xsl:text>
|
1949
|
-
<xsl:number/>
|
1950
|
-
<xsl:text> to entry: </xsl:text>
|
1933
|
+
<!-- <xsl:text>Note </xsl:text>
|
1934
|
+
<xsl:number />
|
1935
|
+
<xsl:text> to entry: </xsl:text> -->
|
1936
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
1937
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
|
1951
1938
|
<xsl:apply-templates/>
|
1952
1939
|
</fo:block>
|
1953
1940
|
</xsl:template>
|
@@ -1961,14 +1948,14 @@
|
|
1961
1948
|
</xsl:template>
|
1962
1949
|
|
1963
1950
|
<xsl:template match="iso:domain">
|
1964
|
-
<fo:inline><<xsl:apply-templates/>></fo:inline>
|
1951
|
+
<fo:inline><<xsl:apply-templates/>></fo:inline><xsl:text> </xsl:text>
|
1965
1952
|
</xsl:template>
|
1966
1953
|
|
1967
1954
|
|
1968
1955
|
<xsl:template match="iso:termexample">
|
1969
1956
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt" text-align="justify">
|
1970
1957
|
<fo:inline padding-right="5mm">
|
1971
|
-
<xsl:
|
1958
|
+
<xsl:value-of select="$title-example"/>
|
1972
1959
|
<xsl:if test="count(ancestor::iso:term[1]//iso:termexample) > 1">
|
1973
1960
|
<xsl:number/>
|
1974
1961
|
</xsl:if>
|
@@ -2009,14 +1996,17 @@
|
|
2009
1996
|
</fo:list-item-label>
|
2010
1997
|
<fo:list-item-body start-indent="body-start()">
|
2011
1998
|
<fo:block>
|
2012
|
-
<xsl:
|
2013
|
-
<xsl:
|
2014
|
-
<xsl:
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
1999
|
+
<xsl:variable name="docidentifier">
|
2000
|
+
<xsl:if test="iso:docidentifier">
|
2001
|
+
<xsl:choose>
|
2002
|
+
<xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
|
2003
|
+
<xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
|
2004
|
+
</xsl:choose>
|
2005
|
+
</xsl:if>
|
2006
|
+
</xsl:variable>
|
2007
|
+
<xsl:value-of select="$docidentifier"/>
|
2018
2008
|
<xsl:apply-templates select="iso:note"/>
|
2019
|
-
<xsl:if test="
|
2009
|
+
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
2020
2010
|
<xsl:choose>
|
2021
2011
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
2022
2012
|
<xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
|
@@ -2063,63 +2053,6 @@
|
|
2063
2053
|
</fo:basic-link>
|
2064
2054
|
</xsl:template>
|
2065
2055
|
|
2066
|
-
<xsl:template match="iso:appendix">
|
2067
|
-
<fo:block font-size="12pt" font-weight="bold" margin-top="12pt" margin-bottom="12pt">
|
2068
|
-
<fo:inline padding-right="5mm">Appendix <xsl:number/></fo:inline>
|
2069
|
-
<xsl:apply-templates select="iso:title" mode="process"/>
|
2070
|
-
</fo:block>
|
2071
|
-
<xsl:apply-templates/>
|
2072
|
-
</xsl:template>
|
2073
|
-
|
2074
|
-
<xsl:template match="iso:appendix//iso:example">
|
2075
|
-
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt">
|
2076
|
-
<xsl:variable name="claims_id" select="ancestor::iso:clause[1]/@id"/>
|
2077
|
-
<xsl:text>EXAMPLE </xsl:text>
|
2078
|
-
<xsl:if test="count(ancestor::iso:clause[1]//iso:example) > 1">
|
2079
|
-
<xsl:number count="iso:example[ancestor::iso:clause[@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
|
2080
|
-
</xsl:if>
|
2081
|
-
<xsl:if test="iso:name">
|
2082
|
-
<xsl:text>— </xsl:text><xsl:apply-templates select="iso:name" mode="process"/>
|
2083
|
-
</xsl:if>
|
2084
|
-
</fo:block>
|
2085
|
-
<xsl:apply-templates/>
|
2086
|
-
</xsl:template>
|
2087
|
-
|
2088
|
-
<xsl:template match="iso:appendix//iso:example/iso:name"/>
|
2089
|
-
<xsl:template match="iso:appendix//iso:example/iso:name" mode="process">
|
2090
|
-
<fo:inline><xsl:apply-templates/></fo:inline>
|
2091
|
-
</xsl:template>
|
2092
|
-
|
2093
|
-
<!-- <xsl:template match="iso:callout/text()">
|
2094
|
-
<fo:basic-link internal-destination="{@target}"><fo:inline><<xsl:apply-templates />></fo:inline></fo:basic-link>
|
2095
|
-
</xsl:template> -->
|
2096
|
-
<xsl:template match="iso:callout">
|
2097
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"><<xsl:apply-templates/>></fo:basic-link>
|
2098
|
-
</xsl:template>
|
2099
|
-
|
2100
|
-
<xsl:template match="iso:annotation">
|
2101
|
-
<fo:block>
|
2102
|
-
|
2103
|
-
</fo:block>
|
2104
|
-
<xsl:apply-templates/>
|
2105
|
-
</xsl:template>
|
2106
|
-
|
2107
|
-
<xsl:template match="iso:annotation/text()"/>
|
2108
|
-
|
2109
|
-
<xsl:template match="iso:annotation/iso:p">
|
2110
|
-
<xsl:variable name="annotation-id" select="../@id"/>
|
2111
|
-
<xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
|
2112
|
-
<fo:block id="{$annotation-id}">
|
2113
|
-
<xsl:value-of select="concat('<', $callout, '> ')"/>
|
2114
|
-
<xsl:apply-templates/>
|
2115
|
-
</fo:block>
|
2116
|
-
</xsl:template>
|
2117
|
-
|
2118
|
-
|
2119
|
-
<xsl:template match="iso:appendix/iso:title"/>
|
2120
|
-
<xsl:template match="iso:appendix/iso:title" mode="process">
|
2121
|
-
<fo:inline><xsl:apply-templates/></fo:inline>
|
2122
|
-
</xsl:template>
|
2123
2056
|
|
2124
2057
|
<xsl:template match="mathml:math" priority="2">
|
2125
2058
|
<fo:inline font-family="Cambria Math">
|
@@ -2143,7 +2076,7 @@
|
|
2143
2076
|
<xsl:variable name="root" select="xalan:nodeset($contents)//item[@id =$target]/@root"/>
|
2144
2077
|
<xsl:variable name="level" select="xalan:nodeset($contents)//item[@id =$target]/@level"/>
|
2145
2078
|
<xsl:choose>
|
2146
|
-
<xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1"
|
2079
|
+
<xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
|
2147
2080
|
<xsl:when test="$type = 'li'">
|
2148
2081
|
<xsl:attribute name="color">black</xsl:attribute>
|
2149
2082
|
<xsl:attribute name="text-decoration">none</xsl:attribute>
|
@@ -2164,18 +2097,6 @@
|
|
2164
2097
|
<xsl:value-of select="$section"/>
|
2165
2098
|
</fo:basic-link>
|
2166
2099
|
</xsl:template>
|
2167
|
-
|
2168
|
-
<xsl:template match="iso:sourcecode">
|
2169
|
-
<fo:block font-family="Courier" font-size="9pt" margin-bottom="12pt">
|
2170
|
-
<xsl:choose>
|
2171
|
-
<xsl:when test="@lang = 'en'"/>
|
2172
|
-
<xsl:otherwise>
|
2173
|
-
<xsl:attribute name="white-space">pre</xsl:attribute>
|
2174
|
-
</xsl:otherwise>
|
2175
|
-
</xsl:choose>
|
2176
|
-
<xsl:apply-templates/>
|
2177
|
-
</fo:block>
|
2178
|
-
</xsl:template>
|
2179
2100
|
|
2180
2101
|
<xsl:template match="iso:example/iso:p">
|
2181
2102
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt">
|
@@ -2183,8 +2104,8 @@
|
|
2183
2104
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
2184
2105
|
</xsl:if> -->
|
2185
2106
|
<xsl:variable name="claims_id" select="ancestor::iso:clause[1]/@id"/>
|
2186
|
-
<fo:inline padding-right="5mm">
|
2187
|
-
<xsl:
|
2107
|
+
<fo:inline padding-right="5mm">
|
2108
|
+
<xsl:value-of select="$title-example"/>
|
2188
2109
|
<xsl:if test="count(ancestor::iso:clause[1]//iso:example) > 1">
|
2189
2110
|
<xsl:number count="iso:example[ancestor::iso:clause[@id = $claims_id]]" level="any"/>
|
2190
2111
|
</xsl:if>
|
@@ -2196,8 +2117,8 @@
|
|
2196
2117
|
<xsl:template match="iso:note/iso:p" name="note">
|
2197
2118
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="12pt" text-align="justify">
|
2198
2119
|
<xsl:variable name="claims_id" select="ancestor::iso:clause[1]/@id"/>
|
2199
|
-
<fo:inline padding-right="6mm">
|
2200
|
-
<xsl:
|
2120
|
+
<fo:inline padding-right="6mm">
|
2121
|
+
<xsl:value-of select="$title-note"/>
|
2201
2122
|
<xsl:if test="count(ancestor::iso:clause[1]//iso:note) > 1">
|
2202
2123
|
<xsl:number count="iso:note[ancestor::iso:clause[@id = $claims_id]]" level="any"/>
|
2203
2124
|
</xsl:if>
|
@@ -2238,9 +2159,9 @@
|
|
2238
2159
|
<xsl:choose>
|
2239
2160
|
<xsl:when test="ancestor::iso:termsource"/>
|
2240
2161
|
<xsl:when test="@type ='clause' and ancestor::iso:eref"/>
|
2241
|
-
<xsl:when test="@type ='clause'"
|
2242
|
-
<xsl:when test="@type ='annex'"
|
2243
|
-
<xsl:when test="@type ='table'"
|
2162
|
+
<xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
|
2163
|
+
<xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
|
2164
|
+
<xsl:when test="@type ='table'"><xsl:value-of select="$title-table"/></xsl:when>
|
2244
2165
|
<xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
|
2245
2166
|
</xsl:choose>
|
2246
2167
|
<xsl:text> </xsl:text><xsl:value-of select="iso:referenceFrom"/>
|
@@ -2431,7 +2352,7 @@
|
|
2431
2352
|
</xsl:when>
|
2432
2353
|
<xsl:when test="$level >= 2">
|
2433
2354
|
<xsl:variable name="num">
|
2434
|
-
<xsl:number format=".1" level="multiple" count="iso:clause/iso:clause | iso:clause/iso:terms | iso:terms/iso:term | iso:clause/iso:term | iso:terms/iso:clause | iso:terms/iso:definitions | iso:definitions/iso:clause | iso:clause/iso:definitions"/>
|
2355
|
+
<xsl:number format=".1" level="multiple" count="iso:clause/iso:clause | iso:clause/iso:terms | iso:terms/iso:term | iso:clause/iso:term | iso:terms/iso:clause | iso:terms/iso:definitions | iso:definitions/iso:clause | iso:definitions/iso:definitions | iso:clause/iso:definitions"/>
|
2435
2356
|
</xsl:variable>
|
2436
2357
|
<xsl:value-of select="concat($sectionNum, $num)"/>
|
2437
2358
|
</xsl:when>
|
@@ -2455,7 +2376,7 @@
|
|
2455
2376
|
<xsl:variable name="annexid" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:annexid)"/>
|
2456
2377
|
<xsl:choose>
|
2457
2378
|
<xsl:when test="$level = 1">
|
2458
|
-
<xsl:
|
2379
|
+
<xsl:value-of select="$title-annex"/>
|
2459
2380
|
<xsl:choose>
|
2460
2381
|
<xsl:when test="count(//iso:annex) = 1 and $annexid != ''">
|
2461
2382
|
<xsl:value-of select="$annexid"/>
|
@@ -2465,8 +2386,7 @@
|
|
2465
2386
|
</xsl:otherwise>
|
2466
2387
|
</xsl:choose>
|
2467
2388
|
</xsl:when>
|
2468
|
-
<xsl:otherwise>
|
2469
|
-
<xsl:variable name="annexid" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:annexid)"/>
|
2389
|
+
<xsl:otherwise>
|
2470
2390
|
<xsl:choose>
|
2471
2391
|
<xsl:when test="count(//iso:annex) = 1 and $annexid != ''">
|
2472
2392
|
<xsl:value-of select="$annexid"/><xsl:number format=".1" level="multiple" count="iso:clause"/>
|
@@ -3183,20 +3103,117 @@
|
|
3183
3103
|
</xsl:choose>
|
3184
3104
|
<xsl:if test="$edition != ''"><xsl:text> edition</xsl:text></xsl:if>
|
3185
3105
|
</xsl:template>
|
3106
|
+
|
3107
|
+
<xsl:template name="printTitlePartFr">
|
3108
|
+
<xsl:variable name="part-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-part']"/>
|
3109
|
+
<xsl:if test="normalize-space($part-fr) != ''">
|
3110
|
+
<xsl:if test="$part != ''">
|
3111
|
+
<xsl:text> — </xsl:text>
|
3112
|
+
<xsl:value-of select="$title-part-fr"/>
|
3113
|
+
<xsl:value-of select="$part"/>
|
3114
|
+
<xsl:text>:</xsl:text>
|
3115
|
+
</xsl:if>
|
3116
|
+
<xsl:value-of select="$part-fr"/>
|
3117
|
+
</xsl:if>
|
3118
|
+
</xsl:template>
|
3119
|
+
|
3120
|
+
<xsl:template name="printTitlePartEn">
|
3121
|
+
<xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
|
3122
|
+
<xsl:if test="normalize-space($part-en) != ''">
|
3123
|
+
<xsl:if test="$part != ''">
|
3124
|
+
<xsl:text> — </xsl:text>
|
3125
|
+
<fo:block font-weight="normal" margin-top="6pt">
|
3126
|
+
<xsl:value-of select="$title-part-en"/>
|
3127
|
+
<xsl:value-of select="$part"/>
|
3128
|
+
<xsl:text>:</xsl:text>
|
3129
|
+
</fo:block>
|
3130
|
+
</xsl:if>
|
3131
|
+
<xsl:value-of select="$part-en"/>
|
3132
|
+
</xsl:if>
|
3133
|
+
</xsl:template>
|
3186
3134
|
|
3187
|
-
|
3135
|
+
|
3136
|
+
<xsl:variable name="title-table">
|
3137
|
+
|
3138
|
+
<xsl:text>Table </xsl:text>
|
3139
|
+
|
3140
|
+
|
3141
|
+
</xsl:variable><xsl:variable name="title-note">
|
3142
|
+
|
3143
|
+
<xsl:text>NOTE </xsl:text>
|
3144
|
+
|
3145
|
+
|
3146
|
+
</xsl:variable><xsl:variable name="title-figure">
|
3147
|
+
|
3148
|
+
<xsl:text>Figure </xsl:text>
|
3149
|
+
|
3150
|
+
|
3151
|
+
</xsl:variable><xsl:variable name="title-example">
|
3152
|
+
|
3153
|
+
<xsl:text>EXAMPLE </xsl:text>
|
3154
|
+
|
3155
|
+
|
3156
|
+
</xsl:variable><xsl:variable name="title-inequality">Inequality </xsl:variable><xsl:variable name="title-equation">Equation </xsl:variable><xsl:variable name="title-annex">
|
3157
|
+
|
3158
|
+
<xsl:text>Annex </xsl:text>
|
3159
|
+
|
3160
|
+
|
3161
|
+
</xsl:variable><xsl:variable name="title-appendix">
|
3162
|
+
<xsl:text>Appendix </xsl:text>
|
3163
|
+
</xsl:variable><xsl:variable name="title-clause">
|
3164
|
+
|
3165
|
+
<xsl:text>Clause </xsl:text>
|
3166
|
+
|
3167
|
+
|
3168
|
+
</xsl:variable><xsl:variable name="title-edition">
|
3169
|
+
<xsl:text>Edition </xsl:text>
|
3170
|
+
</xsl:variable><xsl:variable name="title-toc">
|
3171
|
+
|
3172
|
+
|
3173
|
+
</xsl:variable><xsl:variable name="title-page">Page</xsl:variable><xsl:variable name="title-key">Key</xsl:variable><xsl:variable name="title-where">where</xsl:variable><xsl:variable name="title-descriptors">Descriptors</xsl:variable><xsl:variable name="title-part-en">Part </xsl:variable><xsl:variable name="title-part-fr">Partie </xsl:variable><xsl:variable name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable name="title-modified">modified</xsl:variable><xsl:variable name="title-source">SOURCE</xsl:variable><xsl:variable name="title-keywords">Keywords</xsl:variable><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">
|
3188
3174
|
|
3189
3175
|
<xsl:attribute name="color">blue</xsl:attribute>
|
3190
3176
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
3191
3177
|
|
3192
3178
|
|
3193
|
-
</xsl:attribute-set><xsl:
|
3179
|
+
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
3180
|
+
|
3181
|
+
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
3182
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3183
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
3184
|
+
|
3185
|
+
|
3186
|
+
|
3187
|
+
|
3188
|
+
|
3189
|
+
|
3190
|
+
|
3191
|
+
|
3192
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
3193
|
+
|
3194
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
3195
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
3196
|
+
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
3197
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
3198
|
+
|
3199
|
+
|
3200
|
+
|
3201
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
|
3202
|
+
|
3203
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3204
|
+
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
3205
|
+
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
3206
|
+
|
3207
|
+
|
3208
|
+
|
3209
|
+
</xsl:attribute-set><xsl:template match="text()">
|
3194
3210
|
<xsl:value-of select="."/>
|
3195
|
-
</xsl:template><xsl:template
|
3211
|
+
</xsl:template><xsl:template match="*[local-name()='br']">
|
3196
3212
|
<xsl:value-of select="$linebreak"/>
|
3197
|
-
</xsl:template><xsl:template
|
3198
|
-
<xsl:call-template name="add-zero-spaces"/>
|
3199
|
-
|
3213
|
+
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
3214
|
+
<!-- <xsl:call-template name="add-zero-spaces"/> -->
|
3215
|
+
<xsl:call-template name="add-zero-spaces-java"/>
|
3216
|
+
</xsl:template><xsl:template match="*[local-name()='table']">
|
3200
3217
|
|
3201
3218
|
<xsl:variable name="simple-table">
|
3202
3219
|
<!-- <xsl:copy> -->
|
@@ -3230,32 +3247,13 @@
|
|
3230
3247
|
|
3231
3248
|
|
3232
3249
|
|
3233
|
-
|
3234
|
-
|
3235
|
-
|
3236
|
-
|
3237
|
-
|
3238
|
-
|
3239
|
-
|
3240
|
-
<xsl:variable name="annex-id" select="ancestor::iso:annex/@id"/>
|
3241
|
-
<xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1" level="any" count="iso:table[(not(@unnumbered) or @unnumbered != 'true') and ancestor::iso:annex[@id = $annex-id]]"/>
|
3242
|
-
|
3243
|
-
|
3244
|
-
|
3245
|
-
|
3246
|
-
|
3247
|
-
|
3248
|
-
|
3249
|
-
|
3250
|
-
</xsl:when>
|
3251
|
-
<xsl:otherwise>
|
3252
|
-
|
3253
|
-
|
3254
|
-
<xsl:number format="A." count="*[local-name()='annex']"/>
|
3255
|
-
<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']"/>
|
3256
|
-
|
3257
|
-
</xsl:otherwise>
|
3258
|
-
</xsl:choose>
|
3250
|
+
|
3251
|
+
|
3252
|
+
<xsl:value-of select="$title-table"/>
|
3253
|
+
|
3254
|
+
<xsl:call-template name="getTableNumber"/>
|
3255
|
+
|
3256
|
+
|
3259
3257
|
<xsl:if test="*[local-name()='name']">
|
3260
3258
|
|
3261
3259
|
|
@@ -3329,9 +3327,13 @@
|
|
3329
3327
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
3330
3328
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
3331
3329
|
|
3330
|
+
|
3332
3331
|
<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">
|
3333
3332
|
|
3334
3333
|
<xsl:attribute name="border">1.5pt solid black</xsl:attribute>
|
3334
|
+
<xsl:if test="*[local-name()='thead']">
|
3335
|
+
<xsl:attribute name="border-top">1pt solid black</xsl:attribute>
|
3336
|
+
</xsl:if>
|
3335
3337
|
|
3336
3338
|
|
3337
3339
|
|
@@ -3347,9 +3349,10 @@
|
|
3347
3349
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3348
3350
|
|
3349
3351
|
|
3352
|
+
|
3350
3353
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3351
3354
|
<xsl:choose>
|
3352
|
-
<xsl:when test=". = 1">
|
3355
|
+
<xsl:when test=". = 1 or . = 0">
|
3353
3356
|
<fo:table-column column-width="proportional-column-width(2)"/>
|
3354
3357
|
</xsl:when>
|
3355
3358
|
<xsl:otherwise>
|
@@ -3363,15 +3366,41 @@
|
|
3363
3366
|
|
3364
3367
|
|
3365
3368
|
</fo:block-container>
|
3366
|
-
</xsl:template><xsl:template
|
3369
|
+
</xsl:template><xsl:template name="getTableNumber">
|
3370
|
+
<xsl:choose>
|
3371
|
+
<xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
|
3372
|
+
<xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
|
3373
|
+
</xsl:when>
|
3374
|
+
<xsl:when test="ancestor::*[local-name()='annex']">
|
3375
|
+
|
3376
|
+
<xsl:variable name="annex-id" select="ancestor::*[local-name()='annex']/@id"/>
|
3377
|
+
<xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1" level="any" count="*[local-name()='table'][(not(@unnumbered) or @unnumbered != 'true') and ancestor::*[local-name()='annex'][@id = $annex-id]]"/>
|
3378
|
+
|
3379
|
+
|
3380
|
+
|
3381
|
+
|
3382
|
+
|
3383
|
+
|
3384
|
+
|
3385
|
+
|
3386
|
+
</xsl:when>
|
3387
|
+
<xsl:otherwise>
|
3388
|
+
|
3389
|
+
|
3390
|
+
<xsl:number format="A." count="*[local-name()='annex']"/>
|
3391
|
+
<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']"/>
|
3392
|
+
|
3393
|
+
</xsl:otherwise>
|
3394
|
+
</xsl:choose>
|
3395
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
|
3367
3396
|
<xsl:apply-templates/>
|
3368
|
-
</xsl:template><xsl:template
|
3397
|
+
</xsl:template><xsl:template name="calculate-columns-numbers">
|
3369
3398
|
<xsl:param name="table-row"/>
|
3370
3399
|
<xsl:variable name="columns-count" select="count($table-row/*)"/>
|
3371
3400
|
<xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
|
3372
3401
|
<xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
|
3373
3402
|
<xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
|
3374
|
-
</xsl:template><xsl:template
|
3403
|
+
</xsl:template><xsl:template name="calculate-column-widths">
|
3375
3404
|
<xsl:param name="table"/>
|
3376
3405
|
<xsl:param name="cols-count"/>
|
3377
3406
|
<xsl:param name="curr-col" select="1"/>
|
@@ -3380,7 +3409,7 @@
|
|
3380
3409
|
<xsl:if test="$curr-col <= $cols-count">
|
3381
3410
|
<xsl:variable name="widths">
|
3382
3411
|
<xsl:choose>
|
3383
|
-
<xsl:when test="not($table)"
|
3412
|
+
<xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
|
3384
3413
|
<xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']">
|
3385
3414
|
<xsl:variable name="words">
|
3386
3415
|
<xsl:call-template name="tokenize">
|
@@ -3419,9 +3448,16 @@
|
|
3419
3448
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
3420
3449
|
</xsl:variable>
|
3421
3450
|
<xsl:variable name="words">
|
3451
|
+
<xsl:variable name="string_with_added_zerospaces">
|
3452
|
+
<xsl:call-template name="add-zero-spaces-java">
|
3453
|
+
<xsl:with-param name="text" select="$td_text"/>
|
3454
|
+
</xsl:call-template>
|
3455
|
+
</xsl:variable>
|
3422
3456
|
<xsl:call-template name="tokenize">
|
3423
3457
|
<!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
|
3424
|
-
|
3458
|
+
<!-- 2009 thinspace -->
|
3459
|
+
<!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
|
3460
|
+
<xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
|
3425
3461
|
</xsl:call-template>
|
3426
3462
|
</xsl:variable>
|
3427
3463
|
<xsl:variable name="max_length">
|
@@ -3462,17 +3498,42 @@
|
|
3462
3498
|
<xsl:with-param name="table" select="$table"/>
|
3463
3499
|
</xsl:call-template>
|
3464
3500
|
</xsl:if>
|
3465
|
-
</xsl:template><xsl:template
|
3501
|
+
</xsl:template><xsl:template match="text()" mode="td_text">
|
3466
3502
|
<xsl:variable name="zero-space"></xsl:variable>
|
3467
3503
|
<xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
|
3468
|
-
</xsl:template><xsl:template
|
3504
|
+
</xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
|
3505
|
+
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
3506
|
+
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
3507
|
+
<xsl:value-of select="@target"/>
|
3508
|
+
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
3509
|
+
<xsl:param name="cols-count"/>
|
3469
3510
|
<!-- font-weight="bold" -->
|
3470
|
-
<fo:table-header>
|
3511
|
+
<fo:table-header>
|
3512
|
+
|
3513
|
+
<fo:table-row>
|
3514
|
+
<fo:table-cell number-columns-spanned="{$cols-count}"> <!-- border-left="1pt solid white" border-right="1pt solid white" border-top="1pt solid white" -->
|
3515
|
+
<fo:block text-align="center" font-size="11pt" font-weight="bold">
|
3516
|
+
<!-- (continued) -->
|
3517
|
+
<fo:block-container position="absolute" top="-7mm">
|
3518
|
+
<fo:block>
|
3519
|
+
<fo:retrieve-table-marker retrieve-class-name="table_continued" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table-fragment"/>
|
3520
|
+
</fo:block>
|
3521
|
+
</fo:block-container>
|
3522
|
+
|
3523
|
+
</fo:block>
|
3524
|
+
<!-- <fo:block>fn_name_display
|
3525
|
+
<xsl:call-template name="fn_name_display"/>
|
3526
|
+
</fo:block> -->
|
3527
|
+
|
3528
|
+
</fo:table-cell>
|
3529
|
+
</fo:table-row>
|
3530
|
+
|
3471
3531
|
<xsl:apply-templates/>
|
3472
3532
|
</fo:table-header>
|
3473
|
-
</xsl:template><xsl:template
|
3533
|
+
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
3474
3534
|
<xsl:apply-templates/>
|
3475
|
-
</xsl:template><xsl:template
|
3535
|
+
</xsl:template><xsl:template name="insertTableFooter">
|
3536
|
+
<xsl:param name="cols-count"/>
|
3476
3537
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
3477
3538
|
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
3478
3539
|
|
@@ -3483,22 +3544,7 @@
|
|
3483
3544
|
<!-- if there are note(s) or fn(s) then create footer row -->
|
3484
3545
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
3485
3546
|
|
3486
|
-
|
3487
|
-
<xsl:choose>
|
3488
|
-
<xsl:when test="../*[local-name()='thead']">
|
3489
|
-
<!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
|
3490
|
-
<xsl:call-template name="calculate-columns-numbers">
|
3491
|
-
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
3492
|
-
</xsl:call-template>
|
3493
|
-
</xsl:when>
|
3494
|
-
<xsl:otherwise>
|
3495
|
-
<!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
|
3496
|
-
<xsl:call-template name="calculate-columns-numbers">
|
3497
|
-
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
|
3498
|
-
</xsl:call-template>
|
3499
|
-
</xsl:otherwise>
|
3500
|
-
</xsl:choose>
|
3501
|
-
</xsl:variable>
|
3547
|
+
|
3502
3548
|
|
3503
3549
|
<fo:table-row>
|
3504
3550
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
@@ -3528,11 +3574,30 @@
|
|
3528
3574
|
</fo:table-footer>
|
3529
3575
|
|
3530
3576
|
</xsl:if>
|
3531
|
-
</xsl:template><xsl:template
|
3577
|
+
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
3532
3578
|
|
3533
|
-
<xsl:
|
3579
|
+
<xsl:variable name="cols-count">
|
3580
|
+
<xsl:choose>
|
3581
|
+
<xsl:when test="../*[local-name()='thead']">
|
3582
|
+
<xsl:call-template name="calculate-columns-numbers">
|
3583
|
+
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
3584
|
+
</xsl:call-template>
|
3585
|
+
</xsl:when>
|
3586
|
+
<xsl:otherwise>
|
3587
|
+
<xsl:call-template name="calculate-columns-numbers">
|
3588
|
+
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
|
3589
|
+
</xsl:call-template>
|
3590
|
+
</xsl:otherwise>
|
3591
|
+
</xsl:choose>
|
3592
|
+
</xsl:variable>
|
3593
|
+
|
3594
|
+
<xsl:apply-templates select="../*[local-name()='thead']" mode="process">
|
3595
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3596
|
+
</xsl:apply-templates>
|
3534
3597
|
|
3535
|
-
<xsl:call-template name="insertTableFooter"
|
3598
|
+
<xsl:call-template name="insertTableFooter">
|
3599
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3600
|
+
</xsl:call-template>
|
3536
3601
|
|
3537
3602
|
<fo:table-body>
|
3538
3603
|
<xsl:apply-templates/>
|
@@ -3540,7 +3605,7 @@
|
|
3540
3605
|
|
3541
3606
|
</fo:table-body>
|
3542
3607
|
|
3543
|
-
</xsl:template><xsl:template
|
3608
|
+
</xsl:template><xsl:template match="*[local-name()='tr']">
|
3544
3609
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
3545
3610
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3546
3611
|
<fo:table-row min-height="4mm">
|
@@ -3579,7 +3644,7 @@
|
|
3579
3644
|
|
3580
3645
|
<xsl:apply-templates/>
|
3581
3646
|
</fo:table-row>
|
3582
|
-
</xsl:template><xsl:template
|
3647
|
+
</xsl:template><xsl:template match="*[local-name()='th']">
|
3583
3648
|
<fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
|
3584
3649
|
|
3585
3650
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
@@ -3604,7 +3669,7 @@
|
|
3604
3669
|
<xsl:apply-templates/>
|
3605
3670
|
</fo:block>
|
3606
3671
|
</fo:table-cell>
|
3607
|
-
</xsl:template><xsl:template
|
3672
|
+
</xsl:template><xsl:template match="*[local-name()='td']">
|
3608
3673
|
<fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
|
3609
3674
|
<!-- and ancestor::*[local-name() = 'thead'] -->
|
3610
3675
|
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
@@ -3632,6 +3697,21 @@
|
|
3632
3697
|
</xsl:attribute>
|
3633
3698
|
</xsl:if>
|
3634
3699
|
<fo:block>
|
3700
|
+
|
3701
|
+
<xsl:variable name="row_number">
|
3702
|
+
<xsl:number format="1" count="*[local-name() = 'tr'] | *[local-name() = 'th']"/>
|
3703
|
+
</xsl:variable>
|
3704
|
+
<fo:marker marker-class-name="table_continued">
|
3705
|
+
<xsl:if test="$row_number > 1">
|
3706
|
+
<fo:inline>
|
3707
|
+
<xsl:value-of select="$title-table"/>
|
3708
|
+
<xsl:call-template name="getTableNumber"/>
|
3709
|
+
<xsl:text> </xsl:text>
|
3710
|
+
<fo:inline font-style="italic" font-weight="normal">(continued)</fo:inline>
|
3711
|
+
</fo:inline>
|
3712
|
+
</xsl:if>
|
3713
|
+
</fo:marker>
|
3714
|
+
|
3635
3715
|
<xsl:apply-templates/>
|
3636
3716
|
</fo:block>
|
3637
3717
|
<!-- <xsl:choose>
|
@@ -3647,7 +3727,7 @@
|
|
3647
3727
|
|
3648
3728
|
|
3649
3729
|
</fo:table-cell>
|
3650
|
-
</xsl:template><xsl:template
|
3730
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
|
3651
3731
|
|
3652
3732
|
|
3653
3733
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
@@ -3657,9 +3737,11 @@
|
|
3657
3737
|
|
3658
3738
|
|
3659
3739
|
|
3740
|
+
|
3660
3741
|
<fo:inline padding-right="2mm">
|
3661
3742
|
|
3662
|
-
|
3743
|
+
|
3744
|
+
<xsl:value-of select="$title-note"/>
|
3663
3745
|
|
3664
3746
|
<xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
|
3665
3747
|
<xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) > 1">
|
@@ -3673,9 +3755,9 @@
|
|
3673
3755
|
<xsl:apply-templates mode="process"/>
|
3674
3756
|
</fo:block>
|
3675
3757
|
|
3676
|
-
</xsl:template><xsl:template
|
3758
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
3677
3759
|
<xsl:apply-templates/>
|
3678
|
-
</xsl:template><xsl:template
|
3760
|
+
</xsl:template><xsl:template name="fn_display">
|
3679
3761
|
<xsl:variable name="references">
|
3680
3762
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
3681
3763
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -3695,6 +3777,7 @@
|
|
3695
3777
|
|
3696
3778
|
|
3697
3779
|
|
3780
|
+
|
3698
3781
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
3699
3782
|
|
3700
3783
|
|
@@ -3714,7 +3797,7 @@
|
|
3714
3797
|
</fo:block>
|
3715
3798
|
</xsl:if>
|
3716
3799
|
</xsl:for-each>
|
3717
|
-
</xsl:template><xsl:template
|
3800
|
+
</xsl:template><xsl:template name="fn_name_display">
|
3718
3801
|
<!-- <xsl:variable name="references">
|
3719
3802
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
3720
3803
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -3730,7 +3813,7 @@
|
|
3730
3813
|
<xsl:apply-templates/>
|
3731
3814
|
</fo:block>
|
3732
3815
|
</xsl:for-each>
|
3733
|
-
</xsl:template><xsl:template
|
3816
|
+
</xsl:template><xsl:template name="fn_display_figure">
|
3734
3817
|
<xsl:variable name="key_iso">
|
3735
3818
|
true <!-- and (not(@class) or @class !='pseudocode') -->
|
3736
3819
|
</xsl:variable>
|
@@ -3781,7 +3864,7 @@
|
|
3781
3864
|
</fo:block>
|
3782
3865
|
</xsl:if>
|
3783
3866
|
|
3784
|
-
</xsl:template><xsl:template
|
3867
|
+
</xsl:template><xsl:template match="*[local-name()='fn']">
|
3785
3868
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3786
3869
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
3787
3870
|
|
@@ -3799,11 +3882,11 @@
|
|
3799
3882
|
<xsl:value-of select="@reference"/>
|
3800
3883
|
</fo:basic-link>
|
3801
3884
|
</fo:inline>
|
3802
|
-
</xsl:template><xsl:template
|
3885
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
3803
3886
|
<fo:inline>
|
3804
3887
|
<xsl:apply-templates/>
|
3805
3888
|
</fo:inline>
|
3806
|
-
</xsl:template><xsl:template
|
3889
|
+
</xsl:template><xsl:template match="*[local-name()='dl']">
|
3807
3890
|
<xsl:variable name="parent" select="local-name(..)"/>
|
3808
3891
|
|
3809
3892
|
<xsl:variable name="key_iso">
|
@@ -3819,8 +3902,8 @@
|
|
3819
3902
|
<fo:block margin-bottom="12pt" text-align="left">
|
3820
3903
|
|
3821
3904
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
3822
|
-
|
3823
|
-
<xsl:text>
|
3905
|
+
|
3906
|
+
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
3824
3907
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3825
3908
|
<xsl:text/>
|
3826
3909
|
<xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
|
@@ -3835,7 +3918,7 @@
|
|
3835
3918
|
|
3836
3919
|
|
3837
3920
|
|
3838
|
-
<xsl:
|
3921
|
+
<xsl:value-of select="$title-where"/>
|
3839
3922
|
</fo:block>
|
3840
3923
|
</xsl:when>
|
3841
3924
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
|
@@ -3846,7 +3929,7 @@
|
|
3846
3929
|
|
3847
3930
|
|
3848
3931
|
|
3849
|
-
<xsl:
|
3932
|
+
<xsl:value-of select="$title-key"/>
|
3850
3933
|
</fo:block>
|
3851
3934
|
</xsl:when>
|
3852
3935
|
</xsl:choose>
|
@@ -3862,9 +3945,11 @@
|
|
3862
3945
|
|
3863
3946
|
|
3864
3947
|
|
3948
|
+
|
3865
3949
|
<fo:block>
|
3866
3950
|
|
3867
3951
|
|
3952
|
+
|
3868
3953
|
<!-- create virtual html table for dl/[dt and dd] -->
|
3869
3954
|
<xsl:variable name="html-table">
|
3870
3955
|
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
@@ -3916,7 +4001,7 @@
|
|
3916
4001
|
<xsl:otherwise>
|
3917
4002
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3918
4003
|
<xsl:choose>
|
3919
|
-
<xsl:when test=". = 1">
|
4004
|
+
<xsl:when test=". = 1 or . = 0">
|
3920
4005
|
<fo:table-column column-width="proportional-column-width(2)"/>
|
3921
4006
|
</xsl:when>
|
3922
4007
|
<xsl:otherwise>
|
@@ -3939,7 +4024,7 @@
|
|
3939
4024
|
</fo:block>
|
3940
4025
|
</fo:block>
|
3941
4026
|
</xsl:if>
|
3942
|
-
</xsl:template><xsl:template
|
4027
|
+
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
|
3943
4028
|
<xsl:param name="key_iso"/>
|
3944
4029
|
|
3945
4030
|
<!-- <tr>
|
@@ -3955,7 +4040,7 @@
|
|
3955
4040
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
3956
4041
|
<xsl:attribute name="margin-top">0</xsl:attribute>
|
3957
4042
|
</xsl:if>
|
3958
|
-
|
4043
|
+
<xsl:value-of select="$title-note"/>
|
3959
4044
|
</fo:block>
|
3960
4045
|
</fo:table-cell>
|
3961
4046
|
<fo:table-cell>
|
@@ -3964,7 +4049,7 @@
|
|
3964
4049
|
</fo:block>
|
3965
4050
|
</fo:table-cell>
|
3966
4051
|
</fo:table-row>
|
3967
|
-
</xsl:template><xsl:template
|
4052
|
+
</xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
|
3968
4053
|
<tr>
|
3969
4054
|
<td>
|
3970
4055
|
<xsl:apply-templates/>
|
@@ -3977,11 +4062,12 @@
|
|
3977
4062
|
</td>
|
3978
4063
|
</tr>
|
3979
4064
|
|
3980
|
-
</xsl:template><xsl:template
|
4065
|
+
</xsl:template><xsl:template match="*[local-name()='dt']">
|
3981
4066
|
<xsl:param name="key_iso"/>
|
3982
4067
|
|
3983
4068
|
<fo:table-row>
|
3984
4069
|
<fo:table-cell>
|
4070
|
+
|
3985
4071
|
<fo:block margin-top="6pt">
|
3986
4072
|
|
3987
4073
|
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
@@ -3993,6 +4079,9 @@
|
|
3993
4079
|
</xsl:if>
|
3994
4080
|
|
3995
4081
|
|
4082
|
+
|
4083
|
+
|
4084
|
+
|
3996
4085
|
<xsl:apply-templates/>
|
3997
4086
|
|
3998
4087
|
</fo:block>
|
@@ -4008,37 +4097,37 @@
|
|
4008
4097
|
</fo:table-cell>
|
4009
4098
|
</fo:table-row>
|
4010
4099
|
|
4011
|
-
</xsl:template><xsl:template
|
4100
|
+
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
4012
4101
|
<xsl:apply-templates/>
|
4013
|
-
</xsl:template><xsl:template
|
4102
|
+
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
4014
4103
|
<xsl:apply-templates/>
|
4015
|
-
</xsl:template><xsl:template
|
4104
|
+
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
4016
4105
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
4017
|
-
</xsl:template><xsl:template
|
4106
|
+
</xsl:template><xsl:template match="*[local-name()='em']">
|
4018
4107
|
<fo:inline font-style="italic">
|
4019
4108
|
<xsl:apply-templates/>
|
4020
4109
|
</fo:inline>
|
4021
|
-
</xsl:template><xsl:template
|
4110
|
+
</xsl:template><xsl:template match="*[local-name()='strong']">
|
4022
4111
|
<fo:inline font-weight="bold">
|
4023
4112
|
<xsl:apply-templates/>
|
4024
4113
|
</fo:inline>
|
4025
|
-
</xsl:template><xsl:template
|
4114
|
+
</xsl:template><xsl:template match="*[local-name()='sup']">
|
4026
4115
|
<fo:inline font-size="80%" vertical-align="super">
|
4027
4116
|
<xsl:apply-templates/>
|
4028
4117
|
</fo:inline>
|
4029
|
-
</xsl:template><xsl:template
|
4118
|
+
</xsl:template><xsl:template match="*[local-name()='sub']">
|
4030
4119
|
<fo:inline font-size="80%" vertical-align="sub">
|
4031
4120
|
<xsl:apply-templates/>
|
4032
4121
|
</fo:inline>
|
4033
|
-
</xsl:template><xsl:template
|
4034
|
-
<fo:inline font-family="Courier" font-size="10pt">
|
4122
|
+
</xsl:template><xsl:template match="*[local-name()='tt']">
|
4123
|
+
<fo:inline font-family="Courier" font-size="10pt">
|
4035
4124
|
<xsl:apply-templates/>
|
4036
4125
|
</fo:inline>
|
4037
|
-
</xsl:template><xsl:template
|
4126
|
+
</xsl:template><xsl:template match="*[local-name()='del']">
|
4038
4127
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
4039
4128
|
<xsl:apply-templates/>
|
4040
4129
|
</fo:inline>
|
4041
|
-
</xsl:template><xsl:template
|
4130
|
+
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
4042
4131
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
4043
4132
|
<fo:inline font-size="75%">
|
4044
4133
|
<xsl:if test="string-length($text) > 0">
|
@@ -4047,7 +4136,7 @@
|
|
4047
4136
|
</xsl:call-template>
|
4048
4137
|
</xsl:if>
|
4049
4138
|
</fo:inline>
|
4050
|
-
</xsl:template><xsl:template
|
4139
|
+
</xsl:template><xsl:template name="recursiveSmallCaps">
|
4051
4140
|
<xsl:param name="text"/>
|
4052
4141
|
<xsl:variable name="char" select="substring($text,1,1)"/>
|
4053
4142
|
<xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
|
@@ -4066,7 +4155,7 @@
|
|
4066
4155
|
<xsl:with-param name="text" select="substring($text,2)"/>
|
4067
4156
|
</xsl:call-template>
|
4068
4157
|
</xsl:if>
|
4069
|
-
</xsl:template><xsl:template
|
4158
|
+
</xsl:template><xsl:template name="tokenize">
|
4070
4159
|
<xsl:param name="text"/>
|
4071
4160
|
<xsl:param name="separator" select="' '"/>
|
4072
4161
|
<xsl:choose>
|
@@ -4114,7 +4203,7 @@
|
|
4114
4203
|
</xsl:call-template>
|
4115
4204
|
</xsl:otherwise>
|
4116
4205
|
</xsl:choose>
|
4117
|
-
</xsl:template><xsl:template
|
4206
|
+
</xsl:template><xsl:template name="max_length">
|
4118
4207
|
<xsl:param name="words"/>
|
4119
4208
|
<xsl:for-each select="$words//word">
|
4120
4209
|
<xsl:sort select="." data-type="number" order="descending"/>
|
@@ -4122,7 +4211,11 @@
|
|
4122
4211
|
<xsl:value-of select="."/>
|
4123
4212
|
</xsl:if>
|
4124
4213
|
</xsl:for-each>
|
4125
|
-
</xsl:template><xsl:template
|
4214
|
+
</xsl:template><xsl:template name="add-zero-spaces-java">
|
4215
|
+
<xsl:param name="text" select="."/>
|
4216
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4217
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
4218
|
+
</xsl:template><xsl:template name="add-zero-spaces">
|
4126
4219
|
<xsl:param name="text" select="."/>
|
4127
4220
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
4128
4221
|
<xsl:variable name="zero-space-after-dot">.</xsl:variable>
|
@@ -4175,7 +4268,7 @@
|
|
4175
4268
|
<xsl:value-of select="$text"/>
|
4176
4269
|
</xsl:otherwise>
|
4177
4270
|
</xsl:choose>
|
4178
|
-
</xsl:template><xsl:template
|
4271
|
+
</xsl:template><xsl:template name="add-zero-spaces-equal">
|
4179
4272
|
<xsl:param name="text" select="."/>
|
4180
4273
|
<xsl:variable name="zero-space-after-equals">==========</xsl:variable>
|
4181
4274
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
@@ -4201,7 +4294,7 @@
|
|
4201
4294
|
<xsl:value-of select="$text"/>
|
4202
4295
|
</xsl:otherwise>
|
4203
4296
|
</xsl:choose>
|
4204
|
-
</xsl:template><xsl:template
|
4297
|
+
</xsl:template><xsl:template name="getSimpleTable">
|
4205
4298
|
<xsl:variable name="simple-table">
|
4206
4299
|
|
4207
4300
|
<!-- Step 1. colspan processing -->
|
@@ -4228,9 +4321,9 @@
|
|
4228
4321
|
</xsl:choose> -->
|
4229
4322
|
</xsl:variable>
|
4230
4323
|
<xsl:copy-of select="$simple-table"/>
|
4231
|
-
</xsl:template><xsl:template
|
4324
|
+
</xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
|
4232
4325
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4233
|
-
</xsl:template><xsl:template
|
4326
|
+
</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">
|
4234
4327
|
<xsl:choose>
|
4235
4328
|
<xsl:when test="@colspan">
|
4236
4329
|
<xsl:variable name="td">
|
@@ -4252,16 +4345,16 @@
|
|
4252
4345
|
</xsl:element>
|
4253
4346
|
</xsl:otherwise>
|
4254
4347
|
</xsl:choose>
|
4255
|
-
</xsl:template><xsl:template
|
4348
|
+
</xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
|
4256
4349
|
<xsl:element name="tr">
|
4257
4350
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4258
4351
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4259
4352
|
</xsl:element>
|
4260
|
-
</xsl:template><xsl:template
|
4353
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
|
4261
4354
|
<xsl:copy>
|
4262
4355
|
<xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
|
4263
4356
|
</xsl:copy>
|
4264
|
-
</xsl:template><xsl:template
|
4357
|
+
</xsl:template><xsl:template name="repeatNode">
|
4265
4358
|
<xsl:param name="count"/>
|
4266
4359
|
<xsl:param name="node"/>
|
4267
4360
|
|
@@ -4272,18 +4365,18 @@
|
|
4272
4365
|
</xsl:call-template>
|
4273
4366
|
<xsl:copy-of select="$node"/>
|
4274
4367
|
</xsl:if>
|
4275
|
-
</xsl:template><xsl:template
|
4368
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
|
4276
4369
|
<xsl:copy>
|
4277
4370
|
<xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
|
4278
4371
|
</xsl:copy>
|
4279
|
-
</xsl:template><xsl:template
|
4372
|
+
</xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
|
4280
4373
|
<xsl:copy>
|
4281
4374
|
<xsl:copy-of select="tr[1]"/>
|
4282
4375
|
<xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
|
4283
4376
|
<xsl:with-param name="previousRow" select="tr[1]"/>
|
4284
4377
|
</xsl:apply-templates>
|
4285
4378
|
</xsl:copy>
|
4286
|
-
</xsl:template><xsl:template
|
4379
|
+
</xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
|
4287
4380
|
<xsl:param name="previousRow"/>
|
4288
4381
|
<xsl:variable name="currentRow" select="."/>
|
4289
4382
|
|
@@ -4317,13 +4410,13 @@
|
|
4317
4410
|
<xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
|
4318
4411
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
4319
4412
|
</xsl:apply-templates>
|
4320
|
-
</xsl:template><xsl:template
|
4413
|
+
</xsl:template><xsl:template name="getLang">
|
4321
4414
|
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
4322
4415
|
<xsl:choose>
|
4323
4416
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
4324
4417
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
4325
4418
|
</xsl:choose>
|
4326
|
-
</xsl:template><xsl:template
|
4419
|
+
</xsl:template><xsl:template name="capitalizeWords">
|
4327
4420
|
<xsl:param name="str"/>
|
4328
4421
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
4329
4422
|
<xsl:choose>
|
@@ -4341,19 +4434,19 @@
|
|
4341
4434
|
<xsl:value-of select="substring($str2, 2)"/>
|
4342
4435
|
</xsl:otherwise>
|
4343
4436
|
</xsl:choose>
|
4344
|
-
</xsl:template><xsl:template
|
4437
|
+
</xsl:template><xsl:template match="mathml:math">
|
4345
4438
|
<fo:inline font-family="STIX2Math">
|
4346
4439
|
<fo:instream-foreign-object fox:alt-text="Math">
|
4347
4440
|
<xsl:copy-of select="."/>
|
4348
4441
|
</fo:instream-foreign-object>
|
4349
4442
|
</fo:inline>
|
4350
|
-
</xsl:template><xsl:template
|
4443
|
+
</xsl:template><xsl:template match="*[local-name()='localityStack']">
|
4351
4444
|
<xsl:for-each select="*[local-name()='locality']">
|
4352
4445
|
<xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
|
4353
4446
|
<xsl:apply-templates select="."/>
|
4354
4447
|
<xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
|
4355
4448
|
</xsl:for-each>
|
4356
|
-
</xsl:template><xsl:template
|
4449
|
+
</xsl:template><xsl:template match="*[local-name()='link']" name="link">
|
4357
4450
|
<xsl:variable name="target">
|
4358
4451
|
<xsl:choose>
|
4359
4452
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -4383,4 +4476,122 @@
|
|
4383
4476
|
</xsl:otherwise>
|
4384
4477
|
</xsl:choose>
|
4385
4478
|
</fo:inline>
|
4479
|
+
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
4480
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4481
|
+
<!-- <xsl:choose>
|
4482
|
+
<xsl:when test="@lang = 'en'"></xsl:when>
|
4483
|
+
<xsl:otherwise> -->
|
4484
|
+
<xsl:attribute name="white-space">pre</xsl:attribute>
|
4485
|
+
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
4486
|
+
<!-- </xsl:otherwise>
|
4487
|
+
</xsl:choose> -->
|
4488
|
+
<xsl:apply-templates/>
|
4489
|
+
</fo:block>
|
4490
|
+
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
4491
|
+
<fo:inline id="{@id}"/>
|
4492
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
4493
|
+
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
4494
|
+
<fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
|
4495
|
+
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
4496
|
+
</fo:block>
|
4497
|
+
<xsl:apply-templates/>
|
4498
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
4499
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4500
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
|
4501
|
+
<fo:block xsl:use-attribute-sets="appendix-example-style">
|
4502
|
+
<xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
|
4503
|
+
<xsl:value-of select="$title-example"/>
|
4504
|
+
<xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) > 1">
|
4505
|
+
<xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
|
4506
|
+
</xsl:if>
|
4507
|
+
<xsl:if test="*[local-name()='name']">
|
4508
|
+
<xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
|
4509
|
+
</xsl:if>
|
4510
|
+
</fo:block>
|
4511
|
+
<xsl:apply-templates/>
|
4512
|
+
</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">
|
4513
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4514
|
+
</xsl:template><xsl:template match="*[local-name() = 'callout']">
|
4515
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"><<xsl:apply-templates/>></fo:basic-link>
|
4516
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']">
|
4517
|
+
<xsl:variable name="annotation-id" select="@id"/>
|
4518
|
+
<xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
|
4519
|
+
<fo:block id="{$annotation-id}" white-space="nowrap">
|
4520
|
+
<fo:inline>
|
4521
|
+
<xsl:apply-templates>
|
4522
|
+
<xsl:with-param name="callout" select="concat('<', $callout, '> ')"/>
|
4523
|
+
</xsl:apply-templates>
|
4524
|
+
</fo:inline>
|
4525
|
+
</fo:block>
|
4526
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
4527
|
+
<xsl:param name="callout"/>
|
4528
|
+
<fo:inline id="{@id}">
|
4529
|
+
<!-- for first p in annotation, put <x> -->
|
4530
|
+
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
4531
|
+
<xsl:apply-templates/>
|
4532
|
+
</fo:inline>
|
4533
|
+
</xsl:template><xsl:template name="convertDate">
|
4534
|
+
<xsl:param name="date"/>
|
4535
|
+
<xsl:param name="format" select="'short'"/>
|
4536
|
+
<xsl:variable name="year" select="substring($date, 1, 4)"/>
|
4537
|
+
<xsl:variable name="month" select="substring($date, 6, 2)"/>
|
4538
|
+
<xsl:variable name="day" select="substring($date, 9, 2)"/>
|
4539
|
+
<xsl:variable name="monthStr">
|
4540
|
+
<xsl:choose>
|
4541
|
+
<xsl:when test="$month = '01'">January</xsl:when>
|
4542
|
+
<xsl:when test="$month = '02'">February</xsl:when>
|
4543
|
+
<xsl:when test="$month = '03'">March</xsl:when>
|
4544
|
+
<xsl:when test="$month = '04'">April</xsl:when>
|
4545
|
+
<xsl:when test="$month = '05'">May</xsl:when>
|
4546
|
+
<xsl:when test="$month = '06'">June</xsl:when>
|
4547
|
+
<xsl:when test="$month = '07'">July</xsl:when>
|
4548
|
+
<xsl:when test="$month = '08'">August</xsl:when>
|
4549
|
+
<xsl:when test="$month = '09'">September</xsl:when>
|
4550
|
+
<xsl:when test="$month = '10'">October</xsl:when>
|
4551
|
+
<xsl:when test="$month = '11'">November</xsl:when>
|
4552
|
+
<xsl:when test="$month = '12'">December</xsl:when>
|
4553
|
+
</xsl:choose>
|
4554
|
+
</xsl:variable>
|
4555
|
+
<xsl:variable name="result">
|
4556
|
+
<xsl:choose>
|
4557
|
+
<xsl:when test="$format = 'short' or $day = ''">
|
4558
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4559
|
+
</xsl:when>
|
4560
|
+
<xsl:otherwise>
|
4561
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
|
4562
|
+
</xsl:otherwise>
|
4563
|
+
</xsl:choose>
|
4564
|
+
</xsl:variable>
|
4565
|
+
<xsl:value-of select="$result"/>
|
4566
|
+
</xsl:template><xsl:template name="insertKeywords">
|
4567
|
+
<xsl:param name="sorting" select="'true'"/>
|
4568
|
+
<xsl:param name="charAtEnd" select="'.'"/>
|
4569
|
+
<xsl:param name="charDelim" select="', '"/>
|
4570
|
+
<xsl:choose>
|
4571
|
+
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4572
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4573
|
+
<xsl:sort data-type="text" order="ascending"/>
|
4574
|
+
<xsl:call-template name="insertKeyword">
|
4575
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4576
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4577
|
+
</xsl:call-template>
|
4578
|
+
</xsl:for-each>
|
4579
|
+
</xsl:when>
|
4580
|
+
<xsl:otherwise>
|
4581
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4582
|
+
<xsl:call-template name="insertKeyword">
|
4583
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4584
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4585
|
+
</xsl:call-template>
|
4586
|
+
</xsl:for-each>
|
4587
|
+
</xsl:otherwise>
|
4588
|
+
</xsl:choose>
|
4589
|
+
</xsl:template><xsl:template name="insertKeyword">
|
4590
|
+
<xsl:param name="charAtEnd"/>
|
4591
|
+
<xsl:param name="charDelim"/>
|
4592
|
+
<xsl:apply-templates/>
|
4593
|
+
<xsl:choose>
|
4594
|
+
<xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
|
4595
|
+
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4596
|
+
</xsl:choose>
|
4386
4597
|
</xsl:template></xsl:stylesheet>
|