metanorma-cc 1.8.3 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,8 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
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
+
10
12
  <xsl:variable name="pageWidth" select="210"/>
11
13
  <xsl:variable name="pageHeight" select="297"/>
12
14
  <xsl:variable name="marginLeftRight1" select="19"/>
@@ -44,7 +46,7 @@
44
46
 
45
47
  <xsl:template match="/">
46
48
  <xsl:call-template name="namespaceCheck"/>
47
- <fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
49
+ <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
48
50
  <fo:layout-master-set>
49
51
  <!-- Cover page -->
50
52
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -315,10 +317,7 @@
315
317
  <!-- ============================= -->
316
318
  <!-- CONTENTS -->
317
319
  <!-- ============================= -->
318
- <xsl:template match="node()" mode="contents">
319
- <xsl:apply-templates mode="contents"/>
320
- </xsl:template>
321
-
320
+
322
321
  <!-- element with title -->
323
322
  <xsl:template match="*[csd:title]" mode="contents">
324
323
  <xsl:variable name="level">
@@ -329,7 +328,7 @@
329
328
 
330
329
  <xsl:variable name="display">
331
330
  <xsl:choose>
332
- <xsl:when test="$level &gt; 2">false</xsl:when>
331
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
333
332
  <xsl:otherwise>true</xsl:otherwise>
334
333
  </xsl:choose>
335
334
  </xsl:variable>
@@ -417,7 +416,7 @@
417
416
 
418
417
 
419
418
 
420
- <xsl:template match="csd:title">
419
+ <xsl:template match="csd:title" name="title">
421
420
 
422
421
  <xsl:variable name="level">
423
422
  <xsl:call-template name="getLevel"/>
@@ -500,99 +499,12 @@
500
499
  </xsl:if>
501
500
  </xsl:template>
502
501
 
503
- <!--
504
- <fn reference="1">
505
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
506
- </fn>
507
- -->
508
- <xsl:template match="csd:p/csd:fn">
509
- <fo:footnote>
510
- <xsl:variable name="number">
511
- <xsl:number level="any" count="csd:p/csd:fn"/>
512
- </xsl:variable>
513
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
514
- <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}">
515
- <!-- <xsl:value-of select="@reference"/> -->
516
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
517
- </fo:basic-link>
518
- </fo:inline>
519
- <fo:footnote-body>
520
- <fo:block font-size="10pt" margin-bottom="12pt">
521
- <fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
522
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
523
- </fo:inline>
524
- <xsl:for-each select="csd:p">
525
- <xsl:apply-templates/>
526
- </xsl:for-each>
527
- </fo:block>
528
- </fo:footnote-body>
529
- </fo:footnote>
530
- </xsl:template>
531
-
502
+
532
503
  <xsl:template match="csd:p/csd:fn/csd:p">
533
504
  <xsl:apply-templates/>
534
505
  </xsl:template>
535
506
 
536
507
 
537
- <xsl:template match="csd:bibitem">
538
- <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
539
- <xsl:if test=".//csd:fn">
540
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
541
- </xsl:if>
542
- <!-- csd:docidentifier -->
543
- <xsl:if test="csd:docidentifier">
544
- <xsl:choose>
545
- <xsl:when test="csd:docidentifier/@type = 'metanorma'"/>
546
- <xsl:otherwise>
547
- <xsl:value-of select="csd:docidentifier"/>
548
- </xsl:otherwise>
549
- </xsl:choose>
550
- </xsl:if>
551
- <xsl:apply-templates select="csd:note"/>
552
- <xsl:if test="csd:docidentifier">, </xsl:if>
553
- <fo:inline font-style="italic">
554
- <xsl:choose>
555
- <xsl:when test="csd:title[@type = 'main' and @language = 'en']">
556
- <xsl:value-of select="csd:title[@type = 'main' and @language = 'en']"/>
557
- </xsl:when>
558
- <xsl:otherwise>
559
- <xsl:value-of select="csd:title"/>
560
- </xsl:otherwise>
561
- </xsl:choose>
562
- </fo:inline>
563
- </fo:block>
564
- </xsl:template>
565
-
566
-
567
- <xsl:template match="csd:bibitem/csd:note" priority="2">
568
- <fo:footnote>
569
- <xsl:variable name="number">
570
- <xsl:choose>
571
- <xsl:when test="ancestor::csd:references[preceding-sibling::csd:references]">
572
- <xsl:number level="any" count="csd:references[preceding-sibling::csd:references]//csd:bibitem/csd:note"/>
573
- </xsl:when>
574
- <xsl:otherwise>
575
- <xsl:number level="any" count="csd:bibitem/csd:note"/>
576
- </xsl:otherwise>
577
- </xsl:choose>
578
- </xsl:variable>
579
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
580
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
581
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
582
- </fo:basic-link>
583
- </fo:inline>
584
- <fo:footnote-body>
585
- <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt">
586
- <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" -->
587
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
588
- </fo:inline>
589
- <xsl:apply-templates/>
590
- </fo:block>
591
- </fo:footnote-body>
592
- </fo:footnote>
593
- </xsl:template>
594
-
595
-
596
508
 
597
509
  <xsl:template match="csd:ul | csd:ol" mode="ul_ol">
598
510
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt">
@@ -608,7 +520,9 @@
608
520
  <fo:list-item-label end-indent="label-end()">
609
521
  <fo:block>
610
522
  <xsl:choose>
611
- <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash -->
523
+ <xsl:when test="local-name(..) = 'ul'">
524
+ <xsl:call-template name="setULLabel"/>
525
+ </xsl:when>
612
526
  <xsl:otherwise> <!-- for ordered lists -->
613
527
  <xsl:choose>
614
528
  <xsl:when test="../@type = 'arabic'">
@@ -649,7 +563,7 @@
649
563
  </xsl:variable>
650
564
  <fo:block font-size="{$font-size}" line-height="1.1" role="H{$levelTerm}">
651
565
  <fo:block font-weight="bold" keep-with-next="always">
652
- <xsl:apply-templates select="ancestor::csd:term[1]/csd:name" mode="presentation"/>
566
+ <xsl:apply-templates select="ancestor::csd:term[1]/csd:name"/>
653
567
  </fo:block>
654
568
  <fo:block font-weight="bold" keep-with-next="always">
655
569
  <xsl:call-template name="setStyle_preferred"/>
@@ -659,62 +573,6 @@
659
573
  </xsl:template>
660
574
 
661
575
 
662
-
663
-
664
- <!-- <xsl:template match="csd:references[@id = '_bibliography']"> -->
665
- <xsl:template match="csd:references[not(@normative='true')]">
666
- <fo:block break-after="page"/>
667
- <fo:block id="{@id}">
668
- <xsl:apply-templates/>
669
- </fo:block>
670
- </xsl:template>
671
-
672
-
673
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
674
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem"> -->
675
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem">
676
- <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
677
- <fo:list-item>
678
- <fo:list-item-label end-indent="label-end()">
679
- <fo:block>
680
- <fo:inline id="{@id}">
681
- <xsl:number format="[1]"/>
682
- </fo:inline>
683
- </fo:block>
684
- </fo:list-item-label>
685
- <fo:list-item-body start-indent="body-start()">
686
- <fo:block>
687
- <xsl:if test="csd:docidentifier">
688
- <xsl:choose>
689
- <xsl:when test="csd:docidentifier/@type = 'metanorma'"/>
690
- <xsl:otherwise><fo:inline><xsl:value-of select="csd:docidentifier"/><xsl:apply-templates select="csd:note"/>, </fo:inline></xsl:otherwise>
691
- </xsl:choose>
692
-
693
- </xsl:if>
694
- <xsl:choose>
695
- <xsl:when test="csd:title[@type = 'main' and @language = 'en']">
696
- <xsl:apply-templates select="csd:title[@type = 'main' and @language = 'en']"/>
697
- </xsl:when>
698
- <xsl:otherwise>
699
- <xsl:apply-templates select="csd:title"/>
700
- </xsl:otherwise>
701
- </xsl:choose>
702
- <xsl:apply-templates select="csd:formattedref"/>
703
- </fo:block>
704
- </fo:list-item-body>
705
- </fo:list-item>
706
- </fo:list-block>
707
- </xsl:template>
708
-
709
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem" mode="contents"/> -->
710
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem" mode="contents"/>
711
-
712
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem/csd:title"> -->
713
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem/csd:title">
714
- <fo:inline font-style="italic">
715
- <xsl:apply-templates/>
716
- </fo:inline>
717
- </xsl:template>
718
576
 
719
577
 
720
578
  <xsl:template match="csd:xref" priority="2">
@@ -728,17 +586,6 @@
728
586
  </xsl:template>
729
587
 
730
588
 
731
-
732
- <xsl:template match="csd:admonition">
733
- <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
734
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
735
- <xsl:text> — </xsl:text>
736
- <xsl:apply-templates/>
737
- </fo:block>
738
- </xsl:template>
739
-
740
-
741
-
742
589
  <xsl:template match="csd:formula/csd:stem">
743
590
  <fo:block margin-top="6pt" margin-bottom="12pt">
744
591
  <fo:table table-layout="fixed" width="100%">
@@ -753,7 +600,7 @@
753
600
  </fo:table-cell>
754
601
  <fo:table-cell display-align="center">
755
602
  <fo:block text-align="right">
756
- <xsl:apply-templates select="../csd:name" mode="presentation"/>
603
+ <xsl:apply-templates select="../csd:name" mode="formula_number"/>
757
604
  </fo:block>
758
605
  </fo:table-cell>
759
606
  </fo:table-row>
@@ -818,29 +665,19 @@
818
665
  </xsl:template>
819
666
 
820
667
 
821
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
822
-
823
- <title-annex lang="en">Annex </title-annex>
824
- <title-annex lang="fr">Annexe </title-annex>
825
-
826
- <title-annex lang="zh">Annex </title-annex>
827
-
828
-
668
+ <xsl:variable name="titles_">
829
669
 
830
670
  <title-edition lang="en">
831
671
 
832
- <xsl:text>Edition </xsl:text>
833
-
834
-
672
+ <xsl:text>Edition </xsl:text>
673
+
835
674
  </title-edition>
836
675
 
837
676
  <title-edition lang="fr">
838
-
839
- <xsl:text>Édition </xsl:text>
840
-
677
+ <xsl:text>Édition </xsl:text>
841
678
  </title-edition>
842
679
 
843
-
680
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
844
681
  <title-toc lang="en">
845
682
 
846
683
  <xsl:text>Contents</xsl:text>
@@ -849,24 +686,13 @@
849
686
 
850
687
  </title-toc>
851
688
  <title-toc lang="fr">
689
+ <xsl:text>Sommaire</xsl:text>
690
+ </title-toc>
691
+ <title-toc lang="zh">
852
692
 
853
- <xsl:text>Sommaire</xsl:text>
854
-
855
-
856
- </title-toc>
857
-
858
- <title-toc lang="zh">Contents</title-toc>
859
-
860
-
861
-
862
- <title-page lang="en">Page</title-page>
863
- <title-page lang="fr">Page</title-page>
864
-
865
- <title-key lang="en">Key</title-key>
866
- <title-key lang="fr">Légende</title-key>
867
-
868
- <title-where lang="en">where</title-where>
869
- <title-where lang="fr">où</title-where>
693
+ <xsl:text>Contents</xsl:text>
694
+
695
+ </title-toc>
870
696
 
871
697
  <title-descriptors lang="en">Descriptors</title-descriptors>
872
698
 
@@ -882,32 +708,9 @@
882
708
  </title-part>
883
709
  <title-part lang="zh">第 # 部分:</title-part>
884
710
 
885
- <title-subpart lang="en">
886
-
887
- </title-subpart>
888
- <title-subpart lang="fr">
889
-
890
- </title-subpart>
891
-
892
- <title-modified lang="en">modified</title-modified>
893
- <title-modified lang="fr">modifiée</title-modified>
894
-
895
- <title-modified lang="zh">modified</title-modified>
896
-
897
-
898
-
899
- <title-source lang="en">
900
-
901
- <xsl:text>SOURCE</xsl:text>
902
-
903
-
904
- </title-source>
711
+ <title-subpart lang="en">Sub-part #</title-subpart>
712
+ <title-subpart lang="fr">Partie de sub #</title-subpart>
905
713
 
906
- <title-keywords lang="en">Keywords</title-keywords>
907
-
908
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
909
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
910
-
911
714
  <title-list-tables lang="en">List of Tables</title-list-tables>
912
715
 
913
716
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -916,41 +719,12 @@
916
719
 
917
720
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
918
721
 
919
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
920
-
921
- <title-abstract lang="en">Abstract</title-abstract>
922
-
923
722
  <title-summary lang="en">Summary</title-summary>
924
723
 
925
- <title-in lang="en">in </title-in>
926
-
927
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
928
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
929
-
930
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
931
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
932
-
933
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
934
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
935
-
936
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
937
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
938
-
939
- <title-obligation-normative lang="en">normative</title-obligation-normative>
940
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
941
-
942
- <title-caution lang="en">CAUTION</title-caution>
943
- <title-caution lang="zh">注意</title-caution>
944
-
945
- <title-warning lang="en">WARNING</title-warning>
946
- <title-warning lang="zh">警告</title-warning>
947
-
948
- <title-amendment lang="en">AMENDMENT</title-amendment>
949
-
950
724
  <title-continued lang="en">(continued)</title-continued>
951
725
  <title-continued lang="fr">(continué)</title-continued>
952
726
 
953
- </xsl:variable><xsl:variable name="bibdata">
727
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
954
728
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
955
729
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
956
730
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
@@ -979,6 +753,23 @@
979
753
  </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">
980
754
 
981
755
 
756
+
757
+
758
+ <xsl:attribute name="font-family">Source Sans Pro, STIX Two Math, Source Han Sans</xsl:attribute>
759
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
982
773
  </xsl:attribute-set><xsl:attribute-set name="link-style">
983
774
 
984
775
 
@@ -988,6 +779,9 @@
988
779
 
989
780
 
990
781
 
782
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
783
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
784
+
991
785
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
992
786
  <xsl:attribute name="white-space">pre</xsl:attribute>
993
787
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1001,10 +795,17 @@
1001
795
 
1002
796
 
1003
797
 
798
+
799
+
800
+
801
+
802
+
1004
803
 
1005
804
 
1006
805
 
1007
806
 
807
+
808
+
1008
809
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1009
810
 
1010
811
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1058,18 +859,20 @@
1058
859
 
1059
860
 
1060
861
 
862
+
1061
863
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1062
864
 
1063
865
 
1064
866
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1065
867
 
1066
868
 
869
+
1067
870
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
871
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1068
872
 
1069
873
 
1070
874
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1071
875
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1072
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1073
876
 
1074
877
 
1075
878
 
@@ -1103,6 +906,7 @@
1103
906
 
1104
907
 
1105
908
 
909
+
1106
910
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1107
911
 
1108
912
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -1113,109 +917,107 @@
1113
917
 
1114
918
  </xsl:attribute-set><xsl:variable name="table-border_">
1115
919
 
1116
- </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1117
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1118
-
920
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
921
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
922
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1119
923
 
1120
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1121
- <xsl:attribute name="text-align">center</xsl:attribute>
1122
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1123
924
 
1124
925
 
1125
926
 
1126
927
 
1127
-
928
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1128
929
 
1129
930
 
1130
931
 
1131
-
1132
932
 
1133
933
 
1134
934
 
1135
935
 
1136
- </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1137
936
 
1138
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1139
-
1140
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1141
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1142
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1143
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1144
937
 
1145
938
 
1146
939
 
1147
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1148
940
 
1149
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1150
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
1151
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1152
941
 
1153
942
 
943
+
1154
944
 
1155
- </xsl:attribute-set><xsl:attribute-set name="xref-style">
1156
945
 
946
+ </xsl:attribute-set><xsl:attribute-set name="table-style">
947
+ <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
948
+ <xsl:attribute name="table-layout">fixed</xsl:attribute>
949
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
950
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1157
951
 
1158
952
 
1159
953
 
1160
954
 
1161
- </xsl:attribute-set><xsl:attribute-set name="eref-style">
1162
955
 
956
+
1163
957
 
1164
958
 
1165
- <xsl:attribute name="color">blue</xsl:attribute>
1166
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1167
959
 
1168
960
 
1169
961
 
1170
962
 
1171
- </xsl:attribute-set><xsl:attribute-set name="note-style">
1172
963
 
1173
964
 
1174
965
 
1175
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1176
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1177
966
 
1178
967
 
1179
-
1180
968
 
1181
969
 
1182
970
 
1183
971
 
1184
972
 
973
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
974
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
975
+
1185
976
 
977
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
978
+ <xsl:attribute name="text-align">center</xsl:attribute>
979
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1186
980
 
1187
981
 
1188
982
 
1189
983
 
984
+
1190
985
 
1191
- </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1192
986
 
1193
987
 
988
+
1194
989
 
1195
- <xsl:attribute name="padding-right">6mm</xsl:attribute>
1196
990
 
1197
991
 
1198
992
 
993
+ </xsl:attribute-set><xsl:attribute-set name="table-row-style">
994
+ <xsl:attribute name="min-height">4mm</xsl:attribute>
1199
995
 
1200
996
 
1201
997
 
1202
998
 
999
+ </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
1000
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1203
1001
 
1204
1002
 
1205
1003
 
1206
1004
 
1207
- </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1208
1005
 
1209
1006
 
1210
1007
 
1008
+
1211
1009
 
1212
- </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1010
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1213
1011
 
1214
-
1215
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1216
1012
 
1217
1013
 
1218
-
1014
+ </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1015
+
1016
+ </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style">
1017
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1018
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1019
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1020
+ <xsl:attribute name="display-align">center</xsl:attribute>
1219
1021
 
1220
1022
 
1221
1023
 
@@ -1225,183 +1027,629 @@
1225
1027
 
1226
1028
 
1227
1029
 
1228
- </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1229
1030
 
1230
1031
 
1231
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1232
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1233
1032
 
1234
1033
 
1034
+ </xsl:attribute-set><xsl:attribute-set name="table-cell-style">
1035
+ <xsl:attribute name="display-align">center</xsl:attribute>
1036
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1037
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1235
1038
 
1236
1039
 
1237
1040
 
1238
1041
 
1239
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1240
1042
 
1241
-
1242
1043
 
1243
1044
 
1244
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1245
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
1246
1045
 
1247
1046
 
1248
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1249
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
1250
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
1251
1047
 
1252
1048
 
1253
1049
 
1254
1050
 
1051
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1052
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1053
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
1054
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1055
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1255
1056
 
1256
1057
 
1257
- </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1258
1058
 
1259
1059
 
1260
- <xsl:attribute name="text-align">right</xsl:attribute>
1261
-
1262
-
1263
- </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1264
1060
 
1265
1061
 
1266
1062
 
1267
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1268
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1063
+
1269
1064
 
1270
1065
 
1271
1066
 
1067
+ </xsl:attribute-set><xsl:attribute-set name="table-note-style">
1068
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1069
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1272
1070
 
1273
1071
 
1274
- </xsl:attribute-set><xsl:attribute-set name="origin-style">
1275
1072
 
1276
1073
 
1277
1074
 
1278
1075
 
1279
- </xsl:attribute-set><xsl:attribute-set name="term-style">
1280
1076
 
1281
- </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1282
1077
 
1078
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
1079
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1283
1080
 
1284
-
1285
1081
 
1286
1082
 
1287
1083
 
1288
-
1289
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1290
- <xsl:attribute name="text-align">center</xsl:attribute>
1291
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1292
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1293
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1294
1084
 
1295
1085
 
1086
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
1087
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1088
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1296
1089
 
1090
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1297
1091
 
1298
1092
 
1299
1093
 
1300
1094
 
1301
1095
 
1302
1096
 
1303
-
1304
1097
 
1305
1098
 
1306
1099
 
1307
-
1308
- </xsl:attribute-set><xsl:attribute-set name="formula-style">
1309
1100
 
1310
- </xsl:attribute-set><xsl:attribute-set name="image-style">
1311
- <xsl:attribute name="text-align">center</xsl:attribute>
1312
1101
 
1313
1102
 
1103
+ </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
1104
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1105
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1314
1106
 
1315
1107
 
1108
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style">
1316
1109
 
1110
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style">
1111
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1112
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1113
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1317
1114
 
1318
- </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1115
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style">
1116
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1117
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1118
+
1119
+ </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1120
+
1121
+
1122
+ </xsl:attribute-set><xsl:attribute-set name="dt-style">
1123
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1124
+
1125
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1137
+
1138
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1139
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1140
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1141
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1142
+
1143
+
1144
+
1145
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1146
+
1147
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1148
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1149
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1150
+
1151
+
1152
+
1153
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1160
+
1161
+
1162
+
1163
+ <xsl:attribute name="color">blue</xsl:attribute>
1164
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1165
+
1166
+
1167
+
1168
+
1169
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1170
+
1171
+
1172
+
1173
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1174
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+ </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1190
+
1191
+
1192
+
1193
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
1194
+
1195
+
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1206
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
1207
+
1208
+
1209
+
1210
+
1211
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1212
+
1213
+
1214
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1228
+
1229
+
1230
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1231
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1232
+
1233
+
1234
+
1235
+
1236
+
1237
+
1238
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1239
+
1240
+
1241
+
1242
+
1243
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1244
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1245
+
1246
+
1247
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1248
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1249
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1250
+
1251
+
1252
+
1253
+
1254
+
1255
+
1256
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1257
+
1258
+
1259
+ <xsl:attribute name="text-align">right</xsl:attribute>
1260
+
1261
+
1262
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1263
+
1264
+
1265
+
1266
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1267
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+ </xsl:attribute-set><xsl:attribute-set name="termsource-text-style">
1274
+
1275
+
1276
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1277
+
1278
+
1279
+
1280
+
1281
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1282
+
1283
+ </xsl:attribute-set><xsl:attribute-set name="figure-style">
1284
+
1285
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1294
+ <xsl:attribute name="text-align">center</xsl:attribute>
1295
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1296
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1297
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1313
+
1314
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1315
+ <xsl:attribute name="text-align">center</xsl:attribute>
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1319
1323
 
1320
1324
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1321
1325
 
1322
1326
 
1323
- <xsl:attribute name="width">100%</xsl:attribute>
1324
- <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1325
- <xsl:attribute name="scaling">uniform</xsl:attribute>
1327
+ <xsl:attribute name="width">100%</xsl:attribute>
1328
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1329
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1336
+
1337
+ <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
1338
+
1339
+
1340
+
1341
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1342
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1343
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1344
+ <xsl:attribute name="text-align">center</xsl:attribute>
1345
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1346
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1347
+
1348
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1349
+
1350
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1351
+
1352
+
1353
+
1354
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1355
+
1356
+
1357
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1358
+
1359
+
1360
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1361
+
1362
+
1363
+ </xsl:attribute-set><xsl:variable name="color-added-text">
1364
+ <xsl:text>rgb(0, 255, 0)</xsl:text>
1365
+ </xsl:variable><xsl:attribute-set name="add-style">
1366
+ <xsl:attribute name="color">red</xsl:attribute>
1367
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1368
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1369
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1370
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1371
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1372
+ </xsl:attribute-set><xsl:variable name="color-deleted-text">
1373
+ <xsl:text>red</xsl:text>
1374
+ </xsl:variable><xsl:attribute-set name="del-style">
1375
+ <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
1376
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1377
+ </xsl:attribute-set><xsl:attribute-set name="mathml-style">
1378
+ <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1379
+
1380
+
1381
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1382
+
1383
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1384
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1385
+ </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
1386
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1387
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
1397
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1398
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
1399
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1400
+
1401
+
1402
+
1403
+
1404
+ <xsl:attribute name="font-size">65%</xsl:attribute>
1405
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
1420
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1421
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1422
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1423
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1424
+
1425
+
1426
+
1427
+
1428
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1429
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1446
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1447
+
1448
+
1449
+
1450
+
1451
+ <xsl:attribute name="font-size">60%</xsl:attribute>
1452
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+ </xsl:attribute-set><xsl:attribute-set name="admonition-style">
1468
+
1469
+
1470
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1471
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+ </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
1486
+
1487
+
1488
+
1489
+
1490
+
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+ </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
1497
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+ </xsl:attribute-set><xsl:attribute-set name="admonition-p-style">
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1326
1520
 
1327
1521
 
1328
1522
 
1329
-
1330
-
1331
- </xsl:attribute-set><xsl:attribute-set name="tt-style">
1523
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
1332
1524
 
1333
- <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
1334
1525
 
1335
1526
 
1336
1527
 
1337
- </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1338
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1339
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1340
- <xsl:attribute name="text-align">center</xsl:attribute>
1528
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style">
1545
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1341
1546
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1342
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1343
1547
 
1344
- </xsl:attribute-set><xsl:attribute-set name="domain-style">
1345
-
1346
- </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1548
+
1549
+
1347
1550
 
1348
1551
 
1349
1552
 
1350
- </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1351
1553
 
1352
1554
 
1353
- </xsl:attribute-set><xsl:attribute-set name="definition-style">
1354
1555
 
1355
1556
 
1356
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1357
1557
 
1358
1558
 
1359
- </xsl:attribute-set><xsl:variable name="color-added-text">
1360
- <xsl:text>rgb(0, 255, 0)</xsl:text>
1361
- </xsl:variable><xsl:attribute-set name="add-style">
1362
- <xsl:attribute name="color">red</xsl:attribute>
1363
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1364
- <!-- <xsl:attribute name="color">black</xsl:attribute>
1365
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1366
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
1367
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1368
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
1369
- <xsl:text>red</xsl:text>
1370
- </xsl:variable><xsl:attribute-set name="del-style">
1371
- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
1372
- <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1373
- </xsl:attribute-set><xsl:attribute-set name="mathml-style">
1374
- <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1375
1559
 
1560
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
1376
1561
 
1377
- </xsl:attribute-set><xsl:attribute-set name="list-style">
1378
1562
 
1379
- </xsl:attribute-set><xsl:attribute-set name="toc-style">
1380
- <xsl:attribute name="line-height">135%</xsl:attribute>
1381
- </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">
1382
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1383
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1384
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1385
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1386
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1387
- </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1563
+
1564
+
1565
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style">
1566
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1567
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1568
+
1569
+
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
1582
+
1583
+
1584
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
1585
+
1586
+
1587
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
1588
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1589
+ <xsl:attribute name="font-size">65%</xsl:attribute>
1590
+
1591
+
1592
+
1593
+
1594
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
1609
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1610
+
1611
+
1612
+
1613
+
1614
+ <xsl:attribute name="font-size">60%</xsl:attribute>
1615
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+
1628
+
1629
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
1630
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1631
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1632
+ <xsl:attribute name="start-indent">0pt</xsl:attribute>
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+
1643
+
1644
+ </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
1645
+
1646
+
1647
+
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:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1388
1649
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1389
1650
  <xsl:sort select="@displayorder" data-type="number"/>
1390
1651
  <xsl:apply-templates select="." mode="contents"/>
1391
1652
  </xsl:for-each>
1392
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1393
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1394
-
1395
- <!-- Normative references -->
1396
- <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"/>
1397
- <!-- Terms and definitions -->
1398
- <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"/>
1399
- <!-- Another main sections -->
1400
- <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"/>
1401
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1402
- <!-- Bibliography -->
1403
- <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"/>
1404
-
1405
1653
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1406
1654
 
1407
1655
  <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']]">
@@ -1418,29 +1666,11 @@
1418
1666
  <xsl:sort select="@displayorder" data-type="number"/>
1419
1667
  <xsl:apply-templates select="." mode="contents"/>
1420
1668
  </xsl:for-each>
1421
- </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1422
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1423
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1424
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1425
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1426
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1427
1669
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1428
1670
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1429
1671
  <xsl:sort select="@displayorder" data-type="number"/>
1430
1672
  <xsl:apply-templates select="."/>
1431
1673
  </xsl:for-each>
1432
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1433
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1434
-
1435
- <!-- Normative references -->
1436
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1437
- <!-- Terms and definitions -->
1438
- <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']]"/>
1439
- <!-- Another main sections -->
1440
- <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'])]"/>
1441
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1442
- <!-- Bibliography -->
1443
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1444
1674
  </xsl:template><xsl:template name="processMainSectionsDefault">
1445
1675
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1446
1676
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -1477,43 +1707,19 @@
1477
1707
  <xsl:call-template name="getSimpleTable"/>
1478
1708
  </xsl:variable>
1479
1709
 
1480
- <!-- <xsl:if test="$namespace = 'bipm'">
1481
- <fo:block>&#xA0;</fo:block>
1482
- </xsl:if> -->
1483
-
1484
1710
 
1485
1711
  <!-- Display table's name before table as standalone block -->
1486
1712
  <!-- $namespace = 'iso' or -->
1487
1713
 
1488
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1489
-
1490
-
1491
-
1492
-
1714
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table -->
1715
+
1493
1716
 
1494
- <xsl:call-template name="fn_name_display"/>
1495
1717
 
1718
+ <xsl:call-template name="table_name_fn_display"/>
1496
1719
 
1497
1720
 
1498
1721
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
1499
1722
 
1500
- <!-- <xsl:variable name="cols-count">
1501
- <xsl:choose>
1502
- <xsl:when test="*[local-name()='thead']">
1503
- <xsl:call-template name="calculate-columns-numbers">
1504
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1505
- </xsl:call-template>
1506
- </xsl:when>
1507
- <xsl:otherwise>
1508
- <xsl:call-template name="calculate-columns-numbers">
1509
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1510
- </xsl:call-template>
1511
- </xsl:otherwise>
1512
- </xsl:choose>
1513
- </xsl:variable> -->
1514
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1515
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1516
-
1517
1723
  <xsl:variable name="colwidths">
1518
1724
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1519
1725
  <xsl:call-template name="calculate-column-widths">
@@ -1524,17 +1730,8 @@
1524
1730
  </xsl:variable>
1525
1731
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1526
1732
 
1527
- <!-- <xsl:variable name="colwidths2">
1528
- <xsl:call-template name="calculate-column-widths">
1529
- <xsl:with-param name="cols-count" select="$cols-count"/>
1530
- </xsl:call-template>
1531
- </xsl:variable> -->
1532
-
1533
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1534
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1535
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1536
1733
 
1537
- <xsl:variable name="margin-left">
1734
+ <xsl:variable name="margin-side">
1538
1735
  <xsl:choose>
1539
1736
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1540
1737
  <xsl:otherwise>0</xsl:otherwise>
@@ -1542,65 +1739,67 @@
1542
1739
  </xsl:variable>
1543
1740
 
1544
1741
 
1545
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1546
-
1547
-
1548
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1549
-
1550
-
1551
-
1552
-
1553
-
1742
+ <fo:block-container xsl:use-attribute-sets="table-container-style">
1743
+
1554
1744
 
1745
+ <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
1746
+ <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
1555
1747
 
1556
-
1748
+
1557
1749
 
1750
+
1558
1751
 
1752
+
1559
1753
 
1560
1754
 
1561
1755
 
1756
+
1562
1757
 
1563
1758
 
1564
1759
 
1565
1760
 
1566
1761
 
1762
+ <!-- end table block-container attributes -->
1567
1763
 
1568
1764
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1569
1765
 
1570
1766
 
1767
+ <xsl:variable name="table_width_default">100%</xsl:variable>
1571
1768
  <xsl:variable name="table_width">
1572
1769
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1573
- 100%
1574
-
1575
-
1770
+ <xsl:value-of select="$table_width_default"/>
1576
1771
  </xsl:variable>
1577
1772
 
1773
+
1578
1774
  <xsl:variable name="table_attributes">
1579
- <attribute name="table-layout">fixed</attribute>
1580
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1581
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1582
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1583
-
1584
-
1585
-
1586
-
1587
-
1588
-
1589
-
1590
-
1591
-
1592
-
1593
-
1594
-
1595
-
1596
-
1775
+
1776
+ <xsl:element name="table_attributes" use-attribute-sets="table-style">
1777
+ <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
1778
+
1779
+
1780
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
1781
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
1782
+
1783
+
1784
+
1785
+
1786
+
1787
+
1788
+
1789
+
1790
+
1791
+
1792
+
1793
+
1794
+
1795
+ </xsl:element>
1597
1796
  </xsl:variable>
1598
1797
 
1599
1798
 
1600
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1799
+ <fo:table id="{@id}">
1601
1800
 
1602
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1603
- <xsl:attribute name="{@name}">
1801
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
1802
+ <xsl:attribute name="{local-name()}">
1604
1803
  <xsl:value-of select="."/>
1605
1804
  </xsl:attribute>
1606
1805
  </xsl:for-each>
@@ -1611,7 +1810,6 @@
1611
1810
  </xsl:if>
1612
1811
 
1613
1812
 
1614
-
1615
1813
  <xsl:choose>
1616
1814
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1617
1815
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1637,7 +1835,7 @@
1637
1835
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1638
1836
  </xsl:when>
1639
1837
  <xsl:otherwise>
1640
- <xsl:apply-templates/>
1838
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
1641
1839
  </xsl:otherwise>
1642
1840
  </xsl:choose>
1643
1841
 
@@ -1652,25 +1850,6 @@
1652
1850
  </xsl:call-template>
1653
1851
  </xsl:for-each>
1654
1852
 
1655
- <!-- insert footer as table -->
1656
- <!-- <fo:table>
1657
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1658
- <xsl:attribute name="{@name}">
1659
- <xsl:value-of select="."/>
1660
- </xsl:attribute>
1661
- </xsl:for-each>
1662
-
1663
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1664
- <xsl:choose>
1665
- <xsl:when test=". = 1 or . = 0">
1666
- <fo:table-column column-width="proportional-column-width(2)"/>
1667
- </xsl:when>
1668
- <xsl:otherwise>
1669
- <fo:table-column column-width="proportional-column-width({.})"/>
1670
- </xsl:otherwise>
1671
- </xsl:choose>
1672
- </xsl:for-each>
1673
- </fo:table>-->
1674
1853
 
1675
1854
 
1676
1855
 
@@ -1731,18 +1910,17 @@
1731
1910
  </xsl:otherwise>
1732
1911
  </xsl:choose>
1733
1912
 
1734
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1913
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
1735
1914
  <xsl:param name="continued"/>
1736
1915
  <xsl:if test="normalize-space() != ''">
1737
1916
  <fo:block xsl:use-attribute-sets="table-name-style">
1738
-
1917
+
1739
1918
 
1740
1919
 
1741
1920
 
1742
1921
 
1743
1922
  <xsl:choose>
1744
1923
  <xsl:when test="$continued = 'true'">
1745
- <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1746
1924
 
1747
1925
  </xsl:when>
1748
1926
  <xsl:otherwise>
@@ -1805,13 +1983,6 @@
1805
1983
  <xsl:for-each select="xalan:nodeset($table)/*/tr">
1806
1984
  <xsl:variable name="td_text">
1807
1985
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1808
-
1809
- <!-- <xsl:if test="$namespace = 'bipm'">
1810
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1811
- <word><xsl:value-of select="normalize-space(.)"/></word>
1812
- </xsl:for-each>
1813
- </xsl:if> -->
1814
-
1815
1986
  </xsl:variable>
1816
1987
  <xsl:variable name="words">
1817
1988
  <xsl:variable name="string_with_added_zerospaces">
@@ -1848,7 +2019,6 @@
1848
2019
  </xsl:otherwise>
1849
2020
  </xsl:choose>
1850
2021
  </xsl:variable>
1851
-
1852
2022
 
1853
2023
  <column>
1854
2024
  <xsl:for-each select="xalan:nodeset($widths)//width">
@@ -1884,7 +2054,6 @@
1884
2054
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1885
2055
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1886
2056
  <xsl:param name="cols-count"/>
1887
- <!-- font-weight="bold" -->
1888
2057
  <fo:table-header>
1889
2058
 
1890
2059
 
@@ -1896,85 +2065,26 @@
1896
2065
  <fo:table-row>
1897
2066
  <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">
1898
2067
 
1899
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2068
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
1900
2069
  <xsl:with-param name="continued">true</xsl:with-param>
1901
2070
  </xsl:apply-templates>
1902
2071
 
1903
2072
 
1904
2073
 
1905
-
1906
2074
  </fo:table-cell>
1907
- </fo:table-row>
1908
- </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1909
- <fo:table-body>
1910
- <xsl:apply-templates/>
1911
- </fo:table-body>
1912
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1913
- <xsl:apply-templates/>
1914
- </xsl:template><xsl:template name="insertTableFooter">
1915
- <xsl:param name="cols-count"/>
1916
- <xsl:if test="../*[local-name()='tfoot']">
1917
- <fo:table-footer>
1918
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1919
- </fo:table-footer>
1920
- </xsl:if>
1921
- </xsl:template><xsl:template name="insertTableFooter2">
1922
- <xsl:param name="cols-count"/>
1923
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1924
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
1925
-
1926
- <fo:table-footer>
1927
-
1928
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1929
-
1930
- <!-- if there are note(s) or fn(s) then create footer row -->
1931
- <xsl:if test="$isNoteOrFnExist = 'true'">
1932
-
1933
-
1934
-
1935
- <fo:table-row>
1936
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1937
-
1938
-
1939
-
1940
- <!-- fn will be processed inside 'note' processing -->
1941
-
1942
-
1943
-
1944
-
1945
-
1946
-
1947
- <!-- except gb -->
1948
-
1949
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1950
-
1951
-
1952
- <!-- show Note under table in preface (ex. abstract) sections -->
1953
- <!-- empty, because notes show at page side in main sections -->
1954
- <!-- <xsl:if test="$namespace = 'bipm'">
1955
- <xsl:choose>
1956
- <xsl:when test="ancestor::*[local-name()='preface']">
1957
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1958
- </xsl:when>
1959
- <xsl:otherwise>
1960
- <fo:block/>
1961
- </xsl:otherwise>
1962
- </xsl:choose>
1963
- </xsl:if> -->
1964
-
1965
-
1966
- <!-- horizontal row separator -->
1967
-
1968
-
1969
- <!-- fn processing -->
1970
- <xsl:call-template name="fn_display"/>
1971
-
1972
- </fo:table-cell>
1973
- </fo:table-row>
1974
-
1975
- </xsl:if>
2075
+ </fo:table-row>
2076
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2077
+ <fo:table-body>
2078
+ <xsl:apply-templates/>
2079
+ </fo:table-body>
2080
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2081
+ <xsl:apply-templates/>
2082
+ </xsl:template><xsl:template name="insertTableFooter">
2083
+ <xsl:param name="cols-count"/>
2084
+ <xsl:if test="../*[local-name()='tfoot']">
2085
+ <fo:table-footer>
2086
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1976
2087
  </fo:table-footer>
1977
-
1978
2088
  </xsl:if>
1979
2089
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1980
2090
  <xsl:param name="table_attributes"/>
@@ -2001,17 +2111,18 @@
2001
2111
  </xsl:variable>
2002
2112
 
2003
2113
  <fo:table keep-with-previous="always">
2004
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2114
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2115
+ <xsl:variable name="name" select="local-name()"/>
2005
2116
  <xsl:choose>
2006
- <xsl:when test="@name = 'border-top'">
2007
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2117
+ <xsl:when test="$name = 'border-top'">
2118
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
2008
2119
  </xsl:when>
2009
- <xsl:when test="@name = 'border'">
2010
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2120
+ <xsl:when test="$name = 'border'">
2121
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
2011
2122
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2012
2123
  </xsl:when>
2013
2124
  <xsl:otherwise>
2014
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2125
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
2015
2126
  </xsl:otherwise>
2016
2127
  </xsl:choose>
2017
2128
  </xsl:for-each>
@@ -2040,9 +2151,10 @@
2040
2151
 
2041
2152
  <fo:table-body>
2042
2153
  <fo:table-row>
2043
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2154
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
2044
2155
 
2045
2156
 
2157
+
2046
2158
 
2047
2159
 
2048
2160
  <!-- fn will be processed inside 'note' processing -->
@@ -2052,37 +2164,20 @@
2052
2164
 
2053
2165
 
2054
2166
 
2055
-
2056
-
2057
-
2058
2167
  <!-- for BSI (not PAS) display Notes before footnotes -->
2059
2168
 
2060
2169
 
2061
- <!-- except gb -->
2062
-
2063
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2170
+ <!-- except gb and bsi -->
2064
2171
 
2065
-
2066
- <!-- <xsl:if test="$namespace = 'bipm'">
2067
- <xsl:choose>
2068
- <xsl:when test="ancestor::*[local-name()='preface']">
2069
- show Note under table in preface (ex. abstract) sections
2070
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2071
- </xsl:when>
2072
- <xsl:otherwise>
2073
- empty, because notes show at page side in main sections
2074
- <fo:block/>
2075
- </xsl:otherwise>
2076
- </xsl:choose>
2077
- </xsl:if> -->
2172
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2173
+
2078
2174
 
2079
2175
 
2080
2176
  <!-- horizontal row separator -->
2081
2177
 
2082
2178
 
2083
2179
  <!-- fn processing -->
2084
- <xsl:call-template name="fn_display"/>
2085
-
2180
+ <xsl:call-template name="table_fn_display"/>
2086
2181
 
2087
2182
  <!-- for PAS display Notes after footnotes -->
2088
2183
 
@@ -2124,78 +2219,57 @@
2124
2219
 
2125
2220
 
2126
2221
  <xsl:apply-templates/>
2127
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2128
-
2222
+
2129
2223
  </fo:table-body>
2130
2224
 
2131
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2132
- <xsl:choose>
2133
- <xsl:when test="substring-after(., '—') != ''">
2134
- <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2135
- </xsl:when>
2136
- <xsl:otherwise>
2137
- <xsl:value-of select="."/>
2138
- </xsl:otherwise>
2139
- </xsl:choose>
2140
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2141
- <xsl:apply-templates mode="presentation_name"/>
2142
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2143
- <xsl:apply-templates select="."/>
2144
- </xsl:template><xsl:template match="*[local-name()='tr']">
2145
- <xsl:variable name="parent-name" select="local-name(..)"/>
2146
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2147
- <fo:table-row min-height="4mm">
2148
- <xsl:if test="$parent-name = 'thead'">
2149
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2150
-
2151
-
2152
-
2153
-
2154
-
2155
-
2156
-
2157
-
2158
- </xsl:if>
2159
- <xsl:if test="$parent-name = 'tfoot'">
2160
-
2161
-
2162
-
2163
- </xsl:if>
2164
-
2165
-
2166
-
2167
-
2168
-
2169
-
2170
-
2171
-
2172
-
2173
-
2174
- <!-- <xsl:if test="$namespace = 'bipm'">
2175
- <xsl:attribute name="height">8mm</xsl:attribute>
2176
- </xsl:if> -->
2177
-
2225
+ </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2226
+ <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2227
+
2228
+
2229
+
2230
+
2231
+
2232
+
2233
+
2234
+ <xsl:call-template name="setTableRowAttributes"/>
2235
+
2178
2236
  <xsl:apply-templates/>
2179
2237
  </fo:table-row>
2180
- </xsl:template><xsl:template match="*[local-name()='th']">
2181
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2182
- <xsl:attribute name="text-align">
2183
- <xsl:choose>
2184
- <xsl:when test="@align">
2185
- <xsl:call-template name="setAlignment"/>
2186
- <!-- <xsl:value-of select="@align"/> -->
2187
- </xsl:when>
2188
- <xsl:otherwise>center</xsl:otherwise>
2189
- </xsl:choose>
2190
- </xsl:attribute>
2191
-
2238
+ </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
2239
+ <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
2192
2240
 
2241
+ <xsl:call-template name="setTableRowAttributes"/>
2242
+ <xsl:apply-templates/>
2243
+ </fo:table-row>
2244
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2245
+ <fo:table-row xsl:use-attribute-sets="table-body-row-style">
2246
+
2193
2247
 
2248
+
2194
2249
 
2250
+
2251
+ <xsl:call-template name="setTableRowAttributes"/>
2252
+ <xsl:apply-templates/>
2253
+ </fo:table-row>
2254
+ </xsl:template><xsl:template name="setTableRowAttributes">
2255
+
2256
+
2257
+
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+ </xsl:template><xsl:template match="*[local-name()='th']">
2264
+ <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
2265
+ <xsl:call-template name="setTextAlignment">
2266
+ <xsl:with-param name="default">center</xsl:with-param>
2267
+ </xsl:call-template>
2195
2268
 
2196
2269
 
2197
2270
 
2198
2271
 
2272
+
2199
2273
 
2200
2274
 
2201
2275
 
@@ -2204,21 +2278,25 @@
2204
2278
  <xsl:if test="$lang = 'ar'">
2205
2279
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2206
2280
  </xsl:if>
2207
- <xsl:if test="@colspan">
2208
- <xsl:attribute name="number-columns-spanned">
2209
- <xsl:value-of select="@colspan"/>
2210
- </xsl:attribute>
2211
- </xsl:if>
2212
- <xsl:if test="@rowspan">
2213
- <xsl:attribute name="number-rows-spanned">
2214
- <xsl:value-of select="@rowspan"/>
2215
- </xsl:attribute>
2216
- </xsl:if>
2217
- <xsl:call-template name="display-align"/>
2281
+
2282
+ <xsl:call-template name="setTableCellAttributes"/>
2283
+
2218
2284
  <fo:block>
2219
2285
  <xsl:apply-templates/>
2220
2286
  </fo:block>
2221
2287
  </fo:table-cell>
2288
+ </xsl:template><xsl:template name="setTableCellAttributes">
2289
+ <xsl:if test="@colspan">
2290
+ <xsl:attribute name="number-columns-spanned">
2291
+ <xsl:value-of select="@colspan"/>
2292
+ </xsl:attribute>
2293
+ </xsl:if>
2294
+ <xsl:if test="@rowspan">
2295
+ <xsl:attribute name="number-rows-spanned">
2296
+ <xsl:value-of select="@rowspan"/>
2297
+ </xsl:attribute>
2298
+ </xsl:if>
2299
+ <xsl:call-template name="display-align"/>
2222
2300
  </xsl:template><xsl:template name="display-align">
2223
2301
  <xsl:if test="@valign">
2224
2302
  <xsl:attribute name="display-align">
@@ -2231,22 +2309,18 @@
2231
2309
  </xsl:attribute>
2232
2310
  </xsl:if>
2233
2311
  </xsl:template><xsl:template match="*[local-name()='td']">
2234
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2235
- <xsl:attribute name="text-align">
2236
- <xsl:choose>
2237
- <xsl:when test="@align">
2238
- <xsl:call-template name="setAlignment"/>
2239
- <!-- <xsl:value-of select="@align"/> -->
2240
- </xsl:when>
2241
- <xsl:otherwise>left</xsl:otherwise>
2242
- </xsl:choose>
2243
- </xsl:attribute>
2312
+ <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2313
+ <xsl:call-template name="setTextAlignment">
2314
+ <xsl:with-param name="default">left</xsl:with-param>
2315
+ </xsl:call-template>
2316
+
2244
2317
  <xsl:if test="$lang = 'ar'">
2245
2318
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2246
2319
  </xsl:if>
2247
2320
 
2248
2321
 
2249
2322
 
2323
+ <!-- bsi -->
2250
2324
 
2251
2325
 
2252
2326
 
@@ -2255,34 +2329,36 @@
2255
2329
 
2256
2330
 
2257
2331
 
2332
+
2333
+
2258
2334
 
2259
2335
 
2260
2336
 
2261
2337
 
2262
2338
 
2263
- <xsl:if test=".//*[local-name() = 'table']">
2339
+ <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
2264
2340
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2265
2341
  </xsl:if>
2266
- <xsl:if test="@colspan">
2267
- <xsl:attribute name="number-columns-spanned">
2268
- <xsl:value-of select="@colspan"/>
2269
- </xsl:attribute>
2270
- </xsl:if>
2271
- <xsl:if test="@rowspan">
2272
- <xsl:attribute name="number-rows-spanned">
2273
- <xsl:value-of select="@rowspan"/>
2274
- </xsl:attribute>
2275
- </xsl:if>
2276
- <xsl:call-template name="display-align"/>
2342
+
2343
+ <xsl:call-template name="setTableCellAttributes"/>
2344
+
2277
2345
  <fo:block>
2278
-
2346
+
2347
+
2348
+
2279
2349
  <xsl:apply-templates/>
2280
2350
  </fo:block>
2281
2351
  </fo:table-cell>
2282
2352
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2353
+
2354
+ <fo:block xsl:use-attribute-sets="table-note-style">
2355
+
2356
+
2357
+
2358
+
2283
2359
 
2284
-
2285
- <fo:block font-size="10pt" margin-bottom="12pt">
2360
+ <!-- Table's note name (NOTE, for example) -->
2361
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
2286
2362
 
2287
2363
 
2288
2364
 
@@ -2290,27 +2366,113 @@
2290
2366
 
2291
2367
 
2292
2368
 
2293
-
2294
- <!-- Table's note name (NOTE, for example) -->
2295
-
2296
- <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
2297
-
2298
-
2299
-
2300
-
2369
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
2301
2370
 
2302
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2303
-
2304
- </fo:inline>
2305
-
2306
-
2307
-
2308
- <xsl:apply-templates mode="process"/>
2309
- </fo:block>
2371
+ </fo:inline>
2372
+
2373
+
2374
+
2375
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
2376
+ </fo:block>
2310
2377
 
2311
2378
  </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">
2312
2379
  <xsl:apply-templates/>
2313
- </xsl:template><xsl:template name="fn_display">
2380
+ </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">
2381
+
2382
+ <!-- list of footnotes to calculate actual footnotes number -->
2383
+ <xsl:variable name="p_fn_">
2384
+ <xsl:choose>
2385
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2386
+ <fn gen_id="{generate-id(.)}">
2387
+ <xsl:copy-of select="@*"/>
2388
+ <xsl:copy-of select="node()"/>
2389
+ </fn>
2390
+ </xsl:when>
2391
+ <xsl:otherwise>
2392
+ <!-- itetation for:
2393
+ footnotes in bibdata/title
2394
+ footnotes in bibliography
2395
+ footnotes in document's body (except table's head/body/foot and figure text)
2396
+ -->
2397
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2398
+ <fn gen_id="{generate-id(.)}">
2399
+ <xsl:copy-of select="@*"/>
2400
+ <xsl:copy-of select="node()"/>
2401
+ </fn>
2402
+ </xsl:for-each>
2403
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
2404
+ <xsl:sort select="@displayorder" data-type="number"/>
2405
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2406
+ <!-- copy unique fn -->
2407
+ <fn gen_id="{generate-id(.)}">
2408
+ <xsl:copy-of select="@*"/>
2409
+ <xsl:copy-of select="node()"/>
2410
+ </fn>
2411
+ </xsl:for-each>
2412
+ </xsl:for-each>
2413
+ </xsl:otherwise>
2414
+ </xsl:choose>
2415
+ </xsl:variable>
2416
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2417
+
2418
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
2419
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2420
+ <xsl:variable name="reference" select="@reference"/>
2421
+ <!-- fn sequence number in document -->
2422
+ <xsl:variable name="current_fn_number">
2423
+ <xsl:choose>
2424
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
2425
+ <xsl:otherwise>
2426
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
2427
+ </xsl:otherwise>
2428
+ </xsl:choose>
2429
+ </xsl:variable>
2430
+ <xsl:variable name="current_fn_number_text">
2431
+ <xsl:value-of select="$current_fn_number"/>
2432
+
2433
+
2434
+ </xsl:variable>
2435
+
2436
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
2437
+ <xsl:variable name="footnote_inline">
2438
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
2439
+
2440
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
2441
+ <xsl:value-of select="$current_fn_number_text"/>
2442
+ </fo:basic-link>
2443
+ </fo:inline>
2444
+ </xsl:variable>
2445
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
2446
+ gen_id=<xsl:value-of select="$gen_id"/> -->
2447
+ <xsl:choose>
2448
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
2449
+ <xsl:copy-of select="$footnote_inline"/>
2450
+ </xsl:when>
2451
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
2452
+ <fo:footnote xsl:use-attribute-sets="fn-style">
2453
+ <xsl:copy-of select="$footnote_inline"/>
2454
+ <fo:footnote-body>
2455
+
2456
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
2457
+
2458
+ <fo:block xsl:use-attribute-sets="fn-body-style">
2459
+
2460
+
2461
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
2462
+
2463
+ <xsl:value-of select="$current_fn_number_text"/>
2464
+ </fo:inline>
2465
+ <xsl:apply-templates/>
2466
+ </fo:block>
2467
+ </fo:block-container>
2468
+ </fo:footnote-body>
2469
+ </fo:footnote>
2470
+ </xsl:when>
2471
+ <xsl:otherwise>
2472
+ <xsl:copy-of select="$footnote_inline"/>
2473
+ </xsl:otherwise>
2474
+ </xsl:choose>
2475
+ </xsl:template><xsl:template name="table_fn_display">
2314
2476
  <xsl:variable name="references">
2315
2477
 
2316
2478
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
@@ -2321,33 +2483,26 @@
2321
2483
  <xsl:for-each select="xalan:nodeset($references)//fn">
2322
2484
  <xsl:variable name="reference" select="@reference"/>
2323
2485
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2324
- <fo:block margin-bottom="12pt">
2486
+ <fo:block xsl:use-attribute-sets="table-fn-style">
2325
2487
 
2326
2488
 
2327
2489
 
2328
-
2329
-
2330
-
2331
-
2332
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2490
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
2333
2491
 
2334
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2335
2492
 
2336
2493
 
2337
2494
 
2338
2495
 
2496
+ <xsl:value-of select="@reference"/>
2339
2497
 
2340
2498
 
2341
2499
 
2342
2500
 
2343
- <xsl:value-of select="@reference"/>
2344
2501
 
2345
2502
 
2346
2503
 
2347
2504
  </fo:inline>
2348
- <fo:inline>
2349
-
2350
- <!-- <xsl:apply-templates /> -->
2505
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
2351
2506
  <xsl:copy-of select="./node()"/>
2352
2507
  </fo:inline>
2353
2508
  </fo:block>
@@ -2359,15 +2514,7 @@
2359
2514
 
2360
2515
  <xsl:apply-templates/>
2361
2516
  </fn>
2362
- </xsl:template><xsl:template name="fn_name_display">
2363
- <!-- <xsl:variable name="references">
2364
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2365
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2366
- <xsl:apply-templates />
2367
- </fn>
2368
- </xsl:for-each>
2369
- </xsl:variable>
2370
- $references=<xsl:copy-of select="$references"/> -->
2517
+ </xsl:template><xsl:template name="table_name_fn_display">
2371
2518
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2372
2519
  <xsl:variable name="reference" select="@reference"/>
2373
2520
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -2376,9 +2523,7 @@
2376
2523
  </fo:block>
2377
2524
  </xsl:for-each>
2378
2525
  </xsl:template><xsl:template name="fn_display_figure">
2379
- <xsl:variable name="key_iso">
2380
- <!-- and (not(@class) or @class !='pseudocode') -->
2381
- </xsl:variable>
2526
+
2382
2527
  <xsl:variable name="references">
2383
2528
  <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2384
2529
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2386,50 +2531,52 @@
2386
2531
  </fn>
2387
2532
  </xsl:for-each>
2388
2533
  </xsl:variable>
2534
+
2535
+ <xsl:if test="xalan:nodeset($references)//fn">
2389
2536
 
2390
- <!-- current hierarchy is 'figure' element -->
2391
- <xsl:variable name="following_dl_colwidths">
2392
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2393
- <xsl:variable name="html-table">
2394
- <xsl:variable name="doc_ns">
2537
+ <xsl:variable name="key_iso">
2538
+
2539
+ </xsl:variable>
2540
+
2541
+ <!-- current hierarchy is 'figure' element -->
2542
+ <xsl:variable name="following_dl_colwidths">
2543
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2544
+ <xsl:variable name="html-table">
2545
+ <xsl:variable name="doc_ns">
2546
+
2547
+ </xsl:variable>
2548
+ <xsl:variable name="ns">
2549
+ <xsl:choose>
2550
+ <xsl:when test="normalize-space($doc_ns) != ''">
2551
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2552
+ </xsl:when>
2553
+ <xsl:otherwise>
2554
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2555
+ </xsl:otherwise>
2556
+ </xsl:choose>
2557
+ </xsl:variable>
2395
2558
 
2396
- </xsl:variable>
2397
- <xsl:variable name="ns">
2398
- <xsl:choose>
2399
- <xsl:when test="normalize-space($doc_ns) != ''">
2400
- <xsl:value-of select="normalize-space($doc_ns)"/>
2401
- </xsl:when>
2402
- <xsl:otherwise>
2403
- <xsl:value-of select="substring-before(name(/*), '-')"/>
2404
- </xsl:otherwise>
2405
- </xsl:choose>
2406
- </xsl:variable>
2407
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2408
- <!-- <xsl:element name="{$ns}:table"> -->
2409
2559
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2410
2560
  <tbody>
2411
2561
  <xsl:apply-templates mode="dl"/>
2412
2562
  </tbody>
2413
2563
  </xsl:for-each>
2414
- <!-- </xsl:element> -->
2415
- </xsl:variable>
2416
-
2417
- <xsl:call-template name="calculate-column-widths">
2418
- <xsl:with-param name="cols-count" select="2"/>
2419
- <xsl:with-param name="table" select="$html-table"/>
2420
- </xsl:call-template>
2421
-
2422
- </xsl:if>
2423
- </xsl:variable>
2424
-
2425
-
2426
- <xsl:variable name="maxlength_dt">
2427
- <xsl:for-each select="*[local-name() = 'dl'][1]">
2428
- <xsl:call-template name="getMaxLength_dt"/>
2429
- </xsl:for-each>
2430
- </xsl:variable>
2431
-
2432
- <xsl:if test="xalan:nodeset($references)//fn">
2564
+ </xsl:variable>
2565
+
2566
+ <xsl:call-template name="calculate-column-widths">
2567
+ <xsl:with-param name="cols-count" select="2"/>
2568
+ <xsl:with-param name="table" select="$html-table"/>
2569
+ </xsl:call-template>
2570
+
2571
+ </xsl:if>
2572
+ </xsl:variable>
2573
+
2574
+ <xsl:variable name="maxlength_dt">
2575
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2576
+ <xsl:call-template name="getMaxLength_dt"/>
2577
+ </xsl:for-each>
2578
+ </xsl:variable>
2579
+
2433
2580
  <fo:block>
2434
2581
  <fo:table width="95%" table-layout="fixed">
2435
2582
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -2456,20 +2603,18 @@
2456
2603
  <fo:table-row>
2457
2604
  <fo:table-cell>
2458
2605
  <fo:block>
2459
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
2460
-
2606
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
2461
2607
  <xsl:value-of select="@reference"/>
2462
2608
  </fo:inline>
2463
2609
  </fo:block>
2464
2610
  </fo:table-cell>
2465
2611
  <fo:table-cell>
2466
- <fo:block text-align="justify" margin-bottom="12pt">
2467
-
2612
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
2468
2613
  <xsl:if test="normalize-space($key_iso) = 'true'">
2469
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
2614
+
2615
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
2616
+
2470
2617
  </xsl:if>
2471
-
2472
- <!-- <xsl:apply-templates /> -->
2473
2618
  <xsl:copy-of select="./node()"/>
2474
2619
  </fo:block>
2475
2620
  </fo:table-cell>
@@ -2478,18 +2623,12 @@
2478
2623
  </xsl:for-each>
2479
2624
  </fo:table-body>
2480
2625
  </fo:table>
2481
- </fo:block>
2482
- </xsl:if>
2483
-
2484
- </xsl:template><xsl:template match="*[local-name()='fn']">
2485
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2486
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
2487
-
2488
-
2489
-
2490
-
2491
-
2492
-
2626
+ </fo:block>
2627
+ </xsl:if>
2628
+
2629
+ </xsl:template><xsl:template match="*[local-name()='fn']">
2630
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
2631
+
2493
2632
 
2494
2633
 
2495
2634
 
@@ -2502,6 +2641,8 @@
2502
2641
 
2503
2642
  </fo:basic-link>
2504
2643
  </fo:inline>
2644
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
2645
+ <fo:inline><xsl:value-of select="."/></fo:inline>
2505
2646
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2506
2647
  <fo:inline>
2507
2648
  <xsl:apply-templates/>
@@ -2511,10 +2652,10 @@
2511
2652
  <xsl:variable name="isDeleted" select="@deleted"/>
2512
2653
  <fo:block-container>
2513
2654
 
2514
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2515
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2516
- </xsl:if>
2517
-
2655
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2656
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2657
+ </xsl:if>
2658
+
2518
2659
 
2519
2660
  <xsl:if test="parent::*[local-name() = 'note']">
2520
2661
  <xsl:attribute name="margin-left">
@@ -2531,11 +2672,11 @@
2531
2672
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
2532
2673
  </xsl:call-template>
2533
2674
 
2534
- <fo:block-container>
2535
-
2536
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2537
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2675
+ <fo:block-container margin-left="0mm">
2676
+
2538
2677
 
2678
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2679
+
2539
2680
 
2540
2681
  <xsl:variable name="parent" select="local-name(..)"/>
2541
2682
 
@@ -2546,23 +2687,19 @@
2546
2687
  <xsl:choose>
2547
2688
  <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2548
2689
 
2549
-
2550
- <fo:block margin-bottom="12pt" text-align="left">
2551
-
2552
- <xsl:variable name="title-where">
2553
-
2690
+ <fo:block margin-bottom="12pt" text-align="left">
2554
2691
 
2555
- <xsl:call-template name="getTitle">
2556
- <xsl:with-param name="name" select="'title-where'"/>
2692
+ <xsl:variable name="title-where">
2693
+ <xsl:call-template name="getLocalizedString">
2694
+ <xsl:with-param name="key">where</xsl:with-param>
2557
2695
  </xsl:call-template>
2558
-
2559
- </xsl:variable>
2560
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2561
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2562
- <xsl:text/>
2563
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2564
- </fo:block>
2565
-
2696
+ </xsl:variable>
2697
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2698
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2699
+ <xsl:text/>
2700
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2701
+ </fo:block>
2702
+
2566
2703
  </xsl:when>
2567
2704
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2568
2705
  <fo:block margin-bottom="12pt" text-align="left">
@@ -2571,12 +2708,9 @@
2571
2708
 
2572
2709
 
2573
2710
  <xsl:variable name="title-where">
2574
-
2575
-
2576
- <xsl:call-template name="getTitle">
2577
- <xsl:with-param name="name" select="'title-where'"/>
2578
- </xsl:call-template>
2579
-
2711
+ <xsl:call-template name="getLocalizedString">
2712
+ <xsl:with-param name="key">where</xsl:with-param>
2713
+ </xsl:call-template>
2580
2714
  </xsl:variable>
2581
2715
  <xsl:value-of select="$title-where"/>
2582
2716
  </fo:block>
@@ -2588,12 +2722,9 @@
2588
2722
 
2589
2723
 
2590
2724
  <xsl:variable name="title-key">
2591
-
2592
-
2593
- <xsl:call-template name="getTitle">
2594
- <xsl:with-param name="name" select="'title-key'"/>
2595
- </xsl:call-template>
2596
-
2725
+ <xsl:call-template name="getLocalizedString">
2726
+ <xsl:with-param name="key">key</xsl:with-param>
2727
+ </xsl:call-template>
2597
2728
  </xsl:variable>
2598
2729
  <xsl:value-of select="$title-key"/>
2599
2730
  </fo:block>
@@ -2615,9 +2746,7 @@
2615
2746
  <fo:table width="95%" table-layout="fixed">
2616
2747
 
2617
2748
  <xsl:choose>
2618
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2619
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2620
- </xsl:when>
2749
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
2621
2750
  <xsl:when test="normalize-space($key_iso) = 'true'">
2622
2751
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2623
2752
 
@@ -2638,12 +2767,9 @@
2638
2767
  </xsl:otherwise>
2639
2768
  </xsl:choose>
2640
2769
  </xsl:variable>
2641
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2642
- <!-- <xsl:element name="{$ns}:table"> -->
2643
- <tbody>
2644
- <xsl:apply-templates mode="dl"/>
2645
- </tbody>
2646
- <!-- </xsl:element> -->
2770
+ <tbody>
2771
+ <xsl:apply-templates mode="dl"/>
2772
+ </tbody>
2647
2773
  </xsl:variable>
2648
2774
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
2649
2775
  <xsl:variable name="colwidths">
@@ -2723,8 +2849,6 @@
2723
2849
  </xsl:for-each>
2724
2850
  </xsl:otherwise>
2725
2851
  </xsl:choose>
2726
- <!-- <fo:table-column column-width="15%"/>
2727
- <fo:table-column column-width="85%"/> -->
2728
2852
  </xsl:otherwise>
2729
2853
  </xsl:choose>
2730
2854
  </xsl:template><xsl:template name="getMaxLength_dt">
@@ -2739,12 +2863,6 @@
2739
2863
  </xsl:for-each>
2740
2864
  </xsl:variable>
2741
2865
  <xsl:variable name="maxLength">
2742
- <!-- <xsl:for-each select="*[local-name()='dt']">
2743
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2744
- <xsl:if test="position() = 1">
2745
- <xsl:value-of select="string-length(normalize-space(.))"/>
2746
- </xsl:if>
2747
- </xsl:for-each> -->
2748
2866
  <xsl:for-each select="xalan:nodeset($lengths)/length">
2749
2867
  <xsl:sort select="." data-type="number" order="descending"/>
2750
2868
  <xsl:if test="position() = 1">
@@ -2770,12 +2888,12 @@
2770
2888
  <xsl:if test="normalize-space($key_iso) = 'true'">
2771
2889
  <xsl:attribute name="margin-top">0</xsl:attribute>
2772
2890
  </xsl:if>
2773
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2891
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
2774
2892
  </fo:block>
2775
2893
  </fo:table-cell>
2776
2894
  <fo:table-cell>
2777
2895
  <fo:block>
2778
- <xsl:apply-templates/>
2896
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
2779
2897
  </fo:block>
2780
2898
  </fo:table-cell>
2781
2899
  </fo:table-row>
@@ -2786,81 +2904,41 @@
2786
2904
  </td>
2787
2905
  <td>
2788
2906
 
2789
-
2790
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2791
-
2907
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2908
+
2792
2909
  </td>
2793
2910
  </tr>
2794
2911
 
2795
2912
  </xsl:template><xsl:template match="*[local-name()='dt']">
2796
2913
  <xsl:param name="key_iso"/>
2797
2914
 
2798
- <fo:table-row>
2799
-
2800
-
2915
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
2801
2916
  <fo:table-cell>
2802
2917
 
2803
- <fo:block margin-top="6pt">
2918
+ <fo:block xsl:use-attribute-sets="dt-style">
2804
2919
  <xsl:copy-of select="@id"/>
2805
2920
 
2806
-
2807
2921
  <xsl:if test="normalize-space($key_iso) = 'true'">
2808
2922
  <xsl:attribute name="margin-top">0</xsl:attribute>
2809
-
2810
2923
  </xsl:if>
2811
2924
 
2812
2925
 
2813
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
2814
-
2815
-
2816
-
2817
-
2818
-
2819
2926
 
2820
2927
  <xsl:apply-templates/>
2821
- <!-- <xsl:if test="$namespace = 'gb'">
2822
- <xsl:if test="ancestor::*[local-name()='formula']">
2823
- <xsl:text>—</xsl:text>
2824
- </xsl:if>
2825
- </xsl:if> -->
2826
2928
  </fo:block>
2827
2929
  </fo:table-cell>
2828
2930
  <fo:table-cell>
2829
2931
  <fo:block>
2830
2932
 
2831
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2832
- <xsl:if test="local-name(*[1]) != 'stem'">
2833
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2834
- </xsl:if>
2835
- </xsl:if> -->
2836
-
2837
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2838
-
2933
+
2934
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2839
2935
  </fo:block>
2840
2936
  </fo:table-cell>
2841
2937
  </fo:table-row>
2842
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2843
- <xsl:if test="local-name(*[1]) = 'stem'">
2844
- <fo:table-row>
2845
- <fo:table-cell>
2846
- <fo:block margin-top="6pt">
2847
- <xsl:if test="normalize-space($key_iso) = 'true'">
2848
- <xsl:attribute name="margin-top">0</xsl:attribute>
2849
- </xsl:if>
2850
- <xsl:text>&#xA0;</xsl:text>
2851
- </fo:block>
2852
- </fo:table-cell>
2853
- <fo:table-cell>
2854
- <fo:block>
2855
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2856
- </fo:block>
2857
- </fo:table-cell>
2858
- </fo:table-row>
2859
- </xsl:if>
2860
- </xsl:if> -->
2861
2938
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2862
2939
  <xsl:apply-templates/>
2863
2940
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
2941
+ <xsl:apply-templates select="@language"/>
2864
2942
  <xsl:apply-templates/>
2865
2943
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2866
2944
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -2885,6 +2963,7 @@
2885
2963
  </fo:inline>
2886
2964
  </xsl:template><xsl:template match="*[local-name()='tt']">
2887
2965
  <fo:inline xsl:use-attribute-sets="tt-style">
2966
+
2888
2967
  <xsl:variable name="_font-size">
2889
2968
 
2890
2969
  10
@@ -2921,7 +3000,22 @@
2921
3000
  <xsl:apply-templates/>
2922
3001
  </fo:inline>
2923
3002
  </xsl:template><xsl:template match="*[local-name()='add']">
3003
+ <xsl:param name="skip">true</xsl:param>
2924
3004
  <xsl:choose>
3005
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3006
+ <xsl:choose>
3007
+ <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>
3008
+ <xsl:otherwise>
3009
+ <fo:inline>
3010
+ <xsl:call-template name="insertTag">
3011
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3012
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3013
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3014
+ </xsl:call-template>
3015
+ </fo:inline>
3016
+ </xsl:otherwise>
3017
+ </xsl:choose>
3018
+ </xsl:when>
2925
3019
  <xsl:when test="@amendment">
2926
3020
  <fo:inline>
2927
3021
  <xsl:call-template name="insertTag">
@@ -2956,7 +3050,6 @@
2956
3050
  </fo:inline>
2957
3051
  </xsl:otherwise>
2958
3052
  </xsl:choose>
2959
-
2960
3053
  </xsl:template><xsl:template name="insertTag">
2961
3054
  <xsl:param name="type"/>
2962
3055
  <xsl:param name="kind"/>
@@ -2964,22 +3057,20 @@
2964
3057
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
2965
3058
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
2966
3059
  <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
2967
- <!-- <xsl:attribute name="width">7mm</xsl:attribute>
2968
- <xsl:attribute name="content-height">100%</xsl:attribute> -->
2969
3060
  <xsl:attribute name="height">5mm</xsl:attribute>
2970
3061
  <xsl:attribute name="content-width">100%</xsl:attribute>
2971
3062
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
2972
3063
  <xsl:attribute name="scaling">uniform</xsl:attribute>
2973
3064
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
2974
3065
  <g>
2975
- <xsl:if test="$type = 'closing'">
3066
+ <xsl:if test="$type = 'closing' or $type = 'end'">
2976
3067
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
2977
3068
  </xsl:if>
2978
3069
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
2979
3070
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
2980
3071
  </g>
2981
3072
  <text font-family="Arial" x="15" y="57" font-size="40pt">
2982
- <xsl:if test="$type = 'closing'">
3073
+ <xsl:if test="$type = 'closing' or $type = 'end'">
2983
3074
  <xsl:attribute name="x">25</xsl:attribute>
2984
3075
  </xsl:if>
2985
3076
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -3183,14 +3274,6 @@
3183
3274
 
3184
3275
  <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3185
3276
 
3186
- <!-- <xsl:choose>
3187
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
3188
-
3189
- </xsl:when>
3190
- <xsl:otherwise>
3191
- <xsl:copy-of select="current()"/>
3192
- </xsl:otherwise>
3193
- </xsl:choose> -->
3194
3277
  </xsl:variable>
3195
3278
  <xsl:copy-of select="$simple-table"/>
3196
3279
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
@@ -3309,8 +3392,6 @@
3309
3392
  <xsl:choose>
3310
3393
  <xsl:when test="contains($str2, ' ')">
3311
3394
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3312
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3313
- <xsl:value-of select="substring($substr, 2)"/> -->
3314
3395
  <xsl:call-template name="capitalize">
3315
3396
  <xsl:with-param name="str" select="$substr"/>
3316
3397
  </xsl:call-template>
@@ -3320,8 +3401,6 @@
3320
3401
  </xsl:call-template>
3321
3402
  </xsl:when>
3322
3403
  <xsl:otherwise>
3323
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3324
- <xsl:value-of select="substring($str2, 2)"/> -->
3325
3404
  <xsl:call-template name="capitalize">
3326
3405
  <xsl:with-param name="str" select="$str2"/>
3327
3406
  </xsl:call-template>
@@ -3349,6 +3428,7 @@
3349
3428
  <xsl:apply-templates select="." mode="mathml"/>
3350
3429
  </xsl:variable>
3351
3430
  <fo:instream-foreign-object fox:alt-text="Math">
3431
+
3352
3432
 
3353
3433
 
3354
3434
  <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
@@ -3380,7 +3460,7 @@
3380
3460
  </xsl:attribute>
3381
3461
 
3382
3462
 
3383
- <!-- <xsl:copy-of select="."/> -->
3463
+
3384
3464
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3385
3465
  </fo:instream-foreign-object>
3386
3466
  </fo:inline>
@@ -3439,6 +3519,10 @@
3439
3519
 
3440
3520
 
3441
3521
 
3522
+
3523
+
3524
+
3525
+
3442
3526
  <xsl:choose>
3443
3527
  <xsl:when test="$target_text = ''">
3444
3528
  <xsl:apply-templates/>
@@ -3472,9 +3556,9 @@
3472
3556
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3473
3557
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3474
3558
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3475
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3559
+ <xsl:apply-templates select="*[local-name()='name']"/>
3476
3560
  </fo:block>
3477
- <xsl:apply-templates/>
3561
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
3478
3562
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
3479
3563
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3480
3564
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -3494,25 +3578,8 @@
3494
3578
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3495
3579
  <xsl:apply-templates/>
3496
3580
  </fo:inline>
3497
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3498
- <xsl:variable name="title-modified">
3499
-
3500
-
3501
- <xsl:call-template name="getTitle">
3502
- <xsl:with-param name="name" select="'title-modified'"/>
3503
- </xsl:call-template>
3504
-
3505
- </xsl:variable>
3506
-
3507
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3508
- <xsl:choose>
3509
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3510
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3511
- </xsl:choose>
3512
- <xsl:apply-templates/>
3513
3581
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3514
3582
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3515
-
3516
3583
  <xsl:apply-templates/>
3517
3584
  </fo:basic-link>
3518
3585
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3540,49 +3607,64 @@
3540
3607
  <fo:inline>
3541
3608
  <xsl:apply-templates/>
3542
3609
  </fo:inline>
3543
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
3610
+ </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 -->
3544
3611
  <xsl:if test="normalize-space() != ''">
3545
3612
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3546
3613
  </xsl:if>
3547
3614
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3548
3615
 
3549
3616
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
3617
+
3618
+
3619
+
3620
+
3621
+
3550
3622
 
3551
3623
 
3552
3624
 
3625
+
3553
3626
 
3554
3627
 
3555
3628
  <fo:block-container margin-left="0mm">
3629
+
3556
3630
 
3557
3631
 
3558
3632
 
3633
+
3559
3634
 
3560
-
3561
-
3562
-
3563
-
3564
- <fo:block>
3565
-
3566
-
3567
-
3568
-
3569
-
3635
+ <fo:block>
3636
+
3637
+
3570
3638
 
3571
- <fo:inline xsl:use-attribute-sets="note-name-style">
3572
3639
 
3573
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3574
- </fo:inline>
3575
- <xsl:apply-templates/>
3576
- </fo:block>
3577
-
3578
-
3640
+
3641
+
3642
+
3643
+ <fo:inline xsl:use-attribute-sets="note-name-style">
3644
+
3645
+
3646
+
3647
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
3648
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
3649
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
3650
+ <xsl:with-param name="skip">false</xsl:with-param>
3651
+ </xsl:apply-templates>
3652
+ </xsl:if>
3653
+
3654
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3655
+
3656
+ </fo:inline>
3657
+
3658
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3659
+ </fo:block>
3660
+
3579
3661
  </fo:block-container>
3580
3662
  </fo:block-container>
3581
3663
 
3582
3664
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
3583
3665
  <xsl:variable name="num"><xsl:number/></xsl:variable>
3584
3666
  <xsl:choose>
3585
- <xsl:when test="$num = 1">
3667
+ <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
3586
3668
  <fo:inline xsl:use-attribute-sets="note-p-style">
3587
3669
  <xsl:apply-templates/>
3588
3670
  </fo:inline>
@@ -3597,12 +3679,16 @@
3597
3679
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3598
3680
 
3599
3681
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3682
+
3683
+
3684
+
3685
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3600
3686
 
3601
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3602
3687
  </fo:inline>
3603
- <xsl:apply-templates/>
3688
+
3689
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3604
3690
  </fo:block>
3605
- </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">
3691
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
3606
3692
  <xsl:param name="sfx"/>
3607
3693
  <xsl:variable name="suffix">
3608
3694
  <xsl:choose>
@@ -3619,7 +3705,7 @@
3619
3705
  <xsl:apply-templates/>
3620
3706
  <xsl:value-of select="$suffix"/>
3621
3707
  </xsl:if>
3622
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
3708
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']">
3623
3709
  <xsl:param name="sfx"/>
3624
3710
  <xsl:variable name="suffix">
3625
3711
  <xsl:choose>
@@ -3644,25 +3730,23 @@
3644
3730
  <xsl:apply-templates/>
3645
3731
  </fo:block>
3646
3732
  </xsl:template><xsl:template match="*[local-name() = 'term']">
3647
- <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
3648
3733
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3649
3734
 
3650
3735
 
3736
+
3737
+
3651
3738
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
3652
3739
 
3653
3740
  </xsl:if>
3654
- <xsl:apply-templates/>
3741
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3655
3742
  </fo:block>
3656
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3743
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
3657
3744
  <xsl:if test="normalize-space() != ''">
3658
3745
  <xsl:variable name="level">
3659
3746
  <xsl:call-template name="getLevelTermName"/>
3660
3747
  </xsl:variable>
3661
3748
  <fo:inline role="H{$level}">
3662
3749
  <xsl:apply-templates/>
3663
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3664
- <xsl:text>.</xsl:text>
3665
- </xsl:if> -->
3666
3750
  </fo:inline>
3667
3751
  </xsl:if>
3668
3752
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
@@ -3675,9 +3759,10 @@
3675
3759
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3676
3760
  </xsl:call-template>
3677
3761
 
3678
- <fo:block>
3679
-
3680
- <xsl:apply-templates/>
3762
+
3763
+
3764
+ <fo:block xsl:use-attribute-sets="figure-style">
3765
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3681
3766
  </fo:block>
3682
3767
  <xsl:call-template name="fn_display_figure"/>
3683
3768
  <xsl:for-each select="*[local-name() = 'note']">
@@ -3685,14 +3770,15 @@
3685
3770
  </xsl:for-each>
3686
3771
 
3687
3772
 
3688
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3773
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
3774
+
3689
3775
 
3690
3776
  </fo:block-container>
3691
3777
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3692
3778
  <fo:block id="{@id}">
3693
- <xsl:apply-templates/>
3779
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3694
3780
  </fo:block>
3695
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3781
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3696
3782
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3697
3783
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3698
3784
  <xsl:apply-templates/>
@@ -3799,9 +3885,7 @@
3799
3885
  <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
3800
3886
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
3801
3887
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3802
- <!-- width=<xsl:value-of select="$width"/> -->
3803
3888
  <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3804
- <!-- height=<xsl:value-of select="$height"/> -->
3805
3889
  <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">
3806
3890
  <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
3807
3891
  <xsl:call-template name="svg_cross">
@@ -4071,7 +4155,7 @@
4071
4155
  </fo:basic-link>
4072
4156
  </fo:block>
4073
4157
  </fo:block-container>
4074
- </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">
4158
+ </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">
4075
4159
  <xsl:apply-templates mode="contents"/>
4076
4160
  <xsl:text> </xsl:text>
4077
4161
  </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">
@@ -4083,11 +4167,58 @@
4083
4167
  <xsl:value-of select="."/>
4084
4168
  </xsl:template><xsl:template match="node()" mode="contents">
4085
4169
  <xsl:apply-templates mode="contents"/>
4170
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
4171
+ <xsl:variable name="level">
4172
+ <xsl:call-template name="getLevel">
4173
+ <xsl:with-param name="depth" select="@depth"/>
4174
+ </xsl:call-template>
4175
+ </xsl:variable>
4176
+
4177
+ <xsl:variable name="section">
4178
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4179
+ </xsl:variable>
4180
+
4181
+ <xsl:variable name="type">floating-title</xsl:variable>
4182
+
4183
+ <xsl:variable name="display">
4184
+ <xsl:choose>
4185
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
4186
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
4187
+ <xsl:otherwise>false</xsl:otherwise>
4188
+ </xsl:choose>
4189
+ </xsl:variable>
4190
+
4191
+ <xsl:variable name="skip">false</xsl:variable>
4192
+
4193
+ <xsl:if test="$skip = 'false'">
4194
+
4195
+ <xsl:variable name="title">
4196
+ <xsl:choose>
4197
+ <xsl:when test="*[local-name() = 'tab']">
4198
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4199
+ </xsl:when>
4200
+ <xsl:otherwise>
4201
+ <xsl:copy-of select="node()"/>
4202
+ </xsl:otherwise>
4203
+ </xsl:choose>
4204
+ </xsl:variable>
4205
+
4206
+ <xsl:variable name="root">
4207
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
4208
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
4209
+ </xsl:variable>
4210
+
4211
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
4212
+ <title>
4213
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
4214
+ </title>
4215
+ </item>
4216
+ </xsl:if>
4086
4217
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4087
4218
  <xsl:apply-templates mode="bookmarks"/>
4088
4219
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4089
4220
  <xsl:apply-templates select="."/>
4090
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4221
+ </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">
4091
4222
  <xsl:apply-templates mode="bookmarks"/>
4092
4223
  </xsl:template><xsl:template name="addBookmarks">
4093
4224
  <xsl:param name="contents"/>
@@ -4177,8 +4308,6 @@
4177
4308
 
4178
4309
 
4179
4310
 
4180
-
4181
-
4182
4311
  </fo:bookmark-tree>
4183
4312
  </xsl:if>
4184
4313
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -4249,7 +4378,7 @@
4249
4378
  <xsl:apply-templates mode="bookmark"/>
4250
4379
  </xsl:otherwise>
4251
4380
  </xsl:choose>
4252
- </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">
4381
+ </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']">
4253
4382
  <xsl:if test="normalize-space() != ''">
4254
4383
  <fo:block xsl:use-attribute-sets="figure-name-style">
4255
4384
 
@@ -4258,16 +4387,13 @@
4258
4387
  </fo:block>
4259
4388
  </xsl:if>
4260
4389
  </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">
4261
- <xsl:apply-templates mode="contents_item"/>
4390
+ <xsl:param name="mode">bookmarks</xsl:param>
4391
+ <xsl:apply-templates mode="contents_item">
4392
+ <xsl:with-param name="mode" select="$mode"/>
4393
+ </xsl:apply-templates>
4262
4394
  <!-- <xsl:text> </xsl:text> -->
4263
4395
  </xsl:template><xsl:template name="getSection">
4264
4396
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4265
- <!--
4266
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4267
- <xsl:value-of select="."/>
4268
- </xsl:for-each>
4269
- -->
4270
-
4271
4397
  </xsl:template><xsl:template name="getName">
4272
4398
  <xsl:choose>
4273
4399
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4331,9 +4457,26 @@
4331
4457
  <xsl:copy-of select="."/>
4332
4458
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4333
4459
  <xsl:text> </xsl:text>
4460
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
4461
+ <xsl:param name="mode">bookmarks</xsl:param>
4462
+ <xsl:apply-templates mode="contents_item">
4463
+ <xsl:with-param name="mode" select="$mode"/>
4464
+ </xsl:apply-templates>
4465
+ </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item">
4466
+ <xsl:param name="mode">bookmarks</xsl:param>
4467
+ <xsl:choose>
4468
+ <xsl:when test="starts-with(text(), $ace_tag)">
4469
+ <xsl:if test="$mode = 'contents'">
4470
+ <xsl:copy>
4471
+ <xsl:apply-templates mode="contents_item"/>
4472
+ </xsl:copy>
4473
+ </xsl:if>
4474
+ </xsl:when>
4475
+ <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
4476
+ </xsl:choose>
4334
4477
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4335
4478
 
4336
- <fo:block-container margin-left="0mm">
4479
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
4337
4480
  <xsl:copy-of select="@id"/>
4338
4481
 
4339
4482
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -4370,6 +4513,7 @@
4370
4513
 
4371
4514
 
4372
4515
  </xsl:variable>
4516
+
4373
4517
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4374
4518
  <xsl:if test="$font-size != ''">
4375
4519
  <xsl:attribute name="font-size">
@@ -4386,11 +4530,11 @@
4386
4530
 
4387
4531
 
4388
4532
 
4389
- <xsl:apply-templates/>
4533
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4390
4534
  </fo:block>
4391
4535
 
4392
4536
 
4393
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4537
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
4394
4538
 
4395
4539
 
4396
4540
 
@@ -4404,7 +4548,7 @@
4404
4548
  <xsl:call-template name="add-zero-spaces-java">
4405
4549
  <xsl:with-param name="text" select="$text"/>
4406
4550
  </xsl:call-template>
4407
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
4551
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
4408
4552
  <xsl:if test="normalize-space() != ''">
4409
4553
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4410
4554
  <xsl:apply-templates/>
@@ -4412,10 +4556,10 @@
4412
4556
  </xsl:if>
4413
4557
  </xsl:template><xsl:template match="*[local-name() = 'permission']">
4414
4558
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4415
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4416
- <xsl:apply-templates/>
4559
+ <xsl:apply-templates select="*[local-name()='name']"/>
4560
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4417
4561
  </fo:block>
4418
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
4562
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
4419
4563
  <xsl:if test="normalize-space() != ''">
4420
4564
  <fo:block xsl:use-attribute-sets="permission-name-style">
4421
4565
  <xsl:apply-templates/>
@@ -4428,13 +4572,13 @@
4428
4572
  </fo:block>
4429
4573
  </xsl:template><xsl:template match="*[local-name() = 'requirement']">
4430
4574
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4431
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4432
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
4433
- <xsl:apply-templates select="@obligation" mode="presentation"/>
4434
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
4435
- <xsl:apply-templates/>
4575
+ <xsl:apply-templates select="*[local-name()='name']"/>
4576
+ <xsl:apply-templates select="*[local-name()='label']"/>
4577
+ <xsl:apply-templates select="@obligation"/>
4578
+ <xsl:apply-templates select="*[local-name()='subject']"/>
4579
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/>
4436
4580
  </fo:block>
4437
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
4581
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
4438
4582
  <xsl:if test="normalize-space() != ''">
4439
4583
  <fo:block xsl:use-attribute-sets="requirement-name-style">
4440
4584
 
@@ -4442,20 +4586,24 @@
4442
4586
 
4443
4587
  </fo:block>
4444
4588
  </xsl:if>
4445
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
4589
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']">
4446
4590
  <fo:block xsl:use-attribute-sets="requirement-label-style">
4447
4591
  <xsl:apply-templates/>
4448
4592
  </fo:block>
4449
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
4593
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation">
4450
4594
  <fo:block>
4451
4595
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4452
4596
  </fo:block>
4597
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2">
4598
+ <fo:block xsl:use-attribute-sets="subject-style">
4599
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4600
+ </fo:block>
4453
4601
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4454
4602
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4455
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4456
- <xsl:apply-templates/>
4603
+ <xsl:apply-templates select="*[local-name()='name']"/>
4604
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4457
4605
  </fo:block>
4458
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
4606
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
4459
4607
  <xsl:if test="normalize-space() != ''">
4460
4608
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
4461
4609
  <xsl:apply-templates/>
@@ -4466,10 +4614,6 @@
4466
4614
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4467
4615
  <xsl:apply-templates/>
4468
4616
  </fo:block>
4469
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4470
- <fo:block xsl:use-attribute-sets="subject-style">
4471
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4472
- </fo:block>
4473
4617
  </xsl:template><xsl:template match="*[local-name() = 'subject']">
4474
4618
  <fo:block xsl:use-attribute-sets="subject-style">
4475
4619
  <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
@@ -4513,8 +4657,6 @@
4513
4657
  </xsl:variable>
4514
4658
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4515
4659
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
4516
- <!-- <fo:table-column column-width="35mm"/>
4517
- <fo:table-column column-width="115mm"/> -->
4518
4660
  <fo:table-column column-width="30%"/>
4519
4661
  <fo:table-column column-width="70%"/>
4520
4662
  </xsl:if>
@@ -4524,7 +4666,7 @@
4524
4666
  <xsl:if test=".//*[local-name() = 'fn']">
4525
4667
  <xsl:for-each select="*[local-name() = 'tbody']">
4526
4668
  <fo:block font-size="90%" border-bottom="1pt solid black">
4527
- <xsl:call-template name="fn_display"/>
4669
+ <xsl:call-template name="table_fn_display"/>
4528
4670
  </fo:block>
4529
4671
  </xsl:for-each>
4530
4672
  </xsl:if>
@@ -4541,7 +4683,6 @@
4541
4683
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
4542
4684
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
4543
4685
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
4544
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
4545
4686
  <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
4546
4687
  </xsl:if>
4547
4688
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -4554,34 +4695,11 @@
4554
4695
  </fo:table-row>
4555
4696
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
4556
4697
  <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4557
- <xsl:attribute name="text-align">
4558
- <xsl:choose>
4559
- <xsl:when test="@align">
4560
- <xsl:value-of select="@align"/>
4561
- </xsl:when>
4562
- <xsl:otherwise>left</xsl:otherwise>
4563
- </xsl:choose>
4564
- </xsl:attribute>
4565
- <xsl:if test="@colspan">
4566
- <xsl:attribute name="number-columns-spanned">
4567
- <xsl:value-of select="@colspan"/>
4568
- </xsl:attribute>
4569
- </xsl:if>
4570
- <xsl:if test="@rowspan">
4571
- <xsl:attribute name="number-rows-spanned">
4572
- <xsl:value-of select="@rowspan"/>
4573
- </xsl:attribute>
4574
- </xsl:if>
4575
- <xsl:call-template name="display-align"/>
4698
+ <xsl:call-template name="setTextAlignment">
4699
+ <xsl:with-param name="default">left</xsl:with-param>
4700
+ </xsl:call-template>
4576
4701
 
4577
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4578
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4579
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
4580
- </xsl:if>
4581
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
4582
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4583
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4584
- </xsl:if> -->
4702
+ <xsl:call-template name="setTableCellAttributes"/>
4585
4703
 
4586
4704
  <fo:block>
4587
4705
  <xsl:apply-templates/>
@@ -4593,37 +4711,15 @@
4593
4711
  <xsl:attribute name="padding">0mm</xsl:attribute>
4594
4712
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
4595
4713
  </xsl:if>
4596
- <xsl:attribute name="text-align">
4597
- <xsl:choose>
4598
- <xsl:when test="@align">
4599
- <xsl:value-of select="@align"/>
4600
- </xsl:when>
4601
- <xsl:otherwise>left</xsl:otherwise>
4602
- </xsl:choose>
4603
- </xsl:attribute>
4714
+ <xsl:call-template name="setTextAlignment">
4715
+ <xsl:with-param name="default">left</xsl:with-param>
4716
+ </xsl:call-template>
4717
+
4604
4718
  <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
4605
4719
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4606
4720
  </xsl:if>
4607
- <xsl:if test="@colspan">
4608
- <xsl:attribute name="number-columns-spanned">
4609
- <xsl:value-of select="@colspan"/>
4610
- </xsl:attribute>
4611
- </xsl:if>
4612
- <xsl:if test="@rowspan">
4613
- <xsl:attribute name="number-rows-spanned">
4614
- <xsl:value-of select="@rowspan"/>
4615
- </xsl:attribute>
4616
- </xsl:if>
4617
- <xsl:call-template name="display-align"/>
4618
4721
 
4619
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4620
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
4621
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4622
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
4623
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4624
- </xsl:if>
4625
- </xsl:if> -->
4626
- <!-- 2nd line and below -->
4722
+ <xsl:call-template name="setTableCellAttributes"/>
4627
4723
 
4628
4724
  <fo:block>
4629
4725
  <xsl:apply-templates/>
@@ -4635,15 +4731,15 @@
4635
4731
  <xsl:apply-templates/>
4636
4732
  </fo:block>
4637
4733
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
4638
- <fo:block> <!-- margin-bottom="10pt" -->
4734
+ <fo:block>
4639
4735
  <xsl:apply-templates/>
4640
4736
  </fo:block>
4641
4737
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
4642
4738
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
4643
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4644
- <xsl:apply-templates/>
4739
+ <xsl:apply-templates select="*[local-name()='name']"/>
4740
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4645
4741
  </fo:block>
4646
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
4742
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
4647
4743
  <xsl:if test="normalize-space() != ''">
4648
4744
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
4649
4745
  <xsl:apply-templates/>
@@ -4667,42 +4763,46 @@
4667
4763
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4668
4764
 
4669
4765
 
4670
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4671
-
4672
- <xsl:variable name="element">
4673
- block
4674
-
4675
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
4766
+ <xsl:variable name="fo_element">
4767
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
4768
+ block
4676
4769
  </xsl:variable>
4677
4770
 
4771
+ <!-- display 'EXAMPLE' -->
4772
+ <xsl:apply-templates select="*[local-name()='name']">
4773
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4774
+ </xsl:apply-templates>
4775
+
4678
4776
  <xsl:choose>
4679
- <xsl:when test="contains(normalize-space($element), 'block')">
4680
- <fo:block xsl:use-attribute-sets="example-body-style">
4681
- <xsl:apply-templates/>
4682
- </fo:block>
4777
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
4778
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
4779
+ <fo:block-container margin-left="0mm" margin-right="0mm">
4780
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
4781
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4782
+ </xsl:apply-templates>
4783
+ </fo:block-container>
4784
+ </fo:block-container>
4683
4785
  </xsl:when>
4684
4786
  <xsl:otherwise>
4685
4787
  <fo:inline>
4686
- <xsl:apply-templates/>
4788
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
4789
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4790
+ </xsl:apply-templates>
4687
4791
  </fo:inline>
4688
4792
  </xsl:otherwise>
4689
- </xsl:choose>
4690
-
4691
- </fo:block>
4692
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
4693
-
4694
- <xsl:variable name="element">
4695
- block
4793
+ </xsl:choose>
4696
4794
 
4697
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
4698
- </xsl:variable>
4795
+ </fo:block>
4796
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
4797
+ <xsl:param name="fo_element">block</xsl:param>
4798
+
4699
4799
  <xsl:choose>
4700
4800
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
4701
4801
  <fo:inline>
4702
4802
  <xsl:apply-templates/>
4703
4803
  </fo:inline>
4704
4804
  </xsl:when>
4705
- <xsl:when test="contains(normalize-space($element), 'block')">
4805
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
4706
4806
  <fo:block xsl:use-attribute-sets="example-name-style">
4707
4807
  <xsl:apply-templates/>
4708
4808
  </fo:block>
@@ -4715,14 +4815,15 @@
4715
4815
  </xsl:choose>
4716
4816
 
4717
4817
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4818
+ <xsl:param name="fo_element">block</xsl:param>
4819
+
4718
4820
  <xsl:variable name="num"><xsl:number/></xsl:variable>
4719
4821
  <xsl:variable name="element">
4720
- block
4721
-
4722
4822
 
4823
+ <xsl:value-of select="$fo_element"/>
4723
4824
  </xsl:variable>
4724
4825
  <xsl:choose>
4725
- <xsl:when test="normalize-space($element) = 'block'">
4826
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
4726
4827
  <fo:block xsl:use-attribute-sets="example-p-style">
4727
4828
 
4728
4829
  <xsl:apply-templates/>
@@ -4737,66 +4838,70 @@
4737
4838
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4738
4839
  <fo:block xsl:use-attribute-sets="termsource-style">
4739
4840
 
4841
+
4842
+
4740
4843
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4741
4844
  <xsl:variable name="termsource_text">
4742
4845
  <xsl:apply-templates/>
4743
4846
  </xsl:variable>
4744
-
4745
- <xsl:choose>
4847
+ <xsl:copy-of select="$termsource_text"/>
4848
+ <!-- <xsl:choose>
4746
4849
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4747
- <!-- <xsl:apply-templates /> -->
4748
4850
  <xsl:copy-of select="$termsource_text"/>
4749
4851
  </xsl:when>
4750
4852
  <xsl:otherwise>
4751
-
4752
-
4853
+ <xsl:if test="$namespace = 'bsi'">
4854
+ <xsl:choose>
4855
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
4856
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
4857
+ </xsl:choose>
4858
+ </xsl:if>
4859
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4753
4860
  <xsl:text>[</xsl:text>
4754
-
4755
- <!-- <xsl:apply-templates /> -->
4861
+ </xsl:if>
4756
4862
  <xsl:copy-of select="$termsource_text"/>
4757
-
4758
-
4863
+ <xsl:if test="$namespace = 'bsi'">
4864
+ <xsl:choose>
4865
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
4866
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
4867
+ </xsl:choose>
4868
+ </xsl:if>
4869
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4759
4870
  <xsl:text>]</xsl:text>
4760
-
4871
+ </xsl:if>
4761
4872
  </xsl:otherwise>
4762
- </xsl:choose>
4873
+ </xsl:choose> -->
4763
4874
  </fo:block>
4764
4875
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
4765
4876
  <xsl:if test="normalize-space() != ''">
4766
4877
  <xsl:value-of select="."/>
4767
4878
  </xsl:if>
4768
- </xsl:template><xsl:variable name="localized.source">
4769
- <xsl:call-template name="getLocalizedString">
4770
- <xsl:with-param name="key">source</xsl:with-param>
4771
- </xsl:call-template>
4772
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4879
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
4880
+ <fo:inline xsl:use-attribute-sets="termsource-text-style">
4881
+ <xsl:value-of select="."/>
4882
+ </fo:inline>
4883
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
4773
4884
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4774
4885
  <xsl:if test="normalize-space(@citeas) = ''">
4775
4886
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4776
4887
  </xsl:if>
4777
-
4778
-
4779
- <fo:inline>
4780
-
4781
-
4782
-
4783
-
4784
-
4785
-
4786
-
4787
- <xsl:call-template name="getTitle">
4788
- <xsl:with-param name="name" select="'title-source'"/>
4789
- </xsl:call-template>
4790
- <xsl:text>: </xsl:text>
4791
-
4792
-
4793
- </fo:inline>
4794
-
4795
4888
  <fo:inline xsl:use-attribute-sets="origin-style">
4796
4889
  <xsl:apply-templates/>
4797
4890
  </fo:inline>
4798
-
4799
- </fo:basic-link>
4891
+ </fo:basic-link>
4892
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
4893
+ <xsl:variable name="title-modified">
4894
+ <xsl:call-template name="getLocalizedString">
4895
+ <xsl:with-param name="key">modified</xsl:with-param>
4896
+ </xsl:call-template>
4897
+ </xsl:variable>
4898
+
4899
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4900
+ <xsl:choose>
4901
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4902
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4903
+ </xsl:choose>
4904
+ <xsl:apply-templates/>
4800
4905
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4801
4906
  <fo:inline><xsl:apply-templates/></fo:inline>
4802
4907
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -4815,7 +4920,6 @@
4815
4920
  <fo:block-container margin-left="0mm">
4816
4921
 
4817
4922
  <fo:block xsl:use-attribute-sets="quote-style">
4818
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4819
4923
 
4820
4924
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4821
4925
  </fo:block>
@@ -4858,15 +4962,13 @@
4858
4962
  </xsl:variable>
4859
4963
 
4860
4964
  <xsl:choose>
4861
- <xsl:when test="normalize-space($bibitemid) != ''">
4965
+ <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
4862
4966
  <fo:inline xsl:use-attribute-sets="eref-style">
4863
4967
  <xsl:if test="@type = 'footnote'">
4864
-
4865
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4866
- <xsl:attribute name="font-size">80%</xsl:attribute>
4867
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4868
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4869
-
4968
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4969
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4970
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4971
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4870
4972
 
4871
4973
  </xsl:if>
4872
4974
 
@@ -4886,7 +4988,6 @@
4886
4988
 
4887
4989
 
4888
4990
 
4889
-
4890
4991
  </xsl:if>
4891
4992
 
4892
4993
 
@@ -4945,8 +5046,6 @@
4945
5046
  </xsl:choose>
4946
5047
  </xsl:variable>
4947
5048
 
4948
- <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
4949
-
4950
5049
  <xsl:choose>
4951
5050
  <xsl:when test="$lang = 'zh'">
4952
5051
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -4981,12 +5080,9 @@
4981
5080
  </fo:block>
4982
5081
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4983
5082
  <xsl:variable name="title-deprecated">
4984
-
4985
-
4986
- <xsl:call-template name="getTitle">
4987
- <xsl:with-param name="name" select="'title-deprecated'"/>
4988
- </xsl:call-template>
4989
-
5083
+ <xsl:call-template name="getLocalizedString">
5084
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5085
+ </xsl:call-template>
4990
5086
  </xsl:variable>
4991
5087
  <fo:block xsl:use-attribute-sets="deprecates-style">
4992
5088
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4995,6 +5091,8 @@
4995
5091
  <xsl:if test="*[local-name() = 'strong']">
4996
5092
  <xsl:attribute name="font-weight">normal</xsl:attribute>
4997
5093
  </xsl:if>
5094
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
5095
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
4998
5096
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
4999
5097
  <fo:block xsl:use-attribute-sets="definition-style">
5000
5098
  <xsl:apply-templates/>
@@ -5003,7 +5101,6 @@
5003
5101
  <xsl:apply-templates/>
5004
5102
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5005
5103
  <fo:inline> <xsl:apply-templates/></fo:inline>
5006
- <!-- <fo:block>&#xA0;</fo:block> -->
5007
5104
  <fo:block/>
5008
5105
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5009
5106
 
@@ -5044,11 +5141,6 @@
5044
5141
  <xsl:apply-templates/>
5045
5142
  </fo:block>
5046
5143
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
5047
- <fo:block id="{@id}">
5048
- <xsl:apply-templates/>
5049
- </fo:block>
5050
- </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']">
5051
-
5052
5144
  <fo:block id="{@id}">
5053
5145
  <xsl:apply-templates/>
5054
5146
  </fo:block>
@@ -5065,6 +5157,51 @@
5065
5157
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
5066
5158
  <!-- 0xA0 to space replacement -->
5067
5159
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5160
+ </xsl:template><xsl:variable name="ul_labels_">
5161
+
5162
+
5163
+
5164
+
5165
+ <label>—</label> <!-- em dash -->
5166
+
5167
+
5168
+
5169
+
5170
+
5171
+
5172
+
5173
+
5174
+
5175
+
5176
+
5177
+
5178
+
5179
+
5180
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
5181
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5182
+ <xsl:variable name="list_level">
5183
+ <xsl:choose>
5184
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
5185
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
5186
+ </xsl:choose>
5187
+ </xsl:variable>
5188
+ <xsl:choose>
5189
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
5190
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
5191
+ </xsl:when>
5192
+ <xsl:when test="$list_level mod 3 = 0">
5193
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
5194
+ </xsl:when>
5195
+ <xsl:when test="$list_level mod 2 = 0">
5196
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
5197
+ </xsl:when>
5198
+ <xsl:otherwise>
5199
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
5200
+ </xsl:otherwise>
5201
+ </xsl:choose>
5202
+ </xsl:template><xsl:template match="label" mode="ul_labels">
5203
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
5204
+ <xsl:value-of select="."/>
5068
5205
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5069
5206
  <xsl:choose>
5070
5207
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -5271,20 +5408,102 @@
5271
5408
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
5272
5409
  <fo:block><xsl:apply-templates/></fo:block>
5273
5410
  </fo:table-cell>
5274
- </xsl:template><xsl:template name="processBibitem">
5411
+ </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">
5412
+
5413
+
5414
+
5415
+ <fo:block id="{@id}">
5416
+ <xsl:apply-templates/>
5417
+ </fo:block>
5418
+ </xsl:template><xsl:template match="*[local-name() = 'references']">
5419
+ <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
5420
+
5421
+ <fo:block break-after="page"/>
5422
+
5423
+ </xsl:if>
5424
+
5425
+ <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
5426
+ <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'">
5427
+ <fo:block break-after="page"/>
5428
+ </xsl:if>
5429
+ </xsl:if> -->
5275
5430
 
5431
+ <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
5432
+ <xsl:apply-templates/>
5433
+ </fo:block>
5276
5434
 
5277
5435
 
5278
-
5279
5436
 
5280
5437
 
5281
-
5438
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']">
5439
+ <xsl:call-template name="bibitem"/>
5440
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
5282
5441
 
5442
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
5443
+ <xsl:call-template name="processBibitem"/>
5444
+ </fo:block>
5445
+
5446
+
5447
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
5448
+
5449
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
5450
+ $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
5451
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
5452
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
5453
+ <fo:list-item>
5454
+ <fo:list-item-label end-indent="label-end()">
5455
+ <fo:block>
5456
+ <fo:inline>
5457
+
5458
+ <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
5459
+ <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
5460
+ <xsl:number format="[1]"/>
5461
+ </xsl:if>
5462
+
5463
+ </fo:inline>
5464
+ </fo:block>
5465
+ </fo:list-item-label>
5466
+ <fo:list-item-body start-indent="body-start()">
5467
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
5468
+ <xsl:call-template name="processBibitem"/>
5469
+ </fo:block>
5470
+ </fo:list-item-body>
5471
+ </fo:list-item>
5472
+ </fo:list-block>
5473
+
5283
5474
 
5475
+ </xsl:template><xsl:template name="processBibitem">
5284
5476
 
5285
5477
 
5478
+ <!-- start bibitem processing -->
5479
+ <xsl:if test=".//*[local-name() = 'fn']">
5480
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
5481
+ </xsl:if>
5482
+ <xsl:variable name="docidentifier">
5483
+ <xsl:choose>
5484
+ <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
5485
+ <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
5486
+ </xsl:choose>
5487
+ </xsl:variable>
5488
+ <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
5489
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
5490
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
5491
+ <xsl:choose>
5492
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
5493
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
5494
+ </xsl:when>
5495
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
5496
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
5497
+ </xsl:when>
5498
+ <xsl:otherwise>
5499
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
5500
+ </xsl:otherwise>
5501
+ </xsl:choose>
5502
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
5503
+ <!-- end bibitem processing -->
5504
+
5286
5505
  </xsl:template><xsl:template name="processBibitemDocId">
5287
- <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')]"/>
5506
+ <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')]"/>
5288
5507
  <xsl:choose>
5289
5508
  <xsl:when test="normalize-space($_doc_ident) != ''">
5290
5509
  <!-- <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"/>
@@ -5298,7 +5517,7 @@
5298
5517
  <xsl:if test="$type != ''">
5299
5518
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5300
5519
  </xsl:if> -->
5301
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5520
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
5302
5521
  </xsl:otherwise>
5303
5522
  </xsl:choose>
5304
5523
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -5339,6 +5558,55 @@
5339
5558
  <xsl:value-of select="substring(.,1,1)"/>
5340
5559
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5341
5560
  <fo:inline><xsl:apply-templates/></fo:inline>
5561
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
5562
+ <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
5563
+ <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
5564
+ <xsl:apply-templates/>
5565
+ </fo:inline>
5566
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
5567
+ <fo:footnote>
5568
+ <xsl:variable name="number">
5569
+
5570
+ <xsl:choose>
5571
+ <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
5572
+ <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
5573
+ </xsl:when>
5574
+ <xsl:otherwise>
5575
+ <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
5576
+ </xsl:otherwise>
5577
+ </xsl:choose>
5578
+
5579
+ </xsl:variable>
5580
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
5581
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
5582
+ <xsl:value-of select="$number"/>
5583
+
5584
+ </fo:basic-link>
5585
+ </fo:inline>
5586
+ <fo:footnote-body>
5587
+ <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
5588
+ <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
5589
+ <xsl:value-of select="$number"/>
5590
+
5591
+ </fo:inline>
5592
+ <xsl:apply-templates/>
5593
+ </fo:block>
5594
+ </fo:footnote-body>
5595
+ </fo:footnote>
5596
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
5597
+ <xsl:text> edition </xsl:text>
5598
+ <xsl:value-of select="."/>
5599
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
5600
+ <xsl:text> (</xsl:text>
5601
+ <fo:inline xsl:use-attribute-sets="link-style">
5602
+ <fo:basic-link external-destination="." fox:alt-text=".">
5603
+ <xsl:value-of select="."/>
5604
+ </fo:basic-link>
5605
+ </fo:inline>
5606
+ <xsl:text>)</xsl:text>
5607
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']">
5608
+
5609
+ <xsl:apply-templates/>
5342
5610
  </xsl:template><xsl:template match="*[local-name() = 'form']">
5343
5611
  <fo:block>
5344
5612
  <xsl:apply-templates/>
@@ -5403,7 +5671,18 @@
5403
5671
  <fo:block-container border="1pt solid black" width="50%">
5404
5672
  <fo:block> </fo:block>
5405
5673
  </fo:block-container>
5406
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
5674
+ </xsl:template><xsl:variable name="toc_level">
5675
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
5676
+ <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:-->
5677
+ <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 -->
5678
+ <xsl:choose>
5679
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
5680
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
5681
+ <xsl:otherwise><!-- default value -->
5682
+ 2
5683
+ </xsl:otherwise>
5684
+ </xsl:choose>
5685
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
5407
5686
  <xsl:param name="colwidths"/>
5408
5687
  <xsl:variable name="colwidths_">
5409
5688
  <xsl:choose>
@@ -5483,7 +5762,7 @@
5483
5762
  </td>
5484
5763
  </xsl:for-each>
5485
5764
  <td>333</td> <!-- page number, just for fill -->
5486
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5765
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5487
5766
  <fo:inline padding-right="5mm"> </fo:inline>
5488
5767
  <fo:inline><xsl:apply-templates/></fo:inline>
5489
5768
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -5494,6 +5773,60 @@
5494
5773
  </svg>
5495
5774
  </fo:instream-foreign-object>
5496
5775
  </fo:inline>
5776
+ </xsl:template><xsl:template match="@language">
5777
+ <xsl:copy-of select="."/>
5778
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
5779
+ <xsl:call-template name="title"/>
5780
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']">
5781
+
5782
+
5783
+
5784
+
5785
+
5786
+
5787
+ <fo:block xsl:use-attribute-sets="admonition-style">
5788
+
5789
+
5790
+
5791
+
5792
+
5793
+
5794
+ <xsl:call-template name="displayAdmonitionName"/>
5795
+ <xsl:text> — </xsl:text>
5796
+
5797
+
5798
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5799
+ </fo:block>
5800
+
5801
+ </xsl:template><xsl:template name="displayAdmonitionName">
5802
+
5803
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5804
+ <xsl:if test="not(*[local-name() = 'name'])">
5805
+ <xsl:apply-templates select="@type"/>
5806
+ </xsl:if>
5807
+
5808
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
5809
+ <xsl:apply-templates/>
5810
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
5811
+ <xsl:variable name="admonition_type_">
5812
+ <xsl:call-template name="getLocalizedString">
5813
+ <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
5814
+ </xsl:call-template>
5815
+ </xsl:variable>
5816
+ <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
5817
+ <xsl:value-of select="$admonition_type"/>
5818
+ <xsl:if test="$admonition_type = ''">
5819
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
5820
+ </xsl:if>
5821
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
5822
+
5823
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
5824
+
5825
+
5826
+
5827
+ <xsl:apply-templates/>
5828
+ </fo:block>
5829
+
5497
5830
  </xsl:template><xsl:template name="convertDate">
5498
5831
  <xsl:param name="date"/>
5499
5832
  <xsl:param name="format" select="'short'"/>
@@ -5502,78 +5835,39 @@
5502
5835
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
5503
5836
  <xsl:variable name="monthStr">
5504
5837
  <xsl:choose>
5505
- <xsl:when test="$month = '01'">January</xsl:when>
5506
- <xsl:when test="$month = '02'">February</xsl:when>
5507
- <xsl:when test="$month = '03'">March</xsl:when>
5508
- <xsl:when test="$month = '04'">April</xsl:when>
5509
- <xsl:when test="$month = '05'">May</xsl:when>
5510
- <xsl:when test="$month = '06'">June</xsl:when>
5511
- <xsl:when test="$month = '07'">July</xsl:when>
5512
- <xsl:when test="$month = '08'">August</xsl:when>
5513
- <xsl:when test="$month = '09'">September</xsl:when>
5514
- <xsl:when test="$month = '10'">October</xsl:when>
5515
- <xsl:when test="$month = '11'">November</xsl:when>
5516
- <xsl:when test="$month = '12'">December</xsl:when>
5517
- </xsl:choose>
5518
- </xsl:variable>
5519
- <xsl:variable name="result">
5520
- <xsl:choose>
5521
- <xsl:when test="$format = 'ddMMyyyy'">
5522
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5523
- <xsl:text> </xsl:text>
5524
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5525
- </xsl:when>
5526
- <xsl:when test="$format = 'ddMM'">
5527
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5528
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5529
- </xsl:when>
5530
- <xsl:when test="$format = 'short' or $day = ''">
5531
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5532
- </xsl:when>
5533
- <xsl:otherwise>
5534
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5535
- </xsl:otherwise>
5838
+ <xsl:when test="$month = '01'">january</xsl:when>
5839
+ <xsl:when test="$month = '02'">february</xsl:when>
5840
+ <xsl:when test="$month = '03'">march</xsl:when>
5841
+ <xsl:when test="$month = '04'">april</xsl:when>
5842
+ <xsl:when test="$month = '05'">may</xsl:when>
5843
+ <xsl:when test="$month = '06'">june</xsl:when>
5844
+ <xsl:when test="$month = '07'">july</xsl:when>
5845
+ <xsl:when test="$month = '08'">august</xsl:when>
5846
+ <xsl:when test="$month = '09'">september</xsl:when>
5847
+ <xsl:when test="$month = '10'">october</xsl:when>
5848
+ <xsl:when test="$month = '11'">november</xsl:when>
5849
+ <xsl:when test="$month = '12'">december</xsl:when>
5536
5850
  </xsl:choose>
5537
5851
  </xsl:variable>
5538
- <xsl:value-of select="$result"/>
5539
- </xsl:template><xsl:template name="convertDateLocalized">
5540
- <xsl:param name="date"/>
5541
- <xsl:param name="format" select="'short'"/>
5542
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
5543
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
5544
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
5545
- <xsl:variable name="monthStr">
5546
- <xsl:choose>
5547
- <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>
5548
- <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>
5549
- <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>
5550
- <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>
5551
- <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>
5552
- <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>
5553
- <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>
5554
- <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>
5555
- <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>
5556
- <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>
5557
- <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>
5558
- <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>
5559
- </xsl:choose>
5852
+ <xsl:variable name="monthStr_localized">
5853
+ <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>
5560
5854
  </xsl:variable>
5561
5855
  <xsl:variable name="result">
5562
5856
  <xsl:choose>
5563
5857
  <xsl:when test="$format = 'ddMMyyyy'">
5564
5858
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5565
5859
  <xsl:text> </xsl:text>
5566
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5860
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
5567
5861
  </xsl:when>
5568
5862
  <xsl:when test="$format = 'ddMM'">
5569
5863
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5570
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5864
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/>
5571
5865
  </xsl:when>
5572
5866
  <xsl:when test="$format = 'short' or $day = ''">
5573
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5867
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
5574
5868
  </xsl:when>
5575
5869
  <xsl:otherwise>
5576
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5870
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/>
5577
5871
  </xsl:otherwise>
5578
5872
  </xsl:choose>
5579
5873
  </xsl:variable>
@@ -5625,14 +5919,9 @@
5625
5919
  <dc:title>
5626
5920
  <xsl:variable name="title">
5627
5921
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5628
-
5629
-
5630
-
5631
-
5632
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5633
-
5634
-
5635
5922
 
5923
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5924
+
5636
5925
  </xsl:for-each>
5637
5926
  </xsl:variable>
5638
5927
  <xsl:choose>
@@ -5647,21 +5936,18 @@
5647
5936
  <dc:creator>
5648
5937
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5649
5938
 
5650
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5651
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5652
- <xsl:if test="position() != last()">; </xsl:if>
5653
- </xsl:for-each>
5654
-
5655
-
5656
-
5939
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5940
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5941
+ <xsl:if test="position() != last()">; </xsl:if>
5942
+ </xsl:for-each>
5943
+
5657
5944
  </xsl:for-each>
5658
5945
  </dc:creator>
5659
5946
  <dc:description>
5660
5947
  <xsl:variable name="abstract">
5661
5948
 
5662
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5663
-
5664
-
5949
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5950
+
5665
5951
  </xsl:variable>
5666
5952
  <xsl:value-of select="normalize-space($abstract)"/>
5667
5953
  </dc:description>
@@ -5681,7 +5967,6 @@
5681
5967
  <xsl:value-of select="../@id"/>
5682
5968
  </xsl:when>
5683
5969
  <xsl:otherwise>
5684
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
5685
5970
  <xsl:value-of select="concat(generate-id(..), '_', text())"/>
5686
5971
  </xsl:otherwise>
5687
5972
  </xsl:choose>
@@ -5707,9 +5992,6 @@
5707
5992
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5708
5993
  <xsl:value-of select="$level_total - 2"/>
5709
5994
  </xsl:when>
5710
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
5711
- <xsl:value-of select="$level_total - 1"/>
5712
- </xsl:when> -->
5713
5995
  <xsl:when test="ancestor::*[local-name() = 'sections']">
5714
5996
  <xsl:value-of select="$level_total - 1"/>
5715
5997
  </xsl:when>
@@ -5851,9 +6133,15 @@
5851
6133
  </xsl:template><xsl:template name="getLocalizedString">
5852
6134
  <xsl:param name="key"/>
5853
6135
  <xsl:param name="formatted">false</xsl:param>
6136
+ <xsl:param name="lang"/>
5854
6137
 
5855
6138
  <xsl:variable name="curr_lang">
5856
- <xsl:call-template name="getLang"/>
6139
+ <xsl:choose>
6140
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
6141
+ <xsl:otherwise>
6142
+ <xsl:call-template name="getLang"/>
6143
+ </xsl:otherwise>
6144
+ </xsl:choose>
5857
6145
  </xsl:variable>
5858
6146
 
5859
6147
  <xsl:variable name="data_value">
@@ -5893,7 +6181,6 @@
5893
6181
  <xsl:value-of select="$key_"/>
5894
6182
  </xsl:otherwise>
5895
6183
  </xsl:choose>
5896
-
5897
6184
  </xsl:template><xsl:template name="setTrackChangesStyles">
5898
6185
  <xsl:param name="isAdded"/>
5899
6186
  <xsl:param name="isDeleted"/>
@@ -5916,7 +6203,6 @@
5916
6203
  <xsl:if test="local-name() = 'table'">
5917
6204
  <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
5918
6205
  </xsl:if>
5919
- <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
5920
6206
  <xsl:attribute name="padding">2mm</xsl:attribute>
5921
6207
  </xsl:if>
5922
6208
  </xsl:otherwise>
@@ -5936,15 +6222,18 @@
5936
6222
  </xsl:choose>
5937
6223
  </xsl:template><xsl:template name="setTextAlignment">
5938
6224
  <xsl:param name="default">left</xsl:param>
6225
+ <xsl:variable name="align" select="normalize-space(@align)"/>
5939
6226
  <xsl:attribute name="text-align">
5940
6227
  <xsl:choose>
5941
- <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
6228
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
6229
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
6230
+ <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
5942
6231
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5943
6232
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5944
6233
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5945
6234
  </xsl:choose>
5946
6235
  </xsl:attribute>
5947
- <xsl:if test="@align = 'indent'">
6236
+ <xsl:if test="$align = 'indent'">
5948
6237
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
5949
6238
  </xsl:if>
5950
6239
  </xsl:template><xsl:template name="number-to-words">
@@ -6043,4 +6332,14 @@
6043
6332
  </xsl:otherwise>
6044
6333
  </xsl:choose>
6045
6334
  </xsl:if>
6335
+ </xsl:template><xsl:template name="setAltText">
6336
+ <xsl:param name="value"/>
6337
+ <xsl:attribute name="fox:alt-text">
6338
+ <xsl:choose>
6339
+ <xsl:when test="normalize-space($value) != ''">
6340
+ <xsl:value-of select="$value"/>
6341
+ </xsl:when>
6342
+ <xsl:otherwise>_</xsl:otherwise>
6343
+ </xsl:choose>
6344
+ </xsl:attribute>
6046
6345
  </xsl:template></xsl:stylesheet>