metanorma-iso 1.3.24 → 1.4.1
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/.github/workflows/macos.yml +8 -1
- data/.github/workflows/ubuntu.yml +14 -3
- data/.github/workflows/windows.yml +8 -1
- data/lib/asciidoctor/iso/base.rb +21 -13
- data/lib/asciidoctor/iso/biblio.rng +36 -6
- data/lib/asciidoctor/iso/cleanup.rb +10 -1
- data/lib/asciidoctor/iso/front.rb +16 -110
- data/lib/asciidoctor/iso/front_id.rb +196 -0
- data/lib/asciidoctor/iso/isodoc.rng +444 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
- data/lib/asciidoctor/iso/isostandard.rng +12 -1
- data/lib/asciidoctor/iso/reqt.rng +23 -0
- data/lib/asciidoctor/iso/section.rb +12 -0
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +7 -10
- data/lib/asciidoctor/iso/validate.rb +40 -23
- data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
- data/lib/asciidoctor/iso/validate_style.rb +6 -5
- data/lib/asciidoctor/iso/validate_title.rb +1 -1
- data/lib/isodoc/iso/base_convert.rb +68 -87
- data/lib/isodoc/iso/html/header.html +5 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +25 -16
- data/lib/isodoc/iso/html/isodoc.scss +25 -0
- data/lib/isodoc/iso/html/scripts.html +18 -0
- data/lib/isodoc/iso/html/style-human.scss +23 -0
- data/lib/isodoc/iso/html/style-iso.scss +18 -0
- data/lib/isodoc/iso/html/word_iso_intro.html +4 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +21 -0
- data/lib/isodoc/iso/html/wordstyle.scss +45 -4
- data/lib/isodoc/iso/iso.amendment.xsl +5082 -0
- data/lib/isodoc/iso/iso.international-standard.xsl +1226 -530
- data/lib/isodoc/iso/metadata.rb +67 -23
- data/lib/isodoc/iso/pdf_convert.rb +5 -11
- data/lib/isodoc/iso/presentation_xml_convert.rb +13 -0
- data/lib/isodoc/iso/sections.rb +66 -0
- data/lib/isodoc/iso/sts_convert.rb +31 -0
- data/lib/isodoc/iso/xref.rb +111 -0
- data/lib/metanorma-iso.rb +2 -0
- data/lib/metanorma/iso/processor.rb +20 -9
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +5 -2
- data/spec/asciidoctor-iso/amd_spec.rb +726 -0
- data/spec/asciidoctor-iso/base_spec.rb +24 -20
- data/spec/asciidoctor-iso/cleanup_spec.rb +2 -2
- data/spec/asciidoctor-iso/macros_spec.rb +33 -17
- data/spec/asciidoctor-iso/refs_spec.rb +1 -1
- data/spec/asciidoctor-iso/table_spec.rb +1 -1
- data/spec/isodoc/amd_spec.rb +652 -0
- data/spec/isodoc/blocks_spec.rb +112 -27
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/metadata_spec.rb +88 -4
- data/spec/isodoc/postproc_spec.rb +11 -11
- data/spec/isodoc/ref_spec.rb +7 -7
- data/spec/isodoc/section_spec.rb +28 -1
- data/spec/isodoc/table_spec.rb +29 -29
- data/spec/isodoc/terms_spec.rb +4 -4
- data/spec/isodoc/xref_spec.rb +32 -26
- data/spec/metanorma/processor_spec.rb +2 -2
- data/spec/spec_helper.rb +11 -0
- metadata +61 -11
@@ -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
|
|
@@ -24,18 +24,15 @@
|
|
24
24
|
<xsl:variable name="ISOname" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-reference']"/>
|
25
25
|
|
26
26
|
<!-- Information and documentation — Codes for transcription systems -->
|
27
|
-
<xsl:variable name="title-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'main']"/>
|
28
|
-
<xsl:variable name="title-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'main']"/>
|
29
27
|
<xsl:variable name="title-intro" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-intro']"/>
|
30
28
|
<xsl:variable name="title-intro-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-intro']"/>
|
31
29
|
<xsl:variable name="title-main" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-main']"/>
|
32
30
|
<xsl:variable name="title-main-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-main']"/>
|
33
31
|
<xsl:variable name="part" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@part"/>
|
34
|
-
<xsl:variable name="title-part" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
|
35
|
-
<xsl:variable name="title-part-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-part']"/>
|
36
|
-
|
37
|
-
<xsl:variable name="doctype_uppercased" select="translate(translate(/iso:iso-standard/iso:bibdata/iso:ext/iso:doctype,'-',' '), $lower,$upper)"/>
|
38
32
|
|
33
|
+
<xsl:variable name="doctype" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:doctype"/>
|
34
|
+
<xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new(translate($doctype,'-',' ')))"/>
|
35
|
+
|
39
36
|
<xsl:variable name="stage" select="number(/iso:iso-standard/iso:bibdata/iso:status/iso:stage)"/>
|
40
37
|
<xsl:variable name="substage" select="number(/iso:iso-standard/iso:bibdata/iso:status/iso:substage)"/>
|
41
38
|
<xsl:variable name="stagename" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:stagename)"/>
|
@@ -62,8 +59,8 @@
|
|
62
59
|
|
63
60
|
<xsl:variable name="stage-fullname-uppercased">
|
64
61
|
<xsl:choose>
|
65
|
-
<xsl:when test="$stagename != ''">
|
66
|
-
<xsl:value-of select="
|
62
|
+
<xsl:when test="$stagename != ''">
|
63
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($stagename))"/>
|
67
64
|
</xsl:when>
|
68
65
|
<xsl:when test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP'">NEW WORK ITEM PROPOSAL</xsl:when>
|
69
66
|
<xsl:when test="$stage-abbreviation = 'PWI'">PRELIMINARY WORK ITEM</xsl:when>
|
@@ -144,10 +141,6 @@
|
|
144
141
|
</xsl:variable>
|
145
142
|
|
146
143
|
<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
144
|
|
152
145
|
<!-- Example:
|
153
146
|
<item level="1" id="Foreword" display="true">Foreword</item>
|
@@ -315,33 +308,7 @@
|
|
315
308
|
|
316
309
|
</fo:layout-master-set>
|
317
310
|
|
318
|
-
<
|
319
|
-
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
320
|
-
<pdf:dictionary type="normal" key="ViewerPreferences">
|
321
|
-
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
322
|
-
</pdf:dictionary>
|
323
|
-
</pdf:catalog>
|
324
|
-
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
325
|
-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
326
|
-
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
327
|
-
<!-- Dublin Core properties go here -->
|
328
|
-
<dc:title><xsl:value-of select="$title-en"/></dc:title>
|
329
|
-
<dc:creator><xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:contributor[iso:role/@type='author']/iso:organization/iso:name"/></dc:creator>
|
330
|
-
<dc:description>
|
331
|
-
<xsl:variable name="abstract">
|
332
|
-
<xsl:copy-of select="/iso:iso-standard/iso:bibliography/iso:references/iso:bibitem/iso:abstract//text()"/>
|
333
|
-
</xsl:variable>
|
334
|
-
<xsl:value-of select="normalize-space($abstract)"/>
|
335
|
-
</dc:description>
|
336
|
-
<pdf:Keywords/>
|
337
|
-
</rdf:Description>
|
338
|
-
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
339
|
-
<!-- XMP properties go here -->
|
340
|
-
<xmp:CreatorTool/>
|
341
|
-
</rdf:Description>
|
342
|
-
</rdf:RDF>
|
343
|
-
</x:xmpmeta>
|
344
|
-
</fo:declarations>
|
311
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
345
312
|
|
346
313
|
<!-- cover page -->
|
347
314
|
<xsl:choose>
|
@@ -518,8 +485,10 @@
|
|
518
485
|
</xsl:if>
|
519
486
|
|
520
487
|
<xsl:value-of select="$title-main"/>
|
488
|
+
|
489
|
+
<xsl:call-template name="printTitlePartEn"/>
|
521
490
|
|
522
|
-
<xsl:if test="normalize-space($title-part) != ''">
|
491
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
523
492
|
<xsl:if test="$part != ''">
|
524
493
|
<xsl:text> — </xsl:text>
|
525
494
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -528,7 +497,7 @@
|
|
528
497
|
</fo:block>
|
529
498
|
</xsl:if>
|
530
499
|
<xsl:value-of select="$title-part"/>
|
531
|
-
</xsl:if>
|
500
|
+
</xsl:if> -->
|
532
501
|
</fo:block>
|
533
502
|
|
534
503
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -540,16 +509,9 @@
|
|
540
509
|
</xsl:if>
|
541
510
|
|
542
511
|
<xsl:value-of select="$title-main-fr"/>
|
512
|
+
|
513
|
+
<xsl:call-template name="printTitlePartFr"/>
|
543
514
|
|
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
515
|
</fo:block>
|
554
516
|
</fo:block>
|
555
517
|
<fo:block margin-top="10mm">
|
@@ -681,7 +643,8 @@
|
|
681
643
|
|
682
644
|
<xsl:value-of select="$title-main"/>
|
683
645
|
|
684
|
-
<xsl:
|
646
|
+
<xsl:call-template name="printTitlePartEn"/>
|
647
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
685
648
|
<xsl:if test="$part != ''">
|
686
649
|
<xsl:text> — </xsl:text>
|
687
650
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -690,7 +653,7 @@
|
|
690
653
|
</fo:block>
|
691
654
|
</xsl:if>
|
692
655
|
<xsl:value-of select="$title-part"/>
|
693
|
-
</xsl:if>
|
656
|
+
</xsl:if> -->
|
694
657
|
</fo:block>
|
695
658
|
|
696
659
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -703,15 +666,8 @@
|
|
703
666
|
|
704
667
|
<xsl:value-of select="$title-main-fr"/>
|
705
668
|
|
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>
|
669
|
+
<xsl:call-template name="printTitlePartFr"/>
|
670
|
+
|
715
671
|
</fo:block>
|
716
672
|
</fo:block>
|
717
673
|
</fo:block-container>
|
@@ -801,7 +757,8 @@
|
|
801
757
|
|
802
758
|
<xsl:value-of select="$title-main"/>
|
803
759
|
|
804
|
-
<xsl:
|
760
|
+
<xsl:call-template name="printTitlePartEn"/>
|
761
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
805
762
|
<xsl:if test="$part != ''">
|
806
763
|
<xsl:text> — </xsl:text>
|
807
764
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -810,7 +767,7 @@
|
|
810
767
|
</fo:block>
|
811
768
|
</xsl:if>
|
812
769
|
<xsl:value-of select="$title-part"/>
|
813
|
-
</xsl:if>
|
770
|
+
</xsl:if> -->
|
814
771
|
</fo:block>
|
815
772
|
|
816
773
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -823,15 +780,8 @@
|
|
823
780
|
|
824
781
|
<xsl:value-of select="$title-main-fr"/>
|
825
782
|
|
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>
|
783
|
+
<xsl:call-template name="printTitlePartFr"/>
|
784
|
+
|
835
785
|
</fo:block>
|
836
786
|
</fo:block>
|
837
787
|
</fo:block-container>
|
@@ -920,7 +870,8 @@
|
|
920
870
|
|
921
871
|
<xsl:value-of select="$title-main"/>
|
922
872
|
|
923
|
-
<xsl:
|
873
|
+
<xsl:call-template name="printTitlePartEn"/>
|
874
|
+
<!-- <xsl:if test="normalize-space($title-part) != ''">
|
924
875
|
<xsl:if test="$part != ''">
|
925
876
|
<xsl:text> — </xsl:text>
|
926
877
|
<fo:block font-weight="normal" margin-top="6pt">
|
@@ -929,7 +880,7 @@
|
|
929
880
|
</fo:block>
|
930
881
|
</xsl:if>
|
931
882
|
<xsl:value-of select="$title-part"/>
|
932
|
-
</xsl:if>
|
883
|
+
</xsl:if> -->
|
933
884
|
</fo:block>
|
934
885
|
|
935
886
|
<fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
|
@@ -941,15 +892,17 @@
|
|
941
892
|
|
942
893
|
<xsl:value-of select="$title-main-fr"/>
|
943
894
|
|
944
|
-
<xsl:
|
895
|
+
<xsl:variable name="part-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-part']"/>
|
896
|
+
<xsl:if test="normalize-space($part-fr) != ''">
|
945
897
|
<xsl:if test="$part != ''">
|
946
898
|
<xsl:text> — </xsl:text>
|
947
899
|
<fo:block margin-top="6pt" font-weight="normal">
|
948
|
-
<xsl:
|
949
|
-
<xsl:
|
900
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part)"/>
|
901
|
+
<!-- <xsl:value-of select="$title-part-fr"/><xsl:value-of select="$part"/>
|
902
|
+
<xsl:text>:</xsl:text> -->
|
950
903
|
</fo:block>
|
951
904
|
</xsl:if>
|
952
|
-
<xsl:value-of select="$
|
905
|
+
<xsl:value-of select="$part-fr"/>
|
953
906
|
</xsl:if>
|
954
907
|
</fo:block>
|
955
908
|
</fo:block-container>
|
@@ -989,81 +942,101 @@
|
|
989
942
|
<xsl:apply-templates select="/iso:iso-standard/iso:boilerplate/iso:copyright-statement"/>
|
990
943
|
</fo:block>
|
991
944
|
</fo:block>
|
992
|
-
</fo:block-container>
|
993
|
-
<fo:block break-after="page"/>
|
945
|
+
</fo:block-container>
|
994
946
|
</xsl:if>
|
995
947
|
|
996
|
-
|
997
|
-
|
998
|
-
<
|
999
|
-
<fo:inline font-size="16pt" font-weight="bold">Contents</fo:inline>
|
1000
|
-
<fo:inline keep-together.within-line="always">
|
1001
|
-
<fo:leader leader-pattern="space"/>
|
1002
|
-
<fo:inline font-weight="normal" font-size="10pt">Page</fo:inline>
|
1003
|
-
</fo:inline>
|
1004
|
-
</fo:block>
|
1005
|
-
|
1006
|
-
<xsl:if test="$debug = 'true'">
|
1007
|
-
<xsl:text disable-output-escaping="yes"><!--</xsl:text>
|
1008
|
-
DEBUG
|
1009
|
-
contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
|
1010
|
-
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
1011
|
-
</xsl:if>
|
948
|
+
|
949
|
+
<xsl:choose>
|
950
|
+
<xsl:when test="$doctype = 'amendment'"/><!-- ToC shouldn't be generated in amendments. -->
|
1012
951
|
|
1013
|
-
<xsl:
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
952
|
+
<xsl:otherwise>
|
953
|
+
<xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
|
954
|
+
<fo:block break-after="page"/>
|
955
|
+
</xsl:if>
|
956
|
+
<fo:block-container font-weight="bold">
|
957
|
+
|
958
|
+
<fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
|
959
|
+
<xsl:variable name="title-toc">
|
960
|
+
<xsl:call-template name="getTitle">
|
961
|
+
<xsl:with-param name="name" select="'title-toc'"/>
|
962
|
+
</xsl:call-template>
|
963
|
+
</xsl:variable>
|
964
|
+
<fo:inline font-size="16pt" font-weight="bold"><xsl:value-of select="$title-toc"/></fo:inline>
|
965
|
+
<fo:inline keep-together.within-line="always">
|
966
|
+
<fo:leader leader-pattern="space"/>
|
967
|
+
<xsl:variable name="title-page">
|
968
|
+
<xsl:call-template name="getTitle">
|
969
|
+
<xsl:with-param name="name" select="'title-page'"/>
|
970
|
+
</xsl:call-template>
|
971
|
+
</xsl:variable>
|
972
|
+
<fo:inline font-weight="normal" font-size="10pt"><xsl:value-of select="$title-page"/></fo:inline>
|
973
|
+
</fo:inline>
|
974
|
+
</fo:block>
|
975
|
+
|
976
|
+
<xsl:if test="$debug = 'true'">
|
977
|
+
<xsl:text disable-output-escaping="yes"><!--</xsl:text>
|
978
|
+
DEBUG
|
979
|
+
contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
|
980
|
+
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
1022
981
|
</xsl:if>
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
<xsl:
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
<xsl:if test="@
|
1051
|
-
<
|
982
|
+
|
983
|
+
<xsl:variable name="margin-left">12</xsl:variable>
|
984
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true'][not(@level = 2 and starts-with(@section, '0'))]"><!-- skip clause from preface -->
|
985
|
+
|
986
|
+
<fo:block>
|
987
|
+
<xsl:if test="@level = 1">
|
988
|
+
<xsl:attribute name="margin-top">5pt</xsl:attribute>
|
989
|
+
</xsl:if>
|
990
|
+
<xsl:if test="@level = 3">
|
991
|
+
<xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
|
992
|
+
</xsl:if>
|
993
|
+
<fo:list-block>
|
994
|
+
<xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
|
995
|
+
<xsl:if test="@level >= 2">
|
996
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
997
|
+
</xsl:if>
|
998
|
+
<xsl:attribute name="provisional-distance-between-starts">
|
999
|
+
<xsl:choose>
|
1000
|
+
<!-- skip 0 section without subsections -->
|
1001
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
|
1002
|
+
<xsl:when test="@section != '' and not(@display-section = 'false')"><xsl:value-of select="$margin-left"/>mm</xsl:when>
|
1003
|
+
<xsl:otherwise>0mm</xsl:otherwise>
|
1004
|
+
</xsl:choose>
|
1005
|
+
</xsl:attribute>
|
1006
|
+
<fo:list-item>
|
1007
|
+
<fo:list-item-label end-indent="label-end()">
|
1008
|
+
<fo:block>
|
1009
|
+
<xsl:if test="@section and not(@display-section = 'false')"> <!-- output below -->
|
1010
|
+
<xsl:value-of select="@section"/>
|
1052
1011
|
</xsl:if>
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1012
|
+
</fo:block>
|
1013
|
+
</fo:list-item-label>
|
1014
|
+
<fo:list-item-body start-indent="body-start()">
|
1015
|
+
<fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
|
1016
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
|
1017
|
+
<xsl:if test="@section and @display-section = 'false'">
|
1018
|
+
<xsl:value-of select="@section"/><xsl:text> </xsl:text>
|
1019
|
+
</xsl:if>
|
1020
|
+
<xsl:if test="@addon != ''">
|
1021
|
+
<fo:inline font-weight="normal">(<xsl:value-of select="@addon"/>)</fo:inline>
|
1022
|
+
</xsl:if>
|
1023
|
+
<xsl:text> </xsl:text><xsl:value-of select="text()"/>
|
1024
|
+
<fo:inline keep-together.within-line="always">
|
1025
|
+
<fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
|
1026
|
+
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
1027
|
+
</fo:inline>
|
1028
|
+
</fo:basic-link>
|
1029
|
+
</fo:block>
|
1030
|
+
</fo:list-item-body>
|
1031
|
+
</fo:list-item>
|
1032
|
+
</fo:list-block>
|
1033
|
+
</fo:block>
|
1034
|
+
|
1035
|
+
</xsl:for-each>
|
1036
|
+
</fo:block-container>
|
1037
|
+
</xsl:otherwise>
|
1038
|
+
</xsl:choose>
|
1039
|
+
|
1067
1040
|
<!-- Foreword, Introduction -->
|
1068
1041
|
<xsl:apply-templates select="/iso:iso-standard/iso:preface/node()"/>
|
1069
1042
|
|
@@ -1088,6 +1061,7 @@
|
|
1088
1061
|
</fo:block>
|
1089
1062
|
-->
|
1090
1063
|
<fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
|
1064
|
+
<xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
|
1091
1065
|
<fo:block>
|
1092
1066
|
<xsl:if test="normalize-space($title-intro) != ''">
|
1093
1067
|
<xsl:value-of select="$title-intro"/>
|
@@ -1096,22 +1070,42 @@
|
|
1096
1070
|
|
1097
1071
|
<xsl:value-of select="$title-main"/>
|
1098
1072
|
|
1099
|
-
<xsl:if test="normalize-space($
|
1073
|
+
<xsl:if test="normalize-space($part-en) != ''">
|
1100
1074
|
<xsl:if test="$part != ''">
|
1101
1075
|
<xsl:text> — </xsl:text>
|
1102
1076
|
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
|
1103
|
-
<xsl:
|
1104
|
-
<xsl:
|
1077
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
|
1078
|
+
<!-- <xsl:value-of select="$title-part-en"/>
|
1079
|
+
<xsl:value-of select="$part"/>
|
1080
|
+
<xsl:text>:</xsl:text> -->
|
1105
1081
|
</fo:block>
|
1106
1082
|
</xsl:if>
|
1107
1083
|
</xsl:if>
|
1108
1084
|
</fo:block>
|
1109
1085
|
<fo:block>
|
1110
|
-
<xsl:value-of select="$
|
1086
|
+
<xsl:value-of select="$part-en"/>
|
1111
1087
|
</fo:block>
|
1088
|
+
|
1089
|
+
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
|
1090
|
+
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
1091
|
+
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
|
1092
|
+
<xsl:variable name="title-amendment">
|
1093
|
+
<xsl:call-template name="getTitle">
|
1094
|
+
<xsl:with-param name="name" select="'title-amendment'"/>
|
1095
|
+
</xsl:call-template>
|
1096
|
+
</xsl:variable>
|
1097
|
+
<xsl:value-of select="$title-amendment"/>
|
1098
|
+
<xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
|
1099
|
+
<xsl:if test="normalize-space($amendment-number) != ''">
|
1100
|
+
<xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
|
1101
|
+
</xsl:if>
|
1102
|
+
<xsl:text>: </xsl:text>
|
1103
|
+
<xsl:value-of select="$title-amd"/>
|
1104
|
+
</fo:block>
|
1105
|
+
</xsl:if>
|
1106
|
+
|
1112
1107
|
</fo:block>
|
1113
1108
|
|
1114
|
-
|
1115
1109
|
</fo:block-container>
|
1116
1110
|
<!-- Clause(s) -->
|
1117
1111
|
<fo:block>
|
@@ -1187,6 +1181,19 @@
|
|
1187
1181
|
<xsl:otherwise>ICS  67.060</xsl:otherwise>
|
1188
1182
|
</xsl:choose> -->
|
1189
1183
|
</fo:block>
|
1184
|
+
<xsl:if test="/iso:iso-standard/iso:bibdata/iso:keyword">
|
1185
|
+
<fo:block font-size="9pt" margin-bottom="6pt">
|
1186
|
+
<xsl:variable name="title-descriptors">
|
1187
|
+
<xsl:call-template name="getTitle">
|
1188
|
+
<xsl:with-param name="name" select="'title-descriptors'"/>
|
1189
|
+
</xsl:call-template>
|
1190
|
+
</xsl:variable>
|
1191
|
+
<fo:inline font-weight="bold"><xsl:value-of select="$title-descriptors"/>: </fo:inline>
|
1192
|
+
<xsl:call-template name="insertKeywords">
|
1193
|
+
<xsl:with-param name="sorting">no</xsl:with-param>
|
1194
|
+
</xsl:call-template>
|
1195
|
+
</fo:block>
|
1196
|
+
</xsl:if>
|
1190
1197
|
<fo:block font-size="9pt">Price based on <fo:page-number-citation ref-id="lastBlock"/> pages</fo:block>
|
1191
1198
|
</fo:block-container>
|
1192
1199
|
</fo:block-container>
|
@@ -1303,8 +1310,7 @@
|
|
1303
1310
|
<xsl:template match="iso:figure" mode="contents">
|
1304
1311
|
<item level="" id="{@id}" display="false">
|
1305
1312
|
<xsl:attribute name="section">
|
1306
|
-
<xsl:call-template name="getFigureNumber"/>
|
1307
|
-
<!-- <xsl:text>Figure </xsl:text><xsl:number format="A.1-1" level="multiple" count="iso:annex | iso:figure"/> -->
|
1313
|
+
<xsl:call-template name="getFigureNumber"/>
|
1308
1314
|
</xsl:attribute>
|
1309
1315
|
</item>
|
1310
1316
|
</xsl:template>
|
@@ -1314,21 +1320,14 @@
|
|
1314
1320
|
<xsl:param name="sectionNum"/>
|
1315
1321
|
<xsl:variable name="annex-id" select="ancestor::iso:annex/@id"/>
|
1316
1322
|
<item level="" id="{@id}" display="false" type="table">
|
1317
|
-
<xsl:attribute name="section">
|
1318
|
-
<xsl:
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
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>
|
1323
|
+
<xsl:attribute name="section">
|
1324
|
+
<xsl:variable name="title-table">
|
1325
|
+
<xsl:call-template name="getTitle">
|
1326
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
1327
|
+
</xsl:call-template>
|
1328
|
+
</xsl:variable>
|
1329
|
+
<xsl:value-of select="$title-table"/>
|
1330
|
+
<xsl:call-template name="getTableNumber"/>
|
1332
1331
|
</xsl:attribute>
|
1333
1332
|
<xsl:value-of select="iso:name/text()"/>
|
1334
1333
|
</item>
|
@@ -1337,7 +1336,15 @@
|
|
1337
1336
|
<xsl:template match="iso:formula" mode="contents">
|
1338
1337
|
<item level="" id="{@id}" display="false">
|
1339
1338
|
<xsl:attribute name="section">
|
1340
|
-
<xsl:
|
1339
|
+
<xsl:variable name="title-formula">
|
1340
|
+
<xsl:call-template name="getTitle">
|
1341
|
+
<xsl:with-param name="name" select="'title-formula'"/>
|
1342
|
+
</xsl:call-template>
|
1343
|
+
</xsl:variable>
|
1344
|
+
<xsl:value-of select="$title-formula"/>
|
1345
|
+
<xsl:call-template name="getFormulaNumber">
|
1346
|
+
<xsl:with-param name="display" select="not(@unnumbered = 'true')"/>
|
1347
|
+
</xsl:call-template>
|
1341
1348
|
</xsl:attribute>
|
1342
1349
|
</item>
|
1343
1350
|
</xsl:template>
|
@@ -1443,7 +1450,7 @@
|
|
1443
1450
|
<xsl:param name="sectionNum"/>
|
1444
1451
|
<xsl:param name="sectionNumSkew" select="0"/>
|
1445
1452
|
<fo:block>
|
1446
|
-
<xsl:variable name="pos"><xsl:number count="iso:sections/iso:clause | iso:sections/iso:terms
|
1453
|
+
<xsl:variable name="pos"><xsl:number count="*"/></xsl:variable> <!-- iso:sections/iso:clause | iso:sections/iso:terms | iso:sections/iso:definitions -->
|
1447
1454
|
<xsl:if test="$pos >= 2">
|
1448
1455
|
<xsl:attribute name="space-before">18pt</xsl:attribute>
|
1449
1456
|
</xsl:if>
|
@@ -1452,7 +1459,7 @@
|
|
1452
1459
|
<xsl:choose>
|
1453
1460
|
<xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
|
1454
1461
|
<xsl:when test="$sectionNumSkew != 0">
|
1455
|
-
<xsl:variable name="number"><xsl:number count="iso:sections/iso:clause | iso:sections/iso:terms
|
1462
|
+
<xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!--iso:sections/iso:clause | iso:sections/iso:terms | iso:sections/iso:definitions -->
|
1456
1463
|
<xsl:value-of select="$number + $sectionNumSkew"/>
|
1457
1464
|
</xsl:when>
|
1458
1465
|
</xsl:choose>
|
@@ -1531,6 +1538,11 @@
|
|
1531
1538
|
</xsl:variable>
|
1532
1539
|
|
1533
1540
|
<xsl:choose>
|
1541
|
+
<xsl:when test="$doctype = 'amendment'">
|
1542
|
+
<fo:block id="{$id}" font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
|
1543
|
+
<xsl:apply-templates/>
|
1544
|
+
</fo:block>
|
1545
|
+
</xsl:when>
|
1534
1546
|
<xsl:when test="$parent-name = 'annex'">
|
1535
1547
|
<fo:block id="{$id}" font-size="16pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always">
|
1536
1548
|
<xsl:value-of select="$section"/>
|
@@ -1724,7 +1736,7 @@
|
|
1724
1736
|
<fo:external-graphic src="{@src}" fox:alt-text="Image {@alt}"/>
|
1725
1737
|
</fo:block>
|
1726
1738
|
<fo:block font-weight="bold" margin-top="12pt" margin-bottom="12pt">
|
1727
|
-
<xsl:value-of select="$title-figure"/>
|
1739
|
+
<!-- <xsl:value-of select="$title-figure"/> -->
|
1728
1740
|
<xsl:call-template name="getFigureNumber"/>
|
1729
1741
|
</fo:block>
|
1730
1742
|
</fo:block-container>
|
@@ -1740,9 +1752,12 @@
|
|
1740
1752
|
<xsl:call-template name="note"/>
|
1741
1753
|
</xsl:for-each>
|
1742
1754
|
<fo:block font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-previous="always">
|
1743
|
-
<xsl:
|
1755
|
+
<xsl:variable name="figureNumber">
|
1756
|
+
<xsl:call-template name="getFigureNumber"/>
|
1757
|
+
</xsl:variable>
|
1758
|
+
<xsl:value-of select="$figureNumber"/>
|
1744
1759
|
<xsl:if test="iso:name">
|
1745
|
-
<xsl:if test="not(local-name(..) = 'figure')">
|
1760
|
+
<xsl:if test="not(local-name(..) = 'figure') and normalize-space($figureNumber) != ''">
|
1746
1761
|
<xsl:text> — </xsl:text>
|
1747
1762
|
</xsl:if>
|
1748
1763
|
<xsl:value-of select="iso:name"/>
|
@@ -1752,7 +1767,13 @@
|
|
1752
1767
|
</xsl:template>
|
1753
1768
|
|
1754
1769
|
<xsl:template name="getFigureNumber">
|
1770
|
+
<xsl:variable name="title-figure">
|
1771
|
+
<xsl:call-template name="getTitle">
|
1772
|
+
<xsl:with-param name="name" select="'title-figure'"/>
|
1773
|
+
</xsl:call-template>
|
1774
|
+
</xsl:variable>
|
1755
1775
|
<xsl:choose>
|
1776
|
+
<xsl:when test="$doctype = 'amendment'"/>
|
1756
1777
|
<xsl:when test="ancestor::iso:annex">
|
1757
1778
|
<xsl:choose>
|
1758
1779
|
<xsl:when test="local-name(..) = 'figure'">
|
@@ -1793,15 +1814,17 @@
|
|
1793
1814
|
|
1794
1815
|
<xsl:template match="iso:bibitem">
|
1795
1816
|
<fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
<xsl:
|
1817
|
+
<xsl:variable name="docidentifier">
|
1818
|
+
<xsl:if test="iso:docidentifier">
|
1819
|
+
<xsl:choose>
|
1820
|
+
<xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
|
1821
|
+
<xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
|
1822
|
+
</xsl:choose>
|
1823
|
+
</xsl:if>
|
1824
|
+
</xsl:variable>
|
1825
|
+
<xsl:value-of select="$docidentifier"/>
|
1826
|
+
<xsl:apply-templates select="iso:note"/>
|
1827
|
+
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
1805
1828
|
<fo:inline font-style="italic">
|
1806
1829
|
<xsl:choose>
|
1807
1830
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
@@ -1822,13 +1845,13 @@
|
|
1822
1845
|
<xsl:number level="any" count="iso:bibitem/iso:note"/>
|
1823
1846
|
</xsl:variable>
|
1824
1847
|
<fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="30%"> <!--85% vertical-align="super"-->
|
1825
|
-
<fo:basic-link internal-destination="
|
1848
|
+
<fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
|
1826
1849
|
<xsl:value-of select="$number"/><xsl:text>)</xsl:text>
|
1827
1850
|
</fo:basic-link>
|
1828
1851
|
</fo:inline>
|
1829
1852
|
<fo:footnote-body>
|
1830
1853
|
<fo:block font-size="10pt" margin-bottom="4pt" start-indent="0pt">
|
1831
|
-
<fo:inline id="
|
1854
|
+
<fo:inline id="{generate-id()}" keep-with-next.within-line="always" alignment-baseline="hanging" padding-right="3mm"><!-- font-size="60%" -->
|
1832
1855
|
<xsl:value-of select="$number"/><xsl:text>)</xsl:text>
|
1833
1856
|
</fo:inline>
|
1834
1857
|
<xsl:apply-templates/>
|
@@ -1866,7 +1889,7 @@
|
|
1866
1889
|
|
1867
1890
|
<xsl:template match="iso:term">
|
1868
1891
|
<xsl:param name="sectionNum"/>
|
1869
|
-
<fo:block margin-bottom="10pt">
|
1892
|
+
<fo:block id="{@id}" margin-bottom="10pt">
|
1870
1893
|
<xsl:apply-templates>
|
1871
1894
|
<xsl:with-param name="sectionNum" select="$sectionNum"/>
|
1872
1895
|
</xsl:apply-templates>
|
@@ -1877,7 +1900,7 @@
|
|
1877
1900
|
<xsl:param name="sectionNum"/>
|
1878
1901
|
<fo:block line-height="1.1">
|
1879
1902
|
<fo:block font-weight="bold" keep-with-next="always">
|
1880
|
-
<fo:inline
|
1903
|
+
<fo:inline>
|
1881
1904
|
<xsl:variable name="section">
|
1882
1905
|
<xsl:call-template name="getSection">
|
1883
1906
|
<xsl:with-param name="sectionNum" select="$sectionNum"/>
|
@@ -1900,7 +1923,12 @@
|
|
1900
1923
|
</xsl:template>
|
1901
1924
|
|
1902
1925
|
<xsl:template match="iso:deprecates">
|
1903
|
-
<
|
1926
|
+
<xsl:variable name="title-deprecated">
|
1927
|
+
<xsl:call-template name="getTitle">
|
1928
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
1929
|
+
</xsl:call-template>
|
1930
|
+
</xsl:variable>
|
1931
|
+
<fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
|
1904
1932
|
</xsl:template>
|
1905
1933
|
|
1906
1934
|
<xsl:template match="iso:definition[preceding-sibling::iso:domain]">
|
@@ -1921,7 +1949,14 @@
|
|
1921
1949
|
<fo:block margin-bottom="8pt"> <!-- keep-with-previous="always" -->
|
1922
1950
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
1923
1951
|
<fo:basic-link internal-destination="{iso:origin/@bibitemid}" fox:alt-text="{iso:origin/@citeas}">
|
1924
|
-
<xsl:text>[
|
1952
|
+
<xsl:text>[</xsl:text>
|
1953
|
+
<xsl:variable name="title-source">
|
1954
|
+
<xsl:call-template name="getTitle">
|
1955
|
+
<xsl:with-param name="name" select="'title-source'"/>
|
1956
|
+
</xsl:call-template>
|
1957
|
+
</xsl:variable>
|
1958
|
+
<xsl:value-of select="$title-source"/>
|
1959
|
+
<xsl:text>: </xsl:text>
|
1925
1960
|
<xsl:value-of select="iso:origin/@citeas"/>
|
1926
1961
|
|
1927
1962
|
<xsl:apply-templates select="iso:origin/iso:localityStack"/>
|
@@ -1935,19 +1970,23 @@
|
|
1935
1970
|
</fo:block>
|
1936
1971
|
</xsl:template>
|
1937
1972
|
|
1938
|
-
|
1939
|
-
<xsl:text>, modified — </xsl:text>
|
1940
|
-
<xsl:apply-templates/>
|
1941
|
-
</xsl:template>
|
1973
|
+
|
1942
1974
|
<xsl:template match="iso:modification/iso:p">
|
1943
1975
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
1944
1976
|
</xsl:template>
|
1945
1977
|
|
1946
1978
|
<xsl:template match="iso:termnote">
|
1947
1979
|
<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>
|
1980
|
+
<!-- <xsl:text>Note </xsl:text>
|
1981
|
+
<xsl:number />
|
1982
|
+
<xsl:text> to entry: </xsl:text> -->
|
1983
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
1984
|
+
<xsl:variable name="title-note-to-entry">
|
1985
|
+
<xsl:call-template name="getTitle">
|
1986
|
+
<xsl:with-param name="name" select="'title-note-to-entry'"/>
|
1987
|
+
</xsl:call-template>
|
1988
|
+
</xsl:variable>
|
1989
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
|
1951
1990
|
<xsl:apply-templates/>
|
1952
1991
|
</fo:block>
|
1953
1992
|
</xsl:template>
|
@@ -1961,14 +2000,19 @@
|
|
1961
2000
|
</xsl:template>
|
1962
2001
|
|
1963
2002
|
<xsl:template match="iso:domain">
|
1964
|
-
<fo:inline><<xsl:apply-templates/>></fo:inline>
|
2003
|
+
<fo:inline><<xsl:apply-templates/>></fo:inline><xsl:text> </xsl:text>
|
1965
2004
|
</xsl:template>
|
1966
2005
|
|
1967
2006
|
|
1968
2007
|
<xsl:template match="iso:termexample">
|
1969
2008
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt" text-align="justify">
|
1970
2009
|
<fo:inline padding-right="5mm">
|
1971
|
-
<xsl:
|
2010
|
+
<xsl:variable name="title-example">
|
2011
|
+
<xsl:call-template name="getTitle">
|
2012
|
+
<xsl:with-param name="name" select="'title-example'"/>
|
2013
|
+
</xsl:call-template>
|
2014
|
+
</xsl:variable>
|
2015
|
+
<xsl:value-of select="$title-example"/>
|
1972
2016
|
<xsl:if test="count(ancestor::iso:term[1]//iso:termexample) > 1">
|
1973
2017
|
<xsl:number/>
|
1974
2018
|
</xsl:if>
|
@@ -2009,14 +2053,17 @@
|
|
2009
2053
|
</fo:list-item-label>
|
2010
2054
|
<fo:list-item-body start-indent="body-start()">
|
2011
2055
|
<fo:block>
|
2012
|
-
<xsl:
|
2013
|
-
<xsl:
|
2014
|
-
<xsl:
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2056
|
+
<xsl:variable name="docidentifier">
|
2057
|
+
<xsl:if test="iso:docidentifier">
|
2058
|
+
<xsl:choose>
|
2059
|
+
<xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
|
2060
|
+
<xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
|
2061
|
+
</xsl:choose>
|
2062
|
+
</xsl:if>
|
2063
|
+
</xsl:variable>
|
2064
|
+
<xsl:value-of select="$docidentifier"/>
|
2018
2065
|
<xsl:apply-templates select="iso:note"/>
|
2019
|
-
<xsl:if test="
|
2066
|
+
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
2020
2067
|
<xsl:choose>
|
2021
2068
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
2022
2069
|
<xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
|
@@ -2048,7 +2095,8 @@
|
|
2048
2095
|
</fo:block>
|
2049
2096
|
<fo:block text-align="right">
|
2050
2097
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
2051
|
-
<xsl:
|
2098
|
+
<xsl:apply-templates select="iso:author"/>
|
2099
|
+
<!-- <xsl:text>— </xsl:text><xsl:value-of select="iso:author"/> -->
|
2052
2100
|
<xsl:if test="iso:source">
|
2053
2101
|
<xsl:text>, </xsl:text>
|
2054
2102
|
<xsl:apply-templates select="iso:source"/>
|
@@ -2056,70 +2104,17 @@
|
|
2056
2104
|
</fo:block>
|
2057
2105
|
</xsl:template>
|
2058
2106
|
|
2107
|
+
<xsl:template match="iso:quote/iso:author">
|
2108
|
+
<xsl:text>— </xsl:text><xsl:apply-templates/>
|
2109
|
+
</xsl:template>
|
2110
|
+
|
2059
2111
|
<xsl:template match="iso:source">
|
2060
2112
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
2061
|
-
<xsl:value-of select="@citeas" disable-output-escaping="yes"
|
2113
|
+
<xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
|
2062
2114
|
<xsl:apply-templates select="iso:localityStack"/>
|
2063
2115
|
</fo:basic-link>
|
2064
2116
|
</xsl:template>
|
2065
2117
|
|
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
2118
|
|
2124
2119
|
<xsl:template match="mathml:math" priority="2">
|
2125
2120
|
<fo:inline font-family="Cambria Math">
|
@@ -2142,8 +2137,15 @@
|
|
2142
2137
|
<xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = $target]/@type"/>
|
2143
2138
|
<xsl:variable name="root" select="xalan:nodeset($contents)//item[@id =$target]/@root"/>
|
2144
2139
|
<xsl:variable name="level" select="xalan:nodeset($contents)//item[@id =$target]/@level"/>
|
2140
|
+
|
2141
|
+
<xsl:variable name="title-clause">
|
2142
|
+
<xsl:call-template name="getTitle">
|
2143
|
+
<xsl:with-param name="name" select="'title-clause'"/>
|
2144
|
+
</xsl:call-template>
|
2145
|
+
</xsl:variable>
|
2146
|
+
|
2145
2147
|
<xsl:choose>
|
2146
|
-
<xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1"
|
2148
|
+
<xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
|
2147
2149
|
<xsl:when test="$type = 'li'">
|
2148
2150
|
<xsl:attribute name="color">black</xsl:attribute>
|
2149
2151
|
<xsl:attribute name="text-decoration">none</xsl:attribute>
|
@@ -2164,18 +2166,6 @@
|
|
2164
2166
|
<xsl:value-of select="$section"/>
|
2165
2167
|
</fo:basic-link>
|
2166
2168
|
</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
2169
|
|
2180
2170
|
<xsl:template match="iso:example/iso:p">
|
2181
2171
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt">
|
@@ -2183,8 +2173,13 @@
|
|
2183
2173
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
2184
2174
|
</xsl:if> -->
|
2185
2175
|
<xsl:variable name="claims_id" select="ancestor::iso:clause[1]/@id"/>
|
2186
|
-
<fo:inline padding-right="5mm">
|
2187
|
-
<xsl:
|
2176
|
+
<fo:inline padding-right="5mm">
|
2177
|
+
<xsl:variable name="title-example">
|
2178
|
+
<xsl:call-template name="getTitle">
|
2179
|
+
<xsl:with-param name="name" select="'title-example'"/>
|
2180
|
+
</xsl:call-template>
|
2181
|
+
</xsl:variable>
|
2182
|
+
<xsl:value-of select="$title-example"/>
|
2188
2183
|
<xsl:if test="count(ancestor::iso:clause[1]//iso:example) > 1">
|
2189
2184
|
<xsl:number count="iso:example[ancestor::iso:clause[@id = $claims_id]]" level="any"/>
|
2190
2185
|
</xsl:if>
|
@@ -2196,8 +2191,13 @@
|
|
2196
2191
|
<xsl:template match="iso:note/iso:p" name="note">
|
2197
2192
|
<fo:block font-size="10pt" margin-top="8pt" margin-bottom="12pt" text-align="justify">
|
2198
2193
|
<xsl:variable name="claims_id" select="ancestor::iso:clause[1]/@id"/>
|
2199
|
-
<fo:inline padding-right="6mm">
|
2200
|
-
<xsl:
|
2194
|
+
<fo:inline padding-right="6mm">
|
2195
|
+
<xsl:variable name="title-note">
|
2196
|
+
<xsl:call-template name="getTitle">
|
2197
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
2198
|
+
</xsl:call-template>
|
2199
|
+
</xsl:variable>
|
2200
|
+
<xsl:value-of select="$title-note"/>
|
2201
2201
|
<xsl:if test="count(ancestor::iso:clause[1]//iso:note) > 1">
|
2202
2202
|
<xsl:number count="iso:note[ancestor::iso:clause[@id = $claims_id]]" level="any"/>
|
2203
2203
|
</xsl:if>
|
@@ -2222,7 +2222,7 @@
|
|
2222
2222
|
|
2223
2223
|
<xsl:choose>
|
2224
2224
|
<xsl:when test="@citeas and normalize-space(text()) = ''">
|
2225
|
-
<xsl:value-of select="@citeas" disable-output-escaping="yes"
|
2225
|
+
<xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
|
2226
2226
|
</xsl:when>
|
2227
2227
|
<xsl:when test="@bibitemid and normalize-space(text()) = ''">
|
2228
2228
|
<xsl:value-of select="//iso:bibitem[@id = current()/@bibitemid]/iso:docidentifier"/>
|
@@ -2235,25 +2235,46 @@
|
|
2235
2235
|
</xsl:template>
|
2236
2236
|
|
2237
2237
|
<xsl:template match="iso:locality">
|
2238
|
+
<xsl:variable name="title-clause">
|
2239
|
+
<xsl:call-template name="getTitle">
|
2240
|
+
<xsl:with-param name="name" select="'title-clause'"/>
|
2241
|
+
</xsl:call-template>
|
2242
|
+
</xsl:variable>
|
2243
|
+
<xsl:variable name="title-annex">
|
2244
|
+
<xsl:call-template name="getTitle">
|
2245
|
+
<xsl:with-param name="name" select="'title-annex'"/>
|
2246
|
+
</xsl:call-template>
|
2247
|
+
</xsl:variable>
|
2248
|
+
<xsl:variable name="title-table">
|
2249
|
+
<xsl:call-template name="getTitle">
|
2250
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
2251
|
+
</xsl:call-template>
|
2252
|
+
</xsl:variable>
|
2238
2253
|
<xsl:choose>
|
2239
2254
|
<xsl:when test="ancestor::iso:termsource"/>
|
2240
2255
|
<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'"
|
2256
|
+
<xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
|
2257
|
+
<xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
|
2258
|
+
<xsl:when test="@type ='table'"><xsl:value-of select="$title-table"/></xsl:when>
|
2244
2259
|
<xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
|
2245
2260
|
</xsl:choose>
|
2246
2261
|
<xsl:text> </xsl:text><xsl:value-of select="iso:referenceFrom"/>
|
2247
2262
|
</xsl:template>
|
2248
2263
|
|
2249
2264
|
<xsl:template match="iso:admonition">
|
2250
|
-
<fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
|
2251
|
-
<xsl:value-of select="
|
2265
|
+
<fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
|
2266
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
|
2252
2267
|
<xsl:text> — </xsl:text>
|
2253
2268
|
<xsl:apply-templates/>
|
2254
2269
|
</fo:block>
|
2255
2270
|
</xsl:template>
|
2256
2271
|
|
2272
|
+
<xsl:template match="iso:formula">
|
2273
|
+
<fo:block id="{@id}">
|
2274
|
+
<xsl:apply-templates/>
|
2275
|
+
</fo:block>
|
2276
|
+
</xsl:template>
|
2277
|
+
|
2257
2278
|
<xsl:template match="iso:formula/iso:dt/iso:stem">
|
2258
2279
|
<fo:inline>
|
2259
2280
|
<xsl:apply-templates/>
|
@@ -2261,7 +2282,7 @@
|
|
2261
2282
|
</xsl:template>
|
2262
2283
|
|
2263
2284
|
<xsl:template match="iso:formula/iso:stem">
|
2264
|
-
<fo:block
|
2285
|
+
<fo:block margin-top="6pt" margin-bottom="12pt">
|
2265
2286
|
<fo:table table-layout="fixed" width="100%">
|
2266
2287
|
<fo:table-column column-width="95%"/>
|
2267
2288
|
<fo:table-column column-width="5%"/>
|
@@ -2274,14 +2295,9 @@
|
|
2274
2295
|
</fo:table-cell>
|
2275
2296
|
<fo:table-cell display-align="center">
|
2276
2297
|
<fo:block text-align="right">
|
2277
|
-
<xsl:
|
2278
|
-
<xsl:
|
2279
|
-
|
2280
|
-
</xsl:when>
|
2281
|
-
<xsl:otherwise> <!-- not(ancestor::iso:annex) -->
|
2282
|
-
<!-- <xsl:text>(</xsl:text><xsl:number level="any" count="iso:formula"/><xsl:text>)</xsl:text> -->
|
2283
|
-
</xsl:otherwise>
|
2284
|
-
</xsl:choose>
|
2298
|
+
<xsl:call-template name="getFormulaNumber">
|
2299
|
+
<xsl:with-param name="display" select="not(../@unnumbered = 'true')"/>
|
2300
|
+
</xsl:call-template>
|
2285
2301
|
</fo:block>
|
2286
2302
|
</fo:table-cell>
|
2287
2303
|
</fo:table-row>
|
@@ -2380,38 +2396,6 @@
|
|
2380
2396
|
</fo:static-content>
|
2381
2397
|
</xsl:template>
|
2382
2398
|
|
2383
|
-
<xsl:template name="getId">
|
2384
|
-
<xsl:choose>
|
2385
|
-
<xsl:when test="../@id">
|
2386
|
-
<xsl:value-of select="../@id"/>
|
2387
|
-
</xsl:when>
|
2388
|
-
<xsl:otherwise>
|
2389
|
-
<xsl:value-of select="text()"/>
|
2390
|
-
</xsl:otherwise>
|
2391
|
-
</xsl:choose>
|
2392
|
-
</xsl:template>
|
2393
|
-
|
2394
|
-
<xsl:template name="getLevel">
|
2395
|
-
<xsl:variable name="level_total" select="count(ancestor::*)"/>
|
2396
|
-
<xsl:variable name="level">
|
2397
|
-
<xsl:choose>
|
2398
|
-
<xsl:when test="ancestor::iso:preface">
|
2399
|
-
<xsl:value-of select="$level_total - 2"/>
|
2400
|
-
</xsl:when>
|
2401
|
-
<xsl:when test="ancestor::iso:sections">
|
2402
|
-
<xsl:value-of select="$level_total - 2"/>
|
2403
|
-
</xsl:when>
|
2404
|
-
<xsl:when test="ancestor::iso:bibliography">
|
2405
|
-
<xsl:value-of select="$level_total - 2"/>
|
2406
|
-
</xsl:when>
|
2407
|
-
<xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
|
2408
|
-
<xsl:otherwise>
|
2409
|
-
<xsl:value-of select="$level_total - 1"/>
|
2410
|
-
</xsl:otherwise>
|
2411
|
-
</xsl:choose>
|
2412
|
-
</xsl:variable>
|
2413
|
-
<xsl:value-of select="$level"/>
|
2414
|
-
</xsl:template>
|
2415
2399
|
|
2416
2400
|
<xsl:template name="getSection">
|
2417
2401
|
<xsl:param name="sectionNum"/>
|
@@ -2431,7 +2415,7 @@
|
|
2431
2415
|
</xsl:when>
|
2432
2416
|
<xsl:when test="$level >= 2">
|
2433
2417
|
<xsl:variable name="num">
|
2434
|
-
<xsl:
|
2418
|
+
<xsl:call-template name="getSubSection"/>
|
2435
2419
|
</xsl:variable>
|
2436
2420
|
<xsl:value-of select="concat($sectionNum, $num)"/>
|
2437
2421
|
</xsl:when>
|
@@ -2455,7 +2439,12 @@
|
|
2455
2439
|
<xsl:variable name="annexid" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:annexid)"/>
|
2456
2440
|
<xsl:choose>
|
2457
2441
|
<xsl:when test="$level = 1">
|
2458
|
-
<xsl:
|
2442
|
+
<xsl:variable name="title-annex">
|
2443
|
+
<xsl:call-template name="getTitle">
|
2444
|
+
<xsl:with-param name="name" select="'title-annex'"/>
|
2445
|
+
</xsl:call-template>
|
2446
|
+
</xsl:variable>
|
2447
|
+
<xsl:value-of select="$title-annex"/>
|
2459
2448
|
<xsl:choose>
|
2460
2449
|
<xsl:when test="count(//iso:annex) = 1 and $annexid != ''">
|
2461
2450
|
<xsl:value-of select="$annexid"/>
|
@@ -2465,8 +2454,7 @@
|
|
2465
2454
|
</xsl:otherwise>
|
2466
2455
|
</xsl:choose>
|
2467
2456
|
</xsl:when>
|
2468
|
-
<xsl:otherwise>
|
2469
|
-
<xsl:variable name="annexid" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:annexid)"/>
|
2457
|
+
<xsl:otherwise>
|
2470
2458
|
<xsl:choose>
|
2471
2459
|
<xsl:when test="count(//iso:annex) = 1 and $annexid != ''">
|
2472
2460
|
<xsl:value-of select="$annexid"/><xsl:number format=".1" level="multiple" count="iso:clause"/>
|
@@ -3181,40 +3169,302 @@
|
|
3181
3169
|
<xsl:value-of select="$edition"/>
|
3182
3170
|
</xsl:when>
|
3183
3171
|
</xsl:choose>
|
3184
|
-
<xsl:
|
3172
|
+
<xsl:variable name="title-edition">
|
3173
|
+
<xsl:call-template name="getTitle">
|
3174
|
+
<xsl:with-param name="name" select="'title-edition'"/>
|
3175
|
+
</xsl:call-template>
|
3176
|
+
</xsl:variable>
|
3177
|
+
<xsl:if test="$edition != ''"><xsl:text> </xsl:text><xsl:value-of select="java:toLowerCase(java:java.lang.String.new($title-edition))"/></xsl:if>
|
3178
|
+
</xsl:template>
|
3179
|
+
|
3180
|
+
<xsl:template name="printTitlePartFr">
|
3181
|
+
<xsl:variable name="part-fr" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-part']"/>
|
3182
|
+
<xsl:if test="normalize-space($part-fr) != ''">
|
3183
|
+
<xsl:if test="$part != ''">
|
3184
|
+
<xsl:text> — </xsl:text>
|
3185
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part)"/>
|
3186
|
+
<!-- <xsl:value-of select="$title-part-fr"/>
|
3187
|
+
<xsl:value-of select="$part"/>
|
3188
|
+
<xsl:text>:</xsl:text> -->
|
3189
|
+
</xsl:if>
|
3190
|
+
<xsl:value-of select="$part-fr"/>
|
3191
|
+
</xsl:if>
|
3192
|
+
</xsl:template>
|
3193
|
+
|
3194
|
+
<xsl:template name="printTitlePartEn">
|
3195
|
+
<xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
|
3196
|
+
<xsl:if test="normalize-space($part-en) != ''">
|
3197
|
+
<xsl:if test="$part != ''">
|
3198
|
+
<xsl:text> — </xsl:text>
|
3199
|
+
<fo:block font-weight="normal" margin-top="6pt">
|
3200
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
|
3201
|
+
<!-- <xsl:value-of select="$title-part-en"/>
|
3202
|
+
<xsl:value-of select="$part"/>
|
3203
|
+
<xsl:text>:</xsl:text> -->
|
3204
|
+
</fo:block>
|
3205
|
+
</xsl:if>
|
3206
|
+
<xsl:value-of select="$part-en"/>
|
3207
|
+
</xsl:if>
|
3208
|
+
</xsl:template>
|
3209
|
+
|
3210
|
+
<xsl:template name="getFormulaNumber">
|
3211
|
+
<xsl:param name="display" select="'true'"/>
|
3212
|
+
<xsl:if test="$display = 'true'">
|
3213
|
+
<xsl:choose>
|
3214
|
+
<xsl:when test="ancestor::iso:annex">
|
3215
|
+
<xsl:number format="(A.1)" level="multiple" count="iso:annex | iso:formula[not(@unnumbered='true')]"/>
|
3216
|
+
</xsl:when>
|
3217
|
+
<xsl:otherwise> <!-- not(ancestor::iso:annex) -->
|
3218
|
+
<xsl:text>(</xsl:text><xsl:number level="any" count="iso:formula[not(@unnumbered='true')]"/><xsl:text>)</xsl:text>
|
3219
|
+
</xsl:otherwise>
|
3220
|
+
</xsl:choose>
|
3221
|
+
</xsl:if>
|
3185
3222
|
</xsl:template>
|
3186
3223
|
|
3187
|
-
<xsl:variable
|
3224
|
+
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
|
3188
3225
|
|
3189
|
-
|
3190
|
-
|
3226
|
+
<title-table lang="en">Table </title-table>
|
3227
|
+
<title-table lang="fr">Tableau </title-table>
|
3228
|
+
|
3229
|
+
<title-table lang="zh">Table </title-table>
|
3191
3230
|
|
3192
3231
|
|
3193
|
-
</xsl:attribute-set><xsl:template xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
|
3194
|
-
<xsl:value-of select="."/>
|
3195
|
-
</xsl:template><xsl:template xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='br']">
|
3196
|
-
<xsl:value-of select="$linebreak"/>
|
3197
|
-
</xsl:template><xsl:template xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
3198
|
-
<xsl:call-template name="add-zero-spaces"/>
|
3199
|
-
</xsl:template><xsl:template xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']">
|
3200
|
-
|
3201
|
-
<xsl:variable name="simple-table">
|
3202
|
-
<!-- <xsl:copy> -->
|
3203
|
-
<xsl:call-template name="getSimpleTable"/>
|
3204
|
-
<!-- </xsl:copy> -->
|
3205
|
-
</xsl:variable>
|
3206
|
-
|
3207
|
-
<!-- DEBUG -->
|
3208
|
-
<!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
|
3209
|
-
<!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
|
3210
3232
|
|
3211
|
-
|
3233
|
+
<title-note lang="en">NOTE </title-note>
|
3234
|
+
<title-note lang="fr">NOTE </title-note>
|
3212
3235
|
|
3213
|
-
|
3214
|
-
<fo:block space-before="6pt"> </fo:block>
|
3215
|
-
</xsl:if> -->
|
3236
|
+
<title-note lang="zh">NOTE </title-note>
|
3216
3237
|
|
3217
|
-
|
3238
|
+
|
3239
|
+
|
3240
|
+
<title-figure lang="en">Figure </title-figure>
|
3241
|
+
<title-figure lang="fr">Figure </title-figure>
|
3242
|
+
|
3243
|
+
<title-figure lang="zh">Figure </title-figure>
|
3244
|
+
|
3245
|
+
|
3246
|
+
|
3247
|
+
<title-example lang="en">EXAMPLE </title-example>
|
3248
|
+
<title-example lang="fr">EXEMPLE </title-example>
|
3249
|
+
|
3250
|
+
<title-example lang="zh">EXAMPLE </title-example>
|
3251
|
+
|
3252
|
+
|
3253
|
+
|
3254
|
+
<title-example-xref lang="en">Example </title-example-xref>
|
3255
|
+
<title-example-xref lang="fr">Exemple </title-example-xref>
|
3256
|
+
|
3257
|
+
<title-section lang="en">Section </title-section>
|
3258
|
+
<title-section lang="fr">Section </title-section>
|
3259
|
+
|
3260
|
+
<title-inequality lang="en">Inequality </title-inequality>
|
3261
|
+
<title-inequality lang="fr">Inequality </title-inequality>
|
3262
|
+
|
3263
|
+
<title-equation lang="en">Equation </title-equation>
|
3264
|
+
<title-equation lang="fr">Equation </title-equation>
|
3265
|
+
|
3266
|
+
<title-annex lang="en">Annex </title-annex>
|
3267
|
+
<title-annex lang="fr">Annexe </title-annex>
|
3268
|
+
|
3269
|
+
<title-annex lang="zh">Annex </title-annex>
|
3270
|
+
|
3271
|
+
|
3272
|
+
|
3273
|
+
<title-appendix lang="en">Appendix </title-appendix>
|
3274
|
+
<title-appendix lang="fr">Appendix </title-appendix>
|
3275
|
+
|
3276
|
+
<title-clause lang="en">Clause </title-clause>
|
3277
|
+
<title-clause lang="fr">Article </title-clause>
|
3278
|
+
|
3279
|
+
<title-clause lang="zh">Clause </title-clause>
|
3280
|
+
|
3281
|
+
|
3282
|
+
|
3283
|
+
<title-edition lang="en">
|
3284
|
+
|
3285
|
+
<xsl:text>Edition </xsl:text>
|
3286
|
+
|
3287
|
+
|
3288
|
+
</title-edition>
|
3289
|
+
|
3290
|
+
<title-formula lang="en">Formula </title-formula>
|
3291
|
+
<title-formula lang="fr">Formula </title-formula>
|
3292
|
+
|
3293
|
+
<title-toc lang="en">
|
3294
|
+
|
3295
|
+
<xsl:text>Contents</xsl:text>
|
3296
|
+
|
3297
|
+
|
3298
|
+
|
3299
|
+
</title-toc>
|
3300
|
+
<title-toc lang="fr">Sommaire</title-toc>
|
3301
|
+
|
3302
|
+
<title-toc lang="zh">Contents</title-toc>
|
3303
|
+
|
3304
|
+
|
3305
|
+
|
3306
|
+
<title-page lang="en">Page</title-page>
|
3307
|
+
<title-page lang="fr">Page</title-page>
|
3308
|
+
|
3309
|
+
<title-key lang="en">Key</title-key>
|
3310
|
+
<title-key lang="fr">Légende</title-key>
|
3311
|
+
|
3312
|
+
<title-where lang="en">where</title-where>
|
3313
|
+
<title-where lang="fr">où</title-where>
|
3314
|
+
|
3315
|
+
<title-descriptors lang="en">Descriptors</title-descriptors>
|
3316
|
+
|
3317
|
+
<title-part lang="en">
|
3318
|
+
|
3319
|
+
<xsl:text>Part #:</xsl:text>
|
3320
|
+
|
3321
|
+
|
3322
|
+
</title-part>
|
3323
|
+
<title-part lang="fr">
|
3324
|
+
|
3325
|
+
<xsl:text>Partie #:</xsl:text>
|
3326
|
+
|
3327
|
+
|
3328
|
+
</title-part>
|
3329
|
+
<title-part lang="zh">第 # 部分:</title-part>
|
3330
|
+
|
3331
|
+
<title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
|
3332
|
+
<title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
|
3333
|
+
|
3334
|
+
<title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
|
3335
|
+
|
3336
|
+
|
3337
|
+
|
3338
|
+
<title-modified lang="en">modified</title-modified>
|
3339
|
+
<title-modified lang="fr">modifiée</title-modified>
|
3340
|
+
|
3341
|
+
<title-modified lang="zh">modified</title-modified>
|
3342
|
+
|
3343
|
+
|
3344
|
+
|
3345
|
+
<title-source lang="en">SOURCE</title-source>
|
3346
|
+
|
3347
|
+
<title-keywords lang="en">Keywords</title-keywords>
|
3348
|
+
|
3349
|
+
<title-deprecated lang="en">DEPRECATED</title-deprecated>
|
3350
|
+
<title-deprecated lang="fr">DEPRECATED</title-deprecated>
|
3351
|
+
|
3352
|
+
<title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
|
3353
|
+
|
3354
|
+
<title-list-tables lang="en">List of Tables</title-list-tables>
|
3355
|
+
|
3356
|
+
<title-list-figures lang="en">List of Figures</title-list-figures>
|
3357
|
+
|
3358
|
+
<title-recommendation lang="en">Recommendation </title-recommendation>
|
3359
|
+
|
3360
|
+
<title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
|
3361
|
+
|
3362
|
+
<title-abstract lang="en">Abstract</title-abstract>
|
3363
|
+
|
3364
|
+
<title-summary lang="en">Summary</title-summary>
|
3365
|
+
|
3366
|
+
<title-in lang="en">in </title-in>
|
3367
|
+
|
3368
|
+
<title-box lang="en">Box </title-box>
|
3369
|
+
|
3370
|
+
<title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
|
3371
|
+
<title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
|
3372
|
+
|
3373
|
+
<title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
|
3374
|
+
<title-completion-date lang="zh">本稿完成日期</title-completion-date>
|
3375
|
+
|
3376
|
+
<title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
|
3377
|
+
<title-issuance-date lang="zh"># 发布</title-issuance-date>
|
3378
|
+
|
3379
|
+
<title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
|
3380
|
+
<title-implementation-date lang="zh"># 实施</title-implementation-date>
|
3381
|
+
|
3382
|
+
<title-obligation-normative lang="en">normative</title-obligation-normative>
|
3383
|
+
<title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
|
3384
|
+
|
3385
|
+
<title-caution lang="en">CAUTION</title-caution>
|
3386
|
+
<title-caution lang="zh">注意</title-caution>
|
3387
|
+
|
3388
|
+
<title-warning lang="en">WARNING</title-warning>
|
3389
|
+
<title-warning lang="zh">警告</title-warning>
|
3390
|
+
|
3391
|
+
<title-amendment lang="en">AMENDMENT</title-amendment>
|
3392
|
+
</xsl:variable><xsl:template name="getTitle">
|
3393
|
+
<xsl:param name="name"/>
|
3394
|
+
<xsl:variable name="lang">
|
3395
|
+
<xsl:call-template name="getLang"/>
|
3396
|
+
</xsl:variable>
|
3397
|
+
<xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
|
3398
|
+
<xsl:choose>
|
3399
|
+
<xsl:when test="normalize-space($title_) != ''">
|
3400
|
+
<xsl:value-of select="$title_"/>
|
3401
|
+
</xsl:when>
|
3402
|
+
<xsl:otherwise>
|
3403
|
+
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
3404
|
+
</xsl:otherwise>
|
3405
|
+
</xsl:choose>
|
3406
|
+
</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">
|
3407
|
+
|
3408
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
3409
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
3410
|
+
|
3411
|
+
|
3412
|
+
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
3413
|
+
|
3414
|
+
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
3415
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3416
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
3417
|
+
|
3418
|
+
|
3419
|
+
|
3420
|
+
|
3421
|
+
|
3422
|
+
|
3423
|
+
|
3424
|
+
|
3425
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
3426
|
+
|
3427
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
3428
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
3429
|
+
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
3430
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
3431
|
+
|
3432
|
+
|
3433
|
+
|
3434
|
+
</xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
|
3435
|
+
|
3436
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3437
|
+
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
3438
|
+
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
3439
|
+
|
3440
|
+
|
3441
|
+
|
3442
|
+
</xsl:attribute-set><xsl:template match="text()">
|
3443
|
+
<xsl:value-of select="."/>
|
3444
|
+
</xsl:template><xsl:template match="*[local-name()='br']">
|
3445
|
+
<xsl:value-of select="$linebreak"/>
|
3446
|
+
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
3447
|
+
<!-- <xsl:call-template name="add-zero-spaces"/> -->
|
3448
|
+
<xsl:call-template name="add-zero-spaces-java"/>
|
3449
|
+
</xsl:template><xsl:template match="*[local-name()='table']">
|
3450
|
+
|
3451
|
+
<xsl:variable name="simple-table">
|
3452
|
+
<!-- <xsl:copy> -->
|
3453
|
+
<xsl:call-template name="getSimpleTable"/>
|
3454
|
+
<!-- </xsl:copy> -->
|
3455
|
+
</xsl:variable>
|
3456
|
+
|
3457
|
+
<!-- DEBUG -->
|
3458
|
+
<!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
|
3459
|
+
<!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
|
3460
|
+
|
3461
|
+
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3462
|
+
|
3463
|
+
<!-- <xsl:if test="$namespace = 'iso'">
|
3464
|
+
<fo:block space-before="6pt"> </fo:block>
|
3465
|
+
</xsl:if> -->
|
3466
|
+
|
3467
|
+
<xsl:choose>
|
3218
3468
|
<xsl:when test="@unnumbered = 'true'"/>
|
3219
3469
|
<xsl:otherwise>
|
3220
3470
|
|
@@ -3230,32 +3480,17 @@
|
|
3230
3480
|
|
3231
3481
|
|
3232
3482
|
|
3233
|
-
|
3234
|
-
<xsl:
|
3235
|
-
<xsl:
|
3236
|
-
<xsl:
|
3237
|
-
</xsl:
|
3238
|
-
|
3239
|
-
|
3240
|
-
|
3241
|
-
|
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>
|
3483
|
+
|
3484
|
+
<xsl:variable name="title-table">
|
3485
|
+
<xsl:call-template name="getTitle">
|
3486
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
3487
|
+
</xsl:call-template>
|
3488
|
+
</xsl:variable>
|
3489
|
+
<xsl:value-of select="$title-table"/>
|
3490
|
+
|
3491
|
+
<xsl:call-template name="getTableNumber"/>
|
3492
|
+
|
3493
|
+
|
3259
3494
|
<xsl:if test="*[local-name()='name']">
|
3260
3495
|
|
3261
3496
|
|
@@ -3329,9 +3564,13 @@
|
|
3329
3564
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
3330
3565
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
3331
3566
|
|
3567
|
+
|
3332
3568
|
<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
3569
|
|
3334
3570
|
<xsl:attribute name="border">1.5pt solid black</xsl:attribute>
|
3571
|
+
<xsl:if test="*[local-name()='thead']">
|
3572
|
+
<xsl:attribute name="border-top">1pt solid black</xsl:attribute>
|
3573
|
+
</xsl:if>
|
3335
3574
|
|
3336
3575
|
|
3337
3576
|
|
@@ -3347,9 +3586,10 @@
|
|
3347
3586
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3348
3587
|
|
3349
3588
|
|
3589
|
+
|
3350
3590
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3351
3591
|
<xsl:choose>
|
3352
|
-
<xsl:when test=". = 1">
|
3592
|
+
<xsl:when test=". = 1 or . = 0">
|
3353
3593
|
<fo:table-column column-width="proportional-column-width(2)"/>
|
3354
3594
|
</xsl:when>
|
3355
3595
|
<xsl:otherwise>
|
@@ -3357,21 +3597,56 @@
|
|
3357
3597
|
</xsl:otherwise>
|
3358
3598
|
</xsl:choose>
|
3359
3599
|
</xsl:for-each>
|
3360
|
-
|
3600
|
+
|
3601
|
+
<xsl:choose>
|
3602
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
3603
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
3604
|
+
</xsl:when>
|
3605
|
+
<xsl:otherwise>
|
3606
|
+
<xsl:apply-templates/>
|
3607
|
+
</xsl:otherwise>
|
3608
|
+
</xsl:choose>
|
3609
|
+
|
3361
3610
|
</fo:table>
|
3362
3611
|
|
3363
3612
|
|
3364
3613
|
|
3365
3614
|
</fo:block-container>
|
3366
|
-
</xsl:template><xsl:template
|
3615
|
+
</xsl:template><xsl:template name="getTableNumber">
|
3616
|
+
<xsl:choose>
|
3617
|
+
<xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
|
3618
|
+
<xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
|
3619
|
+
</xsl:when>
|
3620
|
+
<xsl:when test="ancestor::*[local-name()='annex']">
|
3621
|
+
|
3622
|
+
<xsl:variable name="annex-id" select="ancestor::*[local-name()='annex']/@id"/>
|
3623
|
+
<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]]"/>
|
3624
|
+
|
3625
|
+
|
3626
|
+
|
3627
|
+
|
3628
|
+
|
3629
|
+
|
3630
|
+
|
3631
|
+
|
3632
|
+
</xsl:when>
|
3633
|
+
<xsl:otherwise>
|
3634
|
+
|
3635
|
+
|
3636
|
+
<xsl:number format="A." count="*[local-name()='annex']"/>
|
3637
|
+
<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']"/>
|
3638
|
+
|
3639
|
+
</xsl:otherwise>
|
3640
|
+
</xsl:choose>
|
3641
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
|
3367
3642
|
<xsl:apply-templates/>
|
3368
|
-
</xsl:template><xsl:template
|
3643
|
+
</xsl:template><xsl:template name="calculate-columns-numbers">
|
3369
3644
|
<xsl:param name="table-row"/>
|
3370
3645
|
<xsl:variable name="columns-count" select="count($table-row/*)"/>
|
3371
3646
|
<xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
|
3372
3647
|
<xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
|
3373
3648
|
<xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
|
3374
|
-
</xsl:template><xsl:template
|
3649
|
+
</xsl:template><xsl:template name="calculate-column-widths">
|
3375
3650
|
<xsl:param name="table"/>
|
3376
3651
|
<xsl:param name="cols-count"/>
|
3377
3652
|
<xsl:param name="curr-col" select="1"/>
|
@@ -3380,7 +3655,7 @@
|
|
3380
3655
|
<xsl:if test="$curr-col <= $cols-count">
|
3381
3656
|
<xsl:variable name="widths">
|
3382
3657
|
<xsl:choose>
|
3383
|
-
<xsl:when test="not($table)"
|
3658
|
+
<xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
|
3384
3659
|
<xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']">
|
3385
3660
|
<xsl:variable name="words">
|
3386
3661
|
<xsl:call-template name="tokenize">
|
@@ -3419,9 +3694,16 @@
|
|
3419
3694
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
3420
3695
|
</xsl:variable>
|
3421
3696
|
<xsl:variable name="words">
|
3697
|
+
<xsl:variable name="string_with_added_zerospaces">
|
3698
|
+
<xsl:call-template name="add-zero-spaces-java">
|
3699
|
+
<xsl:with-param name="text" select="$td_text"/>
|
3700
|
+
</xsl:call-template>
|
3701
|
+
</xsl:variable>
|
3422
3702
|
<xsl:call-template name="tokenize">
|
3423
3703
|
<!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
|
3424
|
-
|
3704
|
+
<!-- 2009 thinspace -->
|
3705
|
+
<!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
|
3706
|
+
<xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
|
3425
3707
|
</xsl:call-template>
|
3426
3708
|
</xsl:variable>
|
3427
3709
|
<xsl:variable name="max_length">
|
@@ -3462,17 +3744,46 @@
|
|
3462
3744
|
<xsl:with-param name="table" select="$table"/>
|
3463
3745
|
</xsl:call-template>
|
3464
3746
|
</xsl:if>
|
3465
|
-
</xsl:template><xsl:template
|
3747
|
+
</xsl:template><xsl:template match="text()" mode="td_text">
|
3466
3748
|
<xsl:variable name="zero-space"></xsl:variable>
|
3467
3749
|
<xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
|
3468
|
-
</xsl:template><xsl:template
|
3750
|
+
</xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
|
3751
|
+
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
3752
|
+
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
3753
|
+
<xsl:value-of select="@target"/>
|
3754
|
+
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
3755
|
+
<xsl:param name="cols-count"/>
|
3469
3756
|
<!-- font-weight="bold" -->
|
3470
|
-
<fo:table-header>
|
3757
|
+
<fo:table-header>
|
3758
|
+
|
3759
|
+
<fo:table-row>
|
3760
|
+
<fo:table-cell number-columns-spanned="{$cols-count}"> <!-- border-left="1pt solid white" border-right="1pt solid white" border-top="1pt solid white" -->
|
3761
|
+
<fo:block text-align="center" font-size="11pt" font-weight="bold">
|
3762
|
+
<!-- (continued) -->
|
3763
|
+
<fo:block-container position="absolute" top="-7mm">
|
3764
|
+
<fo:block>
|
3765
|
+
<fo:retrieve-table-marker retrieve-class-name="table_continued" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table-fragment"/>
|
3766
|
+
</fo:block>
|
3767
|
+
</fo:block-container>
|
3768
|
+
|
3769
|
+
</fo:block>
|
3770
|
+
<!-- <fo:block>fn_name_display
|
3771
|
+
<xsl:call-template name="fn_name_display"/>
|
3772
|
+
</fo:block> -->
|
3773
|
+
|
3774
|
+
</fo:table-cell>
|
3775
|
+
</fo:table-row>
|
3776
|
+
|
3471
3777
|
<xsl:apply-templates/>
|
3472
3778
|
</fo:table-header>
|
3473
|
-
</xsl:template><xsl:template
|
3779
|
+
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
3780
|
+
<fo:table-body>
|
3781
|
+
<xsl:apply-templates/>
|
3782
|
+
</fo:table-body>
|
3783
|
+
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
3474
3784
|
<xsl:apply-templates/>
|
3475
|
-
</xsl:template><xsl:template
|
3785
|
+
</xsl:template><xsl:template name="insertTableFooter">
|
3786
|
+
<xsl:param name="cols-count"/>
|
3476
3787
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
3477
3788
|
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
3478
3789
|
|
@@ -3483,22 +3794,7 @@
|
|
3483
3794
|
<!-- if there are note(s) or fn(s) then create footer row -->
|
3484
3795
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
3485
3796
|
|
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>
|
3797
|
+
|
3502
3798
|
|
3503
3799
|
<fo:table-row>
|
3504
3800
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
@@ -3528,11 +3824,30 @@
|
|
3528
3824
|
</fo:table-footer>
|
3529
3825
|
|
3530
3826
|
</xsl:if>
|
3531
|
-
</xsl:template><xsl:template
|
3827
|
+
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
3532
3828
|
|
3533
|
-
<xsl:
|
3829
|
+
<xsl:variable name="cols-count">
|
3830
|
+
<xsl:choose>
|
3831
|
+
<xsl:when test="../*[local-name()='thead']">
|
3832
|
+
<xsl:call-template name="calculate-columns-numbers">
|
3833
|
+
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
3834
|
+
</xsl:call-template>
|
3835
|
+
</xsl:when>
|
3836
|
+
<xsl:otherwise>
|
3837
|
+
<xsl:call-template name="calculate-columns-numbers">
|
3838
|
+
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
|
3839
|
+
</xsl:call-template>
|
3840
|
+
</xsl:otherwise>
|
3841
|
+
</xsl:choose>
|
3842
|
+
</xsl:variable>
|
3534
3843
|
|
3535
|
-
<xsl:
|
3844
|
+
<xsl:apply-templates select="../*[local-name()='thead']" mode="process">
|
3845
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3846
|
+
</xsl:apply-templates>
|
3847
|
+
|
3848
|
+
<xsl:call-template name="insertTableFooter">
|
3849
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3850
|
+
</xsl:call-template>
|
3536
3851
|
|
3537
3852
|
<fo:table-body>
|
3538
3853
|
<xsl:apply-templates/>
|
@@ -3540,7 +3855,7 @@
|
|
3540
3855
|
|
3541
3856
|
</fo:table-body>
|
3542
3857
|
|
3543
|
-
</xsl:template><xsl:template
|
3858
|
+
</xsl:template><xsl:template match="*[local-name()='tr']">
|
3544
3859
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
3545
3860
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3546
3861
|
<fo:table-row min-height="4mm">
|
@@ -3579,7 +3894,7 @@
|
|
3579
3894
|
|
3580
3895
|
<xsl:apply-templates/>
|
3581
3896
|
</fo:table-row>
|
3582
|
-
</xsl:template><xsl:template
|
3897
|
+
</xsl:template><xsl:template match="*[local-name()='th']">
|
3583
3898
|
<fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
|
3584
3899
|
|
3585
3900
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
@@ -3604,7 +3919,7 @@
|
|
3604
3919
|
<xsl:apply-templates/>
|
3605
3920
|
</fo:block>
|
3606
3921
|
</fo:table-cell>
|
3607
|
-
</xsl:template><xsl:template
|
3922
|
+
</xsl:template><xsl:template match="*[local-name()='td']">
|
3608
3923
|
<fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
|
3609
3924
|
<!-- and ancestor::*[local-name() = 'thead'] -->
|
3610
3925
|
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
@@ -3632,6 +3947,26 @@
|
|
3632
3947
|
</xsl:attribute>
|
3633
3948
|
</xsl:if>
|
3634
3949
|
<fo:block>
|
3950
|
+
|
3951
|
+
<xsl:variable name="row_number">
|
3952
|
+
<xsl:number format="1" count="*[local-name() = 'tr'] | *[local-name() = 'th']"/>
|
3953
|
+
</xsl:variable>
|
3954
|
+
<fo:marker marker-class-name="table_continued">
|
3955
|
+
<xsl:if test="$row_number > 1">
|
3956
|
+
<fo:inline>
|
3957
|
+
<xsl:variable name="title-table">
|
3958
|
+
<xsl:call-template name="getTitle">
|
3959
|
+
<xsl:with-param name="name" select="'title-table'"/>
|
3960
|
+
</xsl:call-template>
|
3961
|
+
</xsl:variable>
|
3962
|
+
<xsl:value-of select="$title-table"/>
|
3963
|
+
<xsl:call-template name="getTableNumber"/>
|
3964
|
+
<xsl:text> </xsl:text>
|
3965
|
+
<fo:inline font-style="italic" font-weight="normal">(continued)</fo:inline>
|
3966
|
+
</fo:inline>
|
3967
|
+
</xsl:if>
|
3968
|
+
</fo:marker>
|
3969
|
+
|
3635
3970
|
<xsl:apply-templates/>
|
3636
3971
|
</fo:block>
|
3637
3972
|
<!-- <xsl:choose>
|
@@ -3647,7 +3982,7 @@
|
|
3647
3982
|
|
3648
3983
|
|
3649
3984
|
</fo:table-cell>
|
3650
|
-
</xsl:template><xsl:template
|
3985
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
|
3651
3986
|
|
3652
3987
|
|
3653
3988
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
@@ -3657,9 +3992,16 @@
|
|
3657
3992
|
|
3658
3993
|
|
3659
3994
|
|
3995
|
+
|
3660
3996
|
<fo:inline padding-right="2mm">
|
3661
3997
|
|
3662
|
-
|
3998
|
+
|
3999
|
+
<xsl:variable name="title-note">
|
4000
|
+
<xsl:call-template name="getTitle">
|
4001
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
4002
|
+
</xsl:call-template>
|
4003
|
+
</xsl:variable>
|
4004
|
+
<xsl:value-of select="$title-note"/>
|
3663
4005
|
|
3664
4006
|
<xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
|
3665
4007
|
<xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) > 1">
|
@@ -3673,9 +4015,9 @@
|
|
3673
4015
|
<xsl:apply-templates mode="process"/>
|
3674
4016
|
</fo:block>
|
3675
4017
|
|
3676
|
-
</xsl:template><xsl:template
|
4018
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
3677
4019
|
<xsl:apply-templates/>
|
3678
|
-
</xsl:template><xsl:template
|
4020
|
+
</xsl:template><xsl:template name="fn_display">
|
3679
4021
|
<xsl:variable name="references">
|
3680
4022
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
3681
4023
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -3695,6 +4037,7 @@
|
|
3695
4037
|
|
3696
4038
|
|
3697
4039
|
|
4040
|
+
|
3698
4041
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
3699
4042
|
|
3700
4043
|
|
@@ -3714,7 +4057,7 @@
|
|
3714
4057
|
</fo:block>
|
3715
4058
|
</xsl:if>
|
3716
4059
|
</xsl:for-each>
|
3717
|
-
</xsl:template><xsl:template
|
4060
|
+
</xsl:template><xsl:template name="fn_name_display">
|
3718
4061
|
<!-- <xsl:variable name="references">
|
3719
4062
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
3720
4063
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -3730,7 +4073,7 @@
|
|
3730
4073
|
<xsl:apply-templates/>
|
3731
4074
|
</fo:block>
|
3732
4075
|
</xsl:for-each>
|
3733
|
-
</xsl:template><xsl:template
|
4076
|
+
</xsl:template><xsl:template name="fn_display_figure">
|
3734
4077
|
<xsl:variable name="key_iso">
|
3735
4078
|
true <!-- and (not(@class) or @class !='pseudocode') -->
|
3736
4079
|
</xsl:variable>
|
@@ -3741,6 +4084,36 @@
|
|
3741
4084
|
</fn>
|
3742
4085
|
</xsl:for-each>
|
3743
4086
|
</xsl:variable>
|
4087
|
+
|
4088
|
+
<!-- current hierarchy is 'figure' element -->
|
4089
|
+
<xsl:variable name="following_dl_colwidths">
|
4090
|
+
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
4091
|
+
<xsl:variable name="html-table">
|
4092
|
+
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
4093
|
+
<xsl:element name="{$ns}:table">
|
4094
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
4095
|
+
<tbody>
|
4096
|
+
<xsl:apply-templates mode="dl"/>
|
4097
|
+
</tbody>
|
4098
|
+
</xsl:for-each>
|
4099
|
+
</xsl:element>
|
4100
|
+
</xsl:variable>
|
4101
|
+
|
4102
|
+
<xsl:call-template name="calculate-column-widths">
|
4103
|
+
<xsl:with-param name="cols-count" select="2"/>
|
4104
|
+
<xsl:with-param name="table" select="$html-table"/>
|
4105
|
+
</xsl:call-template>
|
4106
|
+
|
4107
|
+
</xsl:if>
|
4108
|
+
</xsl:variable>
|
4109
|
+
|
4110
|
+
|
4111
|
+
<xsl:variable name="maxlength_dt">
|
4112
|
+
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
4113
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
4114
|
+
</xsl:for-each>
|
4115
|
+
</xsl:variable>
|
4116
|
+
|
3744
4117
|
<xsl:if test="xalan:nodeset($references)//fn">
|
3745
4118
|
<fo:block>
|
3746
4119
|
<fo:table width="95%" table-layout="fixed">
|
@@ -3748,8 +4121,19 @@
|
|
3748
4121
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3749
4122
|
|
3750
4123
|
</xsl:if>
|
3751
|
-
<
|
3752
|
-
|
4124
|
+
<xsl:choose>
|
4125
|
+
<!-- if there 'dl', then set same columns width -->
|
4126
|
+
<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
|
4127
|
+
<xsl:call-template name="setColumnWidth_dl">
|
4128
|
+
<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
|
4129
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
4130
|
+
</xsl:call-template>
|
4131
|
+
</xsl:when>
|
4132
|
+
<xsl:otherwise>
|
4133
|
+
<fo:table-column column-width="15%"/>
|
4134
|
+
<fo:table-column column-width="85%"/>
|
4135
|
+
</xsl:otherwise>
|
4136
|
+
</xsl:choose>
|
3753
4137
|
<fo:table-body>
|
3754
4138
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
3755
4139
|
<xsl:variable name="reference" select="@reference"/>
|
@@ -3781,7 +4165,7 @@
|
|
3781
4165
|
</fo:block>
|
3782
4166
|
</xsl:if>
|
3783
4167
|
|
3784
|
-
</xsl:template><xsl:template
|
4168
|
+
</xsl:template><xsl:template match="*[local-name()='fn']">
|
3785
4169
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
3786
4170
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
3787
4171
|
|
@@ -3799,11 +4183,11 @@
|
|
3799
4183
|
<xsl:value-of select="@reference"/>
|
3800
4184
|
</fo:basic-link>
|
3801
4185
|
</fo:inline>
|
3802
|
-
</xsl:template><xsl:template
|
4186
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
3803
4187
|
<fo:inline>
|
3804
4188
|
<xsl:apply-templates/>
|
3805
4189
|
</fo:inline>
|
3806
|
-
</xsl:template><xsl:template
|
4190
|
+
</xsl:template><xsl:template match="*[local-name()='dl']">
|
3807
4191
|
<xsl:variable name="parent" select="local-name(..)"/>
|
3808
4192
|
|
3809
4193
|
<xsl:variable name="key_iso">
|
@@ -3819,8 +4203,13 @@
|
|
3819
4203
|
<fo:block margin-bottom="12pt" text-align="left">
|
3820
4204
|
|
3821
4205
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
3822
|
-
|
3823
|
-
<xsl:
|
4206
|
+
|
4207
|
+
<xsl:variable name="title-where">
|
4208
|
+
<xsl:call-template name="getTitle">
|
4209
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
4210
|
+
</xsl:call-template>
|
4211
|
+
</xsl:variable>
|
4212
|
+
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
3824
4213
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3825
4214
|
<xsl:text/>
|
3826
4215
|
<xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
|
@@ -3835,18 +4224,28 @@
|
|
3835
4224
|
|
3836
4225
|
|
3837
4226
|
|
3838
|
-
<xsl:
|
4227
|
+
<xsl:variable name="title-where">
|
4228
|
+
<xsl:call-template name="getTitle">
|
4229
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
4230
|
+
</xsl:call-template>
|
4231
|
+
</xsl:variable>
|
4232
|
+
<xsl:value-of select="$title-where"/>
|
3839
4233
|
</fo:block>
|
3840
4234
|
</xsl:when>
|
3841
4235
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
|
3842
|
-
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
|
4236
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
3843
4237
|
|
3844
4238
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
3845
4239
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
3846
4240
|
|
3847
4241
|
|
3848
4242
|
|
3849
|
-
<xsl:
|
4243
|
+
<xsl:variable name="title-key">
|
4244
|
+
<xsl:call-template name="getTitle">
|
4245
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
4246
|
+
</xsl:call-template>
|
4247
|
+
</xsl:variable>
|
4248
|
+
<xsl:value-of select="$title-key"/>
|
3850
4249
|
</fo:block>
|
3851
4250
|
</xsl:when>
|
3852
4251
|
</xsl:choose>
|
@@ -3862,26 +4261,11 @@
|
|
3862
4261
|
|
3863
4262
|
|
3864
4263
|
|
4264
|
+
|
3865
4265
|
<fo:block>
|
3866
4266
|
|
3867
4267
|
|
3868
|
-
|
3869
|
-
<xsl:variable name="html-table">
|
3870
|
-
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
3871
|
-
<xsl:element name="{$ns}:table">
|
3872
|
-
<tbody>
|
3873
|
-
<xsl:apply-templates mode="dl"/>
|
3874
|
-
</tbody>
|
3875
|
-
</xsl:element>
|
3876
|
-
</xsl:variable>
|
3877
|
-
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
3878
|
-
<xsl:variable name="colwidths">
|
3879
|
-
<xsl:call-template name="calculate-column-widths">
|
3880
|
-
<xsl:with-param name="cols-count" select="2"/>
|
3881
|
-
<xsl:with-param name="table" select="$html-table"/>
|
3882
|
-
</xsl:call-template>
|
3883
|
-
</xsl:variable>
|
3884
|
-
<!-- colwidths=<xsl:value-of select="$colwidths"/> -->
|
4268
|
+
|
3885
4269
|
|
3886
4270
|
<fo:table width="95%" table-layout="fixed">
|
3887
4271
|
|
@@ -3894,42 +4278,30 @@
|
|
3894
4278
|
|
3895
4279
|
</xsl:when>
|
3896
4280
|
</xsl:choose>
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
3907
|
-
|
3908
|
-
|
3909
|
-
|
3910
|
-
|
3911
|
-
|
3912
|
-
|
3913
|
-
|
3914
|
-
|
3915
|
-
|
3916
|
-
|
3917
|
-
|
3918
|
-
|
3919
|
-
|
3920
|
-
|
3921
|
-
</xsl:when>
|
3922
|
-
<xsl:otherwise>
|
3923
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
3924
|
-
</xsl:otherwise>
|
3925
|
-
</xsl:choose>
|
3926
|
-
</xsl:for-each>
|
3927
|
-
</xsl:otherwise>
|
3928
|
-
</xsl:choose>
|
3929
|
-
<!-- <fo:table-column column-width="15%"/>
|
3930
|
-
<fo:table-column column-width="85%"/> -->
|
3931
|
-
</xsl:otherwise>
|
3932
|
-
</xsl:choose>
|
4281
|
+
<!-- create virtual html table for dl/[dt and dd] -->
|
4282
|
+
<xsl:variable name="html-table">
|
4283
|
+
<xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
|
4284
|
+
<xsl:element name="{$ns}:table">
|
4285
|
+
<tbody>
|
4286
|
+
<xsl:apply-templates mode="dl"/>
|
4287
|
+
</tbody>
|
4288
|
+
</xsl:element>
|
4289
|
+
</xsl:variable>
|
4290
|
+
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
4291
|
+
<xsl:variable name="colwidths">
|
4292
|
+
<xsl:call-template name="calculate-column-widths">
|
4293
|
+
<xsl:with-param name="cols-count" select="2"/>
|
4294
|
+
<xsl:with-param name="table" select="$html-table"/>
|
4295
|
+
</xsl:call-template>
|
4296
|
+
</xsl:variable>
|
4297
|
+
<!-- colwidths=<xsl:value-of select="$colwidths"/> -->
|
4298
|
+
<xsl:variable name="maxlength_dt">
|
4299
|
+
<xsl:call-template name="getMaxLength_dt"/>
|
4300
|
+
</xsl:variable>
|
4301
|
+
<xsl:call-template name="setColumnWidth_dl">
|
4302
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
4303
|
+
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
4304
|
+
</xsl:call-template>
|
3933
4305
|
<fo:table-body>
|
3934
4306
|
<xsl:apply-templates>
|
3935
4307
|
<xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
|
@@ -3939,7 +4311,61 @@
|
|
3939
4311
|
</fo:block>
|
3940
4312
|
</fo:block>
|
3941
4313
|
</xsl:if>
|
3942
|
-
</xsl:template><xsl:template
|
4314
|
+
</xsl:template><xsl:template name="setColumnWidth_dl">
|
4315
|
+
<xsl:param name="colwidths"/>
|
4316
|
+
<xsl:param name="maxlength_dt"/>
|
4317
|
+
<xsl:choose>
|
4318
|
+
<xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
|
4319
|
+
<fo:table-column column-width="50%"/>
|
4320
|
+
<fo:table-column column-width="50%"/>
|
4321
|
+
</xsl:when>
|
4322
|
+
<xsl:otherwise>
|
4323
|
+
<xsl:choose>
|
4324
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
4325
|
+
<fo:table-column column-width="5%"/>
|
4326
|
+
<fo:table-column column-width="95%"/>
|
4327
|
+
</xsl:when>
|
4328
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like t90, a, etc -->
|
4329
|
+
<fo:table-column column-width="10%"/>
|
4330
|
+
<fo:table-column column-width="90%"/>
|
4331
|
+
</xsl:when>
|
4332
|
+
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
4333
|
+
<fo:table-column column-width="60%"/>
|
4334
|
+
<fo:table-column column-width="40%"/>
|
4335
|
+
</xsl:when> -->
|
4336
|
+
<xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.3">
|
4337
|
+
<fo:table-column column-width="50%"/>
|
4338
|
+
<fo:table-column column-width="50%"/>
|
4339
|
+
</xsl:when>
|
4340
|
+
<xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 0.5">
|
4341
|
+
<fo:table-column column-width="40%"/>
|
4342
|
+
<fo:table-column column-width="60%"/>
|
4343
|
+
</xsl:when>
|
4344
|
+
<xsl:otherwise>
|
4345
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
4346
|
+
<xsl:choose>
|
4347
|
+
<xsl:when test=". = 1 or . = 0">
|
4348
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
4349
|
+
</xsl:when>
|
4350
|
+
<xsl:otherwise>
|
4351
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
4352
|
+
</xsl:otherwise>
|
4353
|
+
</xsl:choose>
|
4354
|
+
</xsl:for-each>
|
4355
|
+
</xsl:otherwise>
|
4356
|
+
</xsl:choose>
|
4357
|
+
<!-- <fo:table-column column-width="15%"/>
|
4358
|
+
<fo:table-column column-width="85%"/> -->
|
4359
|
+
</xsl:otherwise>
|
4360
|
+
</xsl:choose>
|
4361
|
+
</xsl:template><xsl:template name="getMaxLength_dt">
|
4362
|
+
<xsl:for-each select="*[local-name()='dt']">
|
4363
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
4364
|
+
<xsl:if test="position() = 1">
|
4365
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
4366
|
+
</xsl:if>
|
4367
|
+
</xsl:for-each>
|
4368
|
+
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
|
3943
4369
|
<xsl:param name="key_iso"/>
|
3944
4370
|
|
3945
4371
|
<!-- <tr>
|
@@ -3955,7 +4381,12 @@
|
|
3955
4381
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
3956
4382
|
<xsl:attribute name="margin-top">0</xsl:attribute>
|
3957
4383
|
</xsl:if>
|
3958
|
-
|
4384
|
+
<xsl:variable name="title-note">
|
4385
|
+
<xsl:call-template name="getTitle">
|
4386
|
+
<xsl:with-param name="name" select="'title-note'"/>
|
4387
|
+
</xsl:call-template>
|
4388
|
+
</xsl:variable>
|
4389
|
+
<xsl:value-of select="$title-note"/>
|
3959
4390
|
</fo:block>
|
3960
4391
|
</fo:table-cell>
|
3961
4392
|
<fo:table-cell>
|
@@ -3964,7 +4395,7 @@
|
|
3964
4395
|
</fo:block>
|
3965
4396
|
</fo:table-cell>
|
3966
4397
|
</fo:table-row>
|
3967
|
-
</xsl:template><xsl:template
|
4398
|
+
</xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
|
3968
4399
|
<tr>
|
3969
4400
|
<td>
|
3970
4401
|
<xsl:apply-templates/>
|
@@ -3977,11 +4408,12 @@
|
|
3977
4408
|
</td>
|
3978
4409
|
</tr>
|
3979
4410
|
|
3980
|
-
</xsl:template><xsl:template
|
4411
|
+
</xsl:template><xsl:template match="*[local-name()='dt']">
|
3981
4412
|
<xsl:param name="key_iso"/>
|
3982
4413
|
|
3983
4414
|
<fo:table-row>
|
3984
4415
|
<fo:table-cell>
|
4416
|
+
|
3985
4417
|
<fo:block margin-top="6pt">
|
3986
4418
|
|
3987
4419
|
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
@@ -3993,8 +4425,15 @@
|
|
3993
4425
|
</xsl:if>
|
3994
4426
|
|
3995
4427
|
|
3996
|
-
<xsl:apply-templates/>
|
3997
4428
|
|
4429
|
+
|
4430
|
+
|
4431
|
+
<xsl:apply-templates/>
|
4432
|
+
<!-- <xsl:if test="$namespace = 'gb'">
|
4433
|
+
<xsl:if test="ancestor::*[local-name()='formula']">
|
4434
|
+
<xsl:text>—</xsl:text>
|
4435
|
+
</xsl:if>
|
4436
|
+
</xsl:if> -->
|
3998
4437
|
</fo:block>
|
3999
4438
|
</fo:table-cell>
|
4000
4439
|
<fo:table-cell>
|
@@ -4008,37 +4447,37 @@
|
|
4008
4447
|
</fo:table-cell>
|
4009
4448
|
</fo:table-row>
|
4010
4449
|
|
4011
|
-
</xsl:template><xsl:template
|
4450
|
+
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
4012
4451
|
<xsl:apply-templates/>
|
4013
|
-
</xsl:template><xsl:template
|
4452
|
+
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
4014
4453
|
<xsl:apply-templates/>
|
4015
|
-
</xsl:template><xsl:template
|
4454
|
+
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
4016
4455
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
4017
|
-
</xsl:template><xsl:template
|
4456
|
+
</xsl:template><xsl:template match="*[local-name()='em']">
|
4018
4457
|
<fo:inline font-style="italic">
|
4019
4458
|
<xsl:apply-templates/>
|
4020
4459
|
</fo:inline>
|
4021
|
-
</xsl:template><xsl:template
|
4460
|
+
</xsl:template><xsl:template match="*[local-name()='strong']">
|
4022
4461
|
<fo:inline font-weight="bold">
|
4023
4462
|
<xsl:apply-templates/>
|
4024
4463
|
</fo:inline>
|
4025
|
-
</xsl:template><xsl:template
|
4464
|
+
</xsl:template><xsl:template match="*[local-name()='sup']">
|
4026
4465
|
<fo:inline font-size="80%" vertical-align="super">
|
4027
4466
|
<xsl:apply-templates/>
|
4028
4467
|
</fo:inline>
|
4029
|
-
</xsl:template><xsl:template
|
4468
|
+
</xsl:template><xsl:template match="*[local-name()='sub']">
|
4030
4469
|
<fo:inline font-size="80%" vertical-align="sub">
|
4031
4470
|
<xsl:apply-templates/>
|
4032
4471
|
</fo:inline>
|
4033
|
-
</xsl:template><xsl:template
|
4034
|
-
<fo:inline font-family="Courier" font-size="10pt">
|
4472
|
+
</xsl:template><xsl:template match="*[local-name()='tt']">
|
4473
|
+
<fo:inline font-family="Courier" font-size="10pt">
|
4035
4474
|
<xsl:apply-templates/>
|
4036
4475
|
</fo:inline>
|
4037
|
-
</xsl:template><xsl:template
|
4476
|
+
</xsl:template><xsl:template match="*[local-name()='del']">
|
4038
4477
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
4039
4478
|
<xsl:apply-templates/>
|
4040
4479
|
</fo:inline>
|
4041
|
-
</xsl:template><xsl:template
|
4480
|
+
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
4042
4481
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
4043
4482
|
<fo:inline font-size="75%">
|
4044
4483
|
<xsl:if test="string-length($text) > 0">
|
@@ -4047,10 +4486,11 @@
|
|
4047
4486
|
</xsl:call-template>
|
4048
4487
|
</xsl:if>
|
4049
4488
|
</fo:inline>
|
4050
|
-
</xsl:template><xsl:template
|
4489
|
+
</xsl:template><xsl:template name="recursiveSmallCaps">
|
4051
4490
|
<xsl:param name="text"/>
|
4052
4491
|
<xsl:variable name="char" select="substring($text,1,1)"/>
|
4053
|
-
<xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
|
4492
|
+
<!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
|
4493
|
+
<xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
|
4054
4494
|
<xsl:choose>
|
4055
4495
|
<xsl:when test="$char=$upperCase">
|
4056
4496
|
<fo:inline font-size="{100 div 0.75}%">
|
@@ -4066,7 +4506,7 @@
|
|
4066
4506
|
<xsl:with-param name="text" select="substring($text,2)"/>
|
4067
4507
|
</xsl:call-template>
|
4068
4508
|
</xsl:if>
|
4069
|
-
</xsl:template><xsl:template
|
4509
|
+
</xsl:template><xsl:template name="tokenize">
|
4070
4510
|
<xsl:param name="text"/>
|
4071
4511
|
<xsl:param name="separator" select="' '"/>
|
4072
4512
|
<xsl:choose>
|
@@ -4114,7 +4554,7 @@
|
|
4114
4554
|
</xsl:call-template>
|
4115
4555
|
</xsl:otherwise>
|
4116
4556
|
</xsl:choose>
|
4117
|
-
</xsl:template><xsl:template
|
4557
|
+
</xsl:template><xsl:template name="max_length">
|
4118
4558
|
<xsl:param name="words"/>
|
4119
4559
|
<xsl:for-each select="$words//word">
|
4120
4560
|
<xsl:sort select="." data-type="number" order="descending"/>
|
@@ -4122,7 +4562,11 @@
|
|
4122
4562
|
<xsl:value-of select="."/>
|
4123
4563
|
</xsl:if>
|
4124
4564
|
</xsl:for-each>
|
4125
|
-
</xsl:template><xsl:template
|
4565
|
+
</xsl:template><xsl:template name="add-zero-spaces-java">
|
4566
|
+
<xsl:param name="text" select="."/>
|
4567
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4568
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
4569
|
+
</xsl:template><xsl:template name="add-zero-spaces">
|
4126
4570
|
<xsl:param name="text" select="."/>
|
4127
4571
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
4128
4572
|
<xsl:variable name="zero-space-after-dot">.</xsl:variable>
|
@@ -4175,7 +4619,7 @@
|
|
4175
4619
|
<xsl:value-of select="$text"/>
|
4176
4620
|
</xsl:otherwise>
|
4177
4621
|
</xsl:choose>
|
4178
|
-
</xsl:template><xsl:template
|
4622
|
+
</xsl:template><xsl:template name="add-zero-spaces-equal">
|
4179
4623
|
<xsl:param name="text" select="."/>
|
4180
4624
|
<xsl:variable name="zero-space-after-equals">==========</xsl:variable>
|
4181
4625
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
@@ -4201,7 +4645,7 @@
|
|
4201
4645
|
<xsl:value-of select="$text"/>
|
4202
4646
|
</xsl:otherwise>
|
4203
4647
|
</xsl:choose>
|
4204
|
-
</xsl:template><xsl:template
|
4648
|
+
</xsl:template><xsl:template name="getSimpleTable">
|
4205
4649
|
<xsl:variable name="simple-table">
|
4206
4650
|
|
4207
4651
|
<!-- Step 1. colspan processing -->
|
@@ -4228,9 +4672,9 @@
|
|
4228
4672
|
</xsl:choose> -->
|
4229
4673
|
</xsl:variable>
|
4230
4674
|
<xsl:copy-of select="$simple-table"/>
|
4231
|
-
</xsl:template><xsl:template
|
4675
|
+
</xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
|
4232
4676
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4233
|
-
</xsl:template><xsl:template
|
4677
|
+
</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
4678
|
<xsl:choose>
|
4235
4679
|
<xsl:when test="@colspan">
|
4236
4680
|
<xsl:variable name="td">
|
@@ -4252,16 +4696,16 @@
|
|
4252
4696
|
</xsl:element>
|
4253
4697
|
</xsl:otherwise>
|
4254
4698
|
</xsl:choose>
|
4255
|
-
</xsl:template><xsl:template
|
4699
|
+
</xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
|
4256
4700
|
<xsl:element name="tr">
|
4257
4701
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4258
4702
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4259
4703
|
</xsl:element>
|
4260
|
-
</xsl:template><xsl:template
|
4704
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
|
4261
4705
|
<xsl:copy>
|
4262
4706
|
<xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
|
4263
4707
|
</xsl:copy>
|
4264
|
-
</xsl:template><xsl:template
|
4708
|
+
</xsl:template><xsl:template name="repeatNode">
|
4265
4709
|
<xsl:param name="count"/>
|
4266
4710
|
<xsl:param name="node"/>
|
4267
4711
|
|
@@ -4272,18 +4716,18 @@
|
|
4272
4716
|
</xsl:call-template>
|
4273
4717
|
<xsl:copy-of select="$node"/>
|
4274
4718
|
</xsl:if>
|
4275
|
-
</xsl:template><xsl:template
|
4719
|
+
</xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
|
4276
4720
|
<xsl:copy>
|
4277
4721
|
<xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
|
4278
4722
|
</xsl:copy>
|
4279
|
-
</xsl:template><xsl:template
|
4723
|
+
</xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
|
4280
4724
|
<xsl:copy>
|
4281
4725
|
<xsl:copy-of select="tr[1]"/>
|
4282
4726
|
<xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
|
4283
4727
|
<xsl:with-param name="previousRow" select="tr[1]"/>
|
4284
4728
|
</xsl:apply-templates>
|
4285
4729
|
</xsl:copy>
|
4286
|
-
</xsl:template><xsl:template
|
4730
|
+
</xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
|
4287
4731
|
<xsl:param name="previousRow"/>
|
4288
4732
|
<xsl:variable name="currentRow" select="."/>
|
4289
4733
|
|
@@ -4317,43 +4761,53 @@
|
|
4317
4761
|
<xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
|
4318
4762
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
4319
4763
|
</xsl:apply-templates>
|
4320
|
-
</xsl:template><xsl:template
|
4764
|
+
</xsl:template><xsl:template name="getLang">
|
4321
4765
|
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
4322
4766
|
<xsl:choose>
|
4323
4767
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
4324
4768
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
4325
4769
|
</xsl:choose>
|
4326
|
-
</xsl:template><xsl:template
|
4770
|
+
</xsl:template><xsl:template name="capitalizeWords">
|
4327
4771
|
<xsl:param name="str"/>
|
4328
4772
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
4329
4773
|
<xsl:choose>
|
4330
4774
|
<xsl:when test="contains($str2, ' ')">
|
4331
4775
|
<xsl:variable name="substr" select="substring-before($str2, ' ')"/>
|
4332
|
-
<xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
|
4333
|
-
<xsl:value-of select="substring($substr, 2)"/>
|
4776
|
+
<!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
|
4777
|
+
<xsl:value-of select="substring($substr, 2)"/> -->
|
4778
|
+
<xsl:call-template name="capitalize">
|
4779
|
+
<xsl:with-param name="str" select="$substr"/>
|
4780
|
+
</xsl:call-template>
|
4334
4781
|
<xsl:text> </xsl:text>
|
4335
4782
|
<xsl:call-template name="capitalizeWords">
|
4336
4783
|
<xsl:with-param name="str" select="substring-after($str2, ' ')"/>
|
4337
4784
|
</xsl:call-template>
|
4338
4785
|
</xsl:when>
|
4339
4786
|
<xsl:otherwise>
|
4340
|
-
<xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
|
4341
|
-
<xsl:value-of select="substring($str2, 2)"/>
|
4787
|
+
<!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
|
4788
|
+
<xsl:value-of select="substring($str2, 2)"/> -->
|
4789
|
+
<xsl:call-template name="capitalize">
|
4790
|
+
<xsl:with-param name="str" select="$str2"/>
|
4791
|
+
</xsl:call-template>
|
4342
4792
|
</xsl:otherwise>
|
4343
4793
|
</xsl:choose>
|
4344
|
-
</xsl:template><xsl:template
|
4794
|
+
</xsl:template><xsl:template name="capitalize">
|
4795
|
+
<xsl:param name="str"/>
|
4796
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
4797
|
+
<xsl:value-of select="substring($str, 2)"/>
|
4798
|
+
</xsl:template><xsl:template match="mathml:math">
|
4345
4799
|
<fo:inline font-family="STIX2Math">
|
4346
4800
|
<fo:instream-foreign-object fox:alt-text="Math">
|
4347
4801
|
<xsl:copy-of select="."/>
|
4348
4802
|
</fo:instream-foreign-object>
|
4349
4803
|
</fo:inline>
|
4350
|
-
</xsl:template><xsl:template
|
4804
|
+
</xsl:template><xsl:template match="*[local-name()='localityStack']">
|
4351
4805
|
<xsl:for-each select="*[local-name()='locality']">
|
4352
4806
|
<xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
|
4353
4807
|
<xsl:apply-templates select="."/>
|
4354
4808
|
<xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
|
4355
4809
|
</xsl:for-each>
|
4356
|
-
</xsl:template><xsl:template
|
4810
|
+
</xsl:template><xsl:template match="*[local-name()='link']" name="link">
|
4357
4811
|
<xsl:variable name="target">
|
4358
4812
|
<xsl:choose>
|
4359
4813
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -4383,4 +4837,246 @@
|
|
4383
4837
|
</xsl:otherwise>
|
4384
4838
|
</xsl:choose>
|
4385
4839
|
</fo:inline>
|
4840
|
+
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
4841
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4842
|
+
<!-- <xsl:choose>
|
4843
|
+
<xsl:when test="@lang = 'en'"></xsl:when>
|
4844
|
+
<xsl:otherwise> -->
|
4845
|
+
<xsl:attribute name="white-space">pre</xsl:attribute>
|
4846
|
+
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
4847
|
+
<!-- </xsl:otherwise>
|
4848
|
+
</xsl:choose> -->
|
4849
|
+
<xsl:apply-templates/>
|
4850
|
+
</fo:block>
|
4851
|
+
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
4852
|
+
<fo:inline id="{@id}"/>
|
4853
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
4854
|
+
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
4855
|
+
<xsl:variable name="title-appendix">
|
4856
|
+
<xsl:call-template name="getTitle">
|
4857
|
+
<xsl:with-param name="name" select="'title-appendix'"/>
|
4858
|
+
</xsl:call-template>
|
4859
|
+
</xsl:variable>
|
4860
|
+
<fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
|
4861
|
+
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
4862
|
+
</fo:block>
|
4863
|
+
<xsl:apply-templates/>
|
4864
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
4865
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4866
|
+
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
|
4867
|
+
<fo:block xsl:use-attribute-sets="appendix-example-style">
|
4868
|
+
<xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
|
4869
|
+
<xsl:variable name="title-example">
|
4870
|
+
<xsl:call-template name="getTitle">
|
4871
|
+
<xsl:with-param name="name" select="'title-example'"/>
|
4872
|
+
</xsl:call-template>
|
4873
|
+
</xsl:variable>
|
4874
|
+
<xsl:value-of select="$title-example"/>
|
4875
|
+
<xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) > 1">
|
4876
|
+
<xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
|
4877
|
+
</xsl:if>
|
4878
|
+
<xsl:if test="*[local-name()='name']">
|
4879
|
+
<xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
|
4880
|
+
</xsl:if>
|
4881
|
+
</fo:block>
|
4882
|
+
<xsl:apply-templates/>
|
4883
|
+
</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">
|
4884
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4885
|
+
</xsl:template><xsl:template match="*[local-name() = 'callout']">
|
4886
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"><<xsl:apply-templates/>></fo:basic-link>
|
4887
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']">
|
4888
|
+
<xsl:variable name="annotation-id" select="@id"/>
|
4889
|
+
<xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
|
4890
|
+
<fo:block id="{$annotation-id}" white-space="nowrap">
|
4891
|
+
<fo:inline>
|
4892
|
+
<xsl:apply-templates>
|
4893
|
+
<xsl:with-param name="callout" select="concat('<', $callout, '> ')"/>
|
4894
|
+
</xsl:apply-templates>
|
4895
|
+
</fo:inline>
|
4896
|
+
</fo:block>
|
4897
|
+
</xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
4898
|
+
<xsl:param name="callout"/>
|
4899
|
+
<fo:inline id="{@id}">
|
4900
|
+
<!-- for first p in annotation, put <x> -->
|
4901
|
+
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
4902
|
+
<xsl:apply-templates/>
|
4903
|
+
</fo:inline>
|
4904
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4905
|
+
<xsl:variable name="title-modified">
|
4906
|
+
<xsl:call-template name="getTitle">
|
4907
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4908
|
+
</xsl:call-template>
|
4909
|
+
</xsl:variable>
|
4910
|
+
<xsl:choose>
|
4911
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
4912
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
4913
|
+
</xsl:choose>
|
4914
|
+
<xsl:apply-templates/>
|
4915
|
+
</xsl:template><xsl:template name="convertDate">
|
4916
|
+
<xsl:param name="date"/>
|
4917
|
+
<xsl:param name="format" select="'short'"/>
|
4918
|
+
<xsl:variable name="year" select="substring($date, 1, 4)"/>
|
4919
|
+
<xsl:variable name="month" select="substring($date, 6, 2)"/>
|
4920
|
+
<xsl:variable name="day" select="substring($date, 9, 2)"/>
|
4921
|
+
<xsl:variable name="monthStr">
|
4922
|
+
<xsl:choose>
|
4923
|
+
<xsl:when test="$month = '01'">January</xsl:when>
|
4924
|
+
<xsl:when test="$month = '02'">February</xsl:when>
|
4925
|
+
<xsl:when test="$month = '03'">March</xsl:when>
|
4926
|
+
<xsl:when test="$month = '04'">April</xsl:when>
|
4927
|
+
<xsl:when test="$month = '05'">May</xsl:when>
|
4928
|
+
<xsl:when test="$month = '06'">June</xsl:when>
|
4929
|
+
<xsl:when test="$month = '07'">July</xsl:when>
|
4930
|
+
<xsl:when test="$month = '08'">August</xsl:when>
|
4931
|
+
<xsl:when test="$month = '09'">September</xsl:when>
|
4932
|
+
<xsl:when test="$month = '10'">October</xsl:when>
|
4933
|
+
<xsl:when test="$month = '11'">November</xsl:when>
|
4934
|
+
<xsl:when test="$month = '12'">December</xsl:when>
|
4935
|
+
</xsl:choose>
|
4936
|
+
</xsl:variable>
|
4937
|
+
<xsl:variable name="result">
|
4938
|
+
<xsl:choose>
|
4939
|
+
<xsl:when test="$format = 'short' or $day = ''">
|
4940
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4941
|
+
</xsl:when>
|
4942
|
+
<xsl:otherwise>
|
4943
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
|
4944
|
+
</xsl:otherwise>
|
4945
|
+
</xsl:choose>
|
4946
|
+
</xsl:variable>
|
4947
|
+
<xsl:value-of select="$result"/>
|
4948
|
+
</xsl:template><xsl:template name="insertKeywords">
|
4949
|
+
<xsl:param name="sorting" select="'true'"/>
|
4950
|
+
<xsl:param name="charAtEnd" select="'.'"/>
|
4951
|
+
<xsl:param name="charDelim" select="', '"/>
|
4952
|
+
<xsl:choose>
|
4953
|
+
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4954
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4955
|
+
<xsl:sort data-type="text" order="ascending"/>
|
4956
|
+
<xsl:call-template name="insertKeyword">
|
4957
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4958
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4959
|
+
</xsl:call-template>
|
4960
|
+
</xsl:for-each>
|
4961
|
+
</xsl:when>
|
4962
|
+
<xsl:otherwise>
|
4963
|
+
<xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4964
|
+
<xsl:call-template name="insertKeyword">
|
4965
|
+
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4966
|
+
<xsl:with-param name="charDelim" select="$charDelim"/>
|
4967
|
+
</xsl:call-template>
|
4968
|
+
</xsl:for-each>
|
4969
|
+
</xsl:otherwise>
|
4970
|
+
</xsl:choose>
|
4971
|
+
</xsl:template><xsl:template name="insertKeyword">
|
4972
|
+
<xsl:param name="charAtEnd"/>
|
4973
|
+
<xsl:param name="charDelim"/>
|
4974
|
+
<xsl:apply-templates/>
|
4975
|
+
<xsl:choose>
|
4976
|
+
<xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
|
4977
|
+
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4978
|
+
</xsl:choose>
|
4979
|
+
</xsl:template><xsl:template name="addPDFUAmeta">
|
4980
|
+
<fo:declarations>
|
4981
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4982
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4983
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4984
|
+
</pdf:dictionary>
|
4985
|
+
</pdf:catalog>
|
4986
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4987
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4988
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4989
|
+
<!-- Dublin Core properties go here -->
|
4990
|
+
<dc:title>
|
4991
|
+
<xsl:variable name="title">
|
4992
|
+
|
4993
|
+
<xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
|
4994
|
+
|
4995
|
+
|
4996
|
+
|
4997
|
+
|
4998
|
+
</xsl:variable>
|
4999
|
+
<xsl:choose>
|
5000
|
+
<xsl:when test="normalize-space($title) != ''">
|
5001
|
+
<xsl:value-of select="$title"/>
|
5002
|
+
</xsl:when>
|
5003
|
+
<xsl:otherwise>
|
5004
|
+
<xsl:text> </xsl:text>
|
5005
|
+
</xsl:otherwise>
|
5006
|
+
</xsl:choose>
|
5007
|
+
</dc:title>
|
5008
|
+
<dc:creator>
|
5009
|
+
|
5010
|
+
<xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
5011
|
+
|
5012
|
+
|
5013
|
+
</dc:creator>
|
5014
|
+
<dc:description>
|
5015
|
+
<xsl:variable name="abstract">
|
5016
|
+
|
5017
|
+
<xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract']//text()"/>
|
5018
|
+
|
5019
|
+
|
5020
|
+
|
5021
|
+
|
5022
|
+
</xsl:variable>
|
5023
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
5024
|
+
</dc:description>
|
5025
|
+
<pdf:Keywords>
|
5026
|
+
<xsl:call-template name="insertKeywords"/>
|
5027
|
+
</pdf:Keywords>
|
5028
|
+
</rdf:Description>
|
5029
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
5030
|
+
<!-- XMP properties go here -->
|
5031
|
+
<xmp:CreatorTool/>
|
5032
|
+
</rdf:Description>
|
5033
|
+
</rdf:RDF>
|
5034
|
+
</x:xmpmeta>
|
5035
|
+
</fo:declarations>
|
5036
|
+
</xsl:template><xsl:template name="getId">
|
5037
|
+
<xsl:choose>
|
5038
|
+
<xsl:when test="../@id">
|
5039
|
+
<xsl:value-of select="../@id"/>
|
5040
|
+
</xsl:when>
|
5041
|
+
<xsl:otherwise>
|
5042
|
+
<!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
|
5043
|
+
<xsl:value-of select="concat(generate-id(..), '_', text())"/>
|
5044
|
+
</xsl:otherwise>
|
5045
|
+
</xsl:choose>
|
5046
|
+
</xsl:template><xsl:template name="getLevel">
|
5047
|
+
<xsl:variable name="level_total" select="count(ancestor::*)"/>
|
5048
|
+
<xsl:variable name="level">
|
5049
|
+
<xsl:choose>
|
5050
|
+
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
5051
|
+
<xsl:value-of select="$level_total - 2"/>
|
5052
|
+
</xsl:when>
|
5053
|
+
<xsl:when test="ancestor::*[local-name() = 'sections']">
|
5054
|
+
<xsl:value-of select="$level_total - 2"/>
|
5055
|
+
</xsl:when>
|
5056
|
+
<xsl:when test="ancestor::*[local-name() = 'bibliography']">
|
5057
|
+
<xsl:value-of select="$level_total - 2"/>
|
5058
|
+
</xsl:when>
|
5059
|
+
<xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
|
5060
|
+
<xsl:otherwise>
|
5061
|
+
<xsl:value-of select="$level_total - 1"/>
|
5062
|
+
</xsl:otherwise>
|
5063
|
+
</xsl:choose>
|
5064
|
+
</xsl:variable>
|
5065
|
+
<xsl:value-of select="$level"/>
|
5066
|
+
</xsl:template><xsl:template name="getSubSection">
|
5067
|
+
<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']"/>
|
5068
|
+
</xsl:template><xsl:template name="split">
|
5069
|
+
<xsl:param name="pText" select="."/>
|
5070
|
+
<xsl:param name="sep" select="','"/>
|
5071
|
+
<xsl:if test="string-length($pText) >0">
|
5072
|
+
<item>
|
5073
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
|
5074
|
+
</item>
|
5075
|
+
<xsl:call-template name="split">
|
5076
|
+
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
5077
|
+
<xsl:with-param name="sep" select="$sep"/>
|
5078
|
+
</xsl:call-template>
|
5079
|
+
</xsl:if>
|
5080
|
+
</xsl:template><xsl:template name="getDocumentId">
|
5081
|
+
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
4386
5082
|
</xsl:template></xsl:stylesheet>
|