metanorma-ogc 1.5.4.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +4 -32
  3. data/.gitignore +11 -0
  4. data/Gemfile +0 -1
  5. data/lib/isodoc/ogc/base_convert.rb +1 -1
  6. data/lib/isodoc/ogc/biblio.rb +7 -6
  7. data/lib/isodoc/ogc/html/html_ogc_titlepage.html +6 -0
  8. data/lib/isodoc/ogc/html/htmlstyle.css +49 -28
  9. data/lib/isodoc/ogc/html/htmlstyle.scss +19 -11
  10. data/lib/isodoc/ogc/html/word_ogc_titlepage.html +6 -1
  11. data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +6 -1
  12. data/lib/isodoc/ogc/html/wordstyle.css +30 -18
  13. data/lib/isodoc/ogc/html/wordstyle.scss +30 -18
  14. data/lib/isodoc/ogc/html/wordstyle_wp.css +22 -12
  15. data/lib/isodoc/ogc/html/wordstyle_wp.scss +22 -12
  16. data/lib/isodoc/ogc/metadata.rb +4 -0
  17. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1677 -1309
  18. data/lib/isodoc/ogc/ogc.best-practice.xsl +1677 -1309
  19. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1677 -1309
  20. data/lib/isodoc/ogc/ogc.community-practice.xsl +1677 -1309
  21. data/lib/isodoc/ogc/ogc.community-standard.xsl +1677 -1309
  22. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1677 -1309
  23. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1677 -1309
  24. data/lib/isodoc/ogc/ogc.other.xsl +1677 -1309
  25. data/lib/isodoc/ogc/ogc.policy.xsl +1677 -1309
  26. data/lib/isodoc/ogc/ogc.reference-model.xsl +1677 -1309
  27. data/lib/isodoc/ogc/ogc.release-notes.xsl +1677 -1309
  28. data/lib/isodoc/ogc/ogc.standard.xsl +1677 -1309
  29. data/lib/isodoc/ogc/ogc.test-suite.xsl +1677 -1309
  30. data/lib/isodoc/ogc/ogc.user-guide.xsl +1677 -1309
  31. data/lib/isodoc/ogc/ogc.white-paper.xsl +1655 -1303
  32. data/lib/isodoc/ogc/presentation_xml_convert.rb +35 -18
  33. data/lib/isodoc/ogc/reqt.rb +17 -3
  34. data/lib/{asciidoctor → metanorma}/ogc/basicdoc.rng +0 -0
  35. data/lib/{asciidoctor → metanorma}/ogc/biblio.rng +2 -2
  36. data/lib/{asciidoctor → metanorma}/ogc/boilerplate.xml +0 -0
  37. data/lib/{asciidoctor → metanorma}/ogc/cleanup.rb +54 -10
  38. data/lib/{asciidoctor → metanorma}/ogc/converter.rb +13 -3
  39. data/lib/{asciidoctor → metanorma}/ogc/front.rb +15 -3
  40. data/lib/{asciidoctor → metanorma}/ogc/isodoc.rng +104 -3
  41. data/lib/{asciidoctor → metanorma}/ogc/ogc.rng +0 -0
  42. data/lib/{asciidoctor → metanorma}/ogc/reqt.rng +0 -0
  43. data/lib/{asciidoctor → metanorma}/ogc/validate.rb +39 -1
  44. data/lib/metanorma/ogc/version.rb +1 -1
  45. data/lib/metanorma/ogc.rb +1 -0
  46. data/lib/metanorma-ogc.rb +0 -1
  47. data/metanorma-ogc.gemspec +1 -1
  48. metadata +14 -15
  49. data/lib/asciidoctor/ogc.rb +0 -6
@@ -9,8 +9,6 @@
9
9
 
10
10
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
11
11
 
12
- <xsl:variable name="pageWidth" select="215.9"/>
13
- <xsl:variable name="pageHeight" select="279.4"/>
14
12
  <xsl:variable name="marginLeftRight1" select="25.4"/>
15
13
  <xsl:variable name="marginLeftRight2" select="25.4"/>
16
14
  <xsl:variable name="marginTop" select="25.4"/>
@@ -125,7 +123,7 @@
125
123
 
126
124
  <xsl:template match="/">
127
125
  <xsl:call-template name="namespaceCheck"/>
128
- <fo:root font-family="Arial, STIX Two Math, Source Han Sans" font-size="11pt" xml:lang="{$lang}">
126
+ <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
129
127
  <fo:layout-master-set>
130
128
 
131
129
  <!-- Document pages -->
@@ -241,7 +239,9 @@
241
239
  <fo:block-container line-height="1.08" font-family="Lato">
242
240
  <fo:block role="TOC">
243
241
  <fo:block xsl:use-attribute-sets="title-toc-style" role="H1">
244
- <xsl:text>Table of Contents</xsl:text>
242
+ <xsl:call-template name="getTitle">
243
+ <xsl:with-param name="name" select="'title-toc'"/>
244
+ </xsl:call-template>
245
245
  </fo:block>
246
246
  <xsl:variable name="margin-left">3.9</xsl:variable>
247
247
  <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
@@ -372,9 +372,6 @@
372
372
  <!-- ============================= -->
373
373
  <!-- CONTENTS -->
374
374
  <!-- ============================= -->
375
- <xsl:template match="node()" mode="contents">
376
- <xsl:apply-templates mode="contents"/>
377
- </xsl:template>
378
375
 
379
376
  <!-- element with title -->
380
377
  <xsl:template match="*[ogc:title]" mode="contents">
@@ -444,64 +441,21 @@
444
441
  <xsl:value-of select="."/><xsl:text> </xsl:text>
445
442
  </fo:block>
446
443
  </xsl:template>
444
+
447
445
 
448
- <xsl:template match="ogc:license-statement//ogc:title">
449
- <xsl:variable name="level">
450
- <xsl:call-template name="getLevel"/>
451
- </xsl:variable>
452
- <fo:block font-family="Lato" text-align="center" font-weight="bold" margin-top="4pt" role="H{$level}">
453
- <xsl:apply-templates/>
454
- </fo:block>
455
- </xsl:template>
456
-
457
- <xsl:template match="ogc:license-statement//ogc:p">
458
- <fo:block font-size="8pt" margin-top="14pt" line-height="115%">
459
- <xsl:if test="following-sibling::ogc:p">
460
- <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
461
- </xsl:if>
462
- <xsl:apply-templates/>
463
- </fo:block>
464
- </xsl:template>
465
-
466
- <xsl:template match="ogc:feedback-statement">
446
+ <xsl:template match="ogc:feedback-statement" priority="2">
467
447
  <fo:block margin-top="12pt" margin-bottom="12pt">
468
448
  <xsl:apply-templates select="ogc:clause[1]"/>
469
449
  </fo:block>
470
450
  </xsl:template>
471
451
 
472
- <xsl:template match="ogc:copyright-statement | ogc:legal-statement">
473
- <fo:block>
474
- <xsl:apply-templates/>
475
- </fo:block>
476
- </xsl:template>
477
452
 
478
453
  <xsl:template match="ogc:copyright-statement//ogc:clause | ogc:legal-statement//ogc:clause" priority="2">
479
454
  <fo:block margin-top="6pt">
480
455
  <xsl:apply-templates/>
481
456
  </fo:block>
482
457
  </xsl:template>
483
-
484
- <xsl:template match="ogc:copyright-statement//ogc:title | ogc:legal-statement//ogc:title">
485
- <xsl:variable name="level">
486
- <xsl:call-template name="getLevel"/>
487
- </xsl:variable>
488
- <fo:block font-family="Lato" text-align="center" font-weight="bold" role="H{$level}">
489
- <xsl:apply-templates/>
490
- </fo:block>
491
- </xsl:template>
492
458
 
493
- <xsl:template match="ogc:copyright-statement//ogc:p | ogc:legal-statement//ogc:p">
494
- <fo:block>
495
- <xsl:attribute name="text-align">
496
- <xsl:choose>
497
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
498
- <xsl:otherwise>left</xsl:otherwise>
499
- </xsl:choose>
500
- </xsl:attribute>
501
- <xsl:apply-templates/>
502
- </fo:block>
503
- </xsl:template>
504
-
505
459
 
506
460
  <xsl:template match="/*/*[local-name() = 'preface']/*" priority="3">
507
461
  <fo:block>
@@ -530,7 +484,7 @@
530
484
  </fo:block>
531
485
  </xsl:template>
532
486
 
533
- <xsl:template match="ogc:title">
487
+ <xsl:template match="ogc:title" name="title">
534
488
 
535
489
  <xsl:variable name="level">
536
490
  <xsl:call-template name="getLevel"/>
@@ -597,7 +551,7 @@
597
551
  <!-- ====== -->
598
552
  <!-- ====== -->
599
553
 
600
- <xsl:template match="ogc:p">
554
+ <xsl:template match="ogc:p" name="paragraph">
601
555
  <xsl:param name="inline" select="'false'"/>
602
556
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
603
557
  <xsl:variable name="element-name">
@@ -652,46 +606,6 @@
652
606
  </xsl:template>
653
607
 
654
608
 
655
- <xsl:template match="ogc:bibitem">
656
- <fo:block id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm" line-height="115%">
657
- <xsl:if test=".//ogc:fn">
658
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
659
- </xsl:if>
660
- <xsl:call-template name="processBibitem"/>
661
- </fo:block>
662
- </xsl:template>
663
-
664
-
665
- <xsl:template match="ogc:bibitem/ogc:note" priority="2">
666
- <fo:footnote>
667
- <xsl:variable name="number">
668
- <xsl:choose>
669
- <xsl:when test="ancestor::ogc:references[preceding-sibling::ogc:references]">
670
- <xsl:number level="any" count="ogc:references[preceding-sibling::ogc:references]//ogc:bibitem/ogc:note"/>
671
- </xsl:when>
672
- <xsl:otherwise>
673
- <xsl:number level="any" count="ogc:bibitem/ogc:note"/>
674
- </xsl:otherwise>
675
- </xsl:choose>
676
- </xsl:variable>
677
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
678
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
679
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
680
- </fo:basic-link>
681
- </fo:inline>
682
- <fo:footnote-body>
683
- <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt">
684
- <fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
685
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
686
- </fo:inline>
687
- <xsl:apply-templates/>
688
- </fo:block>
689
- </fo:footnote-body>
690
- </fo:footnote>
691
- </xsl:template>
692
-
693
-
694
-
695
609
  <xsl:template match="ogc:ul | ogc:ol" mode="ul_ol">
696
610
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
697
611
  <xsl:if test="ancestor::ogc:ul | ancestor::ogc:ol">
@@ -709,7 +623,9 @@
709
623
  <fo:list-item-label end-indent="label-end()">
710
624
  <fo:block>
711
625
  <xsl:choose>
712
- <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash -->
626
+ <xsl:when test="local-name(..) = 'ul'">
627
+ <xsl:call-template name="setULLabel"/>
628
+ </xsl:when>
713
629
  <xsl:otherwise> <!-- for ordered lists -->
714
630
  <xsl:choose>
715
631
  <xsl:when test="../@class = 'steps'">
@@ -749,8 +665,8 @@
749
665
  <fo:list-item-label><fo:block/></fo:list-item-label>
750
666
  <fo:list-item-body>
751
667
  <fo:block>
752
- <xsl:apply-templates select="ogc:name" mode="presentation"/>
753
- <xsl:apply-templates/>
668
+ <xsl:apply-templates select="ogc:name"/>
669
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
754
670
  </fo:block>
755
671
  </fo:list-item-body>
756
672
  </fo:list-item>
@@ -773,7 +689,7 @@
773
689
  </xsl:variable>
774
690
  <fo:block font-size="{$font-size}" role="H{$levelTerm}">
775
691
  <fo:block font-weight="bold" keep-with-next="always">
776
- <xsl:apply-templates select="ancestor::ogc:term[1]/ogc:name" mode="presentation"/>
692
+ <xsl:apply-templates select="ancestor::ogc:term[1]/ogc:name"/>
777
693
  </fo:block>
778
694
  <fo:block font-weight="bold" keep-with-next="always" line-height="1">
779
695
  <xsl:call-template name="setStyle_preferred"/>
@@ -783,65 +699,6 @@
783
699
  </xsl:template>
784
700
 
785
701
 
786
-
787
- <!-- [position() &gt; 1] -->
788
- <xsl:template match="ogc:references[not(@normative='true')]">
789
- <fo:block break-after="page"/>
790
- <fo:block id="{@id}" line-height="120%">
791
- <xsl:apply-templates/>
792
- </fo:block>
793
- </xsl:template>
794
-
795
- <xsl:template match="ogc:annex//ogc:references">
796
- <fo:block id="{@id}">
797
- <xsl:apply-templates/>
798
- </fo:block>
799
- </xsl:template>
800
-
801
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
802
- <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem">
803
- <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm">
804
- <fo:list-item>
805
- <fo:list-item-label end-indent="label-end()">
806
- <fo:block>
807
- <fo:inline>
808
- <xsl:number format="[1]"/>
809
- </fo:inline>
810
- </fo:block>
811
- </fo:list-item-label>
812
- <fo:list-item-body start-indent="body-start()">
813
- <fo:block>
814
- <xsl:call-template name="processBibitem"/>
815
- </fo:block>
816
- </fo:list-item-body>
817
- </fo:list-item>
818
- </fo:list-block>
819
- </xsl:template>
820
-
821
- <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem" mode="contents"/>
822
-
823
- <xsl:template match="ogc:bibitem/ogc:title">
824
- <fo:inline font-style="italic">
825
- <xsl:apply-templates/>
826
- </fo:inline>
827
- </xsl:template>
828
-
829
-
830
-
831
- <xsl:template match="ogc:admonition">
832
- <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt">
833
- <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
834
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
835
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
836
- </fo:block>
837
- <fo:block font-style="italic">
838
- <xsl:apply-templates/>
839
- </fo:block>
840
- </fo:block-container>
841
- </fo:block-container>
842
- </xsl:template>
843
-
844
-
845
702
  <xsl:template match="ogc:formula/ogc:stem">
846
703
  <fo:block margin-top="6pt" margin-bottom="12pt">
847
704
  <fo:table table-layout="fixed" width="100%">
@@ -856,7 +713,7 @@
856
713
  </fo:table-cell>
857
714
  <fo:table-cell display-align="center">
858
715
  <fo:block text-align="right">
859
- <xsl:apply-templates select="../ogc:name" mode="presentation"/>
716
+ <xsl:apply-templates select="../ogc:name" mode="formula_number"/>
860
717
  </fo:block>
861
718
  </fo:table-cell>
862
719
  </fo:table-row>
@@ -867,13 +724,6 @@
867
724
 
868
725
 
869
726
 
870
- <xsl:template match="ogc:pagebreak">
871
- <fo:block break-after="page"/>
872
- <fo:block> </fo:block>
873
- <fo:block break-after="page"/>
874
- </xsl:template>
875
-
876
-
877
727
  <xsl:template name="insertHeaderFooter">
878
728
 
879
729
  <fo:static-content flow-name="xsl-footnote-separator">
@@ -946,55 +796,38 @@
946
796
  </xsl:choose>
947
797
  </xsl:template>
948
798
 
949
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
950
-
951
- <title-annex lang="en">Annex </title-annex>
952
- <title-annex lang="fr">Annexe </title-annex>
953
-
954
- <title-annex lang="zh">Annex </title-annex>
955
-
956
-
799
+ <xsl:variable name="pageWidth_">
800
+ 215.9
801
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
802
+ 279.4
803
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
957
804
 
958
805
  <title-edition lang="en">
959
806
 
960
-
961
- <xsl:text>Version</xsl:text>
962
-
807
+ <xsl:text>Version</xsl:text>
808
+
963
809
  </title-edition>
964
810
 
965
811
  <title-edition lang="fr">
966
-
967
- <xsl:text>Édition </xsl:text>
968
-
812
+ <xsl:text>Édition </xsl:text>
969
813
  </title-edition>
970
814
 
971
-
815
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
972
816
  <title-toc lang="en">
973
817
 
974
- <xsl:text>Contents</xsl:text>
975
818
 
819
+ <xsl:text>Table of Contents</xsl:text>
976
820
 
977
821
 
978
822
  </title-toc>
979
823
  <title-toc lang="fr">
824
+ <xsl:text>Sommaire</xsl:text>
825
+ </title-toc>
826
+ <title-toc lang="zh">
980
827
 
981
- <xsl:text>Sommaire</xsl:text>
982
-
983
-
984
- </title-toc>
985
-
986
- <title-toc lang="zh">Contents</title-toc>
987
-
988
-
989
-
990
- <title-page lang="en">Page</title-page>
991
- <title-page lang="fr">Page</title-page>
992
-
993
- <title-key lang="en">Key</title-key>
994
- <title-key lang="fr">Légende</title-key>
995
-
996
- <title-where lang="en">where</title-where>
997
- <title-where lang="fr">où</title-where>
828
+ <xsl:text>Contents</xsl:text>
829
+
830
+ </title-toc>
998
831
 
999
832
  <title-descriptors lang="en">Descriptors</title-descriptors>
1000
833
 
@@ -1010,32 +843,9 @@
1010
843
  </title-part>
1011
844
  <title-part lang="zh">第 # 部分:</title-part>
1012
845
 
1013
- <title-subpart lang="en">
1014
-
1015
- </title-subpart>
1016
- <title-subpart lang="fr">
1017
-
1018
- </title-subpart>
1019
-
1020
- <title-modified lang="en">modified</title-modified>
1021
- <title-modified lang="fr">modifiée</title-modified>
1022
-
1023
- <title-modified lang="zh">modified</title-modified>
846
+ <title-subpart lang="en">Sub-part #</title-subpart>
847
+ <title-subpart lang="fr">Partie de sub #</title-subpart>
1024
848
 
1025
-
1026
-
1027
- <title-source lang="en">
1028
-
1029
- <xsl:text>SOURCE</xsl:text>
1030
-
1031
-
1032
- </title-source>
1033
-
1034
- <title-keywords lang="en">Keywords</title-keywords>
1035
-
1036
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
1037
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1038
-
1039
849
  <title-list-tables lang="en">List of Tables</title-list-tables>
1040
850
 
1041
851
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -1044,41 +854,12 @@
1044
854
 
1045
855
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1046
856
 
1047
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1048
-
1049
- <title-abstract lang="en">Abstract</title-abstract>
1050
-
1051
857
  <title-summary lang="en">Summary</title-summary>
1052
858
 
1053
- <title-in lang="en">in </title-in>
1054
-
1055
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1056
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1057
-
1058
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
1059
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
1060
-
1061
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
1062
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
1063
-
1064
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
1065
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
1066
-
1067
- <title-obligation-normative lang="en">normative</title-obligation-normative>
1068
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
1069
-
1070
- <title-caution lang="en">CAUTION</title-caution>
1071
- <title-caution lang="zh">注意</title-caution>
1072
-
1073
- <title-warning lang="en">WARNING</title-warning>
1074
- <title-warning lang="zh">警告</title-warning>
1075
-
1076
- <title-amendment lang="en">AMENDMENT</title-amendment>
1077
-
1078
859
  <title-continued lang="en">(continued)</title-continued>
1079
860
  <title-continued lang="fr">(continué)</title-continued>
1080
861
 
1081
- </xsl:variable><xsl:variable name="bibdata">
862
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
1082
863
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1083
864
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1084
865
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
@@ -1107,6 +888,92 @@
1107
888
  </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1108
889
 
1109
890
 
891
+
892
+
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+ <xsl:attribute name="font-family">Arial, STIX Two Math, Source Han Sans</xsl:attribute>
904
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
905
+
906
+
907
+
908
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
909
+
910
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
911
+
912
+
913
+ <xsl:attribute name="font-family">Lato</xsl:attribute>
914
+ <xsl:attribute name="text-align">center</xsl:attribute>
915
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
916
+
917
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
918
+
919
+
920
+
921
+ <xsl:attribute name="text-align">left</xsl:attribute>
922
+
923
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
924
+
925
+
926
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
927
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
928
+
929
+
930
+
931
+
932
+
933
+
934
+ <xsl:attribute name="font-family">Lato</xsl:attribute>
935
+ <xsl:attribute name="text-align">center</xsl:attribute>
936
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
937
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
938
+
939
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
940
+
941
+
942
+
943
+
944
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
945
+ <xsl:attribute name="margin-top">14pt</xsl:attribute>
946
+ <xsl:attribute name="line-height">135%</xsl:attribute>
947
+
948
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
949
+
950
+
951
+
952
+
953
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
954
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
955
+
956
+
957
+
958
+
959
+ <xsl:attribute name="font-family">Lato</xsl:attribute>
960
+ <xsl:attribute name="text-align">center</xsl:attribute>
961
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
962
+
963
+
964
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
965
+
966
+ <xsl:attribute name="text-align">left</xsl:attribute>
967
+
968
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
969
+
970
+
971
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
972
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
973
+
974
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
975
+
976
+
1110
977
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1111
978
 
1112
979
 
@@ -1116,6 +983,9 @@
1116
983
 
1117
984
 
1118
985
 
986
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
987
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
988
+
1119
989
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1120
990
  <xsl:attribute name="white-space">pre</xsl:attribute>
1121
991
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1125,6 +995,11 @@
1125
995
 
1126
996
 
1127
997
 
998
+
999
+
1000
+
1001
+
1002
+
1128
1003
 
1129
1004
 
1130
1005
 
@@ -1134,6 +1009,8 @@
1134
1009
  <xsl:attribute name="line-height">113%</xsl:attribute>
1135
1010
 
1136
1011
 
1012
+
1013
+
1137
1014
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1138
1015
 
1139
1016
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1220,6 +1097,7 @@
1220
1097
 
1221
1098
 
1222
1099
 
1100
+
1223
1101
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1224
1102
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1225
1103
  <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
@@ -1232,7 +1110,9 @@
1232
1110
 
1233
1111
 
1234
1112
 
1113
+
1235
1114
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1115
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1236
1116
 
1237
1117
 
1238
1118
 
@@ -1249,7 +1129,6 @@
1249
1129
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1250
1130
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1251
1131
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1252
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1253
1132
 
1254
1133
 
1255
1134
 
@@ -1266,6 +1145,7 @@
1266
1145
 
1267
1146
 
1268
1147
 
1148
+
1269
1149
 
1270
1150
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1271
1151
 
@@ -1284,55 +1164,261 @@
1284
1164
 
1285
1165
  </xsl:attribute-set><xsl:variable name="table-border_">
1286
1166
 
1287
- </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1288
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1289
-
1167
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
1168
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1169
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1290
1170
 
1291
1171
 
1292
1172
 
1293
1173
 
1294
-
1295
1174
 
1296
1175
 
1297
1176
 
1298
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1299
- <xsl:attribute name="text-align">left</xsl:attribute>
1300
- <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute>
1301
- <xsl:attribute name="font-weight">normal</xsl:attribute>
1302
- <xsl:attribute name="font-style">italic</xsl:attribute>
1303
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1304
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1305
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1306
1177
 
1307
-
1308
1178
 
1309
1179
 
1310
1180
 
1311
1181
 
1312
- </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1313
1182
 
1314
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1315
-
1316
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1317
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1318
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1319
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1320
1183
 
1321
1184
 
1322
1185
 
1323
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1324
1186
 
1325
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1326
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
1327
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1187
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1188
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1328
1189
 
1329
1190
 
1191
+
1330
1192
 
1331
- </xsl:attribute-set><xsl:attribute-set name="xref-style">
1332
1193
 
1194
+ </xsl:attribute-set><xsl:attribute-set name="table-style">
1195
+ <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1196
+ <xsl:attribute name="table-layout">fixed</xsl:attribute>
1197
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1198
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1333
1199
 
1334
1200
 
1335
- <xsl:attribute name="color">blue</xsl:attribute>
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1222
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1223
+
1224
+
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+
1231
+
1232
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1233
+ <xsl:attribute name="text-align">left</xsl:attribute>
1234
+ <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute>
1235
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1236
+ <xsl:attribute name="font-style">italic</xsl:attribute>
1237
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1238
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1239
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+ </xsl:attribute-set><xsl:attribute-set name="table-row-style">
1247
+ <xsl:attribute name="min-height">4mm</xsl:attribute>
1248
+
1249
+
1250
+
1251
+
1252
+ </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
1253
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1264
+
1265
+
1266
+
1267
+ </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1268
+
1269
+ </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style">
1270
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1271
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1272
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1273
+ <xsl:attribute name="display-align">center</xsl:attribute>
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+ <xsl:attribute name="padding">1mm</xsl:attribute>
1285
+ <xsl:attribute name="background-color">rgb(0, 51, 102)</xsl:attribute>
1286
+ <xsl:attribute name="color">white</xsl:attribute>
1287
+ <xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
1288
+ <xsl:attribute name="height">5mm</xsl:attribute>
1289
+
1290
+
1291
+
1292
+
1293
+ </xsl:attribute-set><xsl:attribute-set name="table-cell-style">
1294
+ <xsl:attribute name="display-align">center</xsl:attribute>
1295
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1296
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1308
+ <xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
1309
+ <xsl:attribute name="height">5mm</xsl:attribute>
1310
+
1311
+
1312
+
1313
+
1314
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1315
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1316
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1317
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1318
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1319
+
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+ </xsl:attribute-set><xsl:attribute-set name="table-note-style">
1331
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1332
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
1342
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
1350
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1351
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1364
+
1365
+
1366
+ </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
1367
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1368
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1369
+
1370
+
1371
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style">
1372
+
1373
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style">
1374
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1375
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1376
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1377
+
1378
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style">
1379
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1380
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1381
+
1382
+ </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1383
+
1384
+
1385
+ </xsl:attribute-set><xsl:attribute-set name="dt-style">
1386
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1397
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1398
+
1399
+
1400
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1401
+
1402
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1403
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1404
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1405
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1406
+
1407
+
1408
+
1409
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1410
+
1411
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1412
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1413
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1414
+
1415
+
1416
+
1417
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1418
+
1419
+
1420
+
1421
+ <xsl:attribute name="color">blue</xsl:attribute>
1336
1422
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1337
1423
 
1338
1424
 
@@ -1386,6 +1472,7 @@
1386
1472
 
1387
1473
 
1388
1474
  </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1475
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
1389
1476
 
1390
1477
 
1391
1478
 
@@ -1454,6 +1541,9 @@
1454
1541
 
1455
1542
 
1456
1543
 
1544
+ </xsl:attribute-set><xsl:attribute-set name="termsource-text-style">
1545
+
1546
+
1457
1547
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1458
1548
 
1459
1549
 
@@ -1464,6 +1554,8 @@
1464
1554
 
1465
1555
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1466
1556
 
1557
+ </xsl:attribute-set><xsl:attribute-set name="figure-style">
1558
+
1467
1559
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1468
1560
 
1469
1561
 
@@ -1572,6 +1664,21 @@
1572
1664
 
1573
1665
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1574
1666
  <xsl:attribute name="line-height">135%</xsl:attribute>
1667
+ </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
1668
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1669
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1677
+ <xsl:attribute name="color">blue</xsl:attribute>
1678
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1679
+
1680
+
1681
+
1575
1682
  </xsl:attribute-set><xsl:attribute-set name="fn-style">
1576
1683
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1577
1684
  </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
@@ -1615,19 +1722,222 @@
1615
1722
 
1616
1723
 
1617
1724
 
1618
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1619
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1620
- <xsl:attribute name="color">black</xsl:attribute>
1621
- <xsl:attribute name="text-align">justify</xsl:attribute>
1725
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1726
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1727
+ <xsl:attribute name="color">black</xsl:attribute>
1728
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1729
+
1730
+
1731
+
1732
+
1733
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1734
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1735
+
1736
+
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+
1749
+ <xsl:attribute name="font-size">60%</xsl:attribute>
1750
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1751
+
1752
+
1753
+
1754
+
1755
+ </xsl:attribute-set><xsl:attribute-set name="admonition-style">
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1763
+
1764
+
1765
+
1766
+
1767
+ <xsl:attribute name="border">0.5pt solid rgb(79, 129, 189)</xsl:attribute>
1768
+ <xsl:attribute name="color">rgb(79, 129, 189)</xsl:attribute>
1769
+ <xsl:attribute name="margin-left">16mm</xsl:attribute>
1770
+ <xsl:attribute name="margin-right">16mm</xsl:attribute>
1771
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1772
+
1773
+
1774
+
1775
+
1776
+ </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
1777
+
1778
+
1779
+
1780
+
1781
+
1782
+
1783
+
1784
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1785
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1786
+ <xsl:attribute name="padding">2mm</xsl:attribute>
1787
+ <xsl:attribute name="padding-top">3mm</xsl:attribute>
1788
+
1789
+
1790
+
1791
+
1792
+ </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
1793
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1805
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1806
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1807
+ <xsl:attribute name="font-style">italic</xsl:attribute>
1808
+ <xsl:attribute name="text-align">center</xsl:attribute>
1809
+
1810
+
1811
+
1812
+
1813
+ </xsl:attribute-set><xsl:attribute-set name="admonition-p-style">
1814
+
1815
+
1816
+
1817
+
1818
+
1819
+
1820
+
1821
+
1822
+ <xsl:attribute name="font-style">italic</xsl:attribute>
1823
+
1824
+
1825
+
1826
+
1827
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+
1838
+
1839
+
1840
+
1841
+
1842
+
1843
+
1844
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1845
+ <xsl:attribute name="start-indent">12mm</xsl:attribute>
1846
+ <xsl:attribute name="text-indent">-12mm</xsl:attribute>
1847
+ <xsl:attribute name="line-height">115%</xsl:attribute>
1848
+
1849
+
1850
+
1851
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style">
1852
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1853
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1854
+
1855
+
1856
+
1857
+
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+
1864
+
1865
+
1866
+
1867
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
1868
+
1869
+
1870
+
1871
+
1872
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style">
1873
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1874
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1875
+
1876
+
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+
1884
+
1885
+
1886
+
1887
+
1888
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
1889
+
1890
+
1891
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
1892
+
1893
+
1894
+
1895
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
1896
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1897
+ <xsl:attribute name="font-size">65%</xsl:attribute>
1898
+
1899
+
1900
+
1901
+
1902
+
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+
1909
+
1910
+
1911
+
1912
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1913
+
1914
+
1915
+
1916
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
1917
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1918
+
1919
+
1920
+
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+
1927
+
1622
1928
 
1623
1929
 
1624
1930
 
1625
1931
 
1626
- </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1627
- <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1932
+ <xsl:attribute name="font-size">60%</xsl:attribute>
1933
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1628
1934
 
1629
1935
 
1630
1936
 
1937
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
1938
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1939
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1940
+ <xsl:attribute name="start-indent">0pt</xsl:attribute>
1631
1941
 
1632
1942
 
1633
1943
 
@@ -1639,36 +1949,17 @@
1639
1949
 
1640
1950
 
1641
1951
 
1642
- <xsl:attribute name="font-size">60%</xsl:attribute>
1643
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1952
+ </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
1644
1953
 
1645
1954
 
1646
1955
 
1956
+ <xsl:attribute name="line-height">120%</xsl:attribute>
1647
1957
 
1648
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1649
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1650
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1651
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1652
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1653
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1654
- </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1958
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1655
1959
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1656
1960
  <xsl:sort select="@displayorder" data-type="number"/>
1657
1961
  <xsl:apply-templates select="." mode="contents"/>
1658
1962
  </xsl:for-each>
1659
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1660
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1661
-
1662
- <!-- Normative references -->
1663
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
1664
- <!-- Terms and definitions -->
1665
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1666
- <!-- Another main sections -->
1667
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1668
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1669
- <!-- Bibliography -->
1670
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1671
-
1672
1963
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1673
1964
 
1674
1965
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
@@ -1685,29 +1976,11 @@
1685
1976
  <xsl:sort select="@displayorder" data-type="number"/>
1686
1977
  <xsl:apply-templates select="." mode="contents"/>
1687
1978
  </xsl:for-each>
1688
- </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1689
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1690
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1691
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1692
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1693
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1694
1979
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1695
1980
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1696
1981
  <xsl:sort select="@displayorder" data-type="number"/>
1697
1982
  <xsl:apply-templates select="."/>
1698
1983
  </xsl:for-each>
1699
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1700
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1701
-
1702
- <!-- Normative references -->
1703
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1704
- <!-- Terms and definitions -->
1705
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1706
- <!-- Another main sections -->
1707
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1708
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1709
- <!-- Bibliography -->
1710
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1711
1984
  </xsl:template><xsl:template name="processMainSectionsDefault">
1712
1985
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1713
1986
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -1728,6 +2001,109 @@
1728
2001
  <xsl:value-of select="."/>
1729
2002
  </xsl:template><xsl:template match="*[local-name()='br']">
1730
2003
  <xsl:value-of select="$linebreak"/>
2004
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2005
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
2006
+ <xsl:apply-templates/>
2007
+ </fo:block>
2008
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
2009
+
2010
+ <xsl:variable name="level">
2011
+ <xsl:call-template name="getLevel"/>
2012
+ </xsl:variable>
2013
+ <fo:block role="H{$level}" xsl:use-attribute-sets="copyright-statement-title-style">
2014
+ <xsl:apply-templates/>
2015
+ </fo:block>
2016
+
2017
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
2018
+
2019
+
2020
+ <fo:block xsl:use-attribute-sets="copyright-statement-p-style">
2021
+
2022
+
2023
+
2024
+
2025
+ <xsl:if test="@align">
2026
+ <xsl:attribute name="text-align">
2027
+ <xsl:value-of select="@align"/>
2028
+ </xsl:attribute>
2029
+ </xsl:if>
2030
+
2031
+
2032
+ <xsl:apply-templates/>
2033
+ </fo:block>
2034
+
2035
+
2036
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
2037
+ <fo:block xsl:use-attribute-sets="license-statement-style">
2038
+ <xsl:apply-templates/>
2039
+ </fo:block>
2040
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
2041
+
2042
+ <xsl:variable name="level">
2043
+ <xsl:call-template name="getLevel"/>
2044
+ </xsl:variable>
2045
+ <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
2046
+ <xsl:apply-templates/>
2047
+ </fo:block>
2048
+
2049
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
2050
+
2051
+ <fo:block xsl:use-attribute-sets="license-statement-p-style">
2052
+
2053
+
2054
+
2055
+
2056
+ <xsl:if test="following-sibling::*[local-name() = 'p']">
2057
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
2058
+ </xsl:if>
2059
+
2060
+
2061
+ <xsl:apply-templates/>
2062
+ </fo:block>
2063
+
2064
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
2065
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
2066
+ <xsl:apply-templates/>
2067
+ </fo:block>
2068
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
2069
+
2070
+ <!-- ogc-white-paper rsd -->
2071
+ <xsl:variable name="level">
2072
+ <xsl:call-template name="getLevel"/>
2073
+ </xsl:variable>
2074
+ <fo:block role="H{$level}" xsl:use-attribute-sets="legal-statement-title-style">
2075
+ <xsl:apply-templates/>
2076
+ </fo:block>
2077
+
2078
+
2079
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
2080
+
2081
+ <!-- csa -->
2082
+ <fo:block xsl:use-attribute-sets="legal-statement-p-style">
2083
+
2084
+ <xsl:if test="@align">
2085
+ <xsl:attribute name="text-align">
2086
+ <xsl:value-of select="@align"/>
2087
+ </xsl:attribute>
2088
+ </xsl:if>
2089
+
2090
+ <xsl:apply-templates/>
2091
+ </fo:block>
2092
+
2093
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
2094
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
2095
+ <xsl:apply-templates/>
2096
+ </fo:block>
2097
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
2098
+
2099
+ <!-- process in the template 'title' -->
2100
+ <xsl:call-template name="title"/>
2101
+
2102
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
2103
+
2104
+ <!-- process in the template 'paragraph' -->
2105
+ <xsl:call-template name="paragraph"/>
2106
+
1731
2107
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1732
2108
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1733
2109
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -1744,41 +2120,17 @@
1744
2120
  <xsl:call-template name="getSimpleTable"/>
1745
2121
  </xsl:variable>
1746
2122
 
1747
- <!-- <xsl:if test="$namespace = 'bipm'">
1748
- <fo:block>&#xA0;</fo:block>
1749
- </xsl:if> -->
1750
-
1751
2123
 
1752
2124
  <!-- Display table's name before table as standalone block -->
1753
2125
  <!-- $namespace = 'iso' or -->
1754
2126
 
1755
2127
 
1756
2128
 
1757
-
1758
-
1759
- <xsl:call-template name="fn_name_display"/>
1760
-
2129
+ <xsl:call-template name="table_name_fn_display"/>
1761
2130
 
1762
2131
 
1763
2132
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
1764
2133
 
1765
- <!-- <xsl:variable name="cols-count">
1766
- <xsl:choose>
1767
- <xsl:when test="*[local-name()='thead']">
1768
- <xsl:call-template name="calculate-columns-numbers">
1769
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1770
- </xsl:call-template>
1771
- </xsl:when>
1772
- <xsl:otherwise>
1773
- <xsl:call-template name="calculate-columns-numbers">
1774
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1775
- </xsl:call-template>
1776
- </xsl:otherwise>
1777
- </xsl:choose>
1778
- </xsl:variable> -->
1779
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1780
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1781
-
1782
2134
  <xsl:variable name="colwidths">
1783
2135
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1784
2136
  <xsl:call-template name="calculate-column-widths">
@@ -1789,17 +2141,8 @@
1789
2141
  </xsl:variable>
1790
2142
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1791
2143
 
1792
- <!-- <xsl:variable name="colwidths2">
1793
- <xsl:call-template name="calculate-column-widths">
1794
- <xsl:with-param name="cols-count" select="$cols-count"/>
1795
- </xsl:call-template>
1796
- </xsl:variable> -->
1797
-
1798
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1799
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1800
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1801
2144
 
1802
- <xsl:variable name="margin-left">
2145
+ <xsl:variable name="margin-side">
1803
2146
  <xsl:choose>
1804
2147
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1805
2148
  <xsl:otherwise>0</xsl:otherwise>
@@ -1807,77 +2150,66 @@
1807
2150
  </xsl:variable>
1808
2151
 
1809
2152
 
1810
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1811
-
1812
-
1813
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1814
-
1815
-
1816
-
1817
-
1818
-
1819
-
1820
-
2153
+ <fo:block-container xsl:use-attribute-sets="table-container-style">
2154
+
1821
2155
 
1822
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1823
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1824
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1825
-
2156
+
1826
2157
 
2158
+
1827
2159
 
2160
+
1828
2161
 
1829
2162
 
1830
2163
 
2164
+
1831
2165
 
1832
2166
 
1833
2167
 
1834
2168
 
1835
2169
 
2170
+ <!-- end table block-container attributes -->
1836
2171
 
1837
2172
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1838
2173
 
1839
2174
 
2175
+ <xsl:variable name="table_width_default">100%</xsl:variable>
1840
2176
  <xsl:variable name="table_width">
1841
2177
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1842
2178
 
1843
-
1844
-
1845
- <xsl:choose>
1846
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1847
- <xsl:otherwise>100%</xsl:otherwise>
1848
- </xsl:choose>
1849
-
2179
+ <xsl:choose>
2180
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2181
+ <xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise>
2182
+ </xsl:choose>
2183
+
1850
2184
  </xsl:variable>
1851
2185
 
2186
+
1852
2187
  <xsl:variable name="table_attributes">
1853
- <attribute name="table-layout">fixed</attribute>
1854
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1855
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1856
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1857
-
1858
-
1859
-
1860
-
1861
-
1862
-
1863
-
1864
-
1865
- <attribute name="margin-left">0mm</attribute>
1866
- <attribute name="margin-right">0mm</attribute>
1867
-
1868
-
1869
-
1870
-
1871
-
1872
-
1873
-
2188
+
2189
+ <xsl:element name="table_attributes" use-attribute-sets="table-style">
2190
+ <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2191
+
2192
+
2193
+
2194
+
2195
+
2196
+
2197
+
2198
+
2199
+
2200
+
2201
+
2202
+
2203
+
2204
+
2205
+ </xsl:element>
1874
2206
  </xsl:variable>
1875
2207
 
1876
2208
 
1877
- <fo:table id="{@id}" table-omit-footer-at-break="true">
2209
+ <fo:table id="{@id}">
1878
2210
 
1879
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1880
- <xsl:attribute name="{@name}">
2211
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2212
+ <xsl:attribute name="{local-name()}">
1881
2213
  <xsl:value-of select="."/>
1882
2214
  </xsl:attribute>
1883
2215
  </xsl:for-each>
@@ -1888,7 +2220,6 @@
1888
2220
  </xsl:if>
1889
2221
 
1890
2222
 
1891
-
1892
2223
  <xsl:choose>
1893
2224
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1894
2225
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1914,7 +2245,7 @@
1914
2245
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1915
2246
  </xsl:when>
1916
2247
  <xsl:otherwise>
1917
- <xsl:apply-templates/>
2248
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
1918
2249
  </xsl:otherwise>
1919
2250
  </xsl:choose>
1920
2251
 
@@ -1929,30 +2260,11 @@
1929
2260
  </xsl:call-template>
1930
2261
  </xsl:for-each>
1931
2262
 
1932
- <!-- insert footer as table -->
1933
- <!-- <fo:table>
1934
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1935
- <xsl:attribute name="{@name}">
1936
- <xsl:value-of select="."/>
1937
- </xsl:attribute>
1938
- </xsl:for-each>
1939
-
1940
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1941
- <xsl:choose>
1942
- <xsl:when test=". = 1 or . = 0">
1943
- <fo:table-column column-width="proportional-column-width(2)"/>
1944
- </xsl:when>
1945
- <xsl:otherwise>
1946
- <fo:table-column column-width="proportional-column-width({.})"/>
1947
- </xsl:otherwise>
1948
- </xsl:choose>
1949
- </xsl:for-each>
1950
- </fo:table>-->
1951
2263
 
1952
2264
 
1953
2265
 
1954
2266
 
1955
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2267
+ <xsl:apply-templates select="*[local-name()='name']"/>
1956
2268
 
1957
2269
 
1958
2270
  </fo:block-container>
@@ -2007,18 +2319,17 @@
2007
2319
  </xsl:otherwise>
2008
2320
  </xsl:choose>
2009
2321
 
2010
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2322
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
2011
2323
  <xsl:param name="continued"/>
2012
2324
  <xsl:if test="normalize-space() != ''">
2013
2325
  <fo:block xsl:use-attribute-sets="table-name-style">
2014
-
2326
+
2015
2327
 
2016
2328
 
2017
2329
 
2018
2330
 
2019
2331
  <xsl:choose>
2020
2332
  <xsl:when test="$continued = 'true'">
2021
- <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
2022
2333
 
2023
2334
  </xsl:when>
2024
2335
  <xsl:otherwise>
@@ -2081,13 +2392,6 @@
2081
2392
  <xsl:for-each select="xalan:nodeset($table)/*/tr">
2082
2393
  <xsl:variable name="td_text">
2083
2394
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2084
-
2085
- <!-- <xsl:if test="$namespace = 'bipm'">
2086
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
2087
- <word><xsl:value-of select="normalize-space(.)"/></word>
2088
- </xsl:for-each>
2089
- </xsl:if> -->
2090
-
2091
2395
  </xsl:variable>
2092
2396
  <xsl:variable name="words">
2093
2397
  <xsl:variable name="string_with_added_zerospaces">
@@ -2124,7 +2428,6 @@
2124
2428
  </xsl:otherwise>
2125
2429
  </xsl:choose>
2126
2430
  </xsl:variable>
2127
-
2128
2431
 
2129
2432
  <column>
2130
2433
  <xsl:for-each select="xalan:nodeset($widths)//width">
@@ -2158,9 +2461,8 @@
2158
2461
 
2159
2462
  <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2160
2463
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2161
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2464
+ </xsl:template><xsl:template match="*[local-name()='thead']">
2162
2465
  <xsl:param name="cols-count"/>
2163
- <!-- font-weight="bold" -->
2164
2466
  <fo:table-header>
2165
2467
 
2166
2468
 
@@ -2172,85 +2474,26 @@
2172
2474
  <fo:table-row>
2173
2475
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
2174
2476
 
2175
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2477
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2176
2478
  <xsl:with-param name="continued">true</xsl:with-param>
2177
2479
  </xsl:apply-templates>
2178
2480
 
2179
2481
 
2180
2482
 
2181
-
2182
2483
  </fo:table-cell>
2183
2484
  </fo:table-row>
2184
2485
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2185
2486
  <fo:table-body>
2186
2487
  <xsl:apply-templates/>
2187
2488
  </fo:table-body>
2188
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2489
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
2189
2490
  <xsl:apply-templates/>
2190
2491
  </xsl:template><xsl:template name="insertTableFooter">
2191
2492
  <xsl:param name="cols-count"/>
2192
2493
  <xsl:if test="../*[local-name()='tfoot']">
2193
2494
  <fo:table-footer>
2194
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2195
- </fo:table-footer>
2196
- </xsl:if>
2197
- </xsl:template><xsl:template name="insertTableFooter2">
2198
- <xsl:param name="cols-count"/>
2199
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2200
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
2201
-
2202
- <fo:table-footer>
2203
-
2204
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2205
-
2206
- <!-- if there are note(s) or fn(s) then create footer row -->
2207
- <xsl:if test="$isNoteOrFnExist = 'true'">
2208
-
2209
-
2210
-
2211
- <fo:table-row>
2212
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2213
-
2214
-
2215
-
2216
- <!-- fn will be processed inside 'note' processing -->
2217
-
2218
-
2219
-
2220
-
2221
-
2222
-
2223
- <!-- except gb -->
2224
-
2225
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2226
-
2227
-
2228
- <!-- show Note under table in preface (ex. abstract) sections -->
2229
- <!-- empty, because notes show at page side in main sections -->
2230
- <!-- <xsl:if test="$namespace = 'bipm'">
2231
- <xsl:choose>
2232
- <xsl:when test="ancestor::*[local-name()='preface']">
2233
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2234
- </xsl:when>
2235
- <xsl:otherwise>
2236
- <fo:block/>
2237
- </xsl:otherwise>
2238
- </xsl:choose>
2239
- </xsl:if> -->
2240
-
2241
-
2242
- <!-- horizontal row separator -->
2243
-
2244
-
2245
- <!-- fn processing -->
2246
- <xsl:call-template name="fn_display"/>
2247
-
2248
- </fo:table-cell>
2249
- </fo:table-row>
2250
-
2251
- </xsl:if>
2495
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
2252
2496
  </fo:table-footer>
2253
-
2254
2497
  </xsl:if>
2255
2498
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2256
2499
  <xsl:param name="table_attributes"/>
@@ -2277,17 +2520,18 @@
2277
2520
  </xsl:variable>
2278
2521
 
2279
2522
  <fo:table keep-with-previous="always">
2280
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2523
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2524
+ <xsl:variable name="name" select="local-name()"/>
2281
2525
  <xsl:choose>
2282
- <xsl:when test="@name = 'border-top'">
2283
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2526
+ <xsl:when test="$name = 'border-top'">
2527
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
2284
2528
  </xsl:when>
2285
- <xsl:when test="@name = 'border'">
2286
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2529
+ <xsl:when test="$name = 'border'">
2530
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
2287
2531
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2288
2532
  </xsl:when>
2289
2533
  <xsl:otherwise>
2290
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2534
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
2291
2535
  </xsl:otherwise>
2292
2536
  </xsl:choose>
2293
2537
  </xsl:for-each>
@@ -2316,9 +2560,10 @@
2316
2560
 
2317
2561
  <fo:table-body>
2318
2562
  <fo:table-row>
2319
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2563
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
2320
2564
 
2321
2565
 
2566
+
2322
2567
 
2323
2568
 
2324
2569
  <!-- fn will be processed inside 'note' processing -->
@@ -2328,37 +2573,20 @@
2328
2573
 
2329
2574
 
2330
2575
 
2331
-
2332
-
2333
-
2334
2576
  <!-- for BSI (not PAS) display Notes before footnotes -->
2335
2577
 
2336
2578
 
2337
- <!-- except gb -->
2338
-
2339
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2340
-
2579
+ <!-- except gb and bsi -->
2341
2580
 
2342
- <!-- <xsl:if test="$namespace = 'bipm'">
2343
- <xsl:choose>
2344
- <xsl:when test="ancestor::*[local-name()='preface']">
2345
- show Note under table in preface (ex. abstract) sections
2346
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2347
- </xsl:when>
2348
- <xsl:otherwise>
2349
- empty, because notes show at page side in main sections
2350
- <fo:block/>
2351
- </xsl:otherwise>
2352
- </xsl:choose>
2353
- </xsl:if> -->
2581
+ <xsl:apply-templates select="../*[local-name()='note']"/>
2582
+
2354
2583
 
2355
2584
 
2356
2585
  <!-- horizontal row separator -->
2357
2586
 
2358
2587
 
2359
2588
  <!-- fn processing -->
2360
- <xsl:call-template name="fn_display"/>
2361
-
2589
+ <xsl:call-template name="table_fn_display"/>
2362
2590
 
2363
2591
  <!-- for PAS display Notes after footnotes -->
2364
2592
 
@@ -2388,97 +2616,70 @@
2388
2616
 
2389
2617
 
2390
2618
 
2391
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2619
+ <xsl:apply-templates select="../*[local-name()='thead']">
2392
2620
  <xsl:with-param name="cols-count" select="$cols-count"/>
2393
2621
  </xsl:apply-templates>
2394
2622
 
2395
2623
  <xsl:call-template name="insertTableFooter">
2396
2624
  <xsl:with-param name="cols-count" select="$cols-count"/>
2397
2625
  </xsl:call-template>
2398
-
2399
- <fo:table-body>
2400
-
2401
-
2402
- <xsl:apply-templates/>
2403
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2404
-
2405
- </fo:table-body>
2406
-
2407
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2408
- <xsl:choose>
2409
- <xsl:when test="substring-after(., '—') != ''">
2410
- <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2411
- </xsl:when>
2412
- <xsl:otherwise>
2413
- <xsl:value-of select="."/>
2414
- </xsl:otherwise>
2415
- </xsl:choose>
2416
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2417
- <xsl:apply-templates mode="presentation_name"/>
2418
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2419
- <xsl:apply-templates select="."/>
2420
- </xsl:template><xsl:template match="*[local-name()='tr']">
2421
- <xsl:variable name="parent-name" select="local-name(..)"/>
2422
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2423
- <fo:table-row min-height="4mm">
2424
- <xsl:if test="$parent-name = 'thead'">
2425
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2426
-
2427
-
2428
-
2429
-
2430
-
2431
-
2432
-
2433
-
2434
- </xsl:if>
2435
- <xsl:if test="$parent-name = 'tfoot'">
2436
-
2437
-
2438
-
2439
- </xsl:if>
2440
-
2441
-
2442
-
2443
-
2444
-
2445
-
2446
-
2447
-
2448
-
2449
-
2450
- <!-- <xsl:if test="$namespace = 'bipm'">
2451
- <xsl:attribute name="height">8mm</xsl:attribute>
2452
- </xsl:if> -->
2453
-
2626
+
2627
+ <fo:table-body>
2628
+
2629
+
2454
2630
  <xsl:apply-templates/>
2455
- </fo:table-row>
2456
- </xsl:template><xsl:template match="*[local-name()='th']">
2457
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2458
- <xsl:attribute name="text-align">
2459
- <xsl:choose>
2460
- <xsl:when test="@align">
2461
- <xsl:call-template name="setAlignment"/>
2462
- <!-- <xsl:value-of select="@align"/> -->
2463
- </xsl:when>
2464
- <xsl:otherwise>center</xsl:otherwise>
2465
- </xsl:choose>
2466
- </xsl:attribute>
2467
2631
 
2632
+ </fo:table-body>
2633
+
2634
+ </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2635
+ <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2636
+
2468
2637
 
2469
2638
 
2470
2639
 
2640
+
2471
2641
 
2472
2642
 
2643
+ <xsl:call-template name="setTableRowAttributes"/>
2644
+
2645
+ <xsl:apply-templates/>
2646
+ </fo:table-row>
2647
+ </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
2648
+ <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
2649
+
2650
+ <xsl:call-template name="setTableRowAttributes"/>
2651
+ <xsl:apply-templates/>
2652
+ </fo:table-row>
2653
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2654
+ <fo:table-row xsl:use-attribute-sets="table-body-row-style">
2655
+
2656
+
2657
+
2658
+
2659
+
2660
+ <xsl:call-template name="setTableRowAttributes"/>
2661
+ <xsl:apply-templates/>
2662
+ </fo:table-row>
2663
+ </xsl:template><xsl:template name="setTableRowAttributes">
2664
+
2665
+
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+ </xsl:template><xsl:template match="*[local-name()='th']">
2673
+ <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
2674
+ <xsl:call-template name="setTextAlignment">
2675
+ <xsl:with-param name="default">center</xsl:with-param>
2676
+ </xsl:call-template>
2473
2677
 
2474
- <xsl:attribute name="padding">1mm</xsl:attribute>
2475
- <xsl:attribute name="background-color">rgb(0, 51, 102)</xsl:attribute>
2476
- <xsl:attribute name="color">white</xsl:attribute>
2477
- <xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
2478
- <xsl:attribute name="height">5mm</xsl:attribute>
2479
2678
 
2480
2679
 
2481
2680
 
2681
+
2682
+
2482
2683
 
2483
2684
 
2484
2685
 
@@ -2486,21 +2687,25 @@
2486
2687
  <xsl:if test="$lang = 'ar'">
2487
2688
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2488
2689
  </xsl:if>
2489
- <xsl:if test="@colspan">
2490
- <xsl:attribute name="number-columns-spanned">
2491
- <xsl:value-of select="@colspan"/>
2492
- </xsl:attribute>
2493
- </xsl:if>
2494
- <xsl:if test="@rowspan">
2495
- <xsl:attribute name="number-rows-spanned">
2496
- <xsl:value-of select="@rowspan"/>
2497
- </xsl:attribute>
2498
- </xsl:if>
2499
- <xsl:call-template name="display-align"/>
2690
+
2691
+ <xsl:call-template name="setTableCellAttributes"/>
2692
+
2500
2693
  <fo:block>
2501
2694
  <xsl:apply-templates/>
2502
2695
  </fo:block>
2503
2696
  </fo:table-cell>
2697
+ </xsl:template><xsl:template name="setTableCellAttributes">
2698
+ <xsl:if test="@colspan">
2699
+ <xsl:attribute name="number-columns-spanned">
2700
+ <xsl:value-of select="@colspan"/>
2701
+ </xsl:attribute>
2702
+ </xsl:if>
2703
+ <xsl:if test="@rowspan">
2704
+ <xsl:attribute name="number-rows-spanned">
2705
+ <xsl:value-of select="@rowspan"/>
2706
+ </xsl:attribute>
2707
+ </xsl:if>
2708
+ <xsl:call-template name="display-align"/>
2504
2709
  </xsl:template><xsl:template name="display-align">
2505
2710
  <xsl:if test="@valign">
2506
2711
  <xsl:attribute name="display-align">
@@ -2513,63 +2718,56 @@
2513
2718
  </xsl:attribute>
2514
2719
  </xsl:if>
2515
2720
  </xsl:template><xsl:template match="*[local-name()='td']">
2516
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2517
- <xsl:attribute name="text-align">
2518
- <xsl:choose>
2519
- <xsl:when test="@align">
2520
- <xsl:call-template name="setAlignment"/>
2521
- <!-- <xsl:value-of select="@align"/> -->
2522
- </xsl:when>
2523
- <xsl:otherwise>left</xsl:otherwise>
2524
- </xsl:choose>
2525
- </xsl:attribute>
2721
+ <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2722
+ <xsl:call-template name="setTextAlignment">
2723
+ <xsl:with-param name="default">left</xsl:with-param>
2724
+ </xsl:call-template>
2725
+
2526
2726
  <xsl:if test="$lang = 'ar'">
2527
2727
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2528
2728
  </xsl:if>
2529
2729
 
2530
2730
 
2531
2731
 
2732
+ <!-- bsi -->
2532
2733
 
2533
2734
 
2534
2735
 
2535
2736
 
2536
2737
 
2537
2738
 
2538
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
2539
- <xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
2540
- <xsl:attribute name="height">5mm</xsl:attribute>
2541
2739
 
2542
2740
 
2741
+
2543
2742
 
2544
2743
 
2545
2744
 
2546
2745
 
2547
2746
 
2548
2747
 
2549
- <xsl:if test=".//*[local-name() = 'table']">
2748
+ <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
2550
2749
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2551
2750
  </xsl:if>
2552
- <xsl:if test="@colspan">
2553
- <xsl:attribute name="number-columns-spanned">
2554
- <xsl:value-of select="@colspan"/>
2555
- </xsl:attribute>
2556
- </xsl:if>
2557
- <xsl:if test="@rowspan">
2558
- <xsl:attribute name="number-rows-spanned">
2559
- <xsl:value-of select="@rowspan"/>
2560
- </xsl:attribute>
2561
- </xsl:if>
2562
- <xsl:call-template name="display-align"/>
2751
+
2752
+ <xsl:call-template name="setTableCellAttributes"/>
2753
+
2563
2754
  <fo:block>
2564
-
2755
+
2756
+
2757
+
2565
2758
  <xsl:apply-templates/>
2566
2759
  </fo:block>
2567
2760
  </fo:table-cell>
2568
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2569
-
2761
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
2762
+
2763
+ <fo:block xsl:use-attribute-sets="table-note-style">
2764
+
2765
+
2766
+
2767
+
2570
2768
 
2571
- <fo:block font-size="10pt" margin-bottom="12pt">
2572
-
2769
+ <!-- Table's note name (NOTE, for example) -->
2770
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
2573
2771
 
2574
2772
 
2575
2773
 
@@ -2577,24 +2775,16 @@
2577
2775
 
2578
2776
 
2579
2777
 
2580
- <!-- Table's note name (NOTE, for example) -->
2581
-
2582
- <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
2583
-
2778
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
2584
2779
 
2585
-
2586
-
2587
-
2588
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2589
-
2590
- </fo:inline>
2591
-
2592
-
2593
-
2594
- <xsl:apply-templates mode="process"/>
2595
- </fo:block>
2780
+ </fo:inline>
2781
+
2782
+
2783
+
2784
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
2785
+ </fo:block>
2596
2786
 
2597
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2787
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
2598
2788
  <xsl:apply-templates/>
2599
2789
  </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
2600
2790
 
@@ -2672,8 +2862,7 @@
2672
2862
  <xsl:copy-of select="$footnote_inline"/>
2673
2863
  <fo:footnote-body>
2674
2864
 
2675
- <fo:block-container text-indent="0" start-indent="0">
2676
-
2865
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
2677
2866
 
2678
2867
  <fo:block xsl:use-attribute-sets="fn-body-style">
2679
2868
 
@@ -2692,7 +2881,7 @@
2692
2881
  <xsl:copy-of select="$footnote_inline"/>
2693
2882
  </xsl:otherwise>
2694
2883
  </xsl:choose>
2695
- </xsl:template><xsl:template name="fn_display">
2884
+ </xsl:template><xsl:template name="table_fn_display">
2696
2885
  <xsl:variable name="references">
2697
2886
 
2698
2887
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
@@ -2703,33 +2892,26 @@
2703
2892
  <xsl:for-each select="xalan:nodeset($references)//fn">
2704
2893
  <xsl:variable name="reference" select="@reference"/>
2705
2894
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2706
- <fo:block margin-bottom="12pt">
2895
+ <fo:block xsl:use-attribute-sets="table-fn-style">
2707
2896
 
2708
2897
 
2709
2898
 
2710
-
2711
-
2712
-
2713
-
2714
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2899
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
2715
2900
 
2716
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2717
2901
 
2718
2902
 
2719
2903
 
2720
2904
 
2905
+ <xsl:value-of select="@reference"/>
2721
2906
 
2722
2907
 
2723
2908
 
2724
2909
 
2725
- <xsl:value-of select="@reference"/>
2726
2910
 
2727
2911
 
2728
2912
 
2729
2913
  </fo:inline>
2730
- <fo:inline>
2731
-
2732
- <!-- <xsl:apply-templates /> -->
2914
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
2733
2915
  <xsl:copy-of select="./node()"/>
2734
2916
  </fo:inline>
2735
2917
  </fo:block>
@@ -2747,15 +2929,7 @@
2747
2929
 
2748
2930
  <xsl:apply-templates/>
2749
2931
  </fn>
2750
- </xsl:template><xsl:template name="fn_name_display">
2751
- <!-- <xsl:variable name="references">
2752
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2753
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2754
- <xsl:apply-templates />
2755
- </fn>
2756
- </xsl:for-each>
2757
- </xsl:variable>
2758
- $references=<xsl:copy-of select="$references"/> -->
2932
+ </xsl:template><xsl:template name="table_name_fn_display">
2759
2933
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2760
2934
  <xsl:variable name="reference" select="@reference"/>
2761
2935
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -2764,9 +2938,7 @@
2764
2938
  </fo:block>
2765
2939
  </xsl:for-each>
2766
2940
  </xsl:template><xsl:template name="fn_display_figure">
2767
- <xsl:variable name="key_iso">
2768
- <!-- and (not(@class) or @class !='pseudocode') -->
2769
- </xsl:variable>
2941
+
2770
2942
  <xsl:variable name="references">
2771
2943
  <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2772
2944
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2774,50 +2946,52 @@
2774
2946
  </fn>
2775
2947
  </xsl:for-each>
2776
2948
  </xsl:variable>
2949
+
2950
+ <xsl:if test="xalan:nodeset($references)//fn">
2777
2951
 
2778
- <!-- current hierarchy is 'figure' element -->
2779
- <xsl:variable name="following_dl_colwidths">
2780
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2781
- <xsl:variable name="html-table">
2782
- <xsl:variable name="doc_ns">
2952
+ <xsl:variable name="key_iso">
2953
+
2954
+ </xsl:variable>
2955
+
2956
+ <!-- current hierarchy is 'figure' element -->
2957
+ <xsl:variable name="following_dl_colwidths">
2958
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2959
+ <xsl:variable name="html-table">
2960
+ <xsl:variable name="doc_ns">
2961
+
2962
+ </xsl:variable>
2963
+ <xsl:variable name="ns">
2964
+ <xsl:choose>
2965
+ <xsl:when test="normalize-space($doc_ns) != ''">
2966
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2967
+ </xsl:when>
2968
+ <xsl:otherwise>
2969
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2970
+ </xsl:otherwise>
2971
+ </xsl:choose>
2972
+ </xsl:variable>
2783
2973
 
2784
- </xsl:variable>
2785
- <xsl:variable name="ns">
2786
- <xsl:choose>
2787
- <xsl:when test="normalize-space($doc_ns) != ''">
2788
- <xsl:value-of select="normalize-space($doc_ns)"/>
2789
- </xsl:when>
2790
- <xsl:otherwise>
2791
- <xsl:value-of select="substring-before(name(/*), '-')"/>
2792
- </xsl:otherwise>
2793
- </xsl:choose>
2794
- </xsl:variable>
2795
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2796
- <!-- <xsl:element name="{$ns}:table"> -->
2797
2974
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2798
2975
  <tbody>
2799
2976
  <xsl:apply-templates mode="dl"/>
2800
2977
  </tbody>
2801
2978
  </xsl:for-each>
2802
- <!-- </xsl:element> -->
2803
- </xsl:variable>
2804
-
2805
- <xsl:call-template name="calculate-column-widths">
2806
- <xsl:with-param name="cols-count" select="2"/>
2807
- <xsl:with-param name="table" select="$html-table"/>
2808
- </xsl:call-template>
2809
-
2810
- </xsl:if>
2811
- </xsl:variable>
2812
-
2813
-
2814
- <xsl:variable name="maxlength_dt">
2815
- <xsl:for-each select="*[local-name() = 'dl'][1]">
2816
- <xsl:call-template name="getMaxLength_dt"/>
2817
- </xsl:for-each>
2818
- </xsl:variable>
2819
-
2820
- <xsl:if test="xalan:nodeset($references)//fn">
2979
+ </xsl:variable>
2980
+
2981
+ <xsl:call-template name="calculate-column-widths">
2982
+ <xsl:with-param name="cols-count" select="2"/>
2983
+ <xsl:with-param name="table" select="$html-table"/>
2984
+ </xsl:call-template>
2985
+
2986
+ </xsl:if>
2987
+ </xsl:variable>
2988
+
2989
+ <xsl:variable name="maxlength_dt">
2990
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2991
+ <xsl:call-template name="getMaxLength_dt"/>
2992
+ </xsl:for-each>
2993
+ </xsl:variable>
2994
+
2821
2995
  <fo:block>
2822
2996
  <fo:table width="95%" table-layout="fixed">
2823
2997
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -2844,20 +3018,18 @@
2844
3018
  <fo:table-row>
2845
3019
  <fo:table-cell>
2846
3020
  <fo:block>
2847
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
2848
-
3021
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
2849
3022
  <xsl:value-of select="@reference"/>
2850
3023
  </fo:inline>
2851
3024
  </fo:block>
2852
3025
  </fo:table-cell>
2853
3026
  <fo:table-cell>
2854
- <fo:block text-align="justify" margin-bottom="12pt">
2855
-
3027
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
2856
3028
  <xsl:if test="normalize-space($key_iso) = 'true'">
2857
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
3029
+
3030
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
3031
+
2858
3032
  </xsl:if>
2859
-
2860
- <!-- <xsl:apply-templates /> -->
2861
3033
  <xsl:copy-of select="./node()"/>
2862
3034
  </fo:block>
2863
3035
  </fo:table-cell>
@@ -2870,20 +3042,9 @@
2870
3042
  </xsl:if>
2871
3043
 
2872
3044
  </xsl:template><xsl:template match="*[local-name()='fn']">
2873
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2874
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
2875
-
2876
-
2877
-
2878
-
2879
-
2880
-
2881
-
2882
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2883
- <xsl:attribute name="color">blue</xsl:attribute>
2884
-
3045
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
3046
+
2885
3047
 
2886
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2887
3048
 
2888
3049
 
2889
3050
 
@@ -2911,10 +3072,10 @@
2911
3072
  <xsl:variable name="isDeleted" select="@deleted"/>
2912
3073
  <fo:block-container>
2913
3074
 
2914
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2915
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2916
- </xsl:if>
2917
-
3075
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3076
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3077
+ </xsl:if>
3078
+
2918
3079
 
2919
3080
  <xsl:if test="parent::*[local-name() = 'note']">
2920
3081
  <xsl:attribute name="margin-left">
@@ -2931,11 +3092,11 @@
2931
3092
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
2932
3093
  </xsl:call-template>
2933
3094
 
2934
- <fo:block-container>
2935
-
2936
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2937
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
3095
+ <fo:block-container margin-left="0mm">
3096
+
2938
3097
 
3098
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3099
+
2939
3100
 
2940
3101
  <xsl:variable name="parent" select="local-name(..)"/>
2941
3102
 
@@ -2946,23 +3107,19 @@
2946
3107
  <xsl:choose>
2947
3108
  <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2948
3109
 
2949
-
2950
- <fo:block margin-bottom="12pt" text-align="left">
2951
-
2952
- <xsl:variable name="title-where">
2953
-
3110
+ <fo:block margin-bottom="12pt" text-align="left">
2954
3111
 
2955
- <xsl:call-template name="getTitle">
2956
- <xsl:with-param name="name" select="'title-where'"/>
3112
+ <xsl:variable name="title-where">
3113
+ <xsl:call-template name="getLocalizedString">
3114
+ <xsl:with-param name="key">where</xsl:with-param>
2957
3115
  </xsl:call-template>
2958
-
2959
- </xsl:variable>
2960
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2961
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2962
- <xsl:text/>
2963
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2964
- </fo:block>
2965
-
3116
+ </xsl:variable>
3117
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3118
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
3119
+ <xsl:text/>
3120
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3121
+ </fo:block>
3122
+
2966
3123
  </xsl:when>
2967
3124
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2968
3125
  <fo:block margin-bottom="12pt" text-align="left">
@@ -2971,12 +3128,9 @@
2971
3128
 
2972
3129
 
2973
3130
  <xsl:variable name="title-where">
2974
-
2975
-
2976
- <xsl:call-template name="getTitle">
2977
- <xsl:with-param name="name" select="'title-where'"/>
2978
- </xsl:call-template>
2979
-
3131
+ <xsl:call-template name="getLocalizedString">
3132
+ <xsl:with-param name="key">where</xsl:with-param>
3133
+ </xsl:call-template>
2980
3134
  </xsl:variable>
2981
3135
  <xsl:value-of select="$title-where"/>
2982
3136
  </fo:block>
@@ -2988,12 +3142,9 @@
2988
3142
 
2989
3143
 
2990
3144
  <xsl:variable name="title-key">
2991
-
2992
-
2993
- <xsl:call-template name="getTitle">
2994
- <xsl:with-param name="name" select="'title-key'"/>
2995
- </xsl:call-template>
2996
-
3145
+ <xsl:call-template name="getLocalizedString">
3146
+ <xsl:with-param name="key">key</xsl:with-param>
3147
+ </xsl:call-template>
2997
3148
  </xsl:variable>
2998
3149
  <xsl:value-of select="$title-key"/>
2999
3150
  </fo:block>
@@ -3015,9 +3166,7 @@
3015
3166
  <fo:table width="95%" table-layout="fixed">
3016
3167
 
3017
3168
  <xsl:choose>
3018
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3019
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
3020
- </xsl:when>
3169
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
3021
3170
  <xsl:when test="normalize-space($key_iso) = 'true'">
3022
3171
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3023
3172
 
@@ -3038,12 +3187,9 @@
3038
3187
  </xsl:otherwise>
3039
3188
  </xsl:choose>
3040
3189
  </xsl:variable>
3041
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3042
- <!-- <xsl:element name="{$ns}:table"> -->
3043
- <tbody>
3044
- <xsl:apply-templates mode="dl"/>
3045
- </tbody>
3046
- <!-- </xsl:element> -->
3190
+ <tbody>
3191
+ <xsl:apply-templates mode="dl"/>
3192
+ </tbody>
3047
3193
  </xsl:variable>
3048
3194
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
3049
3195
  <xsl:variable name="colwidths">
@@ -3123,8 +3269,6 @@
3123
3269
  </xsl:for-each>
3124
3270
  </xsl:otherwise>
3125
3271
  </xsl:choose>
3126
- <!-- <fo:table-column column-width="15%"/>
3127
- <fo:table-column column-width="85%"/> -->
3128
3272
  </xsl:otherwise>
3129
3273
  </xsl:choose>
3130
3274
  </xsl:template><xsl:template name="getMaxLength_dt">
@@ -3139,12 +3283,6 @@
3139
3283
  </xsl:for-each>
3140
3284
  </xsl:variable>
3141
3285
  <xsl:variable name="maxLength">
3142
- <!-- <xsl:for-each select="*[local-name()='dt']">
3143
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3144
- <xsl:if test="position() = 1">
3145
- <xsl:value-of select="string-length(normalize-space(.))"/>
3146
- </xsl:if>
3147
- </xsl:for-each> -->
3148
3286
  <xsl:for-each select="xalan:nodeset($lengths)/length">
3149
3287
  <xsl:sort select="." data-type="number" order="descending"/>
3150
3288
  <xsl:if test="position() = 1">
@@ -3170,12 +3308,12 @@
3170
3308
  <xsl:if test="normalize-space($key_iso) = 'true'">
3171
3309
  <xsl:attribute name="margin-top">0</xsl:attribute>
3172
3310
  </xsl:if>
3173
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3311
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3174
3312
  </fo:block>
3175
3313
  </fo:table-cell>
3176
3314
  <fo:table-cell>
3177
3315
  <fo:block>
3178
- <xsl:apply-templates/>
3316
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3179
3317
  </fo:block>
3180
3318
  </fo:table-cell>
3181
3319
  </fo:table-row>
@@ -3186,83 +3324,49 @@
3186
3324
  </td>
3187
3325
  <td>
3188
3326
 
3189
-
3190
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3191
-
3327
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3328
+ <xsl:with-param name="process">true</xsl:with-param>
3329
+ </xsl:apply-templates>
3330
+
3192
3331
  </td>
3193
3332
  </tr>
3194
3333
 
3195
3334
  </xsl:template><xsl:template match="*[local-name()='dt']">
3196
3335
  <xsl:param name="key_iso"/>
3197
3336
 
3198
- <fo:table-row>
3199
-
3200
-
3337
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
3201
3338
  <fo:table-cell>
3202
3339
 
3203
- <fo:block margin-top="6pt">
3340
+ <fo:block xsl:use-attribute-sets="dt-style">
3204
3341
  <xsl:copy-of select="@id"/>
3205
3342
 
3206
-
3207
3343
  <xsl:if test="normalize-space($key_iso) = 'true'">
3208
3344
  <xsl:attribute name="margin-top">0</xsl:attribute>
3209
-
3210
3345
  </xsl:if>
3211
3346
 
3212
3347
 
3213
3348
 
3214
-
3215
-
3216
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
3217
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3218
-
3219
-
3220
-
3221
3349
  <xsl:apply-templates/>
3222
- <!-- <xsl:if test="$namespace = 'gb'">
3223
- <xsl:if test="ancestor::*[local-name()='formula']">
3224
- <xsl:text>—</xsl:text>
3225
- </xsl:if>
3226
- </xsl:if> -->
3227
3350
  </fo:block>
3228
3351
  </fo:table-cell>
3229
3352
  <fo:table-cell>
3230
3353
  <fo:block>
3231
3354
 
3232
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
3233
- <xsl:if test="local-name(*[1]) != 'stem'">
3234
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3235
- </xsl:if>
3236
- </xsl:if> -->
3237
-
3238
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3239
-
3355
+
3356
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3357
+ <xsl:with-param name="process">true</xsl:with-param>
3358
+ </xsl:apply-templates>
3240
3359
  </fo:block>
3241
3360
  </fo:table-cell>
3242
3361
  </fo:table-row>
3243
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
3244
- <xsl:if test="local-name(*[1]) = 'stem'">
3245
- <fo:table-row>
3246
- <fo:table-cell>
3247
- <fo:block margin-top="6pt">
3248
- <xsl:if test="normalize-space($key_iso) = 'true'">
3249
- <xsl:attribute name="margin-top">0</xsl:attribute>
3250
- </xsl:if>
3251
- <xsl:text>&#xA0;</xsl:text>
3252
- </fo:block>
3253
- </fo:table-cell>
3254
- <fo:table-cell>
3255
- <fo:block>
3256
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3257
- </fo:block>
3258
- </fo:table-cell>
3259
- </fo:table-row>
3260
- </xsl:if>
3261
- </xsl:if> -->
3262
3362
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3263
3363
  <xsl:apply-templates/>
3264
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
3265
- <xsl:apply-templates/>
3364
+ </xsl:template><xsl:template match="*[local-name()='dd']">
3365
+ <xsl:param name="process">false</xsl:param>
3366
+ <xsl:if test="$process = 'true'">
3367
+ <xsl:apply-templates select="@language"/>
3368
+ <xsl:apply-templates/>
3369
+ </xsl:if>
3266
3370
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3267
3371
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3268
3372
  </xsl:template><xsl:template match="*[local-name()='em']">
@@ -3286,6 +3390,7 @@
3286
3390
  </fo:inline>
3287
3391
  </xsl:template><xsl:template match="*[local-name()='tt']">
3288
3392
  <fo:inline xsl:use-attribute-sets="tt-style">
3393
+
3289
3394
  <xsl:variable name="_font-size">
3290
3395
 
3291
3396
 
@@ -3322,7 +3427,22 @@
3322
3427
  <xsl:apply-templates/>
3323
3428
  </fo:inline>
3324
3429
  </xsl:template><xsl:template match="*[local-name()='add']">
3430
+ <xsl:param name="skip">true</xsl:param>
3325
3431
  <xsl:choose>
3432
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3433
+ <xsl:choose>
3434
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
3435
+ <xsl:otherwise>
3436
+ <fo:inline>
3437
+ <xsl:call-template name="insertTag">
3438
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3439
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3440
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3441
+ </xsl:call-template>
3442
+ </fo:inline>
3443
+ </xsl:otherwise>
3444
+ </xsl:choose>
3445
+ </xsl:when>
3326
3446
  <xsl:when test="@amendment">
3327
3447
  <fo:inline>
3328
3448
  <xsl:call-template name="insertTag">
@@ -3357,7 +3477,6 @@
3357
3477
  </fo:inline>
3358
3478
  </xsl:otherwise>
3359
3479
  </xsl:choose>
3360
-
3361
3480
  </xsl:template><xsl:template name="insertTag">
3362
3481
  <xsl:param name="type"/>
3363
3482
  <xsl:param name="kind"/>
@@ -3365,22 +3484,20 @@
3365
3484
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
3366
3485
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
3367
3486
  <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
3368
- <!-- <xsl:attribute name="width">7mm</xsl:attribute>
3369
- <xsl:attribute name="content-height">100%</xsl:attribute> -->
3370
3487
  <xsl:attribute name="height">5mm</xsl:attribute>
3371
3488
  <xsl:attribute name="content-width">100%</xsl:attribute>
3372
3489
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3373
3490
  <xsl:attribute name="scaling">uniform</xsl:attribute>
3374
3491
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
3375
3492
  <g>
3376
- <xsl:if test="$type = 'closing'">
3493
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3377
3494
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
3378
3495
  </xsl:if>
3379
3496
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
3380
3497
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
3381
3498
  </g>
3382
3499
  <text font-family="Arial" x="15" y="57" font-size="40pt">
3383
- <xsl:if test="$type = 'closing'">
3500
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3384
3501
  <xsl:attribute name="x">25</xsl:attribute>
3385
3502
  </xsl:if>
3386
3503
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -3424,7 +3541,11 @@
3424
3541
  <xsl:with-param name="text" select="substring($text,2)"/>
3425
3542
  </xsl:call-template>
3426
3543
  </xsl:if>
3427
- </xsl:template><xsl:template name="tokenize">
3544
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
3545
+ <fo:block break-after="page"/>
3546
+ <fo:block> </fo:block>
3547
+ <fo:block break-after="page"/>
3548
+ </xsl:template><xsl:template name="tokenize">
3428
3549
  <xsl:param name="text"/>
3429
3550
  <xsl:param name="separator" select="' '"/>
3430
3551
  <xsl:choose>
@@ -3584,14 +3705,6 @@
3584
3705
 
3585
3706
  <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3586
3707
 
3587
- <!-- <xsl:choose>
3588
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
3589
-
3590
- </xsl:when>
3591
- <xsl:otherwise>
3592
- <xsl:copy-of select="current()"/>
3593
- </xsl:otherwise>
3594
- </xsl:choose> -->
3595
3708
  </xsl:variable>
3596
3709
  <xsl:copy-of select="$simple-table"/>
3597
3710
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
@@ -3710,8 +3823,6 @@
3710
3823
  <xsl:choose>
3711
3824
  <xsl:when test="contains($str2, ' ')">
3712
3825
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3713
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3714
- <xsl:value-of select="substring($substr, 2)"/> -->
3715
3826
  <xsl:call-template name="capitalize">
3716
3827
  <xsl:with-param name="str" select="$substr"/>
3717
3828
  </xsl:call-template>
@@ -3721,8 +3832,6 @@
3721
3832
  </xsl:call-template>
3722
3833
  </xsl:when>
3723
3834
  <xsl:otherwise>
3724
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3725
- <xsl:value-of select="substring($str2, 2)"/> -->
3726
3835
  <xsl:call-template name="capitalize">
3727
3836
  <xsl:with-param name="str" select="$str2"/>
3728
3837
  </xsl:call-template>
@@ -3750,6 +3859,7 @@
3750
3859
  <xsl:apply-templates select="." mode="mathml"/>
3751
3860
  </xsl:variable>
3752
3861
  <fo:instream-foreign-object fox:alt-text="Math">
3862
+
3753
3863
 
3754
3864
 
3755
3865
  <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
@@ -3781,7 +3891,7 @@
3781
3891
  </xsl:attribute>
3782
3892
 
3783
3893
 
3784
- <!-- <xsl:copy-of select="."/> -->
3894
+
3785
3895
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3786
3896
  </fo:instream-foreign-object>
3787
3897
  </fo:inline>
@@ -3840,6 +3950,10 @@
3840
3950
 
3841
3951
 
3842
3952
 
3953
+
3954
+
3955
+
3956
+
3843
3957
  <xsl:choose>
3844
3958
  <xsl:when test="$target_text = ''">
3845
3959
  <xsl:apply-templates/>
@@ -3863,19 +3977,19 @@
3863
3977
  </fo:inline>
3864
3978
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3865
3979
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3866
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3980
+ <xsl:apply-templates select="*[local-name()='title']"/>
3867
3981
  </fo:block>
3868
- <xsl:apply-templates/>
3869
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3982
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
3983
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
3870
3984
  <xsl:variable name="level">
3871
3985
  <xsl:call-template name="getLevel"/>
3872
3986
  </xsl:variable>
3873
3987
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3874
3988
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3875
3989
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3876
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3990
+ <xsl:apply-templates select="*[local-name()='name']"/>
3877
3991
  </fo:block>
3878
- <xsl:apply-templates/>
3992
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
3879
3993
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
3880
3994
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3881
3995
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -3897,7 +4011,6 @@
3897
4011
  </fo:inline>
3898
4012
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3899
4013
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3900
-
3901
4014
  <xsl:apply-templates/>
3902
4015
  </fo:basic-link>
3903
4016
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3925,13 +4038,17 @@
3925
4038
  <fo:inline>
3926
4039
  <xsl:apply-templates/>
3927
4040
  </fo:inline>
3928
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
4041
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand -->
3929
4042
  <xsl:if test="normalize-space() != ''">
3930
4043
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3931
4044
  </xsl:if>
3932
4045
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3933
4046
 
3934
4047
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
4048
+
4049
+
4050
+
4051
+
3935
4052
 
3936
4053
 
3937
4054
  <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
@@ -3940,38 +4057,49 @@
3940
4057
 
3941
4058
 
3942
4059
 
4060
+
4061
+
3943
4062
 
3944
4063
  <fo:block-container margin-left="0mm">
4064
+
3945
4065
 
3946
4066
 
3947
4067
 
4068
+
3948
4069
 
3949
-
3950
-
3951
-
3952
-
3953
- <fo:block>
3954
-
3955
-
3956
-
3957
-
3958
-
4070
+ <fo:block>
4071
+
4072
+
3959
4073
 
3960
- <fo:inline xsl:use-attribute-sets="note-name-style">
3961
4074
 
3962
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3963
- </fo:inline>
3964
- <xsl:apply-templates/>
3965
- </fo:block>
3966
-
3967
-
4075
+
4076
+
4077
+
4078
+ <fo:inline xsl:use-attribute-sets="note-name-style">
4079
+
4080
+
4081
+
4082
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
4083
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
4084
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
4085
+ <xsl:with-param name="skip">false</xsl:with-param>
4086
+ </xsl:apply-templates>
4087
+ </xsl:if>
4088
+
4089
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4090
+
4091
+ </fo:inline>
4092
+
4093
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4094
+ </fo:block>
4095
+
3968
4096
  </fo:block-container>
3969
4097
  </fo:block-container>
3970
4098
 
3971
4099
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
3972
4100
  <xsl:variable name="num"><xsl:number/></xsl:variable>
3973
4101
  <xsl:choose>
3974
- <xsl:when test="$num = 1">
4102
+ <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
3975
4103
  <fo:inline xsl:use-attribute-sets="note-p-style">
3976
4104
  <xsl:apply-templates/>
3977
4105
  </fo:inline>
@@ -3986,12 +4114,16 @@
3986
4114
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3987
4115
 
3988
4116
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4117
+
4118
+
4119
+
4120
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3989
4121
 
3990
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3991
4122
  </fo:inline>
3992
- <xsl:apply-templates/>
4123
+
4124
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3993
4125
  </fo:block>
3994
- </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
4126
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
3995
4127
  <xsl:param name="sfx"/>
3996
4128
  <xsl:variable name="suffix">
3997
4129
  <xsl:choose>
@@ -4008,7 +4140,7 @@
4008
4140
  <xsl:apply-templates/>
4009
4141
  <xsl:value-of select="$suffix"/>
4010
4142
  </xsl:if>
4011
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
4143
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']">
4012
4144
  <xsl:param name="sfx"/>
4013
4145
  <xsl:variable name="suffix">
4014
4146
  <xsl:choose>
@@ -4035,25 +4167,23 @@
4035
4167
  <xsl:apply-templates/>
4036
4168
  </fo:block>
4037
4169
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4038
- <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
4039
4170
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4040
4171
 
4041
4172
 
4173
+
4174
+
4042
4175
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
4043
4176
 
4044
4177
  </xsl:if>
4045
- <xsl:apply-templates/>
4178
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4046
4179
  </fo:block>
4047
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
4180
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
4048
4181
  <xsl:if test="normalize-space() != ''">
4049
4182
  <xsl:variable name="level">
4050
4183
  <xsl:call-template name="getLevelTermName"/>
4051
4184
  </xsl:variable>
4052
4185
  <fo:inline role="H{$level}">
4053
4186
  <xsl:apply-templates/>
4054
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
4055
- <xsl:text>.</xsl:text>
4056
- </xsl:if> -->
4057
4187
  </fo:inline>
4058
4188
  </xsl:if>
4059
4189
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
@@ -4066,9 +4196,10 @@
4066
4196
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4067
4197
  </xsl:call-template>
4068
4198
 
4069
- <fo:block>
4070
-
4071
- <xsl:apply-templates/>
4199
+
4200
+
4201
+ <fo:block xsl:use-attribute-sets="figure-style">
4202
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4072
4203
  </fo:block>
4073
4204
  <xsl:call-template name="fn_display_figure"/>
4074
4205
  <xsl:for-each select="*[local-name() = 'note']">
@@ -4076,14 +4207,15 @@
4076
4207
  </xsl:for-each>
4077
4208
 
4078
4209
 
4079
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4210
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
4211
+
4080
4212
 
4081
4213
  </fo:block-container>
4082
4214
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
4083
4215
  <fo:block id="{@id}">
4084
- <xsl:apply-templates/>
4216
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4085
4217
  </fo:block>
4086
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4218
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4087
4219
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4088
4220
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4089
4221
  <xsl:apply-templates/>
@@ -4190,9 +4322,7 @@
4190
4322
  <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
4191
4323
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
4192
4324
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
4193
- <!-- width=<xsl:value-of select="$width"/> -->
4194
4325
  <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
4195
- <!-- height=<xsl:value-of select="$height"/> -->
4196
4326
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
4197
4327
  <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
4198
4328
  <xsl:call-template name="svg_cross">
@@ -4462,7 +4592,7 @@
4462
4592
  </fo:basic-link>
4463
4593
  </fo:block>
4464
4594
  </fo:block-container>
4465
- </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4595
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4466
4596
  <xsl:apply-templates mode="contents"/>
4467
4597
  <xsl:text> </xsl:text>
4468
4598
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
@@ -4474,11 +4604,72 @@
4474
4604
  <xsl:value-of select="."/>
4475
4605
  </xsl:template><xsl:template match="node()" mode="contents">
4476
4606
  <xsl:apply-templates mode="contents"/>
4607
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
4608
+ <xsl:variable name="level">
4609
+ <xsl:call-template name="getLevel">
4610
+ <xsl:with-param name="depth" select="@depth"/>
4611
+ </xsl:call-template>
4612
+ </xsl:variable>
4613
+
4614
+ <xsl:variable name="section">
4615
+ <xsl:choose>
4616
+ <xsl:when test="@type = 'section-title'"/>
4617
+ <xsl:otherwise>
4618
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4619
+ </xsl:otherwise>
4620
+ </xsl:choose>
4621
+ </xsl:variable>
4622
+
4623
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
4624
+
4625
+ <xsl:variable name="display">
4626
+ <xsl:choose>
4627
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
4628
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
4629
+ <xsl:otherwise>false</xsl:otherwise>
4630
+ </xsl:choose>
4631
+ </xsl:variable>
4632
+
4633
+ <xsl:variable name="skip">false</xsl:variable>
4634
+
4635
+ <xsl:if test="$skip = 'false'">
4636
+
4637
+ <xsl:variable name="title">
4638
+ <xsl:choose>
4639
+ <xsl:when test="*[local-name() = 'tab']">
4640
+ <xsl:choose>
4641
+ <xsl:when test="@type = 'section-title'">
4642
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4643
+ <xsl:text>: </xsl:text>
4644
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4645
+ </xsl:when>
4646
+ <xsl:otherwise>
4647
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4648
+ </xsl:otherwise>
4649
+ </xsl:choose>
4650
+ </xsl:when>
4651
+ <xsl:otherwise>
4652
+ <xsl:copy-of select="node()"/>
4653
+ </xsl:otherwise>
4654
+ </xsl:choose>
4655
+ </xsl:variable>
4656
+
4657
+ <xsl:variable name="root">
4658
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
4659
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
4660
+ </xsl:variable>
4661
+
4662
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
4663
+ <title>
4664
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
4665
+ </title>
4666
+ </item>
4667
+ </xsl:if>
4477
4668
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4478
4669
  <xsl:apply-templates mode="bookmarks"/>
4479
4670
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4480
4671
  <xsl:apply-templates select="."/>
4481
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4672
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4482
4673
  <xsl:apply-templates mode="bookmarks"/>
4483
4674
  </xsl:template><xsl:template name="addBookmarks">
4484
4675
  <xsl:param name="contents"/>
@@ -4567,8 +4758,6 @@
4567
4758
 
4568
4759
 
4569
4760
 
4570
-
4571
-
4572
4761
  <xsl:variable name="list_of_tables_figures_">
4573
4762
  <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']] | //*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4574
4763
  <table_figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></table_figure>
@@ -4586,12 +4775,9 @@
4586
4775
  <xsl:if test="$list_of_tables_figures//table_figure">
4587
4776
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide"> <!-- {$list_of_figures//figure[1]/@id} -->
4588
4777
  <fo:bookmark-title>
4589
-
4590
-
4591
- <xsl:call-template name="getTitle">
4592
- <xsl:with-param name="name" select="'title-table-figures'"/>
4593
- </xsl:call-template>
4594
-
4778
+ <xsl:call-template name="getTitle">
4779
+ <xsl:with-param name="name" select="'title-table-figures'"/>
4780
+ </xsl:call-template>
4595
4781
  </fo:bookmark-title>
4596
4782
  <xsl:for-each select="$list_of_tables_figures//table_figure">
4597
4783
  <fo:bookmark internal-destination="{@id}">
@@ -4673,7 +4859,7 @@
4673
4859
  <xsl:apply-templates mode="bookmark"/>
4674
4860
  </xsl:otherwise>
4675
4861
  </xsl:choose>
4676
- </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4862
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
4677
4863
  <xsl:if test="normalize-space() != ''">
4678
4864
  <fo:block xsl:use-attribute-sets="figure-name-style">
4679
4865
 
@@ -4682,16 +4868,13 @@
4682
4868
  </fo:block>
4683
4869
  </xsl:if>
4684
4870
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
4685
- <xsl:apply-templates mode="contents_item"/>
4871
+ <xsl:param name="mode">bookmarks</xsl:param>
4872
+ <xsl:apply-templates mode="contents_item">
4873
+ <xsl:with-param name="mode" select="$mode"/>
4874
+ </xsl:apply-templates>
4686
4875
  <!-- <xsl:text> </xsl:text> -->
4687
4876
  </xsl:template><xsl:template name="getSection">
4688
4877
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4689
- <!--
4690
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4691
- <xsl:value-of select="."/>
4692
- </xsl:for-each>
4693
- -->
4694
-
4695
4878
  </xsl:template><xsl:template name="getName">
4696
4879
  <xsl:choose>
4697
4880
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4755,9 +4938,26 @@
4755
4938
  <xsl:copy-of select="."/>
4756
4939
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4757
4940
  <xsl:text> </xsl:text>
4941
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
4942
+ <xsl:param name="mode">bookmarks</xsl:param>
4943
+ <xsl:apply-templates mode="contents_item">
4944
+ <xsl:with-param name="mode" select="$mode"/>
4945
+ </xsl:apply-templates>
4946
+ </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item">
4947
+ <xsl:param name="mode">bookmarks</xsl:param>
4948
+ <xsl:choose>
4949
+ <xsl:when test="starts-with(text(), $ace_tag)">
4950
+ <xsl:if test="$mode = 'contents'">
4951
+ <xsl:copy>
4952
+ <xsl:apply-templates mode="contents_item"/>
4953
+ </xsl:copy>
4954
+ </xsl:if>
4955
+ </xsl:when>
4956
+ <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
4957
+ </xsl:choose>
4758
4958
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4759
4959
 
4760
- <fo:block-container margin-left="0mm">
4960
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
4761
4961
  <xsl:copy-of select="@id"/>
4762
4962
 
4763
4963
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -4794,6 +4994,7 @@
4794
4994
 
4795
4995
 
4796
4996
  </xsl:variable>
4997
+
4797
4998
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4798
4999
  <xsl:if test="$font-size != ''">
4799
5000
  <xsl:attribute name="font-size">
@@ -4810,11 +5011,11 @@
4810
5011
 
4811
5012
 
4812
5013
 
4813
- <xsl:apply-templates/>
5014
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4814
5015
  </fo:block>
4815
5016
 
4816
5017
 
4817
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5018
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
4818
5019
 
4819
5020
 
4820
5021
 
@@ -4828,7 +5029,7 @@
4828
5029
  <xsl:call-template name="add-zero-spaces-java">
4829
5030
  <xsl:with-param name="text" select="$text"/>
4830
5031
  </xsl:call-template>
4831
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
5032
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
4832
5033
  <xsl:if test="normalize-space() != ''">
4833
5034
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4834
5035
  <xsl:apply-templates/>
@@ -4836,10 +5037,10 @@
4836
5037
  </xsl:if>
4837
5038
  </xsl:template><xsl:template match="*[local-name() = 'permission']">
4838
5039
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4839
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4840
- <xsl:apply-templates/>
5040
+ <xsl:apply-templates select="*[local-name()='name']"/>
5041
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4841
5042
  </fo:block>
4842
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
5043
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
4843
5044
  <xsl:if test="normalize-space() != ''">
4844
5045
  <fo:block xsl:use-attribute-sets="permission-name-style">
4845
5046
  <xsl:apply-templates/>
@@ -4854,13 +5055,13 @@
4854
5055
  </fo:block>
4855
5056
  </xsl:template><xsl:template match="*[local-name() = 'requirement']">
4856
5057
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4857
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4858
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
4859
- <xsl:apply-templates select="@obligation" mode="presentation"/>
4860
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
4861
- <xsl:apply-templates/>
5058
+ <xsl:apply-templates select="*[local-name()='name']"/>
5059
+ <xsl:apply-templates select="*[local-name()='label']"/>
5060
+ <xsl:apply-templates select="@obligation"/>
5061
+ <xsl:apply-templates select="*[local-name()='subject']"/>
5062
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/>
4862
5063
  </fo:block>
4863
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
5064
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
4864
5065
  <xsl:if test="normalize-space() != ''">
4865
5066
  <fo:block xsl:use-attribute-sets="requirement-name-style">
4866
5067
 
@@ -4874,20 +5075,24 @@
4874
5075
 
4875
5076
  </fo:block>
4876
5077
  </xsl:if>
4877
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
5078
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']">
4878
5079
  <fo:block xsl:use-attribute-sets="requirement-label-style">
4879
5080
  <xsl:apply-templates/>
4880
5081
  </fo:block>
4881
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
5082
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation">
4882
5083
  <fo:block>
4883
5084
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4884
5085
  </fo:block>
5086
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2">
5087
+ <fo:block xsl:use-attribute-sets="subject-style">
5088
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5089
+ </fo:block>
4885
5090
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4886
5091
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4887
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4888
- <xsl:apply-templates/>
5092
+ <xsl:apply-templates select="*[local-name()='name']"/>
5093
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4889
5094
  </fo:block>
4890
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
5095
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
4891
5096
  <xsl:if test="normalize-space() != ''">
4892
5097
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
4893
5098
  <xsl:apply-templates/>
@@ -4898,10 +5103,6 @@
4898
5103
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4899
5104
  <xsl:apply-templates/>
4900
5105
  </fo:block>
4901
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4902
- <fo:block xsl:use-attribute-sets="subject-style">
4903
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4904
- </fo:block>
4905
5106
  </xsl:template><xsl:template match="*[local-name() = 'subject']">
4906
5107
  <fo:block xsl:use-attribute-sets="subject-style">
4907
5108
  <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
@@ -4945,8 +5146,6 @@
4945
5146
  </xsl:variable>
4946
5147
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4947
5148
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
4948
- <!-- <fo:table-column column-width="35mm"/>
4949
- <fo:table-column column-width="115mm"/> -->
4950
5149
  <fo:table-column column-width="30%"/>
4951
5150
  <fo:table-column column-width="70%"/>
4952
5151
  </xsl:if>
@@ -4956,7 +5155,7 @@
4956
5155
  <xsl:if test=".//*[local-name() = 'fn']">
4957
5156
  <xsl:for-each select="*[local-name() = 'tbody']">
4958
5157
  <fo:block font-size="90%" border-bottom="1pt solid black">
4959
- <xsl:call-template name="fn_display"/>
5158
+ <xsl:call-template name="table_fn_display"/>
4960
5159
  </fo:block>
4961
5160
  </xsl:for-each>
4962
5161
  </xsl:if>
@@ -4973,7 +5172,6 @@
4973
5172
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
4974
5173
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
4975
5174
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
4976
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
4977
5175
  <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
4978
5176
  </xsl:if>
4979
5177
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -4986,34 +5184,11 @@
4986
5184
  </fo:table-row>
4987
5185
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
4988
5186
  <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4989
- <xsl:attribute name="text-align">
4990
- <xsl:choose>
4991
- <xsl:when test="@align">
4992
- <xsl:value-of select="@align"/>
4993
- </xsl:when>
4994
- <xsl:otherwise>left</xsl:otherwise>
4995
- </xsl:choose>
4996
- </xsl:attribute>
4997
- <xsl:if test="@colspan">
4998
- <xsl:attribute name="number-columns-spanned">
4999
- <xsl:value-of select="@colspan"/>
5000
- </xsl:attribute>
5001
- </xsl:if>
5002
- <xsl:if test="@rowspan">
5003
- <xsl:attribute name="number-rows-spanned">
5004
- <xsl:value-of select="@rowspan"/>
5005
- </xsl:attribute>
5006
- </xsl:if>
5007
- <xsl:call-template name="display-align"/>
5187
+ <xsl:call-template name="setTextAlignment">
5188
+ <xsl:with-param name="default">left</xsl:with-param>
5189
+ </xsl:call-template>
5008
5190
 
5009
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
5010
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
5011
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
5012
- </xsl:if>
5013
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
5014
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
5015
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
5016
- </xsl:if> -->
5191
+ <xsl:call-template name="setTableCellAttributes"/>
5017
5192
 
5018
5193
  <fo:block>
5019
5194
  <xsl:apply-templates/>
@@ -5025,37 +5200,15 @@
5025
5200
  <xsl:attribute name="padding">0mm</xsl:attribute>
5026
5201
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
5027
5202
  </xsl:if>
5028
- <xsl:attribute name="text-align">
5029
- <xsl:choose>
5030
- <xsl:when test="@align">
5031
- <xsl:value-of select="@align"/>
5032
- </xsl:when>
5033
- <xsl:otherwise>left</xsl:otherwise>
5034
- </xsl:choose>
5035
- </xsl:attribute>
5203
+ <xsl:call-template name="setTextAlignment">
5204
+ <xsl:with-param name="default">left</xsl:with-param>
5205
+ </xsl:call-template>
5206
+
5036
5207
  <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
5037
5208
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5038
5209
  </xsl:if>
5039
- <xsl:if test="@colspan">
5040
- <xsl:attribute name="number-columns-spanned">
5041
- <xsl:value-of select="@colspan"/>
5042
- </xsl:attribute>
5043
- </xsl:if>
5044
- <xsl:if test="@rowspan">
5045
- <xsl:attribute name="number-rows-spanned">
5046
- <xsl:value-of select="@rowspan"/>
5047
- </xsl:attribute>
5048
- </xsl:if>
5049
- <xsl:call-template name="display-align"/>
5050
5210
 
5051
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
5052
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
5053
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
5054
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
5055
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
5056
- </xsl:if>
5057
- </xsl:if> -->
5058
- <!-- 2nd line and below -->
5211
+ <xsl:call-template name="setTableCellAttributes"/>
5059
5212
 
5060
5213
  <fo:block>
5061
5214
  <xsl:apply-templates/>
@@ -5069,15 +5222,15 @@
5069
5222
  <xsl:apply-templates/>
5070
5223
  </fo:block>
5071
5224
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
5072
- <fo:block> <!-- margin-bottom="10pt" -->
5225
+ <fo:block>
5073
5226
  <xsl:apply-templates/>
5074
5227
  </fo:block>
5075
5228
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
5076
5229
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
5077
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5078
- <xsl:apply-templates/>
5230
+ <xsl:apply-templates select="*[local-name()='name']"/>
5231
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5079
5232
  </fo:block>
5080
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
5233
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
5081
5234
  <xsl:if test="normalize-space() != ''">
5082
5235
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
5083
5236
  <xsl:apply-templates/>
@@ -5101,42 +5254,46 @@
5101
5254
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5102
5255
 
5103
5256
 
5104
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5105
-
5106
- <xsl:variable name="element">
5107
- block
5108
-
5109
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
5257
+ <xsl:variable name="fo_element">
5258
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
5259
+ block
5110
5260
  </xsl:variable>
5111
5261
 
5262
+ <!-- display 'EXAMPLE' -->
5263
+ <xsl:apply-templates select="*[local-name()='name']">
5264
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5265
+ </xsl:apply-templates>
5266
+
5112
5267
  <xsl:choose>
5113
- <xsl:when test="contains(normalize-space($element), 'block')">
5114
- <fo:block xsl:use-attribute-sets="example-body-style">
5115
- <xsl:apply-templates/>
5116
- </fo:block>
5268
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5269
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
5270
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5271
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5272
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5273
+ </xsl:apply-templates>
5274
+ </fo:block-container>
5275
+ </fo:block-container>
5117
5276
  </xsl:when>
5118
5277
  <xsl:otherwise>
5119
5278
  <fo:inline>
5120
- <xsl:apply-templates/>
5279
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5280
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5281
+ </xsl:apply-templates>
5121
5282
  </fo:inline>
5122
5283
  </xsl:otherwise>
5123
5284
  </xsl:choose>
5124
5285
 
5125
5286
  </fo:block>
5126
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
5127
-
5128
- <xsl:variable name="element">
5129
- block
5130
-
5131
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
5132
- </xsl:variable>
5287
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
5288
+ <xsl:param name="fo_element">block</xsl:param>
5289
+
5133
5290
  <xsl:choose>
5134
5291
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
5135
5292
  <fo:inline>
5136
5293
  <xsl:apply-templates/>
5137
5294
  </fo:inline>
5138
5295
  </xsl:when>
5139
- <xsl:when test="contains(normalize-space($element), 'block')">
5296
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5140
5297
  <fo:block xsl:use-attribute-sets="example-name-style">
5141
5298
  <xsl:apply-templates/>
5142
5299
  </fo:block>
@@ -5149,14 +5306,15 @@
5149
5306
  </xsl:choose>
5150
5307
 
5151
5308
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5309
+ <xsl:param name="fo_element">block</xsl:param>
5310
+
5152
5311
  <xsl:variable name="num"><xsl:number/></xsl:variable>
5153
5312
  <xsl:variable name="element">
5154
- block
5155
-
5156
5313
 
5314
+ <xsl:value-of select="$fo_element"/>
5157
5315
  </xsl:variable>
5158
5316
  <xsl:choose>
5159
- <xsl:when test="normalize-space($element) = 'block'">
5317
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
5160
5318
  <fo:block xsl:use-attribute-sets="example-p-style">
5161
5319
 
5162
5320
  <xsl:apply-templates/>
@@ -5171,6 +5329,8 @@
5171
5329
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
5172
5330
  <fo:block xsl:use-attribute-sets="termsource-style">
5173
5331
 
5332
+
5333
+
5174
5334
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5175
5335
  <xsl:variable name="termsource_text">
5176
5336
  <xsl:apply-templates/>
@@ -5208,9 +5368,7 @@
5208
5368
  <xsl:value-of select="."/>
5209
5369
  </xsl:if>
5210
5370
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
5211
- <fo:inline>
5212
-
5213
-
5371
+ <fo:inline xsl:use-attribute-sets="termsource-text-style">
5214
5372
  <xsl:value-of select="."/>
5215
5373
  </fo:inline>
5216
5374
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
@@ -5224,12 +5382,9 @@
5224
5382
  </fo:basic-link>
5225
5383
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
5226
5384
  <xsl:variable name="title-modified">
5227
-
5228
-
5229
- <xsl:call-template name="getTitle">
5230
- <xsl:with-param name="name" select="'title-modified'"/>
5231
- </xsl:call-template>
5232
-
5385
+ <xsl:call-template name="getLocalizedString">
5386
+ <xsl:with-param name="key">modified</xsl:with-param>
5387
+ </xsl:call-template>
5233
5388
  </xsl:variable>
5234
5389
 
5235
5390
  <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
@@ -5256,7 +5411,6 @@
5256
5411
  <fo:block-container margin-left="0mm">
5257
5412
 
5258
5413
  <fo:block xsl:use-attribute-sets="quote-style">
5259
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5260
5414
 
5261
5415
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5262
5416
  </fo:block>
@@ -5299,15 +5453,13 @@
5299
5453
  </xsl:variable>
5300
5454
 
5301
5455
  <xsl:choose>
5302
- <xsl:when test="normalize-space($bibitemid) != ''">
5456
+ <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
5303
5457
  <fo:inline xsl:use-attribute-sets="eref-style">
5304
5458
  <xsl:if test="@type = 'footnote'">
5305
-
5306
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5307
- <xsl:attribute name="font-size">80%</xsl:attribute>
5308
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5309
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5310
-
5459
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5460
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5461
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5462
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5311
5463
 
5312
5464
  </xsl:if>
5313
5465
 
@@ -5327,7 +5479,6 @@
5327
5479
 
5328
5480
 
5329
5481
 
5330
-
5331
5482
  </xsl:if>
5332
5483
 
5333
5484
 
@@ -5389,8 +5540,6 @@
5389
5540
  </xsl:choose>
5390
5541
  </xsl:variable>
5391
5542
 
5392
- <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
5393
-
5394
5543
  <xsl:choose>
5395
5544
  <xsl:when test="$lang = 'zh'">
5396
5545
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -5425,12 +5574,9 @@
5425
5574
  </fo:block>
5426
5575
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5427
5576
  <xsl:variable name="title-deprecated">
5428
-
5429
- <xsl:call-template name="getLocalizedString">
5430
- <xsl:with-param name="key">deprecated</xsl:with-param>
5431
- </xsl:call-template>
5432
-
5433
-
5577
+ <xsl:call-template name="getLocalizedString">
5578
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5579
+ </xsl:call-template>
5434
5580
  </xsl:variable>
5435
5581
  <fo:block xsl:use-attribute-sets="deprecates-style">
5436
5582
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5439,6 +5585,8 @@
5439
5585
  <xsl:if test="*[local-name() = 'strong']">
5440
5586
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5441
5587
  </xsl:if>
5588
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
5589
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
5442
5590
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5443
5591
  <fo:block xsl:use-attribute-sets="definition-style">
5444
5592
  <xsl:apply-templates/>
@@ -5447,7 +5595,6 @@
5447
5595
  <xsl:apply-templates/>
5448
5596
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5449
5597
  <fo:inline> <xsl:apply-templates/></fo:inline>
5450
- <!-- <fo:block>&#xA0;</fo:block> -->
5451
5598
  <fo:block/>
5452
5599
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5453
5600
 
@@ -5488,11 +5635,6 @@
5488
5635
  <xsl:apply-templates/>
5489
5636
  </fo:block>
5490
5637
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
5491
- <fo:block id="{@id}">
5492
- <xsl:apply-templates/>
5493
- </fo:block>
5494
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5495
-
5496
5638
  <fo:block id="{@id}">
5497
5639
  <xsl:apply-templates/>
5498
5640
  </fo:block>
@@ -5509,6 +5651,51 @@
5509
5651
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
5510
5652
  <!-- 0xA0 to space replacement -->
5511
5653
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5654
+ </xsl:template><xsl:variable name="ul_labels_">
5655
+
5656
+
5657
+
5658
+
5659
+
5660
+
5661
+
5662
+
5663
+
5664
+
5665
+
5666
+
5667
+
5668
+
5669
+ <label>—</label> <!-- em dash -->
5670
+
5671
+
5672
+
5673
+
5674
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
5675
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5676
+ <xsl:variable name="list_level">
5677
+ <xsl:choose>
5678
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
5679
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
5680
+ </xsl:choose>
5681
+ </xsl:variable>
5682
+ <xsl:choose>
5683
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
5684
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
5685
+ </xsl:when>
5686
+ <xsl:when test="$list_level mod 3 = 0">
5687
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
5688
+ </xsl:when>
5689
+ <xsl:when test="$list_level mod 2 = 0">
5690
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
5691
+ </xsl:when>
5692
+ <xsl:otherwise>
5693
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
5694
+ </xsl:otherwise>
5695
+ </xsl:choose>
5696
+ </xsl:template><xsl:template match="label" mode="ul_labels">
5697
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
5698
+ <xsl:value-of select="."/>
5512
5699
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5513
5700
  <xsl:choose>
5514
5701
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -5715,160 +5902,218 @@
5715
5902
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
5716
5903
  <fo:block><xsl:apply-templates/></fo:block>
5717
5904
  </fo:table-cell>
5718
- </xsl:template><xsl:template name="processBibitem">
5905
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/><xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
5719
5906
 
5720
5907
 
5721
5908
 
5909
+ <fo:block id="{@id}">
5910
+ <xsl:apply-templates/>
5911
+ </fo:block>
5912
+ </xsl:template><xsl:template match="*[local-name() = 'references']">
5913
+ <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
5914
+
5915
+ <fo:block break-after="page"/>
5916
+
5917
+ </xsl:if>
5918
+
5919
+ <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
5920
+ <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'">
5921
+ <fo:block break-after="page"/>
5922
+ </xsl:if>
5923
+ </xsl:if> -->
5924
+
5925
+ <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
5926
+ <xsl:apply-templates/>
5927
+ </fo:block>
5928
+
5929
+
5930
+
5931
+
5932
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']">
5933
+ <xsl:call-template name="bibitem"/>
5934
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
5935
+
5936
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
5937
+ <xsl:call-template name="processBibitem"/>
5938
+ </fo:block>
5939
+
5940
+
5941
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
5942
+
5943
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
5944
+ $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
5945
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
5946
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
5947
+ <fo:list-item>
5948
+ <fo:list-item-label end-indent="label-end()">
5949
+ <fo:block>
5950
+ <fo:inline>
5951
+
5952
+ <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
5953
+ <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
5954
+ <xsl:number format="[1]"/>
5955
+ </xsl:if>
5956
+
5957
+ </fo:inline>
5958
+ </fo:block>
5959
+ </fo:list-item-label>
5960
+ <fo:list-item-body start-indent="body-start()">
5961
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
5962
+ <xsl:call-template name="processBibitem"/>
5963
+ </fo:block>
5964
+ </fo:list-item-body>
5965
+ </fo:list-item>
5966
+ </fo:list-block>
5967
+
5968
+
5969
+ </xsl:template><xsl:template name="processBibitem">
5970
+
5722
5971
 
5723
- <!-- start OGC bibtem processing -->
5724
- <xsl:choose>
5725
- <xsl:when test="*[local-name() = 'formattedref']">
5726
- <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
5727
- </xsl:when>
5728
- <xsl:otherwise>
5729
- <xsl:variable name="personalAuthors">
5730
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
5731
- <xsl:call-template name="processPersonalAuthor"/>
5732
- </xsl:for-each>
5733
- <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
5734
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
5972
+ <!-- start OGC bibitem processing -->
5973
+ <xsl:if test=".//ogc:fn">
5974
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
5975
+ </xsl:if>
5976
+ <xsl:choose>
5977
+ <xsl:when test="*[local-name() = 'formattedref']">
5978
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
5979
+ </xsl:when>
5980
+ <xsl:otherwise>
5981
+ <xsl:variable name="personalAuthors">
5982
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
5735
5983
  <xsl:call-template name="processPersonalAuthor"/>
5736
5984
  </xsl:for-each>
5737
- </xsl:if>
5738
- </xsl:variable>
5739
-
5740
- <xsl:variable name="city" select="*[local-name() = 'place']"/>
5741
- <xsl:variable name="year">
5985
+ <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
5986
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
5987
+ <xsl:call-template name="processPersonalAuthor"/>
5988
+ </xsl:for-each>
5989
+ </xsl:if>
5990
+ </xsl:variable>
5991
+
5992
+ <xsl:variable name="city" select="*[local-name() = 'place']"/>
5993
+ <xsl:variable name="year">
5994
+ <xsl:choose>
5995
+ <xsl:when test="*[local-name() = 'date'][@type = 'published']">
5996
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
5997
+ <xsl:call-template name="renderDate"/>
5998
+ </xsl:for-each>
5999
+ </xsl:when>
6000
+ <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
6001
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
6002
+ <xsl:call-template name="renderDate"/>
6003
+ </xsl:for-each>
6004
+ </xsl:when>
6005
+ <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
6006
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
6007
+ <xsl:call-template name="renderDate"/>
6008
+ </xsl:for-each>
6009
+ </xsl:when>
6010
+ <xsl:otherwise>
6011
+ <xsl:for-each select="*[local-name() = 'date']">
6012
+ <xsl:call-template name="renderDate"/>
6013
+ </xsl:for-each>
6014
+ </xsl:otherwise>
6015
+ </xsl:choose>
6016
+ </xsl:variable>
6017
+
6018
+ <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
6019
+
6020
+
6021
+ <!-- citation structure:
6022
+ {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
6023
+ -->
6024
+
6025
+ <!-- Author(s) -->
5742
6026
  <xsl:choose>
5743
- <xsl:when test="*[local-name() = 'date'][@type = 'published']">
5744
- <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
5745
- <xsl:call-template name="renderDate"/>
5746
- </xsl:for-each>
6027
+ <xsl:when test="xalan:nodeset($personalAuthors)//author">
6028
+ <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
6029
+ <xsl:apply-templates/>
6030
+ <xsl:if test="position() != last()">, </xsl:if>
6031
+ </xsl:for-each>
6032
+ <xsl:text>: </xsl:text>
6033
+ </xsl:when>
6034
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
6035
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
6036
+ <xsl:value-of select="."/>
6037
+ <xsl:if test="position() != last()">/</xsl:if>
6038
+ </xsl:for-each>
6039
+ <xsl:text>: </xsl:text>
5747
6040
  </xsl:when>
5748
- <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
5749
- <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
5750
- <xsl:call-template name="renderDate"/>
6041
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
6042
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
6043
+ <xsl:value-of select="."/>
6044
+ <xsl:if test="position() != last()">, </xsl:if>
5751
6045
  </xsl:for-each>
6046
+ <xsl:text>: </xsl:text>
5752
6047
  </xsl:when>
5753
- <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
5754
- <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
5755
- <xsl:call-template name="renderDate"/>
5756
- </xsl:for-each>
6048
+ </xsl:choose>
6049
+
6050
+
6051
+ <xsl:variable name="document_identifier">
6052
+ <xsl:call-template name="processBibitemDocId"/>
6053
+ </xsl:variable>
6054
+
6055
+ <xsl:value-of select="$document_identifier"/>
6056
+
6057
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
6058
+
6059
+ <xsl:variable name="isDraft">
6060
+ <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
6061
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if>
6062
+ </xsl:variable>
6063
+
6064
+ <xsl:if test="$isDraft = 'true'">
6065
+ <xsl:text> (Draft)</xsl:text>
6066
+ </xsl:if>
6067
+
6068
+ <xsl:text>, </xsl:text>
6069
+
6070
+ <xsl:choose>
6071
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
6072
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
5757
6073
  </xsl:when>
5758
6074
  <xsl:otherwise>
5759
- <xsl:for-each select="*[local-name() = 'date']">
5760
- <xsl:call-template name="renderDate"/>
5761
- </xsl:for-each>
6075
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
5762
6076
  </xsl:otherwise>
5763
6077
  </xsl:choose>
5764
- </xsl:variable>
5765
-
5766
- <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
5767
-
5768
-
5769
- <!-- citation structure:
5770
- {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
5771
- -->
5772
-
5773
- <!-- Author(s) -->
5774
- <xsl:choose>
5775
- <xsl:when test="xalan:nodeset($personalAuthors)//author">
5776
- <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
5777
- <xsl:apply-templates/>
5778
- <xsl:if test="position() != last()">, </xsl:if>
5779
- </xsl:for-each>
5780
- <xsl:text>: </xsl:text>
5781
- </xsl:when>
5782
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
5783
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
5784
- <xsl:value-of select="."/>
5785
- <xsl:if test="position() != last()">/</xsl:if>
5786
- </xsl:for-each>
5787
- <xsl:text>: </xsl:text>
5788
- </xsl:when>
5789
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
6078
+
6079
+ <xsl:text>. </xsl:text>
6080
+
6081
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
5790
6082
  <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
5791
6083
  <xsl:value-of select="."/>
5792
6084
  <xsl:if test="position() != last()">, </xsl:if>
5793
6085
  </xsl:for-each>
5794
- <xsl:text>: </xsl:text>
5795
- </xsl:when>
5796
- </xsl:choose>
5797
-
5798
-
5799
- <xsl:variable name="document_identifier">
5800
- <xsl:call-template name="processBibitemDocId"/>
5801
- </xsl:variable>
5802
-
5803
- <xsl:value-of select="$document_identifier"/>
5804
-
5805
- <xsl:apply-templates select="*[local-name() = 'note']"/>
5806
-
5807
- <xsl:variable name="isDraft">
5808
- <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
5809
- <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if>
5810
- </xsl:variable>
5811
-
5812
- <xsl:if test="$isDraft = 'true'">
5813
- <xsl:text> (Draft)</xsl:text>
5814
- </xsl:if>
5815
-
5816
- <xsl:text>, </xsl:text>
5817
-
5818
- <xsl:choose>
5819
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
5820
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
5821
- </xsl:when>
5822
- <xsl:otherwise>
5823
- <xsl:apply-templates select="*[local-name() = 'title']"/>
5824
- </xsl:otherwise>
5825
- </xsl:choose>
5826
-
5827
- <xsl:text>. </xsl:text>
5828
-
5829
- <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
5830
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
5831
- <xsl:value-of select="."/>
5832
- <xsl:if test="position() != last()">, </xsl:if>
5833
- </xsl:for-each>
5834
- <xsl:if test="normalize-space($city) != ''">, </xsl:if>
5835
- </xsl:if>
5836
-
5837
- <xsl:value-of select="$city"/>
5838
-
5839
- <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''">
5840
- <xsl:text> </xsl:text>
5841
- </xsl:if>
5842
-
5843
- <xsl:if test="normalize-space($year) != ''">
5844
- <xsl:text>(</xsl:text>
5845
- <xsl:value-of select="$year"/>
5846
- <xsl:text>). </xsl:text>
5847
- </xsl:if>
5848
-
5849
- <xsl:if test="normalize-space($uri) != ''">
5850
- <fo:inline>
5851
-
6086
+ <xsl:if test="normalize-space($city) != ''">, </xsl:if>
6087
+ </xsl:if>
6088
+
6089
+ <xsl:value-of select="$city"/>
6090
+
6091
+ <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''">
5852
6092
  <xsl:text> </xsl:text>
5853
- <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
5854
- <xsl:value-of select="$uri"/>
5855
- </fo:basic-link>
5856
- </fo:inline>
5857
- </xsl:if>
5858
-
5859
- </xsl:otherwise>
5860
- </xsl:choose>
5861
- <!-- end OGC bibitem processing-->
5862
-
5863
-
5864
-
5865
-
5866
-
5867
-
5868
-
5869
-
6093
+ </xsl:if>
6094
+
6095
+ <xsl:if test="normalize-space($year) != ''">
6096
+ <xsl:text>(</xsl:text>
6097
+ <xsl:value-of select="$year"/>
6098
+ <xsl:text>). </xsl:text>
6099
+ </xsl:if>
6100
+
6101
+ <xsl:if test="normalize-space($uri) != ''">
6102
+ <fo:inline>
6103
+
6104
+ <xsl:text> </xsl:text>
6105
+ <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
6106
+ <xsl:value-of select="$uri"/>
6107
+ </fo:basic-link>
6108
+ </fo:inline>
6109
+ </xsl:if>
6110
+
6111
+ </xsl:otherwise>
6112
+ </xsl:choose>
6113
+ <!-- end OGC bibitem processing-->
6114
+
5870
6115
  </xsl:template><xsl:template name="processBibitemDocId">
5871
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
6116
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5872
6117
  <xsl:choose>
5873
6118
  <xsl:when test="normalize-space($_doc_ident) != ''">
5874
6119
  <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -5882,7 +6127,7 @@
5882
6127
  <xsl:if test="$type != ''">
5883
6128
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5884
6129
  </xsl:if> -->
5885
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
6130
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
5886
6131
  </xsl:otherwise>
5887
6132
  </xsl:choose>
5888
6133
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -5923,6 +6168,55 @@
5923
6168
  <xsl:value-of select="substring(.,1,1)"/>
5924
6169
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5925
6170
  <fo:inline><xsl:apply-templates/></fo:inline>
6171
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
6172
+ <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
6173
+ <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
6174
+ <xsl:apply-templates/>
6175
+ </fo:inline>
6176
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
6177
+ <fo:footnote>
6178
+ <xsl:variable name="number">
6179
+
6180
+ <xsl:choose>
6181
+ <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
6182
+ <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
6183
+ </xsl:when>
6184
+ <xsl:otherwise>
6185
+ <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
6186
+ </xsl:otherwise>
6187
+ </xsl:choose>
6188
+
6189
+ </xsl:variable>
6190
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
6191
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
6192
+ <xsl:value-of select="$number"/>
6193
+
6194
+ </fo:basic-link>
6195
+ </fo:inline>
6196
+ <fo:footnote-body>
6197
+ <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
6198
+ <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
6199
+ <xsl:value-of select="$number"/>
6200
+
6201
+ </fo:inline>
6202
+ <xsl:apply-templates/>
6203
+ </fo:block>
6204
+ </fo:footnote-body>
6205
+ </fo:footnote>
6206
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
6207
+ <xsl:text> edition </xsl:text>
6208
+ <xsl:value-of select="."/>
6209
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
6210
+ <xsl:text> (</xsl:text>
6211
+ <fo:inline xsl:use-attribute-sets="link-style">
6212
+ <fo:basic-link external-destination="." fox:alt-text=".">
6213
+ <xsl:value-of select="."/>
6214
+ </fo:basic-link>
6215
+ </fo:inline>
6216
+ <xsl:text>)</xsl:text>
6217
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']">
6218
+
6219
+ <xsl:apply-templates/>
5926
6220
  </xsl:template><xsl:template match="*[local-name() = 'form']">
5927
6221
  <fo:block>
5928
6222
  <xsl:apply-templates/>
@@ -5988,27 +6282,14 @@
5988
6282
  <fo:block> </fo:block>
5989
6283
  </fo:block-container>
5990
6284
  </xsl:template><xsl:variable name="toc_level">
6285
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
6286
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
6287
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
5991
6288
  <xsl:choose>
5992
- <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
6289
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
6290
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
5993
6291
  <xsl:otherwise><!-- default value -->
5994
-
5995
-
5996
-
5997
-
5998
-
5999
-
6000
-
6001
-
6002
-
6003
-
6004
-
6005
-
6006
-
6007
-
6008
6292
  3
6009
-
6010
-
6011
-
6012
6293
  </xsl:otherwise>
6013
6294
  </xsl:choose>
6014
6295
  </xsl:variable><xsl:template match="*[local-name() = 'toc']">
@@ -6091,7 +6372,7 @@
6091
6372
  </td>
6092
6373
  </xsl:for-each>
6093
6374
  <td>333</td> <!-- page number, just for fill -->
6094
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6375
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6095
6376
  <fo:inline padding-right="5mm"> </fo:inline>
6096
6377
  <fo:inline><xsl:apply-templates/></fo:inline>
6097
6378
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -6102,6 +6383,66 @@
6102
6383
  </svg>
6103
6384
  </fo:instream-foreign-object>
6104
6385
  </fo:inline>
6386
+ </xsl:template><xsl:template match="@language">
6387
+ <xsl:copy-of select="."/>
6388
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
6389
+ <xsl:call-template name="title"/>
6390
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']">
6391
+
6392
+
6393
+
6394
+
6395
+
6396
+ <!-- text in the box -->
6397
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
6398
+
6399
+
6400
+
6401
+
6402
+
6403
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style">
6404
+
6405
+
6406
+ <fo:block xsl:use-attribute-sets="admonition-name-style">
6407
+ <xsl:call-template name="displayAdmonitionName"/>
6408
+ </fo:block>
6409
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
6410
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6411
+ </fo:block>
6412
+
6413
+ </fo:block-container>
6414
+
6415
+ </fo:block-container>
6416
+
6417
+ </xsl:template><xsl:template name="displayAdmonitionName">
6418
+
6419
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6420
+ <xsl:if test="not(*[local-name() = 'name'])">
6421
+ <xsl:apply-templates select="@type"/>
6422
+ </xsl:if>
6423
+
6424
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
6425
+ <xsl:apply-templates/>
6426
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
6427
+ <xsl:variable name="admonition_type_">
6428
+ <xsl:call-template name="getLocalizedString">
6429
+ <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
6430
+ </xsl:call-template>
6431
+ </xsl:variable>
6432
+ <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
6433
+ <xsl:value-of select="$admonition_type"/>
6434
+ <xsl:if test="$admonition_type = ''">
6435
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
6436
+ </xsl:if>
6437
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
6438
+
6439
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
6440
+
6441
+
6442
+
6443
+ <xsl:apply-templates/>
6444
+ </fo:block>
6445
+
6105
6446
  </xsl:template><xsl:template name="convertDate">
6106
6447
  <xsl:param name="date"/>
6107
6448
  <xsl:param name="format" select="'short'"/>
@@ -6109,83 +6450,80 @@
6109
6450
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
6110
6451
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
6111
6452
  <xsl:variable name="monthStr">
6112
- <xsl:choose>
6113
- <xsl:when test="$month = '01'">January</xsl:when>
6114
- <xsl:when test="$month = '02'">February</xsl:when>
6115
- <xsl:when test="$month = '03'">March</xsl:when>
6116
- <xsl:when test="$month = '04'">April</xsl:when>
6117
- <xsl:when test="$month = '05'">May</xsl:when>
6118
- <xsl:when test="$month = '06'">June</xsl:when>
6119
- <xsl:when test="$month = '07'">July</xsl:when>
6120
- <xsl:when test="$month = '08'">August</xsl:when>
6121
- <xsl:when test="$month = '09'">September</xsl:when>
6122
- <xsl:when test="$month = '10'">October</xsl:when>
6123
- <xsl:when test="$month = '11'">November</xsl:when>
6124
- <xsl:when test="$month = '12'">December</xsl:when>
6125
- </xsl:choose>
6453
+ <xsl:call-template name="getMonthByNum">
6454
+ <xsl:with-param name="num" select="$month"/>
6455
+ <xsl:with-param name="lowercase" select="'true'"/>
6456
+ </xsl:call-template>
6457
+ </xsl:variable>
6458
+ <xsl:variable name="monthStr_localized">
6459
+ <xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if>
6126
6460
  </xsl:variable>
6127
6461
  <xsl:variable name="result">
6128
6462
  <xsl:choose>
6129
- <xsl:when test="$format = 'ddMMyyyy'">
6463
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
6130
6464
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6131
6465
  <xsl:text> </xsl:text>
6132
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6466
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
6133
6467
  </xsl:when>
6134
6468
  <xsl:when test="$format = 'ddMM'">
6135
6469
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6136
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6470
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/>
6137
6471
  </xsl:when>
6138
6472
  <xsl:when test="$format = 'short' or $day = ''">
6139
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
6473
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
6140
6474
  </xsl:when>
6141
6475
  <xsl:otherwise>
6142
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
6476
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
6143
6477
  </xsl:otherwise>
6144
6478
  </xsl:choose>
6145
6479
  </xsl:variable>
6146
6480
  <xsl:value-of select="$result"/>
6147
- </xsl:template><xsl:template name="convertDateLocalized">
6148
- <xsl:param name="date"/>
6149
- <xsl:param name="format" select="'short'"/>
6150
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
6151
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
6152
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
6153
- <xsl:variable name="monthStr">
6154
- <xsl:choose>
6155
- <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
6156
- <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
6157
- <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
6158
- <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
6159
- <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
6160
- <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
6161
- <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
6162
- <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
6163
- <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
6164
- <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
6165
- <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
6166
- <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
6167
- </xsl:choose>
6168
- </xsl:variable>
6169
- <xsl:variable name="result">
6481
+ </xsl:template><xsl:template name="getMonthByNum">
6482
+ <xsl:param name="num"/>
6483
+ <xsl:param name="lang">en</xsl:param>
6484
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
6485
+ <xsl:variable name="monthStr_">
6170
6486
  <xsl:choose>
6171
- <xsl:when test="$format = 'ddMMyyyy'">
6172
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6173
- <xsl:text> </xsl:text>
6174
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6175
- </xsl:when>
6176
- <xsl:when test="$format = 'ddMM'">
6177
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6178
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6179
- </xsl:when>
6180
- <xsl:when test="$format = 'short' or $day = ''">
6181
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
6487
+ <xsl:when test="$lang = 'fr'">
6488
+ <xsl:choose>
6489
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
6490
+ <xsl:when test="$num = '02'">Février</xsl:when>
6491
+ <xsl:when test="$num = '03'">Mars</xsl:when>
6492
+ <xsl:when test="$num = '04'">Avril</xsl:when>
6493
+ <xsl:when test="$num = '05'">Mai</xsl:when>
6494
+ <xsl:when test="$num = '06'">Juin</xsl:when>
6495
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
6496
+ <xsl:when test="$num = '08'">Août</xsl:when>
6497
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
6498
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
6499
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
6500
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
6501
+ </xsl:choose>
6182
6502
  </xsl:when>
6183
6503
  <xsl:otherwise>
6184
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
6504
+ <xsl:choose>
6505
+ <xsl:when test="$num = '01'">January</xsl:when>
6506
+ <xsl:when test="$num = '02'">February</xsl:when>
6507
+ <xsl:when test="$num = '03'">March</xsl:when>
6508
+ <xsl:when test="$num = '04'">April</xsl:when>
6509
+ <xsl:when test="$num = '05'">May</xsl:when>
6510
+ <xsl:when test="$num = '06'">June</xsl:when>
6511
+ <xsl:when test="$num = '07'">July</xsl:when>
6512
+ <xsl:when test="$num = '08'">August</xsl:when>
6513
+ <xsl:when test="$num = '09'">September</xsl:when>
6514
+ <xsl:when test="$num = '10'">October</xsl:when>
6515
+ <xsl:when test="$num = '11'">November</xsl:when>
6516
+ <xsl:when test="$num = '12'">December</xsl:when>
6517
+ </xsl:choose>
6185
6518
  </xsl:otherwise>
6186
6519
  </xsl:choose>
6187
6520
  </xsl:variable>
6188
- <xsl:value-of select="$result"/>
6521
+ <xsl:choose>
6522
+ <xsl:when test="normalize-space($lowercase) = 'true'">
6523
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
6524
+ </xsl:when>
6525
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
6526
+ </xsl:choose>
6189
6527
  </xsl:template><xsl:template name="insertKeywords">
6190
6528
  <xsl:param name="sorting" select="'true'"/>
6191
6529
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -6233,14 +6571,9 @@
6233
6571
  <dc:title>
6234
6572
  <xsl:variable name="title">
6235
6573
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6236
-
6237
-
6238
-
6239
-
6240
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
6241
-
6242
-
6243
6574
 
6575
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
6576
+
6244
6577
  </xsl:for-each>
6245
6578
  </xsl:variable>
6246
6579
  <xsl:choose>
@@ -6255,21 +6588,18 @@
6255
6588
  <dc:creator>
6256
6589
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6257
6590
 
6258
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6259
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6260
- <xsl:if test="position() != last()">; </xsl:if>
6261
- </xsl:for-each>
6262
-
6263
-
6264
-
6591
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6592
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6593
+ <xsl:if test="position() != last()">; </xsl:if>
6594
+ </xsl:for-each>
6595
+
6265
6596
  </xsl:for-each>
6266
6597
  </dc:creator>
6267
6598
  <dc:description>
6268
6599
  <xsl:variable name="abstract">
6269
6600
 
6270
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
6271
-
6272
-
6601
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
6602
+
6273
6603
  </xsl:variable>
6274
6604
  <xsl:value-of select="normalize-space($abstract)"/>
6275
6605
  </dc:description>
@@ -6289,7 +6619,6 @@
6289
6619
  <xsl:value-of select="../@id"/>
6290
6620
  </xsl:when>
6291
6621
  <xsl:otherwise>
6292
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
6293
6622
  <xsl:value-of select="concat(generate-id(..), '_', text())"/>
6294
6623
  </xsl:otherwise>
6295
6624
  </xsl:choose>
@@ -6315,9 +6644,6 @@
6315
6644
  <xsl:when test="ancestor::*[local-name() = 'preface']">
6316
6645
  <xsl:value-of select="$level_total - 2"/>
6317
6646
  </xsl:when>
6318
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
6319
- <xsl:value-of select="$level_total - 1"/>
6320
- </xsl:when> -->
6321
6647
  <xsl:when test="ancestor::*[local-name() = 'sections']">
6322
6648
  <xsl:value-of select="$level_total - 1"/>
6323
6649
  </xsl:when>
@@ -6459,9 +6785,15 @@
6459
6785
  </xsl:template><xsl:template name="getLocalizedString">
6460
6786
  <xsl:param name="key"/>
6461
6787
  <xsl:param name="formatted">false</xsl:param>
6788
+ <xsl:param name="lang"/>
6462
6789
 
6463
6790
  <xsl:variable name="curr_lang">
6464
- <xsl:call-template name="getLang"/>
6791
+ <xsl:choose>
6792
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
6793
+ <xsl:otherwise>
6794
+ <xsl:call-template name="getLang"/>
6795
+ </xsl:otherwise>
6796
+ </xsl:choose>
6465
6797
  </xsl:variable>
6466
6798
 
6467
6799
  <xsl:variable name="data_value">
@@ -6501,7 +6833,6 @@
6501
6833
  <xsl:value-of select="$key_"/>
6502
6834
  </xsl:otherwise>
6503
6835
  </xsl:choose>
6504
-
6505
6836
  </xsl:template><xsl:template name="setTrackChangesStyles">
6506
6837
  <xsl:param name="isAdded"/>
6507
6838
  <xsl:param name="isDeleted"/>
@@ -6524,7 +6855,6 @@
6524
6855
  <xsl:if test="local-name() = 'table'">
6525
6856
  <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
6526
6857
  </xsl:if>
6527
- <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
6528
6858
  <xsl:attribute name="padding">2mm</xsl:attribute>
6529
6859
  </xsl:if>
6530
6860
  </xsl:otherwise>
@@ -6544,15 +6874,18 @@
6544
6874
  </xsl:choose>
6545
6875
  </xsl:template><xsl:template name="setTextAlignment">
6546
6876
  <xsl:param name="default">left</xsl:param>
6877
+ <xsl:variable name="align" select="normalize-space(@align)"/>
6547
6878
  <xsl:attribute name="text-align">
6548
6879
  <xsl:choose>
6549
- <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
6880
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
6881
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
6882
+ <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
6550
6883
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
6551
6884
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
6552
6885
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
6553
6886
  </xsl:choose>
6554
6887
  </xsl:attribute>
6555
- <xsl:if test="@align = 'indent'">
6888
+ <xsl:if test="$align = 'indent'">
6556
6889
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
6557
6890
  </xsl:if>
6558
6891
  </xsl:template><xsl:template name="number-to-words">
@@ -6651,6 +6984,25 @@
6651
6984
  </xsl:otherwise>
6652
6985
  </xsl:choose>
6653
6986
  </xsl:if>
6987
+ </xsl:template><xsl:template name="number-to-ordinal">
6988
+ <xsl:param name="number"/>
6989
+ <xsl:param name="curr_lang"/>
6990
+ <xsl:choose>
6991
+ <xsl:when test="$curr_lang = 'fr'">
6992
+ <xsl:choose>
6993
+ <xsl:when test="$number = '1'">re</xsl:when>
6994
+ <xsl:otherwise>e</xsl:otherwise>
6995
+ </xsl:choose>
6996
+ </xsl:when>
6997
+ <xsl:otherwise>
6998
+ <xsl:choose>
6999
+ <xsl:when test="$number = 1">st</xsl:when>
7000
+ <xsl:when test="$number = 2">nd</xsl:when>
7001
+ <xsl:when test="$number = 3">rd</xsl:when>
7002
+ <xsl:otherwise>th</xsl:otherwise>
7003
+ </xsl:choose>
7004
+ </xsl:otherwise>
7005
+ </xsl:choose>
6654
7006
  </xsl:template><xsl:template name="setAltText">
6655
7007
  <xsl:param name="value"/>
6656
7008
  <xsl:attribute name="fox:alt-text">