metanorma-bipm 2.0.0.1 → 2.0.4

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.
@@ -2,14 +2,6 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:param name="svg_images"/>
6
- <xsl:variable name="images" select="document($svg_images)"/>
7
- <xsl:param name="basepath"/>
8
-
9
- <!-- <item id="#">N_page</item> -->
10
- <!-- param for second pass -->
11
- <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
12
-
13
5
  <xsl:param name="align-cross-elements"/>
14
6
 
15
7
 
@@ -85,14 +77,7 @@
85
77
  <xsl:variable name="column_width" select="($page_width - $column_gap) div $docs_count"/>
86
78
 
87
79
  <xsl:variable name="debug">false</xsl:variable>
88
- <xsl:variable name="pageWidth" select="210"/>
89
- <xsl:variable name="pageHeight" select="297"/>
90
- <xsl:variable name="marginLeftRight1" select="25"/>
91
- <xsl:variable name="marginLeftRight2" select="15"/>
92
- <xsl:variable name="marginTop" select="29.5"/>
93
- <xsl:variable name="marginBottom" select="23.5"/>
94
80
 
95
-
96
81
  <xsl:variable name="all_rights_reserved">
97
82
  <xsl:call-template name="getLocalizedString">
98
83
  <xsl:with-param name="key">all_rights_reserved</xsl:with-param>
@@ -163,14 +148,9 @@
163
148
  </xsl:for-each>
164
149
 
165
150
  </xsl:for-each>
166
-
167
151
  </xsl:variable>
168
152
 
169
153
 
170
- <xsl:variable name="lang">
171
- <xsl:call-template name="getLang"/>
172
- </xsl:variable>
173
-
174
154
  <xsl:template match="/">
175
155
  <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
176
156
  <fo:layout-master-set>
@@ -558,9 +538,6 @@
558
538
  <!-- ============================= -->
559
539
  <!-- CONTENTS -->
560
540
  <!-- ============================= -->
561
- <xsl:template match="node()" mode="contents">
562
- <xsl:apply-templates mode="contents"/>
563
- </xsl:template>
564
541
 
565
542
  <!-- element with title -->
566
543
  <xsl:template match="*[*[local-name()='title']]" mode="contents">
@@ -626,43 +603,6 @@
626
603
  </xsl:template>
627
604
 
628
605
 
629
-
630
- <xsl:template name="getListItemFormat">
631
- <xsl:choose>
632
- <xsl:when test="local-name(..) = 'ul'">
633
- <xsl:call-template name="setULLabel"/>
634
- </xsl:when>
635
- <xsl:otherwise> <!-- for ordered lists -->
636
- <xsl:variable name="start_value">
637
- <xsl:choose>
638
- <xsl:when test="normalize-space(../@start) != ''">
639
- <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
640
- </xsl:when>
641
- <xsl:otherwise>0</xsl:otherwise>
642
- </xsl:choose>
643
- </xsl:variable>
644
-
645
- <xsl:variable name="curr_value">
646
- <xsl:number/>
647
- </xsl:variable>
648
-
649
- <xsl:variable name="format">
650
- <xsl:choose>
651
- <xsl:when test="../@type = 'arabic'">1.</xsl:when>
652
- <xsl:when test="../@type = 'alphabet'">a)</xsl:when>
653
- <xsl:when test="../@type = 'alphabet_upper'">A.</xsl:when>
654
- <xsl:when test="../@type = 'roman'">i)</xsl:when>
655
- <xsl:when test="../@type = 'roman_upper'">I.</xsl:when>
656
- <xsl:otherwise>a)</xsl:otherwise>
657
- </xsl:choose>
658
- </xsl:variable>
659
-
660
- <xsl:number value="$start_value + $curr_value" format="{$format}" lang="en"/>
661
-
662
- </xsl:otherwise>
663
- </xsl:choose>
664
- </xsl:template>
665
-
666
606
  <xsl:template name="setListItemLabel">
667
607
  <xsl:attribute name="label">
668
608
  <xsl:call-template name="getListItemFormat"/>
@@ -678,7 +618,7 @@
678
618
 
679
619
 
680
620
 
681
- <xsl:template match="*[local-name()='p']">
621
+ <xsl:template match="*[local-name()='p']" name="paragraph">
682
622
  <xsl:param name="inline" select="'false'"/>
683
623
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
684
624
  <xsl:variable name="element-name">
@@ -725,34 +665,6 @@
725
665
  <xsl:apply-templates/>
726
666
  </xsl:template>
727
667
 
728
-
729
- <xsl:template match="*[local-name()='bibitem']">
730
- <fo:block id="{@id}" margin-bottom="6pt">
731
- <xsl:call-template name="processBibitem"/>
732
- </fo:block>
733
- </xsl:template>
734
-
735
-
736
- <xsl:template match="*[local-name()='bibitem']/*[local-name()='note']" priority="2">
737
- <fo:footnote>
738
- <xsl:variable name="number">
739
- <xsl:number level="any" count="*[local-name()='bibitem']/*[local-name()='note']"/>
740
- </xsl:variable>
741
- <fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="30%"> <!--85% vertical-align="super"-->
742
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
743
- <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
744
- </fo:basic-link>
745
- </fo:inline>
746
- <fo:footnote-body>
747
- <fo:block font-size="10pt" margin-bottom="4pt" start-indent="0pt">
748
- <fo:inline id="{generate-id()}" keep-with-next.within-line="always" alignment-baseline="hanging" padding-right="3mm"><!-- font-size="60%" -->
749
- <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
750
- </fo:inline>
751
- <xsl:apply-templates/>
752
- </fo:block>
753
- </fo:footnote-body>
754
- </fo:footnote>
755
- </xsl:template>
756
668
 
757
669
 
758
670
  <xsl:template match="jcgm:fn/jcgm:p">
@@ -762,34 +674,6 @@
762
674
  </xsl:template>
763
675
 
764
676
 
765
- <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="ul_ol">
766
- <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
767
- <xsl:apply-templates/>
768
- </fo:list-block>
769
- <xsl:for-each select="./*[local-name()='note']">
770
- <xsl:call-template name="note"/>
771
- </xsl:for-each>
772
- </xsl:template>
773
-
774
- <xsl:template match="*[local-name()='ul']//*[local-name()='note'] | *[local-name()='ol']//*[local-name()='note']" priority="2"/>
775
-
776
-
777
- <xsl:template match="*[local-name()='li']">
778
- <fo:list-item id="{@id}">
779
- <fo:list-item-label end-indent="label-end()">
780
- <fo:block>
781
- <xsl:call-template name="getListItemFormat"/>
782
- </fo:block>
783
- </fo:list-item-label>
784
- <fo:list-item-body start-indent="body-start()">
785
- <fo:block>
786
- <xsl:apply-templates/>
787
- <xsl:apply-templates select=".//*[local-name()='note']" mode="process"/>
788
- </fo:block>
789
- </fo:list-item-body>
790
- </fo:list-item>
791
- </xsl:template>
792
-
793
677
 
794
678
  <!-- for two-columns layout -->
795
679
 
@@ -806,42 +690,24 @@
806
690
  </fo:list-item-label>
807
691
  <fo:list-item-body start-indent="body-start()">
808
692
  <fo:block>
809
- <xsl:apply-templates/>
810
- <xsl:apply-templates select=".//*[local-name()='note']" mode="process"/>
693
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
694
+ <xsl:apply-templates select=".//*[local-name()='note']"/>
811
695
  </fo:block>
812
696
  </fo:list-item-body>
813
697
  </fo:list-item>
814
698
  </fo:list-block>
815
699
  </xsl:template>
816
700
 
817
- <xsl:template match="*[local-name()='note']" mode="process">
818
- <xsl:call-template name="note"/>
819
- </xsl:template>
820
-
821
- <xsl:template match="*[local-name()='preferred']">
822
- <xsl:variable name="level">
823
- <xsl:call-template name="getLevel"/>
824
- </xsl:variable>
825
- <fo:block line-height="1.1" role="H{$level}">
826
- <fo:block font-weight="bold" keep-with-next="always">
827
- <xsl:apply-templates select="ancestor::*[local-name()='term'][1]/*[local-name()='name']" mode="presentation"/>
828
- </fo:block>
829
- <fo:block font-weight="bold" keep-with-next="always">
830
- <xsl:call-template name="setStyle_preferred"/>
831
- <xsl:apply-templates/>
832
- </fo:block>
833
- </fo:block>
834
- </xsl:template>
835
701
 
836
- <xsl:template match="*[local-name()='preferred'][not(parent::*[local-name()='term'])]">
702
+ <xsl:template match="*[local-name()='preferred'][not(parent::*[local-name()='term'])]" priority="2">
837
703
  <xsl:variable name="levelTerm">
838
704
  <xsl:call-template name="getLevelTermName"/>
839
705
  </xsl:variable>
840
- <fo:block line-height="1.1" role="H{$levelTerm}">
841
- <fo:block font-weight="bold" keep-with-next="always">
706
+ <fo:block role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
707
+ <fo:block xsl:use-attribute-sets="term-name-style">
842
708
  <xsl:apply-templates select="preceding-sibling::*[local-name()='term_name'][1]" mode="presentation"/>
843
709
  </fo:block>
844
- <fo:block font-weight="bold" keep-with-next="always">
710
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
845
711
  <xsl:call-template name="setStyle_preferred"/>
846
712
  <xsl:apply-templates/>
847
713
  </fo:block>
@@ -871,51 +737,6 @@
871
737
  <fo:block widows="1" orphans="1"><xsl:apply-templates/></fo:block>
872
738
  </xsl:template>
873
739
 
874
-
875
- <xsl:template match="*[local-name()='references'][@normative='true']">
876
- <fo:block id="{@id}">
877
- <xsl:apply-templates/>
878
- </fo:block>
879
- </xsl:template>
880
-
881
- <xsl:template match="*[local-name()='references'][not(@normative='true')]">
882
- <fo:block break-after="page"/>
883
- <fo:block id="{@id}">
884
- <xsl:apply-templates/>
885
- </fo:block>
886
- </xsl:template>
887
-
888
-
889
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
890
- <xsl:template match="*[local-name()='references'][not(@normative='true')]/*[local-name()='bibitem']">
891
- <fo:list-block margin-bottom="6pt" provisional-distance-between-starts="12mm">
892
- <fo:list-item>
893
- <fo:list-item-label end-indent="label-end()">
894
- <fo:block>
895
- <fo:inline id="{@id}">
896
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
897
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
898
- <xsl:number format="[1]"/>
899
- </xsl:if>
900
- </fo:inline>
901
- </fo:block>
902
- </fo:list-item-label>
903
- <fo:list-item-body start-indent="body-start()">
904
- <fo:block>
905
- <xsl:call-template name="processBibitem"/>
906
- </fo:block>
907
- </fo:list-item-body>
908
- </fo:list-item>
909
- </fo:list-block>
910
- </xsl:template>
911
-
912
-
913
- <xsl:template match="*[local-name()='references']/*[local-name()='bibitem']/*[local-name()='title']">
914
- <fo:inline font-style="italic">
915
- <xsl:apply-templates/>
916
- </fo:inline>
917
- </xsl:template>
918
-
919
740
 
920
741
  <xsl:template match="mathml:math" priority="2">
921
742
  <fo:inline font-family="Cambria Math">
@@ -1015,20 +836,7 @@
1015
836
  </xsl:if>
1016
837
  </xsl:template>
1017
838
 
1018
- <xsl:template match="*[local-name()='admonition']">
1019
- <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
1020
- <xsl:variable name="type">
1021
- <xsl:call-template name="getLocalizedString">
1022
- <xsl:with-param name="key">admonition.<xsl:value-of select="@type"/></xsl:with-param>
1023
- </xsl:call-template>
1024
- </xsl:variable>
1025
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($type))"/>
1026
- <xsl:text> — </xsl:text>
1027
- <xsl:apply-templates/>
1028
- </fo:block>
1029
- </xsl:template>
1030
839
 
1031
-
1032
840
  <xsl:template match="*[local-name()='td' or local-name()='th']/*[local-name()='formula']/*[local-name()='stem']" priority="2">
1033
841
  <fo:block>
1034
842
  <xsl:if test="ancestor::*[local-name()='td' or local-name()='th'][1][@align]">
@@ -1040,29 +848,6 @@
1040
848
  </fo:block>
1041
849
  </xsl:template>
1042
850
 
1043
- <xsl:template match="*[local-name()='formula']/*[local-name()='stem']">
1044
- <fo:block margin-top="6pt" margin-bottom="12pt">
1045
- <fo:table table-layout="fixed" width="100%">
1046
- <fo:table-column column-width="95%"/>
1047
- <fo:table-column column-width="5%"/>
1048
- <fo:table-body>
1049
- <fo:table-row>
1050
- <fo:table-cell display-align="center">
1051
- <fo:block text-align="left" margin-left="25mm">
1052
- <xsl:apply-templates/>
1053
- </fo:block>
1054
- </fo:table-cell>
1055
- <fo:table-cell display-align="center">
1056
- <fo:block text-align="right">
1057
- <xsl:apply-templates select="../*[local-name()='name']" mode="presentation"/>
1058
- </fo:block>
1059
- </fo:table-cell>
1060
- </fo:table-row>
1061
- </fo:table-body>
1062
- </fo:table>
1063
- </fo:block>
1064
- </xsl:template>
1065
-
1066
851
 
1067
852
  <xsl:template name="printEdition">
1068
853
  <xsl:variable name="edition" select="normalize-space(//*[local-name()='bibdata']/*[local-name()='edition'])"/>
@@ -1325,23 +1110,10 @@
1325
1110
  <xsl:attribute name="baseline-shift">0%</xsl:attribute>
1326
1111
  <xsl:attribute name="font-size">100%</xsl:attribute>
1327
1112
  </xsl:if>
1328
- <xsl:choose>
1329
- <xsl:when test="$curr_lang = 'fr'">
1330
- <xsl:choose>
1331
- <xsl:when test=". = '1'">re</xsl:when>
1332
- <xsl:otherwise>e</xsl:otherwise>
1333
- </xsl:choose>
1334
- </xsl:when>
1335
- <xsl:otherwise>
1336
- <xsl:choose>
1337
- <xsl:when test=". = '1'">st</xsl:when>
1338
- <xsl:when test=". = '2'">nd</xsl:when>
1339
- <xsl:when test=". = '3'">rd</xsl:when>
1340
- <xsl:otherwise>th</xsl:otherwise>
1341
- </xsl:choose>
1342
- </xsl:otherwise>
1343
- </xsl:choose>
1344
-
1113
+ <xsl:call-template name="number-to-ordinal">
1114
+ <xsl:with-param name="number" select="."/>
1115
+ <xsl:with-param name="curr_lang" select="$curr_lang"/>
1116
+ </xsl:call-template>
1345
1117
  </fo:inline>
1346
1118
  <xsl:text> </xsl:text>
1347
1119
  <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($title-edition))"/>
@@ -1385,28 +1157,6 @@
1385
1157
  </fo:page-sequence>
1386
1158
  </xsl:template>
1387
1159
 
1388
- <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:title" priority="4"> -->
1389
- <xsl:template match="jcgm:indexsect/jcgm:title" priority="4">
1390
- <fo:block font-weight="bold" span="all" role="H1">
1391
- <!-- Index -->
1392
- <xsl:apply-templates/>
1393
- </fo:block>
1394
- </xsl:template>
1395
-
1396
-
1397
- <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:clause/jcgm:title" priority="4"> -->
1398
- <xsl:template match="jcgm:indexsect/jcgm:clause/jcgm:title" priority="4">
1399
- <!-- Letter A, B, C, ... -->
1400
- <fo:block font-weight="bold" margin-left="25mm" keep-with-next="always">
1401
- <xsl:apply-templates/>
1402
- </fo:block>
1403
- </xsl:template>
1404
-
1405
- <!-- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:ul" priority="4"> -->
1406
- <xsl:template match="jcgm:indexsect//jcgm:ul" priority="4">
1407
- <xsl:apply-templates/>
1408
- </xsl:template>
1409
-
1410
1160
 
1411
1161
  <!-- =================== -->
1412
1162
  <!-- End of Index processing -->
@@ -1757,7 +1507,7 @@
1757
1507
  </term>
1758
1508
  To:
1759
1509
  <term/>
1760
- <name>...</name>
1510
+ <term_name>...</term_name>
1761
1511
  <preferred>...</preferred>
1762
1512
  <definition>...</definition>
1763
1513
  <termsource>...</termsource>
@@ -1960,7 +1710,21 @@
1960
1710
  </fo:block-container>
1961
1711
  </xsl:template>
1962
1712
 
1963
- <xsl:variable name="titles_">
1713
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1714
+ <xsl:call-template name="getLang"/>
1715
+ </xsl:variable><xsl:variable name="pageWidth_">
1716
+ 210
1717
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1718
+ 297
1719
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
1720
+ 25
1721
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
1722
+ 15
1723
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
1724
+ 29.5
1725
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
1726
+ 23.5
1727
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
1964
1728
 
1965
1729
  <title-edition lang="en">
1966
1730
 
@@ -1972,6 +1736,10 @@
1972
1736
  <xsl:text>Édition </xsl:text>
1973
1737
  </title-edition>
1974
1738
 
1739
+ <title-edition lang="ru">
1740
+ <xsl:text>Издание </xsl:text>
1741
+ </title-edition>
1742
+
1975
1743
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
1976
1744
  <title-toc lang="en">
1977
1745
 
@@ -1998,7 +1766,11 @@
1998
1766
 
1999
1767
 
2000
1768
 
2001
- </title-part>
1769
+ </title-part>
1770
+ <title-part lang="ru">
1771
+
1772
+
1773
+ </title-part>
2002
1774
  <title-part lang="zh">第 # 部分:</title-part>
2003
1775
 
2004
1776
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -2014,13 +1786,14 @@
2014
1786
 
2015
1787
  <title-summary lang="en">Summary</title-summary>
2016
1788
 
1789
+ <title-continued lang="ru">(продолжение)</title-continued>
2017
1790
  <title-continued lang="en">(continued)</title-continued>
2018
1791
  <title-continued lang="fr">(continué)</title-continued>
2019
1792
 
2020
1793
  </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
2021
1794
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2022
1795
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2023
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1796
+ </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
2024
1797
  <xsl:param name="name"/>
2025
1798
  <xsl:param name="lang"/>
2026
1799
  <xsl:variable name="lang_">
@@ -2043,12 +1816,73 @@
2043
1816
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2044
1817
  </xsl:otherwise>
2045
1818
  </xsl:choose>
2046
- </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">
1819
+ </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:attribute-set name="root-style">
2047
1820
 
2048
1821
  <xsl:attribute name="font-family">Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute>
2049
1822
  <xsl:attribute name="font-size">10.5pt</xsl:attribute>
2050
1823
 
2051
1824
 
1825
+
1826
+
1827
+
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+
1838
+
1839
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
1840
+
1841
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
1842
+
1843
+
1844
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
1845
+
1846
+
1847
+
1848
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
1849
+
1850
+
1851
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
1852
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1853
+
1854
+
1855
+
1856
+
1857
+
1858
+
1859
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
1860
+
1861
+
1862
+
1863
+
1864
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
1865
+
1866
+
1867
+
1868
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
1869
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
1876
+
1877
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
1878
+
1879
+
1880
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
1881
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1882
+
1883
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
1884
+
1885
+
2052
1886
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2053
1887
 
2054
1888
 
@@ -2058,22 +1892,32 @@
2058
1892
 
2059
1893
 
2060
1894
 
1895
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
1896
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1897
+
2061
1898
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2062
1899
  <xsl:attribute name="white-space">pre</xsl:attribute>
2063
1900
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2064
1901
  <xsl:attribute name="role">Code</xsl:attribute>
2065
1902
 
2066
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
2067
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2068
1903
 
2069
1904
 
2070
1905
 
2071
1906
 
2072
1907
 
1908
+
1909
+
1910
+
1911
+
1912
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1913
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1914
+
2073
1915
 
2074
1916
 
2075
1917
 
2076
1918
 
1919
+
1920
+
2077
1921
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
2078
1922
 
2079
1923
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -2138,11 +1982,11 @@
2138
1982
 
2139
1983
 
2140
1984
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2141
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2142
1985
 
2143
1986
 
2144
1987
 
2145
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
1988
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1989
+
2146
1990
 
2147
1991
 
2148
1992
 
@@ -2188,48 +2032,262 @@
2188
2032
 
2189
2033
  </xsl:attribute-set><xsl:variable name="table-border_">
2190
2034
 
2191
- </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
2192
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2193
-
2035
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
2036
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2037
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2194
2038
 
2195
2039
 
2196
2040
 
2197
2041
 
2198
2042
 
2199
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2200
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2201
- <xsl:attribute name="text-align">center</xsl:attribute>
2202
- <!-- <xsl:attribute name="margin-top">12pt</xsl:attribute> -->
2203
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2204
-
2205
2043
 
2206
2044
 
2207
2045
 
2208
-
2209
2046
 
2210
2047
 
2211
2048
 
2049
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2050
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2051
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2212
2052
 
2213
- </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
2214
2053
 
2215
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2216
-
2217
- <xsl:attribute name="font-size">12pt</xsl:attribute>
2218
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2219
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2220
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2221
2054
 
2222
2055
 
2223
2056
 
2224
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2225
2057
 
2226
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2227
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
2228
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2229
2058
 
2230
2059
 
2060
+
2231
2061
 
2232
- </xsl:attribute-set><xsl:attribute-set name="xref-style">
2062
+
2063
+ </xsl:attribute-set><xsl:attribute-set name="table-style">
2064
+ <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2065
+ <xsl:attribute name="table-layout">fixed</xsl:attribute>
2066
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2067
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+
2077
+
2078
+
2079
+ <xsl:attribute name="border">1.5pt solid black</xsl:attribute>
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+
2087
+
2088
+
2089
+
2090
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2091
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2092
+
2093
+
2094
+
2095
+
2096
+
2097
+
2098
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2099
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2100
+ <xsl:attribute name="text-align">center</xsl:attribute>
2101
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2102
+
2103
+
2104
+
2105
+
2106
+
2107
+
2108
+
2109
+
2110
+
2111
+ </xsl:attribute-set><xsl:attribute-set name="table-row-style">
2112
+ <xsl:attribute name="min-height">4mm</xsl:attribute>
2113
+
2114
+
2115
+
2116
+
2117
+ </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
2118
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2119
+
2120
+
2121
+ <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
2122
+ <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
2123
+
2124
+
2125
+
2126
+
2127
+
2128
+
2129
+
2130
+
2131
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2132
+
2133
+
2134
+
2135
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
2136
+ <xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
2137
+ <xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
2138
+
2139
+ </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2140
+
2141
+ </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style">
2142
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2143
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2144
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2145
+ <xsl:attribute name="display-align">center</xsl:attribute>
2146
+
2147
+
2148
+
2149
+
2150
+
2151
+
2152
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2153
+
2154
+
2155
+
2156
+
2157
+
2158
+
2159
+
2160
+
2161
+ </xsl:attribute-set><xsl:attribute-set name="table-cell-style">
2162
+ <xsl:attribute name="display-align">center</xsl:attribute>
2163
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2164
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2165
+
2166
+
2167
+
2168
+
2169
+
2170
+
2171
+
2172
+
2173
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
2181
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2182
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2183
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2184
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2185
+
2186
+
2187
+
2188
+
2189
+
2190
+
2191
+
2192
+
2193
+
2194
+ <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
2195
+
2196
+
2197
+
2198
+ </xsl:attribute-set><xsl:attribute-set name="table-note-style">
2199
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2200
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2201
+
2202
+
2203
+
2204
+
2205
+
2206
+
2207
+
2208
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
2209
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2210
+
2211
+
2212
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
2213
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2214
+
2215
+
2216
+
2217
+
2218
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
2219
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2220
+
2221
+
2222
+
2223
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
2224
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2225
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2226
+
2227
+
2228
+
2229
+
2230
+
2231
+ <xsl:attribute name="alignment-baseline">hanging</xsl:attribute>
2232
+
2233
+
2234
+
2235
+
2236
+
2237
+
2238
+
2239
+
2240
+ </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
2241
+ <xsl:attribute name="text-indent">0</xsl:attribute>
2242
+ <xsl:attribute name="start-indent">0</xsl:attribute>
2243
+
2244
+
2245
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style">
2246
+
2247
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style">
2248
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2249
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2250
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2251
+
2252
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style">
2253
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2254
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2255
+
2256
+ </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
2257
+
2258
+
2259
+ </xsl:attribute-set><xsl:attribute-set name="dt-style">
2260
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2261
+
2262
+
2263
+
2264
+
2265
+
2266
+
2267
+
2268
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2269
+
2270
+
2271
+
2272
+
2273
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2274
+
2275
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
2276
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2277
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2278
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2279
+
2280
+
2281
+
2282
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2283
+
2284
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2285
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
2286
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2287
+
2288
+
2289
+
2290
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
2233
2291
 
2234
2292
 
2235
2293
 
@@ -2284,6 +2342,7 @@
2284
2342
 
2285
2343
 
2286
2344
  </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
2345
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
2287
2346
 
2288
2347
 
2289
2348
 
@@ -2324,13 +2383,12 @@
2324
2383
 
2325
2384
 
2326
2385
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2327
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
2386
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
2387
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
2328
2388
 
2329
2389
 
2330
2390
 
2331
2391
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2332
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
2333
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
2334
2392
  <xsl:attribute name="font-style">italic</xsl:attribute>
2335
2393
  <xsl:attribute name="text-align">justify</xsl:attribute>
2336
2394
 
@@ -2339,10 +2397,8 @@
2339
2397
 
2340
2398
 
2341
2399
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2400
+ <xsl:attribute name="text-align">right</xsl:attribute>
2342
2401
 
2343
-
2344
- <xsl:attribute name="text-align">right</xsl:attribute>
2345
-
2346
2402
 
2347
2403
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
2348
2404
 
@@ -2354,6 +2410,9 @@
2354
2410
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2355
2411
 
2356
2412
 
2413
+ </xsl:attribute-set><xsl:attribute-set name="termsource-text-style">
2414
+
2415
+
2357
2416
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
2358
2417
 
2359
2418
 
@@ -2363,6 +2422,11 @@
2363
2422
 
2364
2423
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2365
2424
 
2425
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
2426
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2427
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2428
+ </xsl:attribute-set><xsl:attribute-set name="figure-style">
2429
+
2366
2430
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2367
2431
 
2368
2432
 
@@ -2391,6 +2455,37 @@
2391
2455
 
2392
2456
 
2393
2457
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
2458
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2459
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+
2466
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
2467
+ <xsl:attribute name="text-align">center</xsl:attribute>
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+ <xsl:attribute name="text-align">left</xsl:attribute>
2476
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
2477
+
2478
+
2479
+
2480
+
2481
+
2482
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
2483
+ <xsl:attribute name="text-align">right</xsl:attribute>
2484
+
2485
+
2486
+
2487
+
2488
+
2394
2489
 
2395
2490
  </xsl:attribute-set><xsl:attribute-set name="image-style">
2396
2491
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2426,6 +2521,20 @@
2426
2521
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2427
2522
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2428
2523
 
2524
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
2525
+
2526
+
2527
+
2528
+
2529
+
2530
+ <xsl:attribute name="line-height">1.1</xsl:attribute>
2531
+
2532
+
2533
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
2534
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2535
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2536
+
2537
+
2429
2538
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2430
2539
 
2431
2540
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2446,13 +2555,19 @@
2446
2555
  </xsl:attribute-set><xsl:variable name="color-added-text">
2447
2556
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2448
2557
  </xsl:variable><xsl:attribute-set name="add-style">
2449
- <xsl:attribute name="color">red</xsl:attribute>
2450
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2451
- <!-- <xsl:attribute name="color">black</xsl:attribute>
2452
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2453
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
2454
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2455
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
2558
+
2559
+ <xsl:attribute name="color">red</xsl:attribute>
2560
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2561
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
2562
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2563
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2564
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2565
+
2566
+ </xsl:attribute-set><xsl:variable name="add-style">
2567
+ <add-style xsl:use-attribute-sets="add-style"/>
2568
+ </xsl:variable><xsl:template name="append_add-style">
2569
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
2570
+ </xsl:template><xsl:variable name="color-deleted-text">
2456
2571
  <xsl:text>red</xsl:text>
2457
2572
  </xsl:variable><xsl:attribute-set name="del-style">
2458
2573
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -2463,8 +2578,49 @@
2463
2578
 
2464
2579
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2465
2580
 
2581
+
2582
+
2583
+
2584
+
2585
+
2586
+
2587
+
2588
+ <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
2589
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
2590
+
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2601
+
2602
+
2603
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
2604
+
2605
+
2606
+
2607
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
2608
+
2609
+
2610
+
2466
2611
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2467
2612
  <xsl:attribute name="line-height">135%</xsl:attribute>
2613
+ </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
2614
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2615
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+
2623
+
2468
2624
  </xsl:attribute-set><xsl:attribute-set name="fn-style">
2469
2625
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2470
2626
  </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
@@ -2494,7 +2650,6 @@
2494
2650
  <xsl:attribute name="text-indent">0</xsl:attribute>
2495
2651
  <xsl:attribute name="start-indent">0</xsl:attribute>
2496
2652
 
2497
-
2498
2653
  <xsl:attribute name="font-size">9pt</xsl:attribute>
2499
2654
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2500
2655
  <xsl:attribute name="line-height">124%</xsl:attribute>
@@ -2516,6 +2671,7 @@
2516
2671
 
2517
2672
 
2518
2673
 
2674
+
2519
2675
  </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
2520
2676
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2521
2677
 
@@ -2539,15 +2695,339 @@
2539
2695
 
2540
2696
 
2541
2697
 
2698
+ </xsl:attribute-set><xsl:attribute-set name="admonition-style">
2699
+
2700
+
2701
+
2702
+
2703
+
2704
+
2705
+
2706
+
2707
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2708
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2709
+
2710
+
2711
+
2712
+
2713
+
2714
+
2715
+
2716
+ </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
2717
+
2718
+
2719
+
2720
+
2721
+
2722
+
2723
+
2724
+
2725
+
2726
+
2727
+ </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
2728
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2729
+
2730
+
2731
+
2732
+
2733
+
2734
+
2735
+
2736
+
2737
+
2738
+
2739
+
2740
+
2741
+
2742
+ </xsl:attribute-set><xsl:attribute-set name="admonition-p-style">
2743
+
2744
+
2745
+
2746
+
2747
+
2748
+
2749
+
2750
+
2751
+
2752
+
2753
+
2754
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
2755
+
2756
+
2757
+
2758
+
2759
+
2760
+
2761
+
2762
+
2763
+
2764
+
2765
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2766
+
2767
+
2768
+
2769
+
2770
+
2771
+
2772
+
2773
+
2774
+
2775
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style">
2776
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
2777
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2778
+
2779
+
2780
+
2781
+
2782
+
2783
+
2784
+
2785
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2786
+
2787
+
2788
+
2789
+
2790
+
2791
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
2792
+
2793
+
2794
+
2795
+
2796
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style">
2797
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
2798
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2799
+
2800
+
2801
+
2802
+
2803
+
2804
+
2805
+
2806
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2807
+
2808
+
2809
+
2810
+
2811
+
2812
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
2813
+
2814
+
2815
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
2816
+
2817
+
2818
+
2819
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
2820
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2821
+ <xsl:attribute name="font-size">65%</xsl:attribute>
2822
+
2823
+
2824
+
2825
+
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+
2832
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
2833
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
2834
+
2835
+
2836
+
2837
+
2838
+
2839
+
2840
+
2841
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
2842
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2843
+
2844
+
2845
+
2846
+
2847
+
2848
+
2849
+
2850
+
2851
+
2852
+
2853
+ <xsl:attribute name="alignment-baseline">hanging</xsl:attribute>
2854
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
2855
+
2856
+
2857
+
2858
+
2859
+
2860
+
2861
+
2862
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
2863
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2864
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2865
+ <xsl:attribute name="start-indent">0pt</xsl:attribute>
2866
+
2867
+
2868
+
2869
+
2870
+
2871
+
2872
+
2873
+
2874
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2875
+
2876
+
2877
+
2878
+
2879
+ </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
2880
+
2881
+
2882
+
2883
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
2884
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2885
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
2886
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2887
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
2888
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2889
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
2890
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2891
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
2892
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2893
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
2894
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2895
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
2896
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2897
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
2898
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2899
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
2900
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2901
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
2902
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2903
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
2904
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2905
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
2906
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2907
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
2908
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2909
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
2910
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2911
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
2912
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2913
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
2914
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2915
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
2916
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2917
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
2918
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2919
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
2920
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2921
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
2922
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2923
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
2924
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2925
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
2926
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2927
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
2928
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2929
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
2930
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2931
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
2932
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2933
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
2934
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2935
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
2936
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2937
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
2938
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2939
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
2940
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2941
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
2942
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2943
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
2944
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2945
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
2946
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2947
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
2948
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2949
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
2950
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2951
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
2952
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2953
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2954
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
2955
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
2956
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
2957
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2958
+ <xsl:attribute name="font-style">italic</xsl:attribute>
2959
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
2960
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2961
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2962
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
2963
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2964
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
2965
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
2966
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
2967
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
2968
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
2969
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
2970
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
2971
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
2972
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
2973
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
2974
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
2975
+ <xsl:attribute name="role">H1</xsl:attribute>
2976
+
2977
+
2978
+
2979
+
2980
+
2981
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2982
+ <xsl:attribute name="span">all</xsl:attribute>
2983
+
2984
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
2985
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2992
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
2993
+
2542
2994
  </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">
2995
+ <xsl:variable name="nodes_preface_">
2996
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2997
+ <node id="{@id}"/>
2998
+ </xsl:for-each>
2999
+ </xsl:variable>
3000
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3001
+
2543
3002
  <xsl:for-each select="/*/*[local-name()='preface']/*">
2544
3003
  <xsl:sort select="@displayorder" data-type="number"/>
3004
+
3005
+ <!-- process Section's title -->
3006
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
3007
+ <xsl:if test="$preceding-sibling_id != ''">
3008
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
3009
+ </xsl:if>
3010
+
2545
3011
  <xsl:apply-templates select="." mode="contents"/>
2546
3012
  </xsl:for-each>
2547
3013
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2548
3014
 
3015
+ <xsl:variable name="nodes_sections_">
3016
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
3017
+ <node id="{@id}"/>
3018
+ </xsl:for-each>
3019
+ </xsl:variable>
3020
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
3021
+
2549
3022
  <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']]">
2550
3023
  <xsl:sort select="@displayorder" data-type="number"/>
3024
+
3025
+ <!-- process Section's title -->
3026
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
3027
+ <xsl:if test="$preceding-sibling_id != ''">
3028
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
3029
+ </xsl:if>
3030
+
2551
3031
  <xsl:apply-templates select="." mode="contents"/>
2552
3032
  </xsl:for-each>
2553
3033
 
@@ -2585,6 +3065,70 @@
2585
3065
  <xsl:value-of select="."/>
2586
3066
  </xsl:template><xsl:template match="*[local-name()='br']">
2587
3067
  <xsl:value-of select="$linebreak"/>
3068
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
3069
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
3070
+ <xsl:apply-templates/>
3071
+ </fo:block>
3072
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
3073
+
3074
+ <!-- process in the template 'title' -->
3075
+ <xsl:call-template name="title"/>
3076
+
3077
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
3078
+
3079
+
3080
+ <!-- process in the template 'paragraph' -->
3081
+ <xsl:call-template name="paragraph"/>
3082
+
3083
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
3084
+ <fo:block xsl:use-attribute-sets="license-statement-style">
3085
+ <xsl:apply-templates/>
3086
+ </fo:block>
3087
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
3088
+
3089
+ <!-- process in the template 'title' -->
3090
+ <xsl:call-template name="title"/>
3091
+
3092
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
3093
+
3094
+ <!-- process in the template 'paragraph' -->
3095
+ <xsl:call-template name="paragraph"/>
3096
+
3097
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
3098
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
3099
+ <xsl:apply-templates/>
3100
+ </fo:block>
3101
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
3102
+
3103
+ <!-- process in the template 'title' -->
3104
+ <xsl:call-template name="title"/>
3105
+
3106
+
3107
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3108
+ <xsl:param name="margin"/>
3109
+
3110
+ <!-- process in the template 'paragraph' -->
3111
+ <xsl:call-template name="paragraph">
3112
+ <xsl:with-param name="margin" select="$margin"/>
3113
+ </xsl:call-template>
3114
+
3115
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3116
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
3117
+ <xsl:apply-templates/>
3118
+ </fo:block>
3119
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
3120
+
3121
+ <!-- process in the template 'title' -->
3122
+ <xsl:call-template name="title"/>
3123
+
3124
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3125
+ <xsl:param name="margin"/>
3126
+
3127
+ <!-- process in the template 'paragraph' -->
3128
+ <xsl:call-template name="paragraph">
3129
+ <xsl:with-param name="margin" select="$margin"/>
3130
+ </xsl:call-template>
3131
+
2588
3132
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2589
3133
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2590
3134
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -2601,10 +3145,6 @@
2601
3145
  <xsl:call-template name="getSimpleTable"/>
2602
3146
  </xsl:variable>
2603
3147
 
2604
- <!-- <xsl:if test="$namespace = 'bipm'">
2605
- <fo:block>&#xA0;</fo:block>
2606
- </xsl:if> -->
2607
-
2608
3148
 
2609
3149
  <!-- Display table's name before table as standalone block -->
2610
3150
  <!-- $namespace = 'iso' or -->
@@ -2622,10 +3162,10 @@
2622
3162
  </xsl:call-template>
2623
3163
  </xsl:if>
2624
3164
  </xsl:variable>
2625
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3165
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2626
3166
 
2627
3167
 
2628
- <xsl:variable name="margin-left">
3168
+ <xsl:variable name="margin-side">
2629
3169
  <xsl:choose>
2630
3170
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2631
3171
  <xsl:otherwise>0</xsl:otherwise>
@@ -2633,78 +3173,65 @@
2633
3173
  </xsl:variable>
2634
3174
 
2635
3175
 
2636
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2637
-
2638
-
2639
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2640
-
2641
-
2642
-
2643
-
2644
-
2645
-
2646
-
2647
-
3176
+ <fo:block-container xsl:use-attribute-sets="table-container-style">
3177
+
2648
3178
 
3179
+
2649
3180
 
3181
+
2650
3182
 
2651
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2652
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2653
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2654
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3183
+
2655
3184
 
2656
3185
 
2657
3186
 
3187
+
2658
3188
 
2659
3189
 
2660
3190
 
2661
3191
 
2662
3192
 
3193
+ <!-- end table block-container attributes -->
2663
3194
 
2664
3195
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2665
3196
 
2666
3197
 
3198
+ <xsl:variable name="table_width_default">100%</xsl:variable>
2667
3199
  <xsl:variable name="table_width">
2668
- <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2669
- 100%
2670
-
2671
-
2672
- </xsl:variable>
2673
-
2674
- <xsl:variable name="table_attributes">
2675
- <attribute name="table-layout">fixed</attribute>
2676
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
2677
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2678
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2679
-
2680
-
2681
- <attribute name="border">1.5pt solid black</attribute>
2682
- <xsl:if test="*[local-name()='thead']">
2683
- <attribute name="border-top">1pt solid black</attribute>
2684
- </xsl:if>
2685
-
2686
-
2687
-
2688
-
2689
-
2690
-
2691
- <attribute name="margin-left">0mm</attribute>
2692
- <attribute name="margin-right">0mm</attribute>
2693
-
2694
-
2695
-
2696
-
2697
-
2698
-
2699
-
2700
-
3200
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3201
+ <xsl:value-of select="$table_width_default"/>
3202
+ </xsl:variable>
3203
+
3204
+
3205
+ <xsl:variable name="table_attributes">
3206
+
3207
+ <xsl:element name="table_attributes" use-attribute-sets="table-style">
3208
+ <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3209
+
3210
+
3211
+
3212
+
3213
+
3214
+
3215
+
3216
+
3217
+
3218
+
3219
+
3220
+
3221
+ <xsl:if test="*[local-name()='thead']">
3222
+ <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
3223
+ </xsl:if>
3224
+
3225
+
3226
+
3227
+ </xsl:element>
2701
3228
  </xsl:variable>
2702
3229
 
2703
3230
 
2704
- <fo:table id="{@id}" table-omit-footer-at-break="true">
3231
+ <fo:table id="{@id}">
2705
3232
 
2706
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2707
- <xsl:attribute name="{@name}">
3233
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
3234
+ <xsl:attribute name="{local-name()}">
2708
3235
  <xsl:value-of select="."/>
2709
3236
  </xsl:attribute>
2710
3237
  </xsl:for-each>
@@ -2715,7 +3242,6 @@
2715
3242
  </xsl:if>
2716
3243
 
2717
3244
 
2718
-
2719
3245
  <xsl:choose>
2720
3246
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2721
3247
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -2741,7 +3267,7 @@
2741
3267
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2742
3268
  </xsl:when>
2743
3269
  <xsl:otherwise>
2744
- <xsl:apply-templates/>
3270
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
2745
3271
  </xsl:otherwise>
2746
3272
  </xsl:choose>
2747
3273
 
@@ -2816,13 +3342,11 @@
2816
3342
  </xsl:otherwise>
2817
3343
  </xsl:choose>
2818
3344
 
2819
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3345
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
2820
3346
  <xsl:param name="continued"/>
2821
3347
  <xsl:if test="normalize-space() != ''">
2822
3348
  <fo:block xsl:use-attribute-sets="table-name-style">
2823
-
2824
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2825
-
3349
+
2826
3350
 
2827
3351
 
2828
3352
 
@@ -2904,7 +3428,7 @@
2904
3428
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2905
3429
  <!-- 2009 thinspace -->
2906
3430
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
2907
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
3431
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2908
3432
  </xsl:call-template>
2909
3433
  </xsl:variable>
2910
3434
  <xsl:variable name="max_length">
@@ -2929,7 +3453,6 @@
2929
3453
  </xsl:otherwise>
2930
3454
  </xsl:choose>
2931
3455
  </xsl:variable>
2932
-
2933
3456
 
2934
3457
  <column>
2935
3458
  <xsl:for-each select="xalan:nodeset($widths)//width">
@@ -2946,8 +3469,7 @@
2946
3469
  </xsl:call-template>
2947
3470
  </xsl:if>
2948
3471
  </xsl:template><xsl:template match="text()" mode="td_text">
2949
- <xsl:variable name="zero-space">​</xsl:variable>
2950
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3472
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2951
3473
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2952
3474
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2953
3475
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -2963,9 +3485,8 @@
2963
3485
 
2964
3486
  <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2965
3487
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2966
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3488
+ </xsl:template><xsl:template match="*[local-name()='thead']">
2967
3489
  <xsl:param name="cols-count"/>
2968
- <!-- font-weight="bold" -->
2969
3490
  <fo:table-header>
2970
3491
 
2971
3492
  <xsl:call-template name="table-header-title">
@@ -2981,13 +3502,13 @@
2981
3502
  <fo:table-row>
2982
3503
  <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">
2983
3504
 
2984
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3505
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2985
3506
  <xsl:with-param name="continued">true</xsl:with-param>
2986
3507
  </xsl:apply-templates>
2987
3508
 
2988
3509
 
2989
3510
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2990
- <xsl:call-template name="fn_name_display"/>
3511
+ <xsl:call-template name="table_name_fn_display"/>
2991
3512
  </xsl:for-each>
2992
3513
 
2993
3514
  <fo:block text-align="right" font-style="italic">
@@ -3002,13 +3523,13 @@
3002
3523
  <fo:table-body>
3003
3524
  <xsl:apply-templates/>
3004
3525
  </fo:table-body>
3005
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
3526
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
3006
3527
  <xsl:apply-templates/>
3007
3528
  </xsl:template><xsl:template name="insertTableFooter">
3008
3529
  <xsl:param name="cols-count"/>
3009
3530
  <xsl:if test="../*[local-name()='tfoot']">
3010
3531
  <fo:table-footer>
3011
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3532
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
3012
3533
  </fo:table-footer>
3013
3534
  </xsl:if>
3014
3535
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
@@ -3036,17 +3557,18 @@
3036
3557
  </xsl:variable>
3037
3558
 
3038
3559
  <fo:table keep-with-previous="always">
3039
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3560
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
3561
+ <xsl:variable name="name" select="local-name()"/>
3040
3562
  <xsl:choose>
3041
- <xsl:when test="@name = 'border-top'">
3042
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
3563
+ <xsl:when test="$name = 'border-top'">
3564
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
3043
3565
  </xsl:when>
3044
- <xsl:when test="@name = 'border'">
3045
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3566
+ <xsl:when test="$name = 'border'">
3567
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
3046
3568
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3047
3569
  </xsl:when>
3048
3570
  <xsl:otherwise>
3049
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3571
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
3050
3572
  </xsl:otherwise>
3051
3573
  </xsl:choose>
3052
3574
  </xsl:for-each>
@@ -3075,11 +3597,10 @@
3075
3597
 
3076
3598
  <fo:table-body>
3077
3599
  <fo:table-row>
3078
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3600
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3079
3601
 
3080
3602
 
3081
- <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
3082
-
3603
+
3083
3604
 
3084
3605
 
3085
3606
  <!-- fn will be processed inside 'note' processing -->
@@ -3089,15 +3610,12 @@
3089
3610
 
3090
3611
 
3091
3612
 
3092
-
3093
-
3094
-
3095
3613
  <!-- for BSI (not PAS) display Notes before footnotes -->
3096
3614
 
3097
3615
 
3098
3616
  <!-- except gb and bsi -->
3099
3617
 
3100
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3618
+ <xsl:apply-templates select="../*[local-name()='note']"/>
3101
3619
 
3102
3620
 
3103
3621
 
@@ -3105,7 +3623,7 @@
3105
3623
 
3106
3624
 
3107
3625
  <!-- fn processing -->
3108
- <xsl:call-template name="fn_display"/>
3626
+ <xsl:call-template name="table_fn_display"/>
3109
3627
 
3110
3628
  <!-- for PAS display Notes after footnotes -->
3111
3629
 
@@ -3144,7 +3662,7 @@
3144
3662
  </xsl:if>
3145
3663
 
3146
3664
 
3147
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
3665
+ <xsl:apply-templates select="../*[local-name()='thead']">
3148
3666
  <xsl:with-param name="cols-count" select="$cols-count"/>
3149
3667
  </xsl:apply-templates>
3150
3668
 
@@ -3195,90 +3713,65 @@
3195
3713
 
3196
3714
  </fo:table-body>
3197
3715
 
3198
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3199
- <xsl:choose>
3200
- <xsl:when test="substring-after(., '—') != ''">
3201
- <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3202
- </xsl:when>
3203
- <xsl:otherwise>
3204
- <xsl:value-of select="."/>
3205
- </xsl:otherwise>
3206
- </xsl:choose>
3207
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3208
- <xsl:apply-templates mode="presentation_name"/>
3209
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3210
- <xsl:apply-templates select="."/>
3211
- </xsl:template><xsl:template match="*[local-name()='tr']">
3212
- <xsl:variable name="parent-name" select="local-name(..)"/>
3213
-
3214
- <fo:table-row min-height="4mm">
3215
- <xsl:if test="$parent-name = 'thead'">
3216
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3217
-
3218
-
3219
-
3220
- <xsl:choose>
3221
- <xsl:when test="position() = 1">
3222
- <xsl:attribute name="border-top">solid black 1.5pt</xsl:attribute>
3223
- <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
3224
- </xsl:when>
3225
- <xsl:when test="position() = last()">
3226
- <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
3227
- <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute>
3228
- </xsl:when>
3229
- <xsl:otherwise>
3230
- <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
3231
- <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
3232
- </xsl:otherwise>
3233
- </xsl:choose>
3234
-
3235
-
3236
-
3237
-
3238
-
3239
-
3240
- </xsl:if>
3241
- <xsl:if test="$parent-name = 'tfoot'">
3242
-
3243
-
3244
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3245
- <xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
3246
- <xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
3247
-
3248
-
3249
- </xsl:if>
3250
-
3251
-
3252
-
3253
-
3254
-
3255
-
3256
-
3257
-
3258
-
3259
-
3260
- <xsl:apply-templates/>
3261
- </fo:table-row>
3262
- </xsl:template><xsl:template match="*[local-name()='th']">
3263
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
3264
- <xsl:attribute name="text-align">
3716
+ </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3717
+ <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3718
+
3719
+
3720
+
3721
+
3265
3722
  <xsl:choose>
3266
- <xsl:when test="@align">
3267
- <xsl:call-template name="setAlignment"/>
3723
+ <xsl:when test="position() = 1">
3724
+ <xsl:attribute name="border-top">solid black 1.5pt</xsl:attribute>
3725
+ <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
3726
+ </xsl:when>
3727
+ <xsl:when test="position() = last()">
3728
+ <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
3729
+ <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute>
3268
3730
  </xsl:when>
3269
- <xsl:otherwise>center</xsl:otherwise>
3270
3731
  </xsl:choose>
3271
- </xsl:attribute>
3732
+
3733
+
3272
3734
 
3273
3735
 
3274
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
3736
+ <xsl:call-template name="setTableRowAttributes"/>
3275
3737
 
3738
+ <xsl:apply-templates/>
3739
+ </fo:table-row>
3740
+ </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3741
+ <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3742
+
3743
+ <xsl:call-template name="setTableRowAttributes"/>
3744
+ <xsl:apply-templates/>
3745
+ </fo:table-row>
3746
+ </xsl:template><xsl:template match="*[local-name()='tr']">
3747
+ <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3748
+
3276
3749
 
3750
+
3277
3751
 
3752
+
3753
+ <xsl:call-template name="setTableRowAttributes"/>
3754
+ <xsl:apply-templates/>
3755
+ </fo:table-row>
3756
+ </xsl:template><xsl:template name="setTableRowAttributes">
3757
+
3758
+
3759
+
3760
+
3761
+
3762
+
3763
+
3764
+
3765
+ </xsl:template><xsl:template match="*[local-name()='th']">
3766
+ <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
3767
+ <xsl:call-template name="setTextAlignment">
3768
+ <xsl:with-param name="default">center</xsl:with-param>
3769
+ </xsl:call-template>
3278
3770
 
3279
3771
 
3280
3772
 
3281
3773
 
3774
+
3282
3775
 
3283
3776
 
3284
3777
 
@@ -3287,21 +3780,25 @@
3287
3780
  <xsl:if test="$lang = 'ar'">
3288
3781
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3289
3782
  </xsl:if>
3290
- <xsl:if test="@colspan">
3291
- <xsl:attribute name="number-columns-spanned">
3292
- <xsl:value-of select="@colspan"/>
3293
- </xsl:attribute>
3294
- </xsl:if>
3295
- <xsl:if test="@rowspan">
3296
- <xsl:attribute name="number-rows-spanned">
3297
- <xsl:value-of select="@rowspan"/>
3298
- </xsl:attribute>
3299
- </xsl:if>
3300
- <xsl:call-template name="display-align"/>
3783
+
3784
+ <xsl:call-template name="setTableCellAttributes"/>
3785
+
3301
3786
  <fo:block>
3302
3787
  <xsl:apply-templates/>
3303
3788
  </fo:block>
3304
3789
  </fo:table-cell>
3790
+ </xsl:template><xsl:template name="setTableCellAttributes">
3791
+ <xsl:if test="@colspan">
3792
+ <xsl:attribute name="number-columns-spanned">
3793
+ <xsl:value-of select="@colspan"/>
3794
+ </xsl:attribute>
3795
+ </xsl:if>
3796
+ <xsl:if test="@rowspan">
3797
+ <xsl:attribute name="number-rows-spanned">
3798
+ <xsl:value-of select="@rowspan"/>
3799
+ </xsl:attribute>
3800
+ </xsl:if>
3801
+ <xsl:call-template name="display-align"/>
3305
3802
  </xsl:template><xsl:template name="display-align">
3306
3803
  <xsl:if test="@valign">
3307
3804
  <xsl:attribute name="display-align">
@@ -3314,96 +3811,80 @@
3314
3811
  </xsl:attribute>
3315
3812
  </xsl:if>
3316
3813
  </xsl:template><xsl:template match="*[local-name()='td']">
3317
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
3318
- <xsl:attribute name="text-align">
3319
- <xsl:choose>
3320
- <xsl:when test="@align">
3321
- <xsl:call-template name="setAlignment"/>
3322
- </xsl:when>
3323
- <xsl:otherwise>left</xsl:otherwise>
3324
- </xsl:choose>
3325
- </xsl:attribute>
3814
+ <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
3815
+ <xsl:call-template name="setTextAlignment">
3816
+ <xsl:with-param name="default">left</xsl:with-param>
3817
+ </xsl:call-template>
3818
+
3326
3819
  <xsl:if test="$lang = 'ar'">
3327
3820
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3328
3821
  </xsl:if>
3329
- <!-- and ancestor::*[local-name() = 'thead'] -->
3330
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3331
3822
 
3332
3823
 
3333
3824
 
3334
- <xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
3335
- <xsl:attribute name="padding-left">0mm</xsl:attribute>
3336
- </xsl:if>
3825
+ <!-- bsi -->
3337
3826
 
3338
3827
 
3339
3828
 
3340
- <xsl:if test="ancestor::*[local-name() = 'tfoot']">
3341
- <xsl:attribute name="border">solid black 0</xsl:attribute>
3342
- </xsl:if>
3343
3829
 
3344
3830
 
3345
3831
 
3346
3832
 
3347
3833
 
3834
+
3348
3835
 
3836
+ <xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
3837
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3838
+ </xsl:if>
3839
+ <xsl:if test="ancestor::*[local-name() = 'tfoot']">
3840
+ <xsl:attribute name="border">solid black 0</xsl:attribute>
3841
+ </xsl:if>
3349
3842
 
3350
3843
 
3351
3844
 
3352
3845
 
3353
3846
 
3354
3847
 
3355
- <xsl:if test=".//*[local-name() = 'table']">
3848
+ <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3356
3849
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3357
3850
  </xsl:if>
3358
- <xsl:if test="@colspan">
3359
- <xsl:attribute name="number-columns-spanned">
3360
- <xsl:value-of select="@colspan"/>
3361
- </xsl:attribute>
3362
- </xsl:if>
3363
- <xsl:if test="@rowspan">
3364
- <xsl:attribute name="number-rows-spanned">
3365
- <xsl:value-of select="@rowspan"/>
3366
- </xsl:attribute>
3367
- </xsl:if>
3368
- <xsl:call-template name="display-align"/>
3851
+
3852
+ <xsl:call-template name="setTableCellAttributes"/>
3853
+
3369
3854
  <fo:block>
3370
-
3855
+
3856
+
3857
+
3371
3858
  <xsl:apply-templates/>
3372
3859
  </fo:block>
3373
3860
  </fo:table-cell>
3374
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
3375
-
3861
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
3862
+
3863
+ <fo:block xsl:use-attribute-sets="table-note-style">
3864
+
3865
+
3866
+
3867
+
3376
3868
 
3377
- <fo:block font-size="10pt" margin-bottom="12pt">
3869
+ <!-- Table's note name (NOTE, for example) -->
3870
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
3378
3871
 
3379
3872
 
3380
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3381
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3382
3873
 
3383
3874
 
3384
3875
 
3385
3876
 
3386
3877
 
3387
-
3388
-
3389
- <!-- Table's note name (NOTE, for example) -->
3390
-
3391
- <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
3392
-
3878
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3393
3879
 
3394
-
3395
-
3396
-
3397
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3398
-
3399
- </fo:inline>
3400
-
3401
-
3402
-
3403
- <xsl:apply-templates mode="process"/>
3404
- </fo:block>
3880
+ </fo:inline>
3881
+
3882
+
3883
+
3884
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3885
+ </fo:block>
3405
3886
 
3406
- </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">
3887
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
3407
3888
  <xsl:apply-templates/>
3408
3889
  </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">
3409
3890
 
@@ -3481,8 +3962,7 @@
3481
3962
  <xsl:copy-of select="$footnote_inline"/>
3482
3963
  <fo:footnote-body>
3483
3964
 
3484
- <fo:block-container text-indent="0" start-indent="0">
3485
-
3965
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3486
3966
 
3487
3967
  <fo:block xsl:use-attribute-sets="fn-body-style">
3488
3968
 
@@ -3501,7 +3981,7 @@
3501
3981
  <xsl:copy-of select="$footnote_inline"/>
3502
3982
  </xsl:otherwise>
3503
3983
  </xsl:choose>
3504
- </xsl:template><xsl:template name="fn_display">
3984
+ </xsl:template><xsl:template name="table_fn_display">
3505
3985
  <xsl:variable name="references">
3506
3986
 
3507
3987
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
@@ -3512,35 +3992,26 @@
3512
3992
  <xsl:for-each select="xalan:nodeset($references)//fn">
3513
3993
  <xsl:variable name="reference" select="@reference"/>
3514
3994
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3515
- <fo:block margin-bottom="12pt">
3995
+ <fo:block xsl:use-attribute-sets="table-fn-style">
3516
3996
 
3517
3997
 
3518
3998
 
3519
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3520
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3521
-
3522
-
3523
-
3524
-
3525
-
3526
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
3999
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3527
4000
 
3528
4001
 
3529
- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute>
3530
4002
 
3531
4003
 
3532
4004
 
4005
+ <xsl:value-of select="@reference"/>
3533
4006
 
3534
4007
 
3535
4008
 
3536
4009
 
3537
- <xsl:value-of select="@reference"/>
3538
4010
 
3539
4011
 
3540
4012
 
3541
4013
  </fo:inline>
3542
- <fo:inline>
3543
-
4014
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3544
4015
  <xsl:copy-of select="./node()"/>
3545
4016
  </fo:inline>
3546
4017
  </fo:block>
@@ -3552,7 +4023,7 @@
3552
4023
 
3553
4024
  <xsl:apply-templates/>
3554
4025
  </fn>
3555
- </xsl:template><xsl:template name="fn_name_display">
4026
+ </xsl:template><xsl:template name="table_name_fn_display">
3556
4027
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
3557
4028
  <xsl:variable name="reference" select="@reference"/>
3558
4029
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -3561,9 +4032,7 @@
3561
4032
  </fo:block>
3562
4033
  </xsl:for-each>
3563
4034
  </xsl:template><xsl:template name="fn_display_figure">
3564
- <xsl:variable name="key_iso">
3565
- true <!-- and (not(@class) or @class !='pseudocode') -->
3566
- </xsl:variable>
4035
+
3567
4036
  <xsl:variable name="references">
3568
4037
  <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
3569
4038
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -3571,48 +4040,52 @@
3571
4040
  </fn>
3572
4041
  </xsl:for-each>
3573
4042
  </xsl:variable>
4043
+
4044
+ <xsl:if test="xalan:nodeset($references)//fn">
3574
4045
 
3575
- <!-- current hierarchy is 'figure' element -->
3576
- <xsl:variable name="following_dl_colwidths">
3577
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3578
- <xsl:variable name="html-table">
3579
- <xsl:variable name="doc_ns">
4046
+ <xsl:variable name="key_iso">
4047
+ true
4048
+ </xsl:variable>
4049
+
4050
+ <!-- current hierarchy is 'figure' element -->
4051
+ <xsl:variable name="following_dl_colwidths">
4052
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
4053
+ <xsl:variable name="html-table">
4054
+ <xsl:variable name="doc_ns">
4055
+
4056
+ </xsl:variable>
4057
+ <xsl:variable name="ns">
4058
+ <xsl:choose>
4059
+ <xsl:when test="normalize-space($doc_ns) != ''">
4060
+ <xsl:value-of select="normalize-space($doc_ns)"/>
4061
+ </xsl:when>
4062
+ <xsl:otherwise>
4063
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
4064
+ </xsl:otherwise>
4065
+ </xsl:choose>
4066
+ </xsl:variable>
3580
4067
 
3581
- </xsl:variable>
3582
- <xsl:variable name="ns">
3583
- <xsl:choose>
3584
- <xsl:when test="normalize-space($doc_ns) != ''">
3585
- <xsl:value-of select="normalize-space($doc_ns)"/>
3586
- </xsl:when>
3587
- <xsl:otherwise>
3588
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3589
- </xsl:otherwise>
3590
- </xsl:choose>
4068
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
4069
+ <tbody>
4070
+ <xsl:apply-templates mode="dl"/>
4071
+ </tbody>
4072
+ </xsl:for-each>
3591
4073
  </xsl:variable>
3592
4074
 
3593
- <xsl:for-each select="*[local-name() = 'dl'][1]">
3594
- <tbody>
3595
- <xsl:apply-templates mode="dl"/>
3596
- </tbody>
3597
- </xsl:for-each>
3598
- </xsl:variable>
3599
-
3600
- <xsl:call-template name="calculate-column-widths">
3601
- <xsl:with-param name="cols-count" select="2"/>
3602
- <xsl:with-param name="table" select="$html-table"/>
3603
- </xsl:call-template>
3604
-
3605
- </xsl:if>
3606
- </xsl:variable>
3607
-
3608
-
3609
- <xsl:variable name="maxlength_dt">
3610
- <xsl:for-each select="*[local-name() = 'dl'][1]">
3611
- <xsl:call-template name="getMaxLength_dt"/>
3612
- </xsl:for-each>
3613
- </xsl:variable>
3614
-
3615
- <xsl:if test="xalan:nodeset($references)//fn">
4075
+ <xsl:call-template name="calculate-column-widths">
4076
+ <xsl:with-param name="cols-count" select="2"/>
4077
+ <xsl:with-param name="table" select="$html-table"/>
4078
+ </xsl:call-template>
4079
+
4080
+ </xsl:if>
4081
+ </xsl:variable>
4082
+
4083
+ <xsl:variable name="maxlength_dt">
4084
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
4085
+ <xsl:call-template name="getMaxLength_dt"/>
4086
+ </xsl:for-each>
4087
+ </xsl:variable>
4088
+
3616
4089
  <fo:block>
3617
4090
  <fo:table width="95%" table-layout="fixed">
3618
4091
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -3639,20 +4112,18 @@
3639
4112
  <fo:table-row>
3640
4113
  <fo:table-cell>
3641
4114
  <fo:block>
3642
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
3643
-
4115
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
3644
4116
  <xsl:value-of select="@reference"/>
3645
4117
  </fo:inline>
3646
4118
  </fo:block>
3647
4119
  </fo:table-cell>
3648
4120
  <fo:table-cell>
3649
- <fo:block text-align="justify" margin-bottom="12pt">
3650
-
4121
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
3651
4122
  <xsl:if test="normalize-space($key_iso) = 'true'">
3652
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
4123
+
4124
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
4125
+
3653
4126
  </xsl:if>
3654
-
3655
- <!-- <xsl:apply-templates /> -->
3656
4127
  <xsl:copy-of select="./node()"/>
3657
4128
  </fo:block>
3658
4129
  </fo:table-cell>
@@ -3665,7 +4136,8 @@
3665
4136
  </xsl:if>
3666
4137
 
3667
4138
  </xsl:template><xsl:template match="*[local-name()='fn']">
3668
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
4139
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
4140
+
3669
4141
 
3670
4142
 
3671
4143
 
@@ -3675,12 +4147,6 @@
3675
4147
  </xsl:if>
3676
4148
 
3677
4149
 
3678
-
3679
-
3680
-
3681
-
3682
-
3683
-
3684
4150
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3685
4151
 
3686
4152
 
@@ -3720,9 +4186,9 @@
3720
4186
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3721
4187
  </xsl:call-template>
3722
4188
 
3723
- <fo:block-container>
4189
+ <fo:block-container margin-left="0mm">
4190
+
3724
4191
 
3725
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3726
4192
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
3727
4193
 
3728
4194
 
@@ -3950,12 +4416,12 @@
3950
4416
  <xsl:if test="normalize-space($key_iso) = 'true'">
3951
4417
  <xsl:attribute name="margin-top">0</xsl:attribute>
3952
4418
  </xsl:if>
3953
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4419
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3954
4420
  </fo:block>
3955
4421
  </fo:table-cell>
3956
4422
  <fo:table-cell>
3957
4423
  <fo:block>
3958
- <xsl:apply-templates/>
4424
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3959
4425
  </fo:block>
3960
4426
  </fo:table-cell>
3961
4427
  </fo:table-row>
@@ -3966,7 +4432,9 @@
3966
4432
  </td>
3967
4433
  <td>
3968
4434
 
3969
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4435
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4436
+ <xsl:with-param name="process">true</xsl:with-param>
4437
+ </xsl:apply-templates>
3970
4438
 
3971
4439
  </td>
3972
4440
  </tr>
@@ -3974,28 +4442,18 @@
3974
4442
  </xsl:template><xsl:template match="*[local-name()='dt']">
3975
4443
  <xsl:param name="key_iso"/>
3976
4444
 
3977
- <fo:table-row>
3978
-
3979
-
4445
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
3980
4446
  <fo:table-cell>
3981
4447
 
3982
- <fo:block margin-top="6pt">
4448
+ <fo:block xsl:use-attribute-sets="dt-style">
3983
4449
  <xsl:copy-of select="@id"/>
3984
4450
 
3985
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
3986
-
3987
-
3988
4451
  <xsl:if test="normalize-space($key_iso) = 'true'">
3989
4452
  <xsl:attribute name="margin-top">0</xsl:attribute>
3990
-
3991
4453
  </xsl:if>
3992
4454
 
3993
4455
 
3994
4456
 
3995
-
3996
-
3997
-
3998
-
3999
4457
  <xsl:apply-templates/>
4000
4458
  </fo:block>
4001
4459
  </fo:table-cell>
@@ -4003,15 +4461,20 @@
4003
4461
  <fo:block>
4004
4462
 
4005
4463
 
4006
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4464
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4465
+ <xsl:with-param name="process">true</xsl:with-param>
4466
+ </xsl:apply-templates>
4007
4467
  </fo:block>
4008
4468
  </fo:table-cell>
4009
4469
  </fo:table-row>
4010
4470
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
4011
4471
  <xsl:apply-templates/>
4012
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
4013
- <xsl:apply-templates select="@language"/>
4014
- <xsl:apply-templates/>
4472
+ </xsl:template><xsl:template match="*[local-name()='dd']">
4473
+ <xsl:param name="process">false</xsl:param>
4474
+ <xsl:if test="$process = 'true'">
4475
+ <xsl:apply-templates select="@language"/>
4476
+ <xsl:apply-templates/>
4477
+ </xsl:if>
4015
4478
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4016
4479
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4017
4480
  </xsl:template><xsl:template match="*[local-name()='em']">
@@ -4035,6 +4498,7 @@
4035
4498
  </fo:inline>
4036
4499
  </xsl:template><xsl:template match="*[local-name()='tt']">
4037
4500
  <fo:inline xsl:use-attribute-sets="tt-style">
4501
+
4038
4502
  <xsl:variable name="_font-size">
4039
4503
 
4040
4504
 
@@ -4070,16 +4534,46 @@
4070
4534
  <fo:inline text-decoration="underline">
4071
4535
  <xsl:apply-templates/>
4072
4536
  </fo:inline>
4073
- </xsl:template><xsl:template match="*[local-name()='add']">
4537
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
4538
+ <xsl:param name="skip">true</xsl:param>
4539
+ <xsl:param name="block">false</xsl:param>
4540
+ <xsl:param name="type"/>
4541
+ <xsl:param name="text-align"/>
4074
4542
  <xsl:choose>
4075
4543
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4076
- <fo:inline>
4077
- <xsl:call-template name="insertTag">
4078
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
4079
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4080
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4081
- </xsl:call-template>
4082
- </fo:inline>
4544
+ <xsl:choose>
4545
+ <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']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4546
+ <xsl:otherwise>
4547
+ <xsl:variable name="tag">
4548
+ <xsl:call-template name="insertTag">
4549
+ <xsl:with-param name="type">
4550
+ <xsl:choose>
4551
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4552
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4553
+ </xsl:choose>
4554
+ </xsl:with-param>
4555
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4556
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4557
+ </xsl:call-template>
4558
+ </xsl:variable>
4559
+ <xsl:choose>
4560
+ <xsl:when test="$block = 'false'">
4561
+ <fo:inline>
4562
+ <xsl:copy-of select="$tag"/>
4563
+ </fo:inline>
4564
+ </xsl:when>
4565
+ <xsl:otherwise>
4566
+ <fo:block> <!-- for around figures -->
4567
+ <xsl:if test="$text-align != ''">
4568
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
4569
+ </xsl:if>
4570
+ <xsl:copy-of select="$tag"/>
4571
+ </fo:block>
4572
+ </xsl:otherwise>
4573
+ </xsl:choose>
4574
+
4575
+ </xsl:otherwise>
4576
+ </xsl:choose>
4083
4577
  </xsl:when>
4084
4578
  <xsl:when test="@amendment">
4085
4579
  <fo:inline>
@@ -4179,7 +4673,11 @@
4179
4673
  <xsl:with-param name="text" select="substring($text,2)"/>
4180
4674
  </xsl:call-template>
4181
4675
  </xsl:if>
4182
- </xsl:template><xsl:template name="tokenize">
4676
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
4677
+ <fo:block break-after="page"/>
4678
+ <fo:block> </fo:block>
4679
+ <fo:block break-after="page"/>
4680
+ </xsl:template><xsl:template name="tokenize">
4183
4681
  <xsl:param name="text"/>
4184
4682
  <xsl:param name="separator" select="' '"/>
4185
4683
  <xsl:choose>
@@ -4432,17 +4930,21 @@
4432
4930
  </xsl:apply-templates>
4433
4931
  </xsl:template><xsl:template name="getLang">
4434
4932
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4435
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4436
4933
  <xsl:variable name="language">
4437
4934
  <xsl:choose>
4438
4935
  <xsl:when test="$language_current != ''">
4439
4936
  <xsl:value-of select="$language_current"/>
4440
4937
  </xsl:when>
4441
- <xsl:when test="$language_current_2 != ''">
4442
- <xsl:value-of select="$language_current_2"/>
4443
- </xsl:when>
4444
4938
  <xsl:otherwise>
4445
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4939
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4940
+ <xsl:choose>
4941
+ <xsl:when test="$language_current_2 != ''">
4942
+ <xsl:value-of select="$language_current_2"/>
4943
+ </xsl:when>
4944
+ <xsl:otherwise>
4945
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4946
+ </xsl:otherwise>
4947
+ </xsl:choose>
4446
4948
  </xsl:otherwise>
4447
4949
  </xsl:choose>
4448
4950
  </xsl:variable>
@@ -4493,6 +4995,7 @@
4493
4995
  <xsl:apply-templates select="." mode="mathml"/>
4494
4996
  </xsl:variable>
4495
4997
  <fo:instream-foreign-object fox:alt-text="Math">
4998
+
4496
4999
 
4497
5000
 
4498
5001
  <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
@@ -4524,6 +5027,7 @@
4524
5027
  </xsl:attribute>
4525
5028
 
4526
5029
 
5030
+
4527
5031
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4528
5032
  </fo:instream-foreign-object>
4529
5033
  </fo:inline>
@@ -4582,6 +5086,10 @@
4582
5086
 
4583
5087
 
4584
5088
 
5089
+
5090
+
5091
+
5092
+
4585
5093
  <xsl:choose>
4586
5094
  <xsl:when test="$target_text = ''">
4587
5095
  <xsl:apply-templates/>
@@ -4605,10 +5113,10 @@
4605
5113
  </fo:inline>
4606
5114
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4607
5115
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4608
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
5116
+ <xsl:apply-templates select="*[local-name()='title']"/>
4609
5117
  </fo:block>
4610
- <xsl:apply-templates/>
4611
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
5118
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
5119
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
4612
5120
  <xsl:variable name="level">
4613
5121
  <xsl:call-template name="getLevel"/>
4614
5122
  </xsl:variable>
@@ -4639,7 +5147,9 @@
4639
5147
  </fo:inline>
4640
5148
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4641
5149
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4642
-
5150
+ <xsl:if test="parent::*[local-name() = 'add']">
5151
+ <xsl:call-template name="append_add-style"/>
5152
+ </xsl:if>
4643
5153
  <xsl:apply-templates/>
4644
5154
  </fo:basic-link>
4645
5155
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4654,8 +5164,8 @@
4654
5164
 
4655
5165
  </xsl:if>
4656
5166
  <fo:block-container margin-left="0mm">
4657
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
4658
- <xsl:apply-templates/>
5167
+ <fo:block id="{@id}">
5168
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
4659
5169
  </fo:block>
4660
5170
  </fo:block-container>
4661
5171
  </fo:block-container>
@@ -4667,18 +5177,57 @@
4667
5177
  <fo:inline>
4668
5178
  <xsl:apply-templates/>
4669
5179
  </fo:inline>
4670
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
5180
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
4671
5181
  <xsl:if test="normalize-space() != ''">
4672
5182
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
4673
5183
  </xsl:if>
5184
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
5185
+ <fo:block xsl:use-attribute-sets="formula-style">
5186
+
5187
+
5188
+
5189
+ <fo:table table-layout="fixed" width="100%">
5190
+ <fo:table-column column-width="95%"/>
5191
+ <fo:table-column column-width="5%"/>
5192
+ <fo:table-body>
5193
+ <fo:table-row>
5194
+ <fo:table-cell display-align="center">
5195
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5196
+
5197
+
5198
+
5199
+ <xsl:apply-templates/>
5200
+ </fo:block>
5201
+ </fo:table-cell>
5202
+ <fo:table-cell display-align="center">
5203
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
5204
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
5205
+ </fo:block>
5206
+ </fo:table-cell>
5207
+ </fo:table-row>
5208
+ </fo:table-body>
5209
+ </fo:table>
5210
+ </fo:block>
5211
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
5212
+ <fo:block xsl:use-attribute-sets="formula-style">
5213
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5214
+ <xsl:apply-templates/>
5215
+ </fo:block>
5216
+ </fo:block>
4674
5217
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
4675
5218
 
4676
5219
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5220
+
4677
5221
 
4678
5222
 
4679
5223
 
4680
5224
 
4681
5225
 
5226
+
5227
+
5228
+
5229
+
5230
+
4682
5231
  <fo:block-container margin-left="0mm">
4683
5232
 
4684
5233
 
@@ -4689,15 +5238,34 @@
4689
5238
  <fo:block>
4690
5239
 
4691
5240
 
5241
+
4692
5242
 
4693
5243
 
4694
5244
 
4695
5245
 
4696
5246
  <fo:inline xsl:use-attribute-sets="note-name-style">
5247
+
5248
+
5249
+
5250
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5251
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
5252
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
5253
+ <xsl:call-template name="append_add-style"/>
5254
+ </xsl:if>
5255
+
5256
+
5257
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
5258
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
5259
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
5260
+ <xsl:with-param name="skip">false</xsl:with-param>
5261
+ </xsl:apply-templates>
5262
+ </xsl:if>
5263
+
5264
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4697
5265
 
4698
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4699
5266
  </fo:inline>
4700
- <xsl:apply-templates/>
5267
+
5268
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4701
5269
  </fo:block>
4702
5270
 
4703
5271
  </fo:block-container>
@@ -4706,7 +5274,7 @@
4706
5274
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
4707
5275
  <xsl:variable name="num"><xsl:number/></xsl:variable>
4708
5276
  <xsl:choose>
4709
- <xsl:when test="$num = 1">
5277
+ <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
4710
5278
  <fo:inline xsl:use-attribute-sets="note-p-style">
4711
5279
  <xsl:apply-templates/>
4712
5280
  </fo:inline>
@@ -4721,12 +5289,22 @@
4721
5289
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
4722
5290
 
4723
5291
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5292
+
5293
+
5294
+
5295
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5296
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
5297
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
5298
+ <xsl:call-template name="append_add-style"/>
5299
+ </xsl:if>
5300
+
5301
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4724
5302
 
4725
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4726
5303
  </fo:inline>
4727
- <xsl:apply-templates/>
5304
+
5305
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4728
5306
  </fo:block>
4729
- </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">
5307
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
4730
5308
  <xsl:param name="sfx"/>
4731
5309
  <xsl:variable name="suffix">
4732
5310
  <xsl:choose>
@@ -4743,7 +5321,7 @@
4743
5321
  <xsl:apply-templates/>
4744
5322
  <xsl:value-of select="$suffix"/>
4745
5323
  </xsl:if>
4746
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
5324
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']">
4747
5325
  <xsl:param name="sfx"/>
4748
5326
  <xsl:variable name="suffix">
4749
5327
  <xsl:choose>
@@ -4771,14 +5349,17 @@
4771
5349
  </fo:block>
4772
5350
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4773
5351
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5352
+
5353
+
5354
+
4774
5355
 
4775
5356
 
4776
5357
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
4777
5358
 
4778
5359
  </xsl:if>
4779
- <xsl:apply-templates/>
5360
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4780
5361
  </fo:block>
4781
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5362
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
4782
5363
  <xsl:if test="normalize-space() != ''">
4783
5364
  <xsl:variable name="level">
4784
5365
  <xsl:call-template name="getLevelTermName"/>
@@ -4797,9 +5378,10 @@
4797
5378
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4798
5379
  </xsl:call-template>
4799
5380
 
4800
- <fo:block>
4801
-
4802
- <xsl:apply-templates/>
5381
+
5382
+
5383
+ <fo:block xsl:use-attribute-sets="figure-style">
5384
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4803
5385
  </fo:block>
4804
5386
  <xsl:call-template name="fn_display_figure"/>
4805
5387
  <xsl:for-each select="*[local-name() = 'note']">
@@ -4807,15 +5389,15 @@
4807
5389
  </xsl:for-each>
4808
5390
 
4809
5391
 
4810
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5392
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
4811
5393
 
4812
5394
 
4813
5395
  </fo:block-container>
4814
5396
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
4815
5397
  <fo:block id="{@id}">
4816
- <xsl:apply-templates/>
5398
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4817
5399
  </fo:block>
4818
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5400
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4819
5401
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4820
5402
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4821
5403
  <xsl:apply-templates/>
@@ -5192,7 +5774,7 @@
5192
5774
  </fo:basic-link>
5193
5775
  </fo:block>
5194
5776
  </fo:block-container>
5195
- </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">
5777
+ </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">
5196
5778
  <xsl:apply-templates mode="contents"/>
5197
5779
  <xsl:text> </xsl:text>
5198
5780
  </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">
@@ -5204,7 +5786,11 @@
5204
5786
  <xsl:value-of select="."/>
5205
5787
  </xsl:template><xsl:template match="node()" mode="contents">
5206
5788
  <xsl:apply-templates mode="contents"/>
5207
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
5789
+ </xsl:template><xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder">
5790
+ <xsl:call-template name="contents_section-title"/>
5791
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
5792
+ <xsl:call-template name="contents_section-title"/>
5793
+ </xsl:template><xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
5208
5794
  <xsl:variable name="level">
5209
5795
  <xsl:call-template name="getLevel">
5210
5796
  <xsl:with-param name="depth" select="@depth"/>
@@ -5212,10 +5798,15 @@
5212
5798
  </xsl:variable>
5213
5799
 
5214
5800
  <xsl:variable name="section">
5215
- <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5801
+ <xsl:choose>
5802
+ <xsl:when test="@type = 'section-title'"/>
5803
+ <xsl:otherwise>
5804
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5805
+ </xsl:otherwise>
5806
+ </xsl:choose>
5216
5807
  </xsl:variable>
5217
5808
 
5218
- <xsl:variable name="type">floating-title</xsl:variable>
5809
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
5219
5810
 
5220
5811
  <xsl:variable name="display">
5221
5812
  <xsl:choose>
@@ -5232,7 +5823,16 @@
5232
5823
  <xsl:variable name="title">
5233
5824
  <xsl:choose>
5234
5825
  <xsl:when test="*[local-name() = 'tab']">
5235
- <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5826
+ <xsl:choose>
5827
+ <xsl:when test="@type = 'section-title'">
5828
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5829
+ <xsl:text>: </xsl:text>
5830
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5831
+ </xsl:when>
5832
+ <xsl:otherwise>
5833
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5834
+ </xsl:otherwise>
5835
+ </xsl:choose>
5236
5836
  </xsl:when>
5237
5837
  <xsl:otherwise>
5238
5838
  <xsl:copy-of select="node()"/>
@@ -5415,7 +6015,7 @@
5415
6015
  <xsl:apply-templates mode="bookmark"/>
5416
6016
  </xsl:otherwise>
5417
6017
  </xsl:choose>
5418
- </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">
6018
+ </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']">
5419
6019
  <xsl:if test="normalize-space() != ''">
5420
6020
  <fo:block xsl:use-attribute-sets="figure-name-style">
5421
6021
 
@@ -5499,16 +6099,21 @@
5499
6099
  <xsl:apply-templates mode="contents_item">
5500
6100
  <xsl:with-param name="mode" select="$mode"/>
5501
6101
  </xsl:apply-templates>
5502
- </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
6102
+ </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item">
5503
6103
  <xsl:param name="mode">bookmarks</xsl:param>
5504
- <xsl:if test="$mode = 'contents'">
5505
- <xsl:copy>
5506
- <xsl:apply-templates mode="contents_item"/>
5507
- </xsl:copy>
5508
- </xsl:if>
6104
+ <xsl:choose>
6105
+ <xsl:when test="starts-with(text(), $ace_tag)">
6106
+ <xsl:if test="$mode = 'contents'">
6107
+ <xsl:copy>
6108
+ <xsl:apply-templates mode="contents_item"/>
6109
+ </xsl:copy>
6110
+ </xsl:if>
6111
+ </xsl:when>
6112
+ <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
6113
+ </xsl:choose>
5509
6114
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
5510
6115
 
5511
- <fo:block-container margin-left="0mm">
6116
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
5512
6117
  <xsl:copy-of select="@id"/>
5513
6118
 
5514
6119
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -5545,6 +6150,7 @@
5545
6150
 
5546
6151
 
5547
6152
  </xsl:variable>
6153
+
5548
6154
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5549
6155
  <xsl:if test="$font-size != ''">
5550
6156
  <xsl:attribute name="font-size">
@@ -5561,11 +6167,11 @@
5561
6167
 
5562
6168
 
5563
6169
 
5564
- <xsl:apply-templates/>
6170
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5565
6171
  </fo:block>
5566
6172
 
5567
6173
 
5568
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6174
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
5569
6175
 
5570
6176
 
5571
6177
 
@@ -5573,13 +6179,141 @@
5573
6179
  </fo:block-container>
5574
6180
  </fo:block-container>
5575
6181
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
5576
- <xsl:variable name="text">
6182
+ <xsl:choose>
6183
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6184
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6185
+ <xsl:choose>
6186
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
6187
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
6188
+ </xsl:when>
6189
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
6190
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6191
+ </xsl:otherwise>
6192
+ </xsl:choose>
6193
+ </xsl:when>
6194
+ <xsl:otherwise>
6195
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6196
+ </xsl:otherwise>
6197
+ </xsl:choose>
6198
+
6199
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
6200
+ <xsl:variable name="text_step1">
5577
6201
  <xsl:call-template name="add-zero-spaces-equal"/>
5578
6202
  </xsl:variable>
5579
- <xsl:call-template name="add-zero-spaces-java">
5580
- <xsl:with-param name="text" select="$text"/>
5581
- </xsl:call-template>
5582
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
6203
+ <xsl:variable name="text_step2">
6204
+ <xsl:call-template name="add-zero-spaces-java">
6205
+ <xsl:with-param name="text" select="$text_step1"/>
6206
+ </xsl:call-template>
6207
+ </xsl:variable>
6208
+ <xsl:value-of select="$text_step2"/>
6209
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
6210
+ <xsl:apply-templates mode="syntax_highlight"/>
6211
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
6212
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
6213
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
6214
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
6215
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
6216
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
6217
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
6218
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
6219
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
6220
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
6221
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
6222
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
6223
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
6224
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
6225
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
6226
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
6227
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
6228
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
6229
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
6230
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
6231
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
6232
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
6233
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
6234
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
6235
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
6236
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
6237
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
6238
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
6239
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
6240
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
6241
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
6242
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
6243
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
6244
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
6245
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
6246
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
6247
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
6248
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
6249
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
6250
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
6251
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
6252
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
6253
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
6254
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
6255
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
6256
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
6257
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
6258
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
6259
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
6260
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
6261
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
6262
+ <fo:inline>
6263
+ <xsl:variable name="classes_">
6264
+ <xsl:call-template name="split">
6265
+ <xsl:with-param name="pText" select="@class"/>
6266
+ <xsl:with-param name="sep" select="' '"/>
6267
+ </xsl:call-template>
6268
+ <!-- a few classes together (_and_ suffix) -->
6269
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
6270
+ <item>hljs-char_and_escape_</item>
6271
+ </xsl:if>
6272
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
6273
+ <item>hljs-title_and_class_</item>
6274
+ </xsl:if>
6275
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
6276
+ <item>hljs-title_and_class__and_inherited__</item>
6277
+ </xsl:if>
6278
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
6279
+ <item>hljs-title_and_function_</item>
6280
+ </xsl:if>
6281
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
6282
+ <item>hljs-variable_and_language_</item>
6283
+ </xsl:if>
6284
+ <!-- with parent classes (_ suffix) -->
6285
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
6286
+ <item>hljs-meta_hljs-keyword</item>
6287
+ </xsl:if>
6288
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
6289
+ <item>hljs-meta_hljs-string</item>
6290
+ </xsl:if>
6291
+ </xsl:variable>
6292
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
6293
+
6294
+ <xsl:for-each select="$classes/item">
6295
+ <xsl:variable name="class_name" select="."/>
6296
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6297
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6298
+ </xsl:for-each>
6299
+ </xsl:for-each>
6300
+
6301
+ <!-- <xsl:variable name="class_name">
6302
+ <xsl:choose>
6303
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
6304
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
6305
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
6306
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
6307
+ </xsl:choose>
6308
+ </xsl:variable>
6309
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6310
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6311
+ </xsl:for-each> -->
6312
+
6313
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
6314
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
6315
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6316
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
5583
6317
  <xsl:if test="normalize-space() != ''">
5584
6318
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
5585
6319
  <xsl:apply-templates/>
@@ -5587,10 +6321,10 @@
5587
6321
  </xsl:if>
5588
6322
  </xsl:template><xsl:template match="*[local-name() = 'permission']">
5589
6323
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
5590
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5591
- <xsl:apply-templates/>
6324
+ <xsl:apply-templates select="*[local-name()='name']"/>
6325
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5592
6326
  </fo:block>
5593
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
6327
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
5594
6328
  <xsl:if test="normalize-space() != ''">
5595
6329
  <fo:block xsl:use-attribute-sets="permission-name-style">
5596
6330
  <xsl:apply-templates/>
@@ -5603,13 +6337,13 @@
5603
6337
  </fo:block>
5604
6338
  </xsl:template><xsl:template match="*[local-name() = 'requirement']">
5605
6339
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
5606
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5607
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
5608
- <xsl:apply-templates select="@obligation" mode="presentation"/>
5609
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
5610
- <xsl:apply-templates/>
6340
+ <xsl:apply-templates select="*[local-name()='name']"/>
6341
+ <xsl:apply-templates select="*[local-name()='label']"/>
6342
+ <xsl:apply-templates select="@obligation"/>
6343
+ <xsl:apply-templates select="*[local-name()='subject']"/>
6344
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/>
5611
6345
  </fo:block>
5612
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
6346
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
5613
6347
  <xsl:if test="normalize-space() != ''">
5614
6348
  <fo:block xsl:use-attribute-sets="requirement-name-style">
5615
6349
 
@@ -5617,20 +6351,24 @@
5617
6351
 
5618
6352
  </fo:block>
5619
6353
  </xsl:if>
5620
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
6354
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']">
5621
6355
  <fo:block xsl:use-attribute-sets="requirement-label-style">
5622
6356
  <xsl:apply-templates/>
5623
6357
  </fo:block>
5624
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
6358
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation">
5625
6359
  <fo:block>
5626
6360
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
5627
6361
  </fo:block>
6362
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2">
6363
+ <fo:block xsl:use-attribute-sets="subject-style">
6364
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6365
+ </fo:block>
5628
6366
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
5629
6367
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5630
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5631
- <xsl:apply-templates/>
6368
+ <xsl:apply-templates select="*[local-name()='name']"/>
6369
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5632
6370
  </fo:block>
5633
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
6371
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
5634
6372
  <xsl:if test="normalize-space() != ''">
5635
6373
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
5636
6374
  <xsl:apply-templates/>
@@ -5641,10 +6379,6 @@
5641
6379
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5642
6380
  <xsl:apply-templates/>
5643
6381
  </fo:block>
5644
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5645
- <fo:block xsl:use-attribute-sets="subject-style">
5646
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5647
- </fo:block>
5648
6382
  </xsl:template><xsl:template match="*[local-name() = 'subject']">
5649
6383
  <fo:block xsl:use-attribute-sets="subject-style">
5650
6384
  <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
@@ -5697,7 +6431,7 @@
5697
6431
  <xsl:if test=".//*[local-name() = 'fn']">
5698
6432
  <xsl:for-each select="*[local-name() = 'tbody']">
5699
6433
  <fo:block font-size="90%" border-bottom="1pt solid black">
5700
- <xsl:call-template name="fn_display"/>
6434
+ <xsl:call-template name="table_fn_display"/>
5701
6435
  </fo:block>
5702
6436
  </xsl:for-each>
5703
6437
  </xsl:if>
@@ -5726,25 +6460,11 @@
5726
6460
  </fo:table-row>
5727
6461
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
5728
6462
  <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
5729
- <xsl:attribute name="text-align">
5730
- <xsl:choose>
5731
- <xsl:when test="@align">
5732
- <xsl:value-of select="@align"/>
5733
- </xsl:when>
5734
- <xsl:otherwise>left</xsl:otherwise>
5735
- </xsl:choose>
5736
- </xsl:attribute>
5737
- <xsl:if test="@colspan">
5738
- <xsl:attribute name="number-columns-spanned">
5739
- <xsl:value-of select="@colspan"/>
5740
- </xsl:attribute>
5741
- </xsl:if>
5742
- <xsl:if test="@rowspan">
5743
- <xsl:attribute name="number-rows-spanned">
5744
- <xsl:value-of select="@rowspan"/>
5745
- </xsl:attribute>
5746
- </xsl:if>
5747
- <xsl:call-template name="display-align"/>
6463
+ <xsl:call-template name="setTextAlignment">
6464
+ <xsl:with-param name="default">left</xsl:with-param>
6465
+ </xsl:call-template>
6466
+
6467
+ <xsl:call-template name="setTableCellAttributes"/>
5748
6468
 
5749
6469
  <fo:block>
5750
6470
  <xsl:apply-templates/>
@@ -5756,28 +6476,15 @@
5756
6476
  <xsl:attribute name="padding">0mm</xsl:attribute>
5757
6477
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
5758
6478
  </xsl:if>
5759
- <xsl:attribute name="text-align">
5760
- <xsl:choose>
5761
- <xsl:when test="@align">
5762
- <xsl:value-of select="@align"/>
5763
- </xsl:when>
5764
- <xsl:otherwise>left</xsl:otherwise>
5765
- </xsl:choose>
5766
- </xsl:attribute>
6479
+ <xsl:call-template name="setTextAlignment">
6480
+ <xsl:with-param name="default">left</xsl:with-param>
6481
+ </xsl:call-template>
6482
+
5767
6483
  <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
5768
6484
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5769
6485
  </xsl:if>
5770
- <xsl:if test="@colspan">
5771
- <xsl:attribute name="number-columns-spanned">
5772
- <xsl:value-of select="@colspan"/>
5773
- </xsl:attribute>
5774
- </xsl:if>
5775
- <xsl:if test="@rowspan">
5776
- <xsl:attribute name="number-rows-spanned">
5777
- <xsl:value-of select="@rowspan"/>
5778
- </xsl:attribute>
5779
- </xsl:if>
5780
- <xsl:call-template name="display-align"/>
6486
+
6487
+ <xsl:call-template name="setTableCellAttributes"/>
5781
6488
 
5782
6489
  <fo:block>
5783
6490
  <xsl:apply-templates/>
@@ -5794,10 +6501,10 @@
5794
6501
  </fo:block>
5795
6502
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
5796
6503
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
5797
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5798
- <xsl:apply-templates/>
6504
+ <xsl:apply-templates select="*[local-name()='name']"/>
6505
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5799
6506
  </fo:block>
5800
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
6507
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
5801
6508
  <xsl:if test="normalize-space() != ''">
5802
6509
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
5803
6510
  <xsl:apply-templates/>
@@ -5823,9 +6530,7 @@
5823
6530
 
5824
6531
  <xsl:variable name="fo_element">
5825
6532
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
5826
-
5827
6533
  inline
5828
-
5829
6534
  </xsl:variable>
5830
6535
 
5831
6536
  <!-- display 'EXAMPLE' -->
@@ -5903,6 +6608,8 @@
5903
6608
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
5904
6609
  <fo:block xsl:use-attribute-sets="termsource-style">
5905
6610
 
6611
+
6612
+
5906
6613
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5907
6614
  <xsl:variable name="termsource_text">
5908
6615
  <xsl:apply-templates/>
@@ -5940,9 +6647,7 @@
5940
6647
  <xsl:value-of select="."/>
5941
6648
  </xsl:if>
5942
6649
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
5943
- <fo:inline>
5944
-
5945
-
6650
+ <fo:inline xsl:use-attribute-sets="termsource-text-style">
5946
6651
  <xsl:value-of select="."/>
5947
6652
  </fo:inline>
5948
6653
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
@@ -5987,8 +6692,7 @@
5987
6692
  </xsl:if>
5988
6693
 
5989
6694
  <fo:block-container margin-left="0mm">
5990
-
5991
- <fo:block xsl:use-attribute-sets="quote-style">
6695
+ <fo:block-container xsl:use-attribute-sets="quote-style">
5992
6696
 
5993
6697
  <xsl:if test="ancestor::*[local-name() = 'boilerplate']">
5994
6698
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
@@ -5996,8 +6700,12 @@
5996
6700
  <xsl:attribute name="font-style">normal</xsl:attribute>
5997
6701
  </xsl:if>
5998
6702
 
5999
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6000
- </fo:block>
6703
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6704
+ <fo:block role="BlockQuote">
6705
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6706
+ </fo:block>
6707
+ </fo:block-container>
6708
+ </fo:block-container>
6001
6709
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
6002
6710
  <fo:block xsl:use-attribute-sets="quote-source-style">
6003
6711
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -6037,7 +6745,7 @@
6037
6745
  </xsl:variable>
6038
6746
 
6039
6747
  <xsl:choose>
6040
- <xsl:when test="normalize-space($bibitemid) != ''">
6748
+ <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
6041
6749
  <fo:inline xsl:use-attribute-sets="eref-style">
6042
6750
  <xsl:if test="@type = 'footnote'">
6043
6751
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -6060,7 +6768,6 @@
6060
6768
 
6061
6769
 
6062
6770
 
6063
-
6064
6771
  </xsl:if>
6065
6772
 
6066
6773
 
@@ -6118,7 +6825,6 @@
6118
6825
  </xsl:choose>
6119
6826
  </xsl:variable>
6120
6827
 
6121
-
6122
6828
  <xsl:choose>
6123
6829
  <xsl:when test="$lang = 'zh'">
6124
6830
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -6144,6 +6850,31 @@
6144
6850
  <xsl:with-param name="count" select="$count - 1"/>
6145
6851
  </xsl:call-template>
6146
6852
  </xsl:if>
6853
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
6854
+ <xsl:variable name="level">
6855
+ <xsl:call-template name="getLevel"/>
6856
+ </xsl:variable>
6857
+ <xsl:variable name="font-size">
6858
+ inherit
6859
+ </xsl:variable>
6860
+ <xsl:variable name="levelTerm">
6861
+ <xsl:call-template name="getLevelTermName"/>
6862
+ </xsl:variable>
6863
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
6864
+
6865
+
6866
+
6867
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
6868
+ <fo:block xsl:use-attribute-sets="term-name-style">
6869
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
6870
+ </fo:block>
6871
+ </xsl:if>
6872
+
6873
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
6874
+ <xsl:call-template name="setStyle_preferred"/>
6875
+ <xsl:apply-templates/>
6876
+ </fo:block>
6877
+ </fo:block>
6147
6878
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
6148
6879
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
6149
6880
  <xsl:text> </xsl:text>
@@ -6218,11 +6949,6 @@
6218
6949
  <xsl:apply-templates/>
6219
6950
  </fo:block>
6220
6951
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
6221
- <fo:block id="{@id}">
6222
- <xsl:apply-templates/>
6223
- </fo:block>
6224
- </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']">
6225
-
6226
6952
  <fo:block id="{@id}">
6227
6953
  <xsl:apply-templates/>
6228
6954
  </fo:block>
@@ -6241,26 +6967,10 @@
6241
6967
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6242
6968
  </xsl:template><xsl:variable name="ul_labels_">
6243
6969
 
6244
-
6245
-
6246
-
6247
-
6248
-
6249
-
6250
-
6251
- <label level="1">—</label> <!-- em dash -->
6252
- <label level="2">−</label><!-- minus sign -->
6253
- <label level="3" font-size="75%">o</label> <!-- white circle -->
6254
-
6255
-
6256
-
6257
-
6258
-
6259
-
6260
-
6261
-
6262
-
6263
-
6970
+ <label level="1">—</label> <!-- em dash -->
6971
+ <label level="2">−</label><!-- minus sign -->
6972
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
6973
+
6264
6974
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
6265
6975
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6266
6976
  <xsl:variable name="list_level">
@@ -6283,9 +6993,94 @@
6283
6993
  <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
6284
6994
  </xsl:otherwise>
6285
6995
  </xsl:choose>
6286
- </xsl:template><xsl:template match="label" mode="ul_labels">
6287
- <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6288
- <xsl:value-of select="."/>
6996
+ </xsl:template><xsl:template match="label" mode="ul_labels">
6997
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6998
+ <xsl:value-of select="."/>
6999
+ </xsl:template><xsl:template name="getListItemFormat">
7000
+ <!-- Example: for BSI <?list-type loweralpha?> -->
7001
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
7002
+ <xsl:choose>
7003
+ <xsl:when test="local-name(..) = 'ul'">
7004
+ <xsl:choose>
7005
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
7006
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
7007
+ </xsl:choose>
7008
+ </xsl:when>
7009
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
7010
+
7011
+ <!-- Example: for BSI <?list-start 2?> -->
7012
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
7013
+
7014
+ <xsl:variable name="start_value">
7015
+ <xsl:choose>
7016
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
7017
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7018
+ </xsl:when>
7019
+ <xsl:when test="normalize-space(../@start) != ''">
7020
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7021
+ </xsl:when>
7022
+ <xsl:otherwise>0</xsl:otherwise>
7023
+ </xsl:choose>
7024
+ </xsl:variable>
7025
+
7026
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
7027
+
7028
+ <xsl:variable name="type">
7029
+ <xsl:choose>
7030
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
7031
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
7032
+
7033
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
7034
+
7035
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
7036
+ <xsl:variable name="list_level">
7037
+ <xsl:choose>
7038
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
7039
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
7040
+ </xsl:choose>
7041
+ </xsl:variable>
7042
+
7043
+ <xsl:choose>
7044
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
7045
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
7046
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
7047
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
7048
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
7049
+ <xsl:otherwise> <!-- level 1 -->
7050
+ <xsl:choose>
7051
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
7052
+ <xsl:otherwise>alphabet</xsl:otherwise>
7053
+ </xsl:choose>
7054
+ </xsl:otherwise>
7055
+ </xsl:choose>
7056
+
7057
+ </xsl:otherwise>
7058
+ </xsl:choose>
7059
+ </xsl:variable>
7060
+
7061
+ <xsl:variable name="format">
7062
+ <xsl:choose>
7063
+ <xsl:when test="$type = 'arabic'">
7064
+ 1.
7065
+ </xsl:when>
7066
+ <xsl:when test="$type = 'alphabet'">
7067
+ a)
7068
+ </xsl:when>
7069
+ <xsl:when test="$type = 'alphabet_upper'">
7070
+ A.
7071
+ </xsl:when>
7072
+ <xsl:when test="$type = 'roman'">
7073
+ i)
7074
+ </xsl:when>
7075
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
7076
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
7077
+ </xsl:choose>
7078
+ </xsl:variable>
7079
+
7080
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
7081
+
7082
+ </xsl:otherwise>
7083
+ </xsl:choose>
6289
7084
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6290
7085
  <xsl:choose>
6291
7086
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -6301,18 +7096,71 @@
6301
7096
 
6302
7097
  <fo:block-container margin-left="0mm">
6303
7098
  <fo:block>
6304
- <xsl:apply-templates select="." mode="ul_ol"/>
7099
+ <xsl:apply-templates select="." mode="list"/>
6305
7100
  </fo:block>
6306
7101
  </fo:block-container>
6307
7102
  </fo:block-container>
6308
7103
  </xsl:when>
6309
7104
  <xsl:otherwise>
6310
7105
  <fo:block>
6311
- <xsl:apply-templates select="." mode="ul_ol"/>
7106
+ <xsl:apply-templates select="." mode="list"/>
6312
7107
  </fo:block>
6313
7108
  </xsl:otherwise>
6314
7109
  </xsl:choose>
6315
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
7110
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7111
+ <fo:list-block xsl:use-attribute-sets="list-style">
7112
+
7113
+
7114
+
7115
+
7116
+
7117
+
7118
+
7119
+
7120
+
7121
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7122
+ </fo:list-block>
7123
+ <!-- <xsl:for-each select="./iho:note">
7124
+ <xsl:call-template name="note"/>
7125
+ </xsl:for-each> -->
7126
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
7127
+ </xsl:template><xsl:template match="*[local-name()='li']">
7128
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
7129
+ <xsl:copy-of select="@id"/>
7130
+
7131
+
7132
+
7133
+ <fo:list-item-label end-indent="label-end()">
7134
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
7135
+
7136
+
7137
+
7138
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7139
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
7140
+ <xsl:call-template name="append_add-style"/>
7141
+ </xsl:if>
7142
+
7143
+ <xsl:call-template name="getListItemFormat"/>
7144
+ </fo:block>
7145
+ </fo:list-item-label>
7146
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
7147
+ <fo:block>
7148
+
7149
+
7150
+
7151
+
7152
+
7153
+ <xsl:apply-templates/>
7154
+
7155
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
7156
+
7157
+ <xsl:for-each select="./bsi:note">
7158
+ <xsl:call-template name="note"/>
7159
+ </xsl:for-each> -->
7160
+ </fo:block>
7161
+ </fo:list-item-body>
7162
+ </fo:list-item>
7163
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
6316
7164
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
6317
7165
  <bookmark><xsl:value-of select="@id"/></bookmark>
6318
7166
  </xsl:for-each>
@@ -6334,7 +7182,7 @@
6334
7182
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
6335
7183
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
6336
7184
  <xsl:if test="@to">
6337
- <xsl:value-of select="$dash"/>
7185
+ <xsl:value-of select="$en_dash"/>
6338
7186
  <xsl:copy>
6339
7187
  <xsl:copy-of select="@*"/>
6340
7188
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -6359,7 +7207,7 @@
6359
7207
  <xsl:param name="target"/>
6360
7208
  <!-- <node></node> -->
6361
7209
  <xsl:choose>
6362
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
7210
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
6363
7211
  <!-- skip text (i.e. remove it) and process next element -->
6364
7212
  <!-- [removed_<xsl:value-of select="."/>] -->
6365
7213
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -6443,12 +7291,22 @@
6443
7291
  </xsl:variable>
6444
7292
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
6445
7293
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7294
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
7295
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
7296
+ <!-- Index -->
7297
+ <xsl:apply-templates/>
7298
+ </fo:block>
7299
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
7300
+ <!-- Letter A, B, C, ... -->
7301
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
7302
+ <xsl:apply-templates/>
7303
+ </fo:block>
6446
7304
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
6447
7305
  <xsl:apply-templates/>
6448
7306
  <fo:block>
6449
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
6450
- <fo:block> </fo:block>
6451
- </xsl:if>
7307
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
7308
+ <fo:block> </fo:block>
7309
+ </xsl:if>
6452
7310
  </fo:block>
6453
7311
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
6454
7312
  <xsl:apply-templates/>
@@ -6458,6 +7316,9 @@
6458
7316
 
6459
7317
  <xsl:apply-templates/>
6460
7318
  </fo:block>
7319
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
7320
+ <!-- to split by '_' and other chars -->
7321
+ <xsl:call-template name="add-zero-spaces-java"/>
6461
7322
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
6462
7323
  <fo:inline id="{@id}" font-size="1pt"/>
6463
7324
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -6492,64 +7353,105 @@
6492
7353
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
6493
7354
  <fo:block><xsl:apply-templates/></fo:block>
6494
7355
  </fo:table-cell>
6495
- </xsl:template><xsl:template name="processBibitem">
6496
-
7356
+ </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">
6497
7357
 
6498
7358
 
6499
7359
 
7360
+ <fo:block id="{@id}">
7361
+ <xsl:apply-templates/>
7362
+ </fo:block>
7363
+ </xsl:template><xsl:template match="*[local-name() = 'references']">
7364
+ <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
7365
+
7366
+ <fo:block break-after="page"/>
7367
+
7368
+ </xsl:if>
6500
7369
 
7370
+ <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
7371
+ <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'">
7372
+ <fo:block break-after="page"/>
7373
+ </xsl:if>
7374
+ </xsl:if> -->
6501
7375
 
7376
+ <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
7377
+ <xsl:apply-templates/>
7378
+ </fo:block>
6502
7379
 
6503
7380
 
6504
7381
 
6505
7382
 
7383
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']">
7384
+ <xsl:call-template name="bibitem"/>
7385
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
6506
7386
 
6507
-
7387
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
7388
+ <xsl:call-template name="processBibitem"/>
7389
+ </fo:block>
7390
+
7391
+
7392
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
7393
+
7394
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
7395
+ $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
7396
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
7397
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
7398
+ <fo:list-item>
7399
+ <fo:list-item-label end-indent="label-end()">
7400
+ <fo:block>
7401
+ <fo:inline>
7402
+
7403
+ <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
7404
+ <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
7405
+ <xsl:number format="[1]"/>
7406
+ </xsl:if>
7407
+
7408
+ </fo:inline>
7409
+ </fo:block>
7410
+ </fo:list-item-label>
7411
+ <fo:list-item-body start-indent="body-start()">
7412
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
7413
+ <xsl:call-template name="processBibitem"/>
7414
+ </fo:block>
7415
+ </fo:list-item-body>
7416
+ </fo:list-item>
7417
+ </fo:list-block>
7418
+
6508
7419
 
7420
+ </xsl:template><xsl:template name="processBibitem">
6509
7421
 
6510
-
6511
7422
 
6512
- <!-- start JCGM bibitem processing -->
6513
- <xsl:variable name="docidentifier">
6514
- <xsl:if test="*[local-name()='docidentifier']">
7423
+ <!-- start JCGM bibitem processing -->
7424
+ <xsl:variable name="docidentifier">
6515
7425
  <xsl:choose>
6516
7426
  <xsl:when test="*[local-name()='docidentifier']/@type = 'metanorma'"/>
6517
7427
  <xsl:otherwise><xsl:value-of select="*[local-name()='docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
6518
7428
  </xsl:choose>
6519
- </xsl:if>
6520
- </xsl:variable>
6521
- <xsl:value-of select="$docidentifier"/>
7429
+ </xsl:variable>
7430
+ <xsl:value-of select="$docidentifier"/>
7431
+
7432
+ <xsl:choose>
7433
+ <xsl:when test="*[local-name()='formattedref']">
7434
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
7435
+ <xsl:apply-templates select="*[local-name()='formattedref']"/>
7436
+ </xsl:when>
7437
+ <xsl:otherwise>
7438
+ <xsl:apply-templates select="*[local-name()='note']"/>
7439
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
7440
+ <xsl:choose>
7441
+ <xsl:when test="*[local-name()='title'][@type = 'main' and @language = $lang]">
7442
+ <xsl:apply-templates select="*[local-name()='title'][@type = 'main' and @language = $lang]"/>
7443
+ </xsl:when>
7444
+ <xsl:when test="*[local-name()='title'][@type = 'main' and @language = 'en']">
7445
+ <xsl:apply-templates select="*[local-name()='title'][@type = 'main' and @language = 'en']"/>
7446
+ </xsl:when>
7447
+ <xsl:otherwise>
7448
+ <xsl:apply-templates select="*[local-name()='title']"/>
7449
+ </xsl:otherwise>
7450
+ </xsl:choose>
7451
+ </xsl:otherwise>
7452
+ </xsl:choose>
7453
+ <!-- end JCGM bibitem processing -->
6522
7454
 
6523
- <xsl:choose>
6524
- <xsl:when test="*[local-name()='formattedref']">
6525
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
6526
- <xsl:apply-templates select="*[local-name()='formattedref']"/>
6527
- </xsl:when>
6528
- <xsl:otherwise>
6529
- <xsl:apply-templates select="*[local-name()='note']"/>
6530
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
6531
- <xsl:choose>
6532
- <xsl:when test="*[local-name()='title'][@type = 'main' and @language = $lang]">
6533
- <xsl:apply-templates select="*[local-name()='title'][@type = 'main' and @language = $lang]"/>
6534
- </xsl:when>
6535
- <xsl:when test="*[local-name()='title'][@type = 'main' and @language = 'en']">
6536
- <xsl:apply-templates select="*[local-name()='title'][@type = 'main' and @language = 'en']"/>
6537
- </xsl:when>
6538
- <xsl:otherwise>
6539
- <xsl:apply-templates select="*[local-name()='title']"/>
6540
- </xsl:otherwise>
6541
- </xsl:choose>
6542
- </xsl:otherwise>
6543
- </xsl:choose>
6544
- <!-- end JCGM bibitem processing -->
6545
-
6546
-
6547
-
6548
-
6549
-
6550
-
6551
-
6552
-
6553
7455
  </xsl:template><xsl:template name="processBibitemDocId">
6554
7456
  <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')]"/>
6555
7457
  <xsl:choose>
@@ -6606,6 +7508,52 @@
6606
7508
  <xsl:value-of select="substring(.,1,1)"/>
6607
7509
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
6608
7510
  <fo:inline><xsl:apply-templates/></fo:inline>
7511
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
7512
+ <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
7513
+ <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
7514
+ <xsl:apply-templates/>
7515
+ </fo:inline>
7516
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
7517
+ <fo:footnote>
7518
+ <xsl:variable name="number">
7519
+
7520
+ <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
7521
+
7522
+ </xsl:variable>
7523
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
7524
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
7525
+ <xsl:value-of select="$number"/>
7526
+
7527
+ <xsl:text>)</xsl:text>
7528
+
7529
+ </fo:basic-link>
7530
+ </fo:inline>
7531
+ <fo:footnote-body>
7532
+ <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
7533
+ <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7534
+ <xsl:value-of select="$number"/>
7535
+
7536
+ <xsl:text>)</xsl:text>
7537
+
7538
+ </fo:inline>
7539
+ <xsl:apply-templates/>
7540
+ </fo:block>
7541
+ </fo:footnote-body>
7542
+ </fo:footnote>
7543
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
7544
+ <xsl:text> edition </xsl:text>
7545
+ <xsl:value-of select="."/>
7546
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
7547
+ <xsl:text> (</xsl:text>
7548
+ <fo:inline xsl:use-attribute-sets="link-style">
7549
+ <fo:basic-link external-destination="." fox:alt-text=".">
7550
+ <xsl:value-of select="."/>
7551
+ </fo:basic-link>
7552
+ </fo:inline>
7553
+ <xsl:text>)</xsl:text>
7554
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']">
7555
+
7556
+ <xsl:apply-templates/>
6609
7557
  </xsl:template><xsl:template match="*[local-name() = 'form']">
6610
7558
  <fo:block>
6611
7559
  <xsl:apply-templates/>
@@ -6712,7 +7660,7 @@
6712
7660
  </fo:table-body>
6713
7661
  </fo:table>
6714
7662
  </fo:block>
6715
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7663
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
6716
7664
  <fo:table-row min-height="5mm">
6717
7665
  <xsl:apply-templates/>
6718
7666
  </fo:table-row>
@@ -6774,8 +7722,58 @@
6774
7722
  </fo:inline>
6775
7723
  </xsl:template><xsl:template match="@language">
6776
7724
  <xsl:copy-of select="."/>
6777
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
7725
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
6778
7726
  <xsl:call-template name="title"/>
7727
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']">
7728
+
7729
+
7730
+
7731
+
7732
+
7733
+
7734
+ <fo:block xsl:use-attribute-sets="admonition-style">
7735
+
7736
+
7737
+
7738
+
7739
+
7740
+
7741
+ <xsl:call-template name="displayAdmonitionName"/>
7742
+ <xsl:text> — </xsl:text>
7743
+
7744
+
7745
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7746
+ </fo:block>
7747
+
7748
+ </xsl:template><xsl:template name="displayAdmonitionName">
7749
+
7750
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7751
+ <xsl:if test="not(*[local-name() = 'name'])">
7752
+ <xsl:apply-templates select="@type"/>
7753
+ </xsl:if>
7754
+
7755
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
7756
+ <xsl:apply-templates/>
7757
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
7758
+ <xsl:variable name="admonition_type_">
7759
+ <xsl:call-template name="getLocalizedString">
7760
+ <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
7761
+ </xsl:call-template>
7762
+ </xsl:variable>
7763
+ <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
7764
+ <xsl:value-of select="$admonition_type"/>
7765
+ <xsl:if test="$admonition_type = ''">
7766
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
7767
+ </xsl:if>
7768
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
7769
+
7770
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
7771
+
7772
+
7773
+
7774
+ <xsl:apply-templates/>
7775
+ </fo:block>
7776
+
6779
7777
  </xsl:template><xsl:template name="convertDate">
6780
7778
  <xsl:param name="date"/>
6781
7779
  <xsl:param name="format" select="'short'"/>
@@ -6783,83 +7781,80 @@
6783
7781
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
6784
7782
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
6785
7783
  <xsl:variable name="monthStr">
6786
- <xsl:choose>
6787
- <xsl:when test="$month = '01'">January</xsl:when>
6788
- <xsl:when test="$month = '02'">February</xsl:when>
6789
- <xsl:when test="$month = '03'">March</xsl:when>
6790
- <xsl:when test="$month = '04'">April</xsl:when>
6791
- <xsl:when test="$month = '05'">May</xsl:when>
6792
- <xsl:when test="$month = '06'">June</xsl:when>
6793
- <xsl:when test="$month = '07'">July</xsl:when>
6794
- <xsl:when test="$month = '08'">August</xsl:when>
6795
- <xsl:when test="$month = '09'">September</xsl:when>
6796
- <xsl:when test="$month = '10'">October</xsl:when>
6797
- <xsl:when test="$month = '11'">November</xsl:when>
6798
- <xsl:when test="$month = '12'">December</xsl:when>
6799
- </xsl:choose>
7784
+ <xsl:call-template name="getMonthByNum">
7785
+ <xsl:with-param name="num" select="$month"/>
7786
+ <xsl:with-param name="lowercase" select="'true'"/>
7787
+ </xsl:call-template>
7788
+ </xsl:variable>
7789
+ <xsl:variable name="monthStr_localized">
7790
+ <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>
6800
7791
  </xsl:variable>
6801
7792
  <xsl:variable name="result">
6802
7793
  <xsl:choose>
6803
- <xsl:when test="$format = 'ddMMyyyy'">
7794
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
6804
7795
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6805
7796
  <xsl:text> </xsl:text>
6806
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
7797
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
6807
7798
  </xsl:when>
6808
7799
  <xsl:when test="$format = 'ddMM'">
6809
7800
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6810
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
7801
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/>
6811
7802
  </xsl:when>
6812
7803
  <xsl:when test="$format = 'short' or $day = ''">
6813
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7804
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
6814
7805
  </xsl:when>
6815
7806
  <xsl:otherwise>
6816
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
7807
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
6817
7808
  </xsl:otherwise>
6818
7809
  </xsl:choose>
6819
7810
  </xsl:variable>
6820
7811
  <xsl:value-of select="$result"/>
6821
- </xsl:template><xsl:template name="convertDateLocalized">
6822
- <xsl:param name="date"/>
6823
- <xsl:param name="format" select="'short'"/>
6824
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
6825
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
6826
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
6827
- <xsl:variable name="monthStr">
6828
- <xsl:choose>
6829
- <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>
6830
- <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>
6831
- <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>
6832
- <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>
6833
- <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>
6834
- <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>
6835
- <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>
6836
- <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>
6837
- <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>
6838
- <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>
6839
- <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>
6840
- <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>
6841
- </xsl:choose>
6842
- </xsl:variable>
6843
- <xsl:variable name="result">
7812
+ </xsl:template><xsl:template name="getMonthByNum">
7813
+ <xsl:param name="num"/>
7814
+ <xsl:param name="lang">en</xsl:param>
7815
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
7816
+ <xsl:variable name="monthStr_">
6844
7817
  <xsl:choose>
6845
- <xsl:when test="$format = 'ddMMyyyy'">
6846
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6847
- <xsl:text> </xsl:text>
6848
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6849
- </xsl:when>
6850
- <xsl:when test="$format = 'ddMM'">
6851
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6852
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6853
- </xsl:when>
6854
- <xsl:when test="$format = 'short' or $day = ''">
6855
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7818
+ <xsl:when test="$lang = 'fr'">
7819
+ <xsl:choose>
7820
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
7821
+ <xsl:when test="$num = '02'">Février</xsl:when>
7822
+ <xsl:when test="$num = '03'">Mars</xsl:when>
7823
+ <xsl:when test="$num = '04'">Avril</xsl:when>
7824
+ <xsl:when test="$num = '05'">Mai</xsl:when>
7825
+ <xsl:when test="$num = '06'">Juin</xsl:when>
7826
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
7827
+ <xsl:when test="$num = '08'">Août</xsl:when>
7828
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
7829
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
7830
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
7831
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
7832
+ </xsl:choose>
6856
7833
  </xsl:when>
6857
7834
  <xsl:otherwise>
6858
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
7835
+ <xsl:choose>
7836
+ <xsl:when test="$num = '01'">January</xsl:when>
7837
+ <xsl:when test="$num = '02'">February</xsl:when>
7838
+ <xsl:when test="$num = '03'">March</xsl:when>
7839
+ <xsl:when test="$num = '04'">April</xsl:when>
7840
+ <xsl:when test="$num = '05'">May</xsl:when>
7841
+ <xsl:when test="$num = '06'">June</xsl:when>
7842
+ <xsl:when test="$num = '07'">July</xsl:when>
7843
+ <xsl:when test="$num = '08'">August</xsl:when>
7844
+ <xsl:when test="$num = '09'">September</xsl:when>
7845
+ <xsl:when test="$num = '10'">October</xsl:when>
7846
+ <xsl:when test="$num = '11'">November</xsl:when>
7847
+ <xsl:when test="$num = '12'">December</xsl:when>
7848
+ </xsl:choose>
6859
7849
  </xsl:otherwise>
6860
7850
  </xsl:choose>
6861
7851
  </xsl:variable>
6862
- <xsl:value-of select="$result"/>
7852
+ <xsl:choose>
7853
+ <xsl:when test="normalize-space($lowercase) = 'true'">
7854
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
7855
+ </xsl:when>
7856
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7857
+ </xsl:choose>
6863
7858
  </xsl:template><xsl:template name="insertKeywords">
6864
7859
  <xsl:param name="sorting" select="'true'"/>
6865
7860
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -6892,9 +7887,6 @@
6892
7887
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
6893
7888
  </xsl:choose>
6894
7889
  </xsl:template><xsl:template name="addPDFUAmeta">
6895
- <xsl:variable name="lang">
6896
- <xsl:call-template name="getLang"/>
6897
- </xsl:variable>
6898
7890
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
6899
7891
  <pdf:dictionary type="normal" key="ViewerPreferences">
6900
7892
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -7119,10 +8111,12 @@
7119
8111
  <xsl:param name="key"/>
7120
8112
  <xsl:param name="formatted">false</xsl:param>
7121
8113
  <xsl:param name="lang"/>
8114
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
7122
8115
 
7123
8116
  <xsl:variable name="curr_lang">
7124
8117
  <xsl:choose>
7125
8118
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
8119
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7126
8120
  <xsl:otherwise>
7127
8121
  <xsl:call-template name="getLang"/>
7128
8122
  </xsl:otherwise>
@@ -7157,6 +8151,7 @@
7157
8151
  </xsl:otherwise>
7158
8152
  </xsl:choose>
7159
8153
  </xsl:when>
8154
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7160
8155
  <xsl:otherwise>
7161
8156
  <xsl:variable name="key_">
7162
8157
  <xsl:call-template name="capitalize">
@@ -7166,7 +8161,6 @@
7166
8161
  <xsl:value-of select="$key_"/>
7167
8162
  </xsl:otherwise>
7168
8163
  </xsl:choose>
7169
-
7170
8164
  </xsl:template><xsl:template name="setTrackChangesStyles">
7171
8165
  <xsl:param name="isAdded"/>
7172
8166
  <xsl:param name="isDeleted"/>
@@ -7208,15 +8202,18 @@
7208
8202
  </xsl:choose>
7209
8203
  </xsl:template><xsl:template name="setTextAlignment">
7210
8204
  <xsl:param name="default">left</xsl:param>
8205
+ <xsl:variable name="align" select="normalize-space(@align)"/>
7211
8206
  <xsl:attribute name="text-align">
7212
8207
  <xsl:choose>
7213
- <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
8208
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
8209
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
8210
+ <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
7214
8211
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
7215
8212
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
7216
8213
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7217
8214
  </xsl:choose>
7218
8215
  </xsl:attribute>
7219
- <xsl:if test="@align = 'indent'">
8216
+ <xsl:if test="$align = 'indent'">
7220
8217
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
7221
8218
  </xsl:if>
7222
8219
  </xsl:template><xsl:template name="number-to-words">
@@ -7224,53 +8221,153 @@
7224
8221
  <xsl:param name="first"/>
7225
8222
  <xsl:if test="$number != ''">
7226
8223
  <xsl:variable name="words">
7227
- <words>
7228
- <word cardinal="1">One-</word>
7229
- <word ordinal="1">First </word>
7230
- <word cardinal="2">Two-</word>
7231
- <word ordinal="2">Second </word>
7232
- <word cardinal="3">Three-</word>
7233
- <word ordinal="3">Third </word>
7234
- <word cardinal="4">Four-</word>
7235
- <word ordinal="4">Fourth </word>
7236
- <word cardinal="5">Five-</word>
7237
- <word ordinal="5">Fifth </word>
7238
- <word cardinal="6">Six-</word>
7239
- <word ordinal="6">Sixth </word>
7240
- <word cardinal="7">Seven-</word>
7241
- <word ordinal="7">Seventh </word>
7242
- <word cardinal="8">Eight-</word>
7243
- <word ordinal="8">Eighth </word>
7244
- <word cardinal="9">Nine-</word>
7245
- <word ordinal="9">Ninth </word>
7246
- <word ordinal="10">Tenth </word>
7247
- <word ordinal="11">Eleventh </word>
7248
- <word ordinal="12">Twelfth </word>
7249
- <word ordinal="13">Thirteenth </word>
7250
- <word ordinal="14">Fourteenth </word>
7251
- <word ordinal="15">Fifteenth </word>
7252
- <word ordinal="16">Sixteenth </word>
7253
- <word ordinal="17">Seventeenth </word>
7254
- <word ordinal="18">Eighteenth </word>
7255
- <word ordinal="19">Nineteenth </word>
7256
- <word cardinal="20">Twenty-</word>
7257
- <word ordinal="20">Twentieth </word>
7258
- <word cardinal="30">Thirty-</word>
7259
- <word ordinal="30">Thirtieth </word>
7260
- <word cardinal="40">Forty-</word>
7261
- <word ordinal="40">Fortieth </word>
7262
- <word cardinal="50">Fifty-</word>
7263
- <word ordinal="50">Fiftieth </word>
7264
- <word cardinal="60">Sixty-</word>
7265
- <word ordinal="60">Sixtieth </word>
7266
- <word cardinal="70">Seventy-</word>
7267
- <word ordinal="70">Seventieth </word>
7268
- <word cardinal="80">Eighty-</word>
7269
- <word ordinal="80">Eightieth </word>
7270
- <word cardinal="90">Ninety-</word>
7271
- <word ordinal="90">Ninetieth </word>
7272
- <word cardinal="100">Hundred-</word>
7273
- <word ordinal="100">Hundredth </word>
8224
+ <words>
8225
+ <xsl:choose>
8226
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
8227
+ <word cardinal="1">Une-</word>
8228
+ <word ordinal="1">Première </word>
8229
+ <word cardinal="2">Deux-</word>
8230
+ <word ordinal="2">Seconde </word>
8231
+ <word cardinal="3">Trois-</word>
8232
+ <word ordinal="3">Tierce </word>
8233
+ <word cardinal="4">Quatre-</word>
8234
+ <word ordinal="4">Quatrième </word>
8235
+ <word cardinal="5">Cinq-</word>
8236
+ <word ordinal="5">Cinquième </word>
8237
+ <word cardinal="6">Six-</word>
8238
+ <word ordinal="6">Sixième </word>
8239
+ <word cardinal="7">Sept-</word>
8240
+ <word ordinal="7">Septième </word>
8241
+ <word cardinal="8">Huit-</word>
8242
+ <word ordinal="8">Huitième </word>
8243
+ <word cardinal="9">Neuf-</word>
8244
+ <word ordinal="9">Neuvième </word>
8245
+ <word ordinal="10">Dixième </word>
8246
+ <word ordinal="11">Onzième </word>
8247
+ <word ordinal="12">Douzième </word>
8248
+ <word ordinal="13">Treizième </word>
8249
+ <word ordinal="14">Quatorzième </word>
8250
+ <word ordinal="15">Quinzième </word>
8251
+ <word ordinal="16">Seizième </word>
8252
+ <word ordinal="17">Dix-septième </word>
8253
+ <word ordinal="18">Dix-huitième </word>
8254
+ <word ordinal="19">Dix-neuvième </word>
8255
+ <word cardinal="20">Vingt-</word>
8256
+ <word ordinal="20">Vingtième </word>
8257
+ <word cardinal="30">Trente-</word>
8258
+ <word ordinal="30">Trentième </word>
8259
+ <word cardinal="40">Quarante-</word>
8260
+ <word ordinal="40">Quarantième </word>
8261
+ <word cardinal="50">Cinquante-</word>
8262
+ <word ordinal="50">Cinquantième </word>
8263
+ <word cardinal="60">Soixante-</word>
8264
+ <word ordinal="60">Soixantième </word>
8265
+ <word cardinal="70">Septante-</word>
8266
+ <word ordinal="70">Septantième </word>
8267
+ <word cardinal="80">Huitante-</word>
8268
+ <word ordinal="80">Huitantième </word>
8269
+ <word cardinal="90">Nonante-</word>
8270
+ <word ordinal="90">Nonantième </word>
8271
+ <word cardinal="100">Cent-</word>
8272
+ <word ordinal="100">Centième </word>
8273
+ </xsl:when>
8274
+ <xsl:when test="$lang = 'ru'">
8275
+ <word cardinal="1">Одна-</word>
8276
+ <word ordinal="1">Первое </word>
8277
+ <word cardinal="2">Две-</word>
8278
+ <word ordinal="2">Второе </word>
8279
+ <word cardinal="3">Три-</word>
8280
+ <word ordinal="3">Третье </word>
8281
+ <word cardinal="4">Четыре-</word>
8282
+ <word ordinal="4">Четвертое </word>
8283
+ <word cardinal="5">Пять-</word>
8284
+ <word ordinal="5">Пятое </word>
8285
+ <word cardinal="6">Шесть-</word>
8286
+ <word ordinal="6">Шестое </word>
8287
+ <word cardinal="7">Семь-</word>
8288
+ <word ordinal="7">Седьмое </word>
8289
+ <word cardinal="8">Восемь-</word>
8290
+ <word ordinal="8">Восьмое </word>
8291
+ <word cardinal="9">Девять-</word>
8292
+ <word ordinal="9">Девятое </word>
8293
+ <word ordinal="10">Десятое </word>
8294
+ <word ordinal="11">Одиннадцатое </word>
8295
+ <word ordinal="12">Двенадцатое </word>
8296
+ <word ordinal="13">Тринадцатое </word>
8297
+ <word ordinal="14">Четырнадцатое </word>
8298
+ <word ordinal="15">Пятнадцатое </word>
8299
+ <word ordinal="16">Шестнадцатое </word>
8300
+ <word ordinal="17">Семнадцатое </word>
8301
+ <word ordinal="18">Восемнадцатое </word>
8302
+ <word ordinal="19">Девятнадцатое </word>
8303
+ <word cardinal="20">Двадцать-</word>
8304
+ <word ordinal="20">Двадцатое </word>
8305
+ <word cardinal="30">Тридцать-</word>
8306
+ <word ordinal="30">Тридцатое </word>
8307
+ <word cardinal="40">Сорок-</word>
8308
+ <word ordinal="40">Сороковое </word>
8309
+ <word cardinal="50">Пятьдесят-</word>
8310
+ <word ordinal="50">Пятидесятое </word>
8311
+ <word cardinal="60">Шестьдесят-</word>
8312
+ <word ordinal="60">Шестидесятое </word>
8313
+ <word cardinal="70">Семьдесят-</word>
8314
+ <word ordinal="70">Семидесятое </word>
8315
+ <word cardinal="80">Восемьдесят-</word>
8316
+ <word ordinal="80">Восьмидесятое </word>
8317
+ <word cardinal="90">Девяносто-</word>
8318
+ <word ordinal="90">Девяностое </word>
8319
+ <word cardinal="100">Сто-</word>
8320
+ <word ordinal="100">Сотое </word>
8321
+ </xsl:when>
8322
+ <xsl:otherwise> <!-- default english -->
8323
+ <word cardinal="1">One-</word>
8324
+ <word ordinal="1">First </word>
8325
+ <word cardinal="2">Two-</word>
8326
+ <word ordinal="2">Second </word>
8327
+ <word cardinal="3">Three-</word>
8328
+ <word ordinal="3">Third </word>
8329
+ <word cardinal="4">Four-</word>
8330
+ <word ordinal="4">Fourth </word>
8331
+ <word cardinal="5">Five-</word>
8332
+ <word ordinal="5">Fifth </word>
8333
+ <word cardinal="6">Six-</word>
8334
+ <word ordinal="6">Sixth </word>
8335
+ <word cardinal="7">Seven-</word>
8336
+ <word ordinal="7">Seventh </word>
8337
+ <word cardinal="8">Eight-</word>
8338
+ <word ordinal="8">Eighth </word>
8339
+ <word cardinal="9">Nine-</word>
8340
+ <word ordinal="9">Ninth </word>
8341
+ <word ordinal="10">Tenth </word>
8342
+ <word ordinal="11">Eleventh </word>
8343
+ <word ordinal="12">Twelfth </word>
8344
+ <word ordinal="13">Thirteenth </word>
8345
+ <word ordinal="14">Fourteenth </word>
8346
+ <word ordinal="15">Fifteenth </word>
8347
+ <word ordinal="16">Sixteenth </word>
8348
+ <word ordinal="17">Seventeenth </word>
8349
+ <word ordinal="18">Eighteenth </word>
8350
+ <word ordinal="19">Nineteenth </word>
8351
+ <word cardinal="20">Twenty-</word>
8352
+ <word ordinal="20">Twentieth </word>
8353
+ <word cardinal="30">Thirty-</word>
8354
+ <word ordinal="30">Thirtieth </word>
8355
+ <word cardinal="40">Forty-</word>
8356
+ <word ordinal="40">Fortieth </word>
8357
+ <word cardinal="50">Fifty-</word>
8358
+ <word ordinal="50">Fiftieth </word>
8359
+ <word cardinal="60">Sixty-</word>
8360
+ <word ordinal="60">Sixtieth </word>
8361
+ <word cardinal="70">Seventy-</word>
8362
+ <word ordinal="70">Seventieth </word>
8363
+ <word cardinal="80">Eighty-</word>
8364
+ <word ordinal="80">Eightieth </word>
8365
+ <word cardinal="90">Ninety-</word>
8366
+ <word ordinal="90">Ninetieth </word>
8367
+ <word cardinal="100">Hundred-</word>
8368
+ <word ordinal="100">Hundredth </word>
8369
+ </xsl:otherwise>
8370
+ </xsl:choose>
7274
8371
  </words>
7275
8372
  </xsl:variable>
7276
8373
 
@@ -7315,6 +8412,25 @@
7315
8412
  </xsl:otherwise>
7316
8413
  </xsl:choose>
7317
8414
  </xsl:if>
8415
+ </xsl:template><xsl:template name="number-to-ordinal">
8416
+ <xsl:param name="number"/>
8417
+ <xsl:param name="curr_lang"/>
8418
+ <xsl:choose>
8419
+ <xsl:when test="$curr_lang = 'fr'">
8420
+ <xsl:choose>
8421
+ <xsl:when test="$number = '1'">re</xsl:when>
8422
+ <xsl:otherwise>e</xsl:otherwise>
8423
+ </xsl:choose>
8424
+ </xsl:when>
8425
+ <xsl:otherwise>
8426
+ <xsl:choose>
8427
+ <xsl:when test="$number = 1">st</xsl:when>
8428
+ <xsl:when test="$number = 2">nd</xsl:when>
8429
+ <xsl:when test="$number = 3">rd</xsl:when>
8430
+ <xsl:otherwise>th</xsl:otherwise>
8431
+ </xsl:choose>
8432
+ </xsl:otherwise>
8433
+ </xsl:choose>
7318
8434
  </xsl:template><xsl:template name="setAltText">
7319
8435
  <xsl:param name="value"/>
7320
8436
  <xsl:attribute name="fox:alt-text">
@@ -7325,4 +8441,18 @@
7325
8441
  <xsl:otherwise>_</xsl:otherwise>
7326
8442
  </xsl:choose>
7327
8443
  </xsl:attribute>
8444
+ </xsl:template><xsl:template name="substring-after-last">
8445
+ <xsl:param name="value"/>
8446
+ <xsl:param name="delimiter"/>
8447
+ <xsl:choose>
8448
+ <xsl:when test="contains($value, $delimiter)">
8449
+ <xsl:call-template name="substring-after-last">
8450
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
8451
+ <xsl:with-param name="delimiter" select="$delimiter"/>
8452
+ </xsl:call-template>
8453
+ </xsl:when>
8454
+ <xsl:otherwise>
8455
+ <xsl:value-of select="$value"/>
8456
+ </xsl:otherwise>
8457
+ </xsl:choose>
7328
8458
  </xsl:template></xsl:stylesheet>