metanorma-un 0.5.4 → 0.5.9

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.
@@ -39,7 +39,7 @@
39
39
 
40
40
  <xsl:template match="/">
41
41
  <xsl:call-template name="namespaceCheck"/>
42
- <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10pt" xml:lang="{$lang}">
42
+ <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
43
43
  <fo:layout-master-set>
44
44
  <!-- Cover page -->
45
45
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -644,7 +644,7 @@
644
644
  <xsl:otherwise> <!-- for ordered lists -->
645
645
  <xsl:choose>
646
646
  <xsl:when test="../@type = 'arabic'">
647
- <xsl:number format="a)"/>
647
+ <xsl:number format="a)" lang="en"/>
648
648
  </xsl:when>
649
649
  <xsl:when test="../@type = 'alphabet'">
650
650
  <xsl:number format="1)"/>
@@ -652,7 +652,7 @@
652
652
  <xsl:when test="ancestor::*[un:annex]">
653
653
  <xsl:choose>
654
654
  <xsl:when test="$level = 1">
655
- <xsl:number format="a)"/>
655
+ <xsl:number format="a)" lang="en"/>
656
656
  </xsl:when>
657
657
  <xsl:when test="$level = 2">
658
658
  <xsl:number format="i)"/>
@@ -1081,7 +1081,12 @@
1081
1081
 
1082
1082
 
1083
1083
  </title-toc>
1084
- <title-toc lang="fr">Sommaire</title-toc>
1084
+ <title-toc lang="fr">
1085
+
1086
+ <xsl:text>Sommaire</xsl:text>
1087
+
1088
+
1089
+ </title-toc>
1085
1090
 
1086
1091
  <title-toc lang="zh">Contents</title-toc>
1087
1092
 
@@ -1101,13 +1106,22 @@
1101
1106
  <title-part lang="en">
1102
1107
 
1103
1108
 
1109
+
1104
1110
  </title-part>
1105
1111
  <title-part lang="fr">
1106
1112
 
1107
1113
 
1114
+
1108
1115
  </title-part>
1109
1116
  <title-part lang="zh">第 # 部分:</title-part>
1110
1117
 
1118
+ <title-subpart lang="en">
1119
+
1120
+ </title-subpart>
1121
+ <title-subpart lang="fr">
1122
+
1123
+ </title-subpart>
1124
+
1111
1125
  <title-modified lang="en">modified</title-modified>
1112
1126
  <title-modified lang="fr">modifiée</title-modified>
1113
1127
 
@@ -1169,10 +1183,19 @@
1169
1183
 
1170
1184
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1171
1185
  <xsl:param name="name"/>
1172
- <xsl:variable name="lang">
1173
- <xsl:call-template name="getLang"/>
1186
+ <xsl:param name="lang"/>
1187
+ <xsl:variable name="lang_">
1188
+ <xsl:choose>
1189
+ <xsl:when test="$lang != ''">
1190
+ <xsl:value-of select="$lang"/>
1191
+ </xsl:when>
1192
+ <xsl:otherwise>
1193
+ <xsl:call-template name="getLang"/>
1194
+ </xsl:otherwise>
1195
+ </xsl:choose>
1174
1196
  </xsl:variable>
1175
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1197
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1198
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1176
1199
  <xsl:choose>
1177
1200
  <xsl:when test="normalize-space($title_) != ''">
1178
1201
  <xsl:value-of select="$title_"/>
@@ -1317,6 +1340,7 @@
1317
1340
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1318
1341
 
1319
1342
 
1343
+
1320
1344
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1321
1345
 
1322
1346
 
@@ -1352,6 +1376,7 @@
1352
1376
  <xsl:attribute name="border-top">0.1mm solid black</xsl:attribute>
1353
1377
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1354
1378
 
1379
+
1355
1380
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1356
1381
 
1357
1382
 
@@ -1419,6 +1444,7 @@
1419
1444
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1420
1445
 
1421
1446
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1447
+
1422
1448
 
1423
1449
 
1424
1450
 
@@ -1540,6 +1566,10 @@
1540
1566
 
1541
1567
 
1542
1568
 
1569
+ <!-- <xsl:if test="$namespace = 'bipm'">
1570
+ <fo:block>&#xA0;</fo:block>
1571
+ </xsl:if> -->
1572
+
1543
1573
  <!-- $namespace = 'iso' or -->
1544
1574
 
1545
1575
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1572,11 +1602,14 @@
1572
1602
 
1573
1603
 
1574
1604
  <xsl:variable name="colwidths">
1575
- <xsl:call-template name="calculate-column-widths">
1576
- <xsl:with-param name="cols-count" select="$cols-count"/>
1577
- <xsl:with-param name="table" select="$simple-table"/>
1578
- </xsl:call-template>
1605
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1606
+ <xsl:call-template name="calculate-column-widths">
1607
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1608
+ <xsl:with-param name="table" select="$simple-table"/>
1609
+ </xsl:call-template>
1610
+ </xsl:if>
1579
1611
  </xsl:variable>
1612
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1580
1613
 
1581
1614
  <!-- <xsl:variable name="colwidths2">
1582
1615
  <xsl:call-template name="calculate-column-widths">
@@ -1598,37 +1631,107 @@
1598
1631
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1599
1632
 
1600
1633
 
1634
+
1601
1635
 
1602
1636
  <xsl:attribute name="space-after">12pt</xsl:attribute>
1637
+ <xsl:if test="not(ancestor::*[local-name()='sections'])">
1638
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1639
+ </xsl:if>
1640
+
1641
+
1642
+
1603
1643
 
1644
+
1604
1645
 
1605
1646
 
1606
-
1607
1647
 
1608
1648
 
1609
1649
 
1610
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1611
-
1612
-
1650
+
1651
+
1652
+ <xsl:variable name="table_attributes">
1653
+ <attribute name="table-layout">fixed</attribute>
1654
+ <attribute name="width">100%</attribute>
1655
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1656
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1613
1657
 
1614
1658
 
1615
1659
 
1616
1660
 
1661
+
1617
1662
 
1618
1663
  <xsl:if test="ancestor::*[local-name()='sections']">
1619
- <xsl:attribute name="border-top">1.5pt solid black</xsl:attribute>
1620
- <xsl:attribute name="border-bottom">1.5pt solid black</xsl:attribute>
1621
- </xsl:if>
1622
- <xsl:if test="not(ancestor::*[local-name()='sections'])">
1623
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1624
- </xsl:if>
1664
+ <attribute name="border-top">1.5pt solid black</attribute>
1665
+ <attribute name="border-bottom">1.5pt solid black</attribute>
1666
+ </xsl:if>
1667
+
1668
+
1625
1669
 
1670
+
1626
1671
 
1672
+ </xsl:variable>
1673
+
1674
+
1675
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1627
1676
 
1677
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1678
+ <xsl:attribute name="{@name}">
1679
+ <xsl:value-of select="."/>
1680
+ </xsl:attribute>
1681
+ </xsl:for-each>
1628
1682
 
1683
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1684
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1685
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1686
+ </xsl:if>
1629
1687
 
1688
+ <xsl:choose>
1689
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1690
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1691
+ <fo:table-column column-width="{@width}"/>
1692
+ </xsl:for-each>
1693
+ </xsl:when>
1694
+ <xsl:otherwise>
1695
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1696
+ <xsl:choose>
1697
+ <xsl:when test=". = 1 or . = 0">
1698
+ <fo:table-column column-width="proportional-column-width(2)"/>
1699
+ </xsl:when>
1700
+ <xsl:otherwise>
1701
+ <fo:table-column column-width="proportional-column-width({.})"/>
1702
+ </xsl:otherwise>
1703
+ </xsl:choose>
1704
+ </xsl:for-each>
1705
+ </xsl:otherwise>
1706
+ </xsl:choose>
1630
1707
 
1708
+ <xsl:choose>
1709
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1710
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1711
+ </xsl:when>
1712
+ <xsl:otherwise>
1713
+ <xsl:apply-templates/>
1714
+ </xsl:otherwise>
1715
+ </xsl:choose>
1631
1716
 
1717
+ </fo:table>
1718
+
1719
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1720
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1721
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1722
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1723
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1724
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1725
+ </xsl:call-template>
1726
+ </xsl:for-each>
1727
+
1728
+ <!-- insert footer as table -->
1729
+ <!-- <fo:table>
1730
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1731
+ <xsl:attribute name="{@name}">
1732
+ <xsl:value-of select="."/>
1733
+ </xsl:attribute>
1734
+ </xsl:for-each>
1632
1735
 
1633
1736
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1634
1737
  <xsl:choose>
@@ -1640,17 +1743,7 @@
1640
1743
  </xsl:otherwise>
1641
1744
  </xsl:choose>
1642
1745
  </xsl:for-each>
1643
-
1644
- <xsl:choose>
1645
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1646
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1647
- </xsl:when>
1648
- <xsl:otherwise>
1649
- <xsl:apply-templates/>
1650
- </xsl:otherwise>
1651
- </xsl:choose>
1652
-
1653
- </fo:table>
1746
+ </fo:table>-->
1654
1747
 
1655
1748
 
1656
1749
 
@@ -1661,6 +1754,7 @@
1661
1754
  <xsl:if test="normalize-space() != ''">
1662
1755
  <fo:block xsl:use-attribute-sets="table-name-style">
1663
1756
 
1757
+
1664
1758
  <xsl:apply-templates/>
1665
1759
  </fo:block>
1666
1760
  </xsl:if>
@@ -1716,6 +1810,13 @@
1716
1810
  <xsl:for-each select="xalan:nodeset($table)//tr">
1717
1811
  <xsl:variable name="td_text">
1718
1812
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1813
+
1814
+ <!-- <xsl:if test="$namespace = 'bipm'">
1815
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1816
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1817
+ </xsl:for-each>
1818
+ </xsl:if> -->
1819
+
1719
1820
  </xsl:variable>
1720
1821
  <xsl:variable name="words">
1721
1822
  <xsl:variable name="string_with_added_zerospaces">
@@ -1775,11 +1876,14 @@
1775
1876
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1776
1877
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1777
1878
  <xsl:value-of select="@target"/>
1879
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1880
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1881
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1778
1882
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1779
1883
  <xsl:param name="cols-count"/>
1780
1884
  <!-- font-weight="bold" -->
1781
1885
  <fo:table-header>
1782
-
1886
+
1783
1887
  <xsl:apply-templates/>
1784
1888
  </fo:table-header>
1785
1889
  </xsl:template><xsl:template name="table-header-title">
@@ -1804,6 +1908,13 @@
1804
1908
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1805
1909
  <xsl:apply-templates/>
1806
1910
  </xsl:template><xsl:template name="insertTableFooter">
1911
+ <xsl:param name="cols-count"/>
1912
+ <xsl:if test="../*[local-name()='tfoot']">
1913
+ <fo:table-footer>
1914
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1915
+ </fo:table-footer>
1916
+ </xsl:if>
1917
+ </xsl:template><xsl:template name="insertTableFooter2">
1807
1918
  <xsl:param name="cols-count"/>
1808
1919
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1809
1920
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1825,11 +1936,29 @@
1825
1936
  <!-- fn will be processed inside 'note' processing -->
1826
1937
 
1827
1938
 
1939
+
1940
+
1941
+
1942
+
1828
1943
  <!-- except gb -->
1829
1944
 
1830
1945
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1831
1946
 
1832
1947
 
1948
+ <!-- show Note under table in preface (ex. abstract) sections -->
1949
+ <!-- empty, because notes show at page side in main sections -->
1950
+ <!-- <xsl:if test="$namespace = 'bipm'">
1951
+ <xsl:choose>
1952
+ <xsl:when test="ancestor::*[local-name()='preface']">
1953
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1954
+ </xsl:when>
1955
+ <xsl:otherwise>
1956
+ <fo:block/>
1957
+ </xsl:otherwise>
1958
+ </xsl:choose>
1959
+ </xsl:if> -->
1960
+
1961
+
1833
1962
  <!-- horizontal row separator -->
1834
1963
 
1835
1964
 
@@ -1843,6 +1972,107 @@
1843
1972
  </fo:table-footer>
1844
1973
 
1845
1974
  </xsl:if>
1975
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1976
+ <xsl:param name="table_attributes"/>
1977
+ <xsl:param name="colwidths"/>
1978
+ <xsl:param name="colgroup"/>
1979
+
1980
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1981
+
1982
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1983
+
1984
+ <xsl:variable name="cols-count">
1985
+ <xsl:choose>
1986
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1987
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1988
+ </xsl:when>
1989
+ <xsl:otherwise>
1990
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1991
+ </xsl:otherwise>
1992
+ </xsl:choose>
1993
+ </xsl:variable>
1994
+
1995
+ <fo:table keep-with-previous="always">
1996
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1997
+ <xsl:choose>
1998
+ <xsl:when test="@name = 'border-top'">
1999
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2000
+ </xsl:when>
2001
+ <xsl:when test="@name = 'border'">
2002
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2003
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2004
+ </xsl:when>
2005
+ <xsl:otherwise>
2006
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2007
+ </xsl:otherwise>
2008
+ </xsl:choose>
2009
+ </xsl:for-each>
2010
+
2011
+ <xsl:choose>
2012
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2013
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2014
+ <fo:table-column column-width="{@width}"/>
2015
+ </xsl:for-each>
2016
+ </xsl:when>
2017
+ <xsl:otherwise>
2018
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2019
+ <xsl:choose>
2020
+ <xsl:when test=". = 1 or . = 0">
2021
+ <fo:table-column column-width="proportional-column-width(2)"/>
2022
+ </xsl:when>
2023
+ <xsl:otherwise>
2024
+ <fo:table-column column-width="proportional-column-width({.})"/>
2025
+ </xsl:otherwise>
2026
+ </xsl:choose>
2027
+ </xsl:for-each>
2028
+ </xsl:otherwise>
2029
+ </xsl:choose>
2030
+
2031
+ <fo:table-body>
2032
+ <fo:table-row>
2033
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2034
+
2035
+
2036
+
2037
+ <!-- fn will be processed inside 'note' processing -->
2038
+
2039
+
2040
+
2041
+
2042
+
2043
+
2044
+
2045
+ <!-- except gb -->
2046
+
2047
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2048
+
2049
+
2050
+ <!-- <xsl:if test="$namespace = 'bipm'">
2051
+ <xsl:choose>
2052
+ <xsl:when test="ancestor::*[local-name()='preface']">
2053
+ show Note under table in preface (ex. abstract) sections
2054
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2055
+ </xsl:when>
2056
+ <xsl:otherwise>
2057
+ empty, because notes show at page side in main sections
2058
+ <fo:block/>
2059
+ </xsl:otherwise>
2060
+ </xsl:choose>
2061
+ </xsl:if> -->
2062
+
2063
+
2064
+ <!-- horizontal row separator -->
2065
+
2066
+
2067
+ <!-- fn processing -->
2068
+ <xsl:call-template name="fn_display"/>
2069
+
2070
+ </fo:table-cell>
2071
+ </fo:table-row>
2072
+ </fo:table-body>
2073
+
2074
+ </fo:table>
2075
+ </xsl:if>
1846
2076
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1847
2077
 
1848
2078
  <xsl:variable name="cols-count">
@@ -1895,8 +2125,12 @@
1895
2125
 
1896
2126
  </xsl:if>
1897
2127
 
1898
-
1899
-
2128
+
2129
+
2130
+
2131
+ <!-- <xsl:if test="$namespace = 'bipm'">
2132
+ <xsl:attribute name="height">8mm</xsl:attribute>
2133
+ </xsl:if> -->
1900
2134
 
1901
2135
  <xsl:apply-templates/>
1902
2136
  </fo:table-row>
@@ -1936,6 +2170,7 @@
1936
2170
 
1937
2171
 
1938
2172
 
2173
+
1939
2174
  <xsl:if test="@colspan">
1940
2175
  <xsl:attribute name="number-columns-spanned">
1941
2176
  <xsl:value-of select="@colspan"/>
@@ -1975,7 +2210,7 @@
1975
2210
 
1976
2211
 
1977
2212
 
1978
-
2213
+
1979
2214
 
1980
2215
 
1981
2216
 
@@ -1988,6 +2223,7 @@
1988
2223
 
1989
2224
 
1990
2225
 
2226
+
1991
2227
  <xsl:if test="@colspan">
1992
2228
  <xsl:attribute name="number-columns-spanned">
1993
2229
  <xsl:value-of select="@colspan"/>
@@ -1999,7 +2235,8 @@
1999
2235
  </xsl:attribute>
2000
2236
  </xsl:if>
2001
2237
  <xsl:call-template name="display-align"/>
2002
- <fo:block>
2238
+ <fo:block>
2239
+
2003
2240
  <xsl:apply-templates/>
2004
2241
  </fo:block>
2005
2242
  </fo:table-cell>
@@ -2011,6 +2248,8 @@
2011
2248
 
2012
2249
 
2013
2250
 
2251
+
2252
+
2014
2253
  <fo:inline padding-right="2mm">
2015
2254
 
2016
2255
 
@@ -2025,10 +2264,11 @@
2025
2264
  </fo:inline> -->
2026
2265
  </xsl:if>
2027
2266
 
2028
-
2267
+
2029
2268
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2030
2269
 
2031
2270
  </fo:inline>
2271
+
2032
2272
  <xsl:apply-templates mode="process"/>
2033
2273
  </fo:block>
2034
2274
 
@@ -2052,6 +2292,7 @@
2052
2292
 
2053
2293
 
2054
2294
 
2295
+
2055
2296
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2056
2297
 
2057
2298
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -2061,12 +2302,15 @@
2061
2302
 
2062
2303
 
2063
2304
 
2305
+
2064
2306
  <xsl:value-of select="@reference"/>
2065
2307
 
2308
+
2066
2309
  </fo:inline>
2067
2310
  <fo:inline>
2068
2311
 
2069
- <xsl:apply-templates/>
2312
+ <!-- <xsl:apply-templates /> -->
2313
+ <xsl:copy-of select="./node()"/>
2070
2314
  </fo:inline>
2071
2315
  </fo:block>
2072
2316
  </xsl:if>
@@ -2103,7 +2347,20 @@
2103
2347
  <xsl:variable name="following_dl_colwidths">
2104
2348
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2105
2349
  <xsl:variable name="html-table">
2106
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2350
+ <xsl:variable name="doc_ns">
2351
+
2352
+ </xsl:variable>
2353
+ <xsl:variable name="ns">
2354
+ <xsl:choose>
2355
+ <xsl:when test="normalize-space($doc_ns) != ''">
2356
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2357
+ </xsl:when>
2358
+ <xsl:otherwise>
2359
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2360
+ </xsl:otherwise>
2361
+ </xsl:choose>
2362
+ </xsl:variable>
2363
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2107
2364
  <xsl:element name="{$ns}:table">
2108
2365
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2109
2366
  <tbody>
@@ -2168,7 +2425,8 @@
2168
2425
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2169
2426
  </xsl:if>
2170
2427
 
2171
- <xsl:apply-templates/>
2428
+ <!-- <xsl:apply-templates /> -->
2429
+ <xsl:copy-of select="./node()"/>
2172
2430
  </fo:block>
2173
2431
  </fo:table-cell>
2174
2432
  </fo:table-row>
@@ -2187,9 +2445,12 @@
2187
2445
 
2188
2446
 
2189
2447
 
2448
+
2190
2449
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2191
2450
 
2451
+
2192
2452
  <xsl:value-of select="@reference"/>
2453
+
2193
2454
  </fo:basic-link>
2194
2455
  </fo:inline>
2195
2456
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2197,7 +2458,11 @@
2197
2458
  <xsl:apply-templates/>
2198
2459
  </fo:inline>
2199
2460
  </xsl:template><xsl:template match="*[local-name()='dl']">
2200
- <fo:block-container margin-left="0mm">
2461
+ <fo:block-container>
2462
+
2463
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2464
+
2465
+
2201
2466
  <xsl:if test="parent::*[local-name() = 'note']">
2202
2467
  <xsl:attribute name="margin-left">
2203
2468
  <xsl:choose>
@@ -2207,8 +2472,11 @@
2207
2472
  </xsl:attribute>
2208
2473
 
2209
2474
  </xsl:if>
2210
- <fo:block-container margin-left="0mm">
2211
-
2475
+ <fo:block-container>
2476
+
2477
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2478
+
2479
+
2212
2480
  <xsl:variable name="parent" select="local-name(..)"/>
2213
2481
 
2214
2482
  <xsl:variable name="key_iso">
@@ -2222,9 +2490,12 @@
2222
2490
  <fo:block margin-bottom="12pt" text-align="left">
2223
2491
 
2224
2492
  <xsl:variable name="title-where">
2225
- <xsl:call-template name="getTitle">
2226
- <xsl:with-param name="name" select="'title-where'"/>
2227
- </xsl:call-template>
2493
+
2494
+
2495
+ <xsl:call-template name="getTitle">
2496
+ <xsl:with-param name="name" select="'title-where'"/>
2497
+ </xsl:call-template>
2498
+
2228
2499
  </xsl:variable>
2229
2500
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2230
2501
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2240,9 +2511,12 @@
2240
2511
 
2241
2512
 
2242
2513
  <xsl:variable name="title-where">
2243
- <xsl:call-template name="getTitle">
2244
- <xsl:with-param name="name" select="'title-where'"/>
2245
- </xsl:call-template>
2514
+
2515
+
2516
+ <xsl:call-template name="getTitle">
2517
+ <xsl:with-param name="name" select="'title-where'"/>
2518
+ </xsl:call-template>
2519
+
2246
2520
  </xsl:variable>
2247
2521
  <xsl:value-of select="$title-where"/>
2248
2522
  </fo:block>
@@ -2253,9 +2527,12 @@
2253
2527
 
2254
2528
 
2255
2529
  <xsl:variable name="title-key">
2256
- <xsl:call-template name="getTitle">
2257
- <xsl:with-param name="name" select="'title-key'"/>
2258
- </xsl:call-template>
2530
+
2531
+
2532
+ <xsl:call-template name="getTitle">
2533
+ <xsl:with-param name="name" select="'title-key'"/>
2534
+ </xsl:call-template>
2535
+
2259
2536
  </xsl:variable>
2260
2537
  <xsl:value-of select="$title-key"/>
2261
2538
  </fo:block>
@@ -2287,7 +2564,20 @@
2287
2564
  </xsl:choose>
2288
2565
  <!-- create virtual html table for dl/[dt and dd] -->
2289
2566
  <xsl:variable name="html-table">
2290
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2567
+ <xsl:variable name="doc_ns">
2568
+
2569
+ </xsl:variable>
2570
+ <xsl:variable name="ns">
2571
+ <xsl:choose>
2572
+ <xsl:when test="normalize-space($doc_ns) != ''">
2573
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2574
+ </xsl:when>
2575
+ <xsl:otherwise>
2576
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2577
+ </xsl:otherwise>
2578
+ </xsl:choose>
2579
+ </xsl:variable>
2580
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2291
2581
  <xsl:element name="{$ns}:table">
2292
2582
  <tbody>
2293
2583
  <xsl:apply-templates mode="dl"/>
@@ -2431,6 +2721,7 @@
2431
2721
 
2432
2722
 
2433
2723
 
2724
+
2434
2725
  <xsl:apply-templates/>
2435
2726
  <!-- <xsl:if test="$namespace = 'gb'">
2436
2727
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2484,6 +2775,7 @@
2484
2775
  </fo:inline>
2485
2776
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2486
2777
  <fo:inline font-weight="bold">
2778
+
2487
2779
  <xsl:apply-templates/>
2488
2780
  </fo:inline>
2489
2781
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2497,18 +2789,18 @@
2497
2789
  </xsl:template><xsl:template match="*[local-name()='tt']">
2498
2790
  <fo:inline xsl:use-attribute-sets="tt-style">
2499
2791
  <xsl:variable name="_font-size">
2500
-
2501
-
2502
-
2503
2792
 
2504
2793
 
2505
2794
 
2506
2795
 
2507
2796
 
2508
2797
 
2509
-
2510
2798
 
2511
-
2799
+
2800
+
2801
+
2802
+
2803
+
2512
2804
 
2513
2805
 
2514
2806
  </xsl:variable>
@@ -2812,7 +3104,18 @@
2812
3104
  <xsl:with-param name="previousRow" select="$newRow"/>
2813
3105
  </xsl:apply-templates>
2814
3106
  </xsl:template><xsl:template name="getLang">
2815
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3107
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3108
+ <xsl:variable name="language">
3109
+ <xsl:choose>
3110
+ <xsl:when test="$language_current != ''">
3111
+ <xsl:value-of select="$language_current"/>
3112
+ </xsl:when>
3113
+ <xsl:otherwise>
3114
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3115
+ </xsl:otherwise>
3116
+ </xsl:choose>
3117
+ </xsl:variable>
3118
+
2816
3119
  <xsl:choose>
2817
3120
  <xsl:when test="$language = 'English'">en</xsl:when>
2818
3121
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2846,7 +3149,8 @@
2846
3149
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2847
3150
  <xsl:value-of select="substring($str, 2)"/>
2848
3151
  </xsl:template><xsl:template match="mathml:math">
2849
- <fo:inline font-family="STIX2Math">
3152
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3153
+
2850
3154
  <xsl:variable name="mathml">
2851
3155
  <xsl:apply-templates select="." mode="mathml"/>
2852
3156
  </xsl:variable>
@@ -2876,6 +3180,7 @@
2876
3180
  </xsl:choose>
2877
3181
  </xsl:variable>
2878
3182
  <fo:inline xsl:use-attribute-sets="link-style">
3183
+
2879
3184
  <xsl:choose>
2880
3185
  <xsl:when test="$target = ''">
2881
3186
  <xsl:apply-templates/>
@@ -2929,10 +3234,14 @@
2929
3234
  </fo:inline>
2930
3235
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2931
3236
  <xsl:variable name="title-modified">
2932
- <xsl:call-template name="getTitle">
2933
- <xsl:with-param name="name" select="'title-modified'"/>
2934
- </xsl:call-template>
3237
+
3238
+
3239
+ <xsl:call-template name="getTitle">
3240
+ <xsl:with-param name="name" select="'title-modified'"/>
3241
+ </xsl:call-template>
3242
+
2935
3243
  </xsl:variable>
3244
+
2936
3245
  <xsl:choose>
2937
3246
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2938
3247
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2940,7 +3249,7 @@
2940
3249
  <xsl:apply-templates/>
2941
3250
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2942
3251
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2943
-
3252
+
2944
3253
  <xsl:apply-templates/>
2945
3254
  </fo:basic-link>
2946
3255
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3006,6 +3315,8 @@
3006
3315
 
3007
3316
 
3008
3317
 
3318
+
3319
+
3009
3320
  <fo:inline xsl:use-attribute-sets="note-name-style">
3010
3321
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3011
3322
  </fo:inline>
@@ -3098,7 +3409,8 @@
3098
3409
  </fo:inline>
3099
3410
  </xsl:if>
3100
3411
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3101
- <fo:block-container id="{@id}">
3412
+ <fo:block-container id="{@id}">
3413
+
3102
3414
  <fo:block>
3103
3415
  <xsl:apply-templates/>
3104
3416
  </fo:block>
@@ -3154,7 +3466,7 @@
3154
3466
  <xsl:apply-templates mode="bookmarks"/>
3155
3467
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3156
3468
  <xsl:apply-templates select="."/>
3157
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3469
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3158
3470
  <xsl:apply-templates mode="bookmarks"/>
3159
3471
  </xsl:template><xsl:template name="addBookmarks">
3160
3472
  <xsl:param name="contents"/>
@@ -3168,18 +3480,9 @@
3168
3480
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3169
3481
  <fo:bookmark-title>
3170
3482
  <xsl:variable name="bookmark-title_">
3171
- <xsl:choose>
3172
- <xsl:when test="@lang = 'en'">
3173
-
3174
-
3175
- </xsl:when>
3176
- <xsl:when test="@lang = 'fr'">
3177
-
3178
-
3179
- </xsl:when>
3180
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3181
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3182
- </xsl:choose>
3483
+ <xsl:call-template name="getLangVersion">
3484
+ <xsl:with-param name="lang" select="@lang"/>
3485
+ </xsl:call-template>
3183
3486
  </xsl:variable>
3184
3487
  <xsl:choose>
3185
3488
  <xsl:when test="normalize-space($bookmark-title_) != ''">
@@ -3221,6 +3524,20 @@
3221
3524
 
3222
3525
  </fo:bookmark-tree>
3223
3526
  </xsl:if>
3527
+ </xsl:template><xsl:template name="getLangVersion">
3528
+ <xsl:param name="lang"/>
3529
+ <xsl:choose>
3530
+ <xsl:when test="$lang = 'en'">
3531
+
3532
+
3533
+ </xsl:when>
3534
+ <xsl:when test="$lang = 'fr'">
3535
+
3536
+
3537
+ </xsl:when>
3538
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3539
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3540
+ </xsl:choose>
3224
3541
  </xsl:template><xsl:template match="item" mode="bookmark">
3225
3542
  <fo:bookmark internal-destination="{@id}" starting-state="hide">
3226
3543
  <fo:bookmark-title>
@@ -3235,7 +3552,7 @@
3235
3552
  </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">
3236
3553
  <xsl:if test="normalize-space() != ''">
3237
3554
  <fo:block xsl:use-attribute-sets="figure-name-style">
3238
-
3555
+
3239
3556
  <xsl:apply-templates/>
3240
3557
  </fo:block>
3241
3558
  </xsl:if>
@@ -3820,9 +4137,12 @@
3820
4137
  </fo:block>
3821
4138
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3822
4139
  <xsl:variable name="title-deprecated">
3823
- <xsl:call-template name="getTitle">
3824
- <xsl:with-param name="name" select="'title-deprecated'"/>
3825
- </xsl:call-template>
4140
+
4141
+
4142
+ <xsl:call-template name="getTitle">
4143
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4144
+ </xsl:call-template>
4145
+
3826
4146
  </xsl:variable>
3827
4147
  <fo:block xsl:use-attribute-sets="deprecates-style">
3828
4148
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3871,13 +4191,14 @@
3871
4191
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3872
4192
  <fo:block>
3873
4193
  <xsl:call-template name="setId"/>
4194
+
3874
4195
  <xsl:apply-templates/>
3875
4196
  </fo:block>
3876
4197
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3877
4198
  <fo:block id="{@id}">
3878
4199
  <xsl:apply-templates/>
3879
4200
  </fo:block>
3880
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4201
+ </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']">
3881
4202
 
3882
4203
  <fo:block id="{@id}">
3883
4204
  <xsl:apply-templates/>
@@ -3911,6 +4232,7 @@
3911
4232
  </xsl:choose>
3912
4233
  </xsl:attribute>
3913
4234
 
4235
+
3914
4236
  <fo:block-container margin-left="0mm">
3915
4237
  <fo:block>
3916
4238
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -3938,7 +4260,8 @@
3938
4260
  <fo:table-column column-width="107mm"/>
3939
4261
  <fo:table-column column-width="15mm"/>
3940
4262
  <fo:table-body>
3941
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4263
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4264
+
3942
4265
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3943
4266
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3944
4267
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -3956,6 +4279,10 @@
3956
4279
  <fo:block><xsl:apply-templates/></fo:block>
3957
4280
  </fo:table-cell>
3958
4281
  </xsl:template><xsl:template name="processBibitem">
4282
+
4283
+
4284
+ <!-- end BIPM bibitem processing-->
4285
+
3959
4286
 
3960
4287
 
3961
4288
 
@@ -4096,6 +4423,7 @@
4096
4423
 
4097
4424
 
4098
4425
 
4426
+
4099
4427
 
4100
4428
  </xsl:variable>
4101
4429
  <xsl:choose>
@@ -4110,6 +4438,7 @@
4110
4438
  <dc:creator>
4111
4439
 
4112
4440
 
4441
+
4113
4442
  </dc:creator>
4114
4443
  <dc:description>
4115
4444
  <xsl:variable name="abstract">
@@ -4119,6 +4448,7 @@
4119
4448
  <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4120
4449
 
4121
4450
 
4451
+
4122
4452
  </xsl:variable>
4123
4453
  <xsl:value-of select="normalize-space($abstract)"/>
4124
4454
  </dc:description>
@@ -4190,13 +4520,22 @@
4190
4520
  </xsl:template><xsl:template name="split">
4191
4521
  <xsl:param name="pText" select="."/>
4192
4522
  <xsl:param name="sep" select="','"/>
4523
+ <xsl:param name="normalize-space" select="'true'"/>
4193
4524
  <xsl:if test="string-length($pText) &gt;0">
4194
4525
  <item>
4195
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4526
+ <xsl:choose>
4527
+ <xsl:when test="$normalize-space = 'true'">
4528
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4529
+ </xsl:when>
4530
+ <xsl:otherwise>
4531
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4532
+ </xsl:otherwise>
4533
+ </xsl:choose>
4196
4534
  </item>
4197
4535
  <xsl:call-template name="split">
4198
4536
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4199
4537
  <xsl:with-param name="sep" select="$sep"/>
4538
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4200
4539
  </xsl:call-template>
4201
4540
  </xsl:if>
4202
4541
  </xsl:template><xsl:template name="getDocumentId">
@@ -4262,4 +4601,23 @@
4262
4601
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4263
4602
  </xsl:call-template>
4264
4603
  </xsl:if>
4604
+ </xsl:template><xsl:template name="repeat">
4605
+ <xsl:param name="char" select="'*'"/>
4606
+ <xsl:param name="count"/>
4607
+ <xsl:if test="$count &gt; 0">
4608
+ <xsl:value-of select="$char"/>
4609
+ <xsl:call-template name="repeat">
4610
+ <xsl:with-param name="char" select="$char"/>
4611
+ <xsl:with-param name="count" select="$count - 1"/>
4612
+ </xsl:call-template>
4613
+ </xsl:if>
4614
+ </xsl:template><xsl:template name="getLocalizedString">
4615
+ <xsl:param name="key"/>
4616
+
4617
+ <xsl:variable name="curr_lang">
4618
+ <xsl:call-template name="getLang"/>
4619
+ </xsl:variable>
4620
+
4621
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4622
+
4265
4623
  </xsl:template></xsl:stylesheet>