metanorma-ogc 1.3.1 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,12 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
- <xsl:variable name="pageWidth" select="'215.9mm'"/>
11
- <xsl:variable name="pageHeight" select="'279.4mm'"/>
10
+ <xsl:variable name="pageWidth" select="215.9"/>
11
+ <xsl:variable name="pageHeight" select="279.4"/>
12
+ <xsl:variable name="marginLeftRight1" select="35"/>
13
+ <xsl:variable name="marginLeftRight2" select="17"/>
14
+ <xsl:variable name="marginTop" select="16.5"/>
15
+ <xsl:variable name="marginBottom" select="22.5"/>
12
16
 
13
17
 
14
18
 
@@ -74,7 +78,7 @@
74
78
  <fo:root font-family="Lato, STIX Two Math, Source Han Sans" font-size="11pt" color="{$color_main}" xml:lang="{$lang}">
75
79
  <fo:layout-master-set>
76
80
  <!-- Cover page -->
77
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
81
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
78
82
  <fo:region-body margin-top="16.5mm" margin-bottom="10mm" margin-left="16.5mm" margin-right="14mm"/>
79
83
  <fo:region-before region-name="cover-page-header" extent="16.5mm"/>
80
84
  <fo:region-after extent="10mm"/>
@@ -83,7 +87,7 @@
83
87
  </fo:simple-page-master>
84
88
 
85
89
  <!-- Preface pages -->
86
- <fo:simple-page-master master-name="preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
90
+ <fo:simple-page-master master-name="preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
87
91
  <fo:region-body margin-top="16.5mm" margin-bottom="22.5mm" margin-left="16.5mm" margin-right="16.5mm"/>
88
92
  <fo:region-before region-name="header" extent="16.5mm"/>
89
93
  <fo:region-after region-name="footer" extent="22.5mm"/>
@@ -93,12 +97,12 @@
93
97
 
94
98
 
95
99
  <!-- Document pages -->
96
- <fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
97
- <fo:region-body margin-top="16.5mm" margin-bottom="22.5mm" margin-left="35mm" margin-right="17mm"/>
98
- <fo:region-before region-name="header" extent="16.5mm"/>
99
- <fo:region-after region-name="footer" extent="22.5mm"/>
100
+ <fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
101
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
102
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
100
104
  <fo:region-start region-name="left-region" extent="16.5mm"/>
101
- <fo:region-end region-name="right-region" extent="17mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
102
106
  </fo:simple-page-master>
103
107
 
104
108
  </fo:layout-master-set>
@@ -124,16 +128,16 @@
124
128
  <!-- background image -->
125
129
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
126
130
  <fo:block>
127
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
131
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
128
132
  </fo:block>
129
133
  </fo:block-container>
130
134
 
131
135
  <!-- background color -->
132
136
  <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
133
137
  <fo:block>
134
- <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
135
- <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
136
- <rect width="215.9mm" height="279.4mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:0.85"/>
138
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
139
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
140
+ <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:0.85"/>
137
141
  </svg>
138
142
  </fo:instream-foreign-object>
139
143
  </fo:block>
@@ -272,10 +276,10 @@
272
276
  </xsl:if>
273
277
 
274
278
  <!-- crossing lines -->
275
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
279
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
276
280
  <fo:block>
277
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
278
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
281
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
282
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
279
283
  <line x1="230" y1="0" x2="2159" y2="490" stroke="{$color_lightorange}"/>
280
284
  <line x1="0" y1="395" x2="820" y2="0" stroke="{$color_lightorange}"/>
281
285
  <circle style="fill:{$color_lightorange};" cx="614" cy="100" r="15"/>
@@ -305,10 +309,10 @@
305
309
  <fo:flow flow-name="xsl-region-body">
306
310
 
307
311
  <!-- crossing lines -->
308
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
312
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
309
313
  <fo:block>
310
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
311
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
314
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
315
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
312
316
  <line x1="0" y1="545" x2="2084" y2="0" stroke="{$color_lightorange}"/>
313
317
  <line x1="0" y1="1374" x2="355" y2="0" stroke="{$color_lightorange}"/>
314
318
  <circle style="fill:{$color_lightorange};" cx="227" cy="487" r="15"/>
@@ -601,9 +605,9 @@
601
605
  <!-- background color -->
602
606
  <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
603
607
  <fo:block>
604
- <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
605
- <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
606
- <rect width="215.9mm" height="279.4mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:1"/>
608
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
609
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
610
+ <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:1"/>
607
611
  </svg>
608
612
  </fo:instream-foreign-object>
609
613
  </fo:block>
@@ -1355,10 +1359,10 @@
1355
1359
  </xsl:template>
1356
1360
 
1357
1361
  <xsl:template name="insertCrossingLines">
1358
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
1362
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
1359
1363
  <fo:block>
1360
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
1361
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
1364
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
1365
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
1362
1366
  <line x1="0" y1="300" x2="2159" y2="675" stroke="{$color_orange}"/>
1363
1367
  <line x1="1215" y1="0" x2="2159" y2="1380" stroke="{$color_orange}"/>
1364
1368
  <line x1="0" y1="1850" x2="2159" y2="2390" stroke="{$color_orange}"/>
@@ -1595,6 +1599,9 @@
1595
1599
  <title-continued lang="en">(continued)</title-continued>
1596
1600
  <title-continued lang="fr">(continué)</title-continued>
1597
1601
 
1602
+ </xsl:variable><xsl:variable name="bibdata">
1603
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1604
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1598
1605
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1599
1606
  <xsl:param name="name"/>
1600
1607
  <xsl:param name="lang"/>
@@ -1624,6 +1631,8 @@
1624
1631
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1625
1632
 
1626
1633
 
1634
+
1635
+
1627
1636
  <!-- <xsl:attribute name="color">rgb(33, 55, 92)</xsl:attribute> -->
1628
1637
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1629
1638
 
@@ -1715,7 +1724,7 @@
1715
1724
 
1716
1725
 
1717
1726
 
1718
-
1727
+
1719
1728
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1720
1729
 
1721
1730
 
@@ -1731,6 +1740,7 @@
1731
1740
 
1732
1741
 
1733
1742
 
1743
+
1734
1744
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1735
1745
 
1736
1746
 
@@ -1750,9 +1760,7 @@
1750
1760
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1751
1761
 
1752
1762
 
1753
-
1754
-
1755
-
1763
+
1756
1764
 
1757
1765
 
1758
1766
 
@@ -1781,8 +1789,10 @@
1781
1789
 
1782
1790
 
1783
1791
 
1792
+
1784
1793
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1785
1794
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1795
+
1786
1796
 
1787
1797
 
1788
1798
 
@@ -1800,6 +1810,9 @@
1800
1810
 
1801
1811
 
1802
1812
 
1813
+
1814
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1815
+
1803
1816
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1804
1817
 
1805
1818
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1822,16 +1835,21 @@
1822
1835
 
1823
1836
 
1824
1837
 
1838
+
1839
+
1825
1840
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1826
1841
 
1827
1842
 
1828
1843
 
1829
1844
 
1830
1845
 
1846
+
1847
+
1831
1848
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1832
1849
 
1833
1850
 
1834
1851
 
1852
+
1835
1853
 
1836
1854
 
1837
1855
 
@@ -1846,6 +1864,7 @@
1846
1864
 
1847
1865
 
1848
1866
 
1867
+
1849
1868
  </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">
1850
1869
 
1851
1870
 
@@ -1856,6 +1875,7 @@
1856
1875
 
1857
1876
 
1858
1877
 
1878
+
1859
1879
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1860
1880
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
1861
1881
 
@@ -1884,16 +1904,20 @@
1884
1904
 
1885
1905
 
1886
1906
 
1907
+
1887
1908
 
1888
1909
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1889
1910
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1890
1911
 
1912
+
1891
1913
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1892
1914
 
1915
+
1893
1916
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1894
1917
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
1895
1918
 
1896
1919
 
1920
+
1897
1921
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1898
1922
 
1899
1923
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1915,6 +1939,7 @@
1915
1939
 
1916
1940
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1917
1941
 
1942
+
1918
1943
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1919
1944
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1920
1945
 
@@ -1922,15 +1947,18 @@
1922
1947
 
1923
1948
 
1924
1949
 
1950
+
1925
1951
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1926
1952
 
1927
1953
 
1928
1954
 
1929
1955
 
1956
+
1930
1957
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1931
1958
 
1932
1959
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1933
1960
 
1961
+
1934
1962
 
1935
1963
 
1936
1964
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1948,6 +1976,7 @@
1948
1976
 
1949
1977
 
1950
1978
 
1979
+
1951
1980
 
1952
1981
 
1953
1982
 
@@ -1957,6 +1986,7 @@
1957
1986
  </xsl:attribute-set><xsl:attribute-set name="image-style">
1958
1987
  <xsl:attribute name="text-align">center</xsl:attribute>
1959
1988
 
1989
+
1960
1990
  <xsl:attribute name="space-before">12pt</xsl:attribute>
1961
1991
  <xsl:attribute name="space-after">6pt</xsl:attribute>
1962
1992
 
@@ -1968,6 +1998,7 @@
1968
1998
 
1969
1999
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1970
2000
 
2001
+
1971
2002
  <xsl:attribute name="width">100%</xsl:attribute>
1972
2003
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1973
2004
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -1996,13 +2027,16 @@
1996
2027
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1997
2028
 
1998
2029
 
2030
+
1999
2031
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
2000
2032
 
2033
+
2001
2034
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
2002
2035
 
2003
2036
  <xsl:attribute name="space-after">6pt</xsl:attribute>
2004
2037
 
2005
2038
 
2039
+
2006
2040
  </xsl:attribute-set><xsl:variable name="color-added-text">
2007
2041
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2008
2042
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -2021,6 +2055,8 @@
2021
2055
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
2022
2056
 
2023
2057
 
2058
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
2059
+
2024
2060
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2025
2061
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2026
2062
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -2031,14 +2067,15 @@
2031
2067
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2032
2068
 
2033
2069
  <!-- Normative references -->
2034
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
2070
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
2035
2071
  <!-- Terms and definitions -->
2036
2072
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
2037
2073
  <!-- Another main sections -->
2038
2074
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
2039
2075
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
2040
2076
  <!-- Bibliography -->
2041
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
2077
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
2078
+
2042
2079
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2043
2080
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2044
2081
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -2069,18 +2106,18 @@
2069
2106
  <xsl:variable name="table-preamble">
2070
2107
 
2071
2108
 
2072
- <fo:block> </fo:block>
2109
+ <fo:block> </fo:block>
2073
2110
 
2074
2111
  </xsl:variable>
2075
2112
 
2076
2113
  <xsl:variable name="table">
2077
2114
 
2078
2115
  <xsl:variable name="simple-table">
2079
- <xsl:call-template name="getSimpleTable"/>
2116
+ <xsl:call-template name="getSimpleTable"/>
2080
2117
  </xsl:variable>
2081
2118
 
2082
2119
  <!-- <xsl:if test="$namespace = 'bipm'">
2083
- <fo:block>&#xA0;</fo:block>
2120
+ <fo:block>&#xA0;</fo:block>
2084
2121
  </xsl:if> -->
2085
2122
 
2086
2123
  <!-- $namespace = 'iso' or -->
@@ -2143,6 +2180,7 @@
2143
2180
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2144
2181
 
2145
2182
 
2183
+
2146
2184
 
2147
2185
 
2148
2186
 
@@ -2163,6 +2201,8 @@
2163
2201
 
2164
2202
 
2165
2203
 
2204
+
2205
+
2166
2206
  <xsl:variable name="table_width">
2167
2207
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2168
2208
 
@@ -2186,6 +2226,7 @@
2186
2226
 
2187
2227
 
2188
2228
 
2229
+
2189
2230
  <attribute name="margin-left">0mm</attribute>
2190
2231
  <attribute name="margin-right">0mm</attribute>
2191
2232
 
@@ -2194,6 +2235,7 @@
2194
2235
 
2195
2236
 
2196
2237
 
2238
+
2197
2239
  </xsl:variable>
2198
2240
 
2199
2241
 
@@ -2327,11 +2369,25 @@
2327
2369
  </xsl:choose>
2328
2370
 
2329
2371
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2372
+ <xsl:param name="continued"/>
2330
2373
  <xsl:if test="normalize-space() != ''">
2331
2374
  <fo:block xsl:use-attribute-sets="table-name-style">
2332
2375
 
2333
2376
 
2334
- <xsl:apply-templates/>
2377
+
2378
+
2379
+
2380
+ <xsl:choose>
2381
+ <xsl:when test="$continued = 'true'">
2382
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
2383
+
2384
+ </xsl:when>
2385
+ <xsl:otherwise>
2386
+ <xsl:apply-templates/>
2387
+ </xsl:otherwise>
2388
+ </xsl:choose>
2389
+
2390
+
2335
2391
  </fo:block>
2336
2392
  </xsl:if>
2337
2393
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -2468,21 +2524,22 @@
2468
2524
  <!-- font-weight="bold" -->
2469
2525
  <fo:table-header>
2470
2526
 
2527
+
2471
2528
  <xsl:apply-templates/>
2472
2529
  </fo:table-header>
2473
2530
  </xsl:template><xsl:template name="table-header-title">
2474
- <xsl:param name="cols-count"/>
2531
+ <xsl:param name="cols-count"/>
2475
2532
  <!-- row for title -->
2476
2533
  <fo:table-row>
2477
2534
  <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">
2478
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2535
+
2536
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2537
+ <xsl:with-param name="continued">true</xsl:with-param>
2538
+ </xsl:apply-templates>
2479
2539
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2480
2540
  <xsl:call-template name="fn_name_display"/>
2481
- </xsl:for-each>
2482
- <fo:block text-align="right" font-style="italic">
2483
- <xsl:text> </xsl:text>
2484
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2485
- </fo:block>
2541
+ </xsl:for-each>
2542
+
2486
2543
  </fo:table-cell>
2487
2544
  </fo:table-row>
2488
2545
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2707,6 +2764,7 @@
2707
2764
 
2708
2765
 
2709
2766
 
2767
+
2710
2768
  </xsl:if>
2711
2769
  <xsl:if test="$parent-name = 'tfoot'">
2712
2770
 
@@ -2728,6 +2786,10 @@
2728
2786
  </xsl:if>
2729
2787
 
2730
2788
 
2789
+
2790
+
2791
+
2792
+
2731
2793
  <!-- <xsl:if test="$namespace = 'bipm'">
2732
2794
  <xsl:attribute name="height">8mm</xsl:attribute>
2733
2795
  </xsl:if> -->
@@ -2749,6 +2811,7 @@
2749
2811
 
2750
2812
 
2751
2813
 
2814
+
2752
2815
 
2753
2816
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2754
2817
 
@@ -2758,6 +2821,7 @@
2758
2821
 
2759
2822
 
2760
2823
 
2824
+
2761
2825
  <xsl:if test="$lang = 'ar'">
2762
2826
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2763
2827
  </xsl:if>
@@ -2807,6 +2871,8 @@
2807
2871
 
2808
2872
 
2809
2873
 
2874
+
2875
+
2810
2876
  <xsl:attribute name="border">solid 0pt white</xsl:attribute>
2811
2877
 
2812
2878
 
@@ -2814,6 +2880,9 @@
2814
2880
 
2815
2881
 
2816
2882
 
2883
+
2884
+
2885
+
2817
2886
  <xsl:if test=".//*[local-name() = 'table']">
2818
2887
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2819
2888
  </xsl:if>
@@ -2843,6 +2912,7 @@
2843
2912
 
2844
2913
 
2845
2914
 
2915
+
2846
2916
  <fo:inline padding-right="2mm">
2847
2917
 
2848
2918
 
@@ -2892,6 +2962,7 @@
2892
2962
 
2893
2963
 
2894
2964
 
2965
+
2895
2966
  <xsl:value-of select="@reference"/>
2896
2967
 
2897
2968
 
@@ -3032,11 +3103,15 @@
3032
3103
 
3033
3104
 
3034
3105
 
3106
+
3107
+
3108
+
3035
3109
  <xsl:attribute name="vertical-align">super</xsl:attribute>
3036
3110
 
3037
3111
 
3038
3112
 
3039
3113
 
3114
+
3040
3115
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3041
3116
 
3042
3117
  <xsl:attribute name="internal-destination">
@@ -3133,6 +3208,7 @@
3133
3208
 
3134
3209
 
3135
3210
 
3211
+
3136
3212
  <xsl:variable name="title-key">
3137
3213
 
3138
3214
 
@@ -3345,6 +3421,7 @@
3345
3421
 
3346
3422
  <xsl:attribute name="min-height">8.5mm</xsl:attribute>
3347
3423
 
3424
+
3348
3425
  <fo:table-cell>
3349
3426
 
3350
3427
  <fo:block margin-top="6pt">
@@ -3363,6 +3440,7 @@
3363
3440
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3364
3441
 
3365
3442
 
3443
+
3366
3444
  <xsl:apply-templates/>
3367
3445
  <!-- <xsl:if test="$namespace = 'gb'">
3368
3446
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3419,6 +3497,8 @@
3419
3497
 
3420
3498
  <xsl:apply-templates/>
3421
3499
  </fo:inline>
3500
+ </xsl:template><xsl:template match="*[local-name()='padding']">
3501
+ <fo:inline padding-right="{@value}"> </fo:inline>
3422
3502
  </xsl:template><xsl:template match="*[local-name()='sup']">
3423
3503
  <fo:inline font-size="80%" vertical-align="super">
3424
3504
  <xsl:apply-templates/>
@@ -3441,6 +3521,7 @@
3441
3521
 
3442
3522
 
3443
3523
 
3524
+
3444
3525
  10
3445
3526
 
3446
3527
 
@@ -3825,11 +3906,15 @@
3825
3906
  </xsl:apply-templates>
3826
3907
  </xsl:template><xsl:template name="getLang">
3827
3908
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3909
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3828
3910
  <xsl:variable name="language">
3829
3911
  <xsl:choose>
3830
3912
  <xsl:when test="$language_current != ''">
3831
3913
  <xsl:value-of select="$language_current"/>
3832
3914
  </xsl:when>
3915
+ <xsl:when test="$language_current_2 != ''">
3916
+ <xsl:value-of select="$language_current_2"/>
3917
+ </xsl:when>
3833
3918
  <xsl:otherwise>
3834
3919
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3835
3920
  </xsl:otherwise>
@@ -3903,9 +3988,27 @@
3903
3988
  <xsl:copy>
3904
3989
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3905
3990
  </xsl:copy>
3906
- <mathml:mspace width="0.5ex"/>
3991
+ <xsl:choose>
3992
+ <!-- if in msub, then don't add space -->
3993
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3994
+ <!-- if next char in digit, don't add space -->
3995
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3996
+ <xsl:otherwise>
3997
+ <mathml:mspace width="0.5ex"/>
3998
+ </xsl:otherwise>
3999
+ </xsl:choose>
3907
4000
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3908
4001
  <xsl:variable name="target">
4002
+ <xsl:choose>
4003
+ <xsl:when test="@updatetype = 'true'">
4004
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
4005
+ </xsl:when>
4006
+ <xsl:otherwise>
4007
+ <xsl:value-of select="normalize-space(@target)"/>
4008
+ </xsl:otherwise>
4009
+ </xsl:choose>
4010
+ </xsl:variable>
4011
+ <xsl:variable name="target_text">
3909
4012
  <xsl:choose>
3910
4013
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3911
4014
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3917,20 +4020,22 @@
3917
4020
  </xsl:variable>
3918
4021
  <fo:inline xsl:use-attribute-sets="link-style">
3919
4022
 
4023
+
4024
+
3920
4025
  <xsl:choose>
3921
- <xsl:when test="$target = ''">
4026
+ <xsl:when test="$target_text = ''">
3922
4027
  <xsl:apply-templates/>
3923
4028
  </xsl:when>
3924
4029
  <xsl:otherwise>
3925
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4030
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3926
4031
  <xsl:choose>
3927
4032
  <xsl:when test="normalize-space(.) = ''">
3928
- <!-- <xsl:value-of select="$target"/> -->
3929
4033
  <xsl:call-template name="add-zero-spaces-link-java">
3930
- <xsl:with-param name="text" select="$target"/>
4034
+ <xsl:with-param name="text" select="$target_text"/>
3931
4035
  </xsl:call-template>
3932
4036
  </xsl:when>
3933
4037
  <xsl:otherwise>
4038
+ <!-- output text from <link>text</link> -->
3934
4039
  <xsl:apply-templates/>
3935
4040
  </xsl:otherwise>
3936
4041
  </xsl:choose>
@@ -4046,6 +4151,7 @@
4046
4151
 
4047
4152
 
4048
4153
  <fo:inline xsl:use-attribute-sets="note-name-style">
4154
+
4049
4155
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4050
4156
  </fo:inline>
4051
4157
  <xsl:apply-templates/>
@@ -4071,7 +4177,9 @@
4071
4177
  </xsl:choose>
4072
4178
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
4073
4179
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
4180
+
4074
4181
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4182
+
4075
4183
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4076
4184
  </fo:inline>
4077
4185
  <xsl:apply-templates/>
@@ -4147,13 +4255,17 @@
4147
4255
  </xsl:call-template>
4148
4256
 
4149
4257
  <fo:block>
4258
+
4150
4259
  <xsl:apply-templates/>
4151
4260
  </fo:block>
4152
4261
  <xsl:call-template name="fn_display_figure"/>
4153
4262
  <xsl:for-each select="*[local-name() = 'note']">
4154
4263
  <xsl:call-template name="note"/>
4155
4264
  </xsl:for-each>
4156
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4265
+
4266
+
4267
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4268
+
4157
4269
  </fo:block-container>
4158
4270
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
4159
4271
  <fo:block id="{@id}">
@@ -4266,21 +4378,249 @@
4266
4378
  <xsl:param name="height"/>
4267
4379
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
4268
4380
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
4381
+ </xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
4382
+ <xsl:param name="name"/>
4383
+
4384
+ <xsl:variable name="svg_content">
4385
+ <xsl:apply-templates select="." mode="svg_update"/>
4386
+ </xsl:variable>
4387
+
4388
+ <xsl:variable name="alt-text">
4389
+ <xsl:choose>
4390
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
4391
+ <xsl:value-of select="../*[local-name() = 'name']"/>
4392
+ </xsl:when>
4393
+ <xsl:when test="normalize-space($name) != ''">
4394
+ <xsl:value-of select="$name"/>
4395
+ </xsl:when>
4396
+ <xsl:otherwise>Figure</xsl:otherwise>
4397
+ </xsl:choose>
4398
+ </xsl:variable>
4399
+
4400
+ <xsl:choose>
4401
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
4402
+ <fo:block>
4403
+ <xsl:variable name="width" select="@width"/>
4404
+ <xsl:variable name="height" select="@height"/>
4405
+
4406
+ <xsl:variable name="scale_x">
4407
+ <xsl:choose>
4408
+ <xsl:when test="$width &gt; $width_effective_px">
4409
+ <xsl:value-of select="$width_effective_px div $width"/>
4410
+ </xsl:when>
4411
+ <xsl:otherwise>1</xsl:otherwise>
4412
+ </xsl:choose>
4413
+ </xsl:variable>
4414
+
4415
+ <xsl:variable name="scale_y">
4416
+ <xsl:choose>
4417
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
4418
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
4419
+ </xsl:when>
4420
+ <xsl:otherwise>1</xsl:otherwise>
4421
+ </xsl:choose>
4422
+ </xsl:variable>
4423
+
4424
+ <xsl:variable name="scale">
4425
+ <xsl:choose>
4426
+ <xsl:when test="$scale_y != 1">
4427
+ <xsl:value-of select="$scale_x * $scale_y"/>
4428
+ </xsl:when>
4429
+ <xsl:otherwise>
4430
+ <xsl:value-of select="$scale_x"/>
4431
+ </xsl:otherwise>
4432
+ </xsl:choose>
4433
+ </xsl:variable>
4434
+
4435
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
4436
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
4437
+
4438
+ <fo:table table-layout="fixed" width="100%">
4439
+ <fo:table-column column-width="proportional-column-width(1)"/>
4440
+ <fo:table-column column-width="{$width_scale}px"/>
4441
+ <fo:table-column column-width="proportional-column-width(1)"/>
4442
+ <fo:table-body>
4443
+ <fo:table-row>
4444
+ <fo:table-cell column-number="2">
4445
+ <fo:block>
4446
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
4447
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4448
+ <fo:block line-height="0" font-size="0">
4449
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4450
+ <xsl:call-template name="bookmark"/>
4451
+ </xsl:for-each>
4452
+ </fo:block>
4453
+ </xsl:if>
4454
+ <fo:block text-depth="0" line-height="0" font-size="0">
4455
+
4456
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4457
+ <xsl:attribute name="width">100%</xsl:attribute>
4458
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4459
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4460
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4461
+
4462
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
4463
+ </fo:instream-foreign-object>
4464
+ </fo:block>
4465
+
4466
+ <xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
4467
+ <xsl:with-param name="scale" select="$scale"/>
4468
+ </xsl:apply-templates>
4469
+ </fo:block-container>
4470
+ </fo:block>
4471
+ </fo:table-cell>
4472
+ </fo:table-row>
4473
+ </fo:table-body>
4474
+ </fo:table>
4475
+ </fo:block>
4476
+
4477
+ </xsl:when>
4478
+ <xsl:otherwise>
4479
+ <fo:block xsl:use-attribute-sets="image-style">
4480
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4481
+ <xsl:attribute name="width">100%</xsl:attribute>
4482
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4483
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4484
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4485
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4486
+ <!-- effective height / width = 1.48, 1.4 - with title -->
4487
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4488
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4489
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4490
+ </xsl:if>
4491
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4492
+ <xsl:copy-of select="$svg_content"/>
4493
+ </fo:instream-foreign-object>
4494
+ </fo:block>
4495
+ </xsl:otherwise>
4496
+ </xsl:choose>
4497
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
4498
+ <xsl:copy>
4499
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
4500
+ </xsl:copy>
4501
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
4502
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4503
+ <xsl:value-of select="."/>
4504
+ </xsl:attribute>
4505
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4506
+ <xsl:variable name="svg_content" select="document(@src)"/>
4507
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4508
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
4509
+ <xsl:call-template name="image_svg">
4510
+ <xsl:with-param name="name" select="$name"/>
4511
+ </xsl:call-template>
4512
+ </xsl:for-each>
4513
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
4514
+ <xsl:copy>
4515
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
4516
+ </xsl:copy>
4517
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
4518
+ <xsl:apply-templates mode="svg_remove_a"/>
4519
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
4520
+ <xsl:param name="scale"/>
4521
+ <xsl:variable name="dest">
4522
+ <xsl:choose>
4523
+ <xsl:when test="starts-with(@href, '#')">
4524
+ <xsl:value-of select="substring-after(@href, '#')"/>
4525
+ </xsl:when>
4526
+ <xsl:otherwise>
4527
+ <xsl:value-of select="@href"/>
4528
+ </xsl:otherwise>
4529
+ </xsl:choose>
4530
+ </xsl:variable>
4531
+ <xsl:for-each select="./*[local-name() = 'rect']">
4532
+ <xsl:call-template name="insertSVGMapLink">
4533
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
4534
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
4535
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
4536
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
4537
+ <xsl:with-param name="dest" select="$dest"/>
4538
+ </xsl:call-template>
4539
+ </xsl:for-each>
4540
+
4541
+ <xsl:for-each select="./*[local-name() = 'polygon']">
4542
+ <xsl:variable name="points">
4543
+ <xsl:call-template name="split">
4544
+ <xsl:with-param name="pText" select="@points"/>
4545
+ </xsl:call-template>
4546
+ </xsl:variable>
4547
+ <xsl:variable name="x_coords">
4548
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
4549
+ <xsl:sort select="." data-type="number"/>
4550
+ <x><xsl:value-of select="."/></x>
4551
+ </xsl:for-each>
4552
+ </xsl:variable>
4553
+ <xsl:variable name="y_coords">
4554
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
4555
+ <xsl:sort select="." data-type="number"/>
4556
+ <y><xsl:value-of select="."/></y>
4557
+ </xsl:for-each>
4558
+ </xsl:variable>
4559
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
4560
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
4561
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
4562
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
4563
+ <xsl:call-template name="insertSVGMapLink">
4564
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
4565
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
4566
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
4567
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
4568
+ <xsl:with-param name="dest" select="$dest"/>
4569
+ </xsl:call-template>
4570
+ </xsl:for-each>
4571
+
4572
+ <xsl:for-each select="./*[local-name() = 'circle']">
4573
+ <xsl:call-template name="insertSVGMapLink">
4574
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
4575
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
4576
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
4577
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
4578
+ <xsl:with-param name="dest" select="$dest"/>
4579
+ </xsl:call-template>
4580
+ </xsl:for-each>
4581
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
4582
+ <xsl:call-template name="insertSVGMapLink">
4583
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
4584
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
4585
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
4586
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
4587
+ <xsl:with-param name="dest" select="$dest"/>
4588
+ </xsl:call-template>
4589
+ </xsl:for-each>
4590
+ </xsl:template><xsl:template name="insertSVGMapLink">
4591
+ <xsl:param name="left"/>
4592
+ <xsl:param name="top"/>
4593
+ <xsl:param name="width"/>
4594
+ <xsl:param name="height"/>
4595
+ <xsl:param name="dest"/>
4596
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
4597
+ <fo:block font-size="1pt">
4598
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
4599
+ <fo:inline-container inline-progression-dimension="100%">
4600
+ <fo:block-container height="{$height - 1}px" width="100%">
4601
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
4602
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
4603
+ </xsl:if> -->
4604
+ <fo:block> </fo:block></fo:block-container>
4605
+ </fo:inline-container>
4606
+ </fo:basic-link>
4607
+ </fo:block>
4608
+ </fo:block-container>
4269
4609
  </xsl:template><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">
4270
4610
  <xsl:apply-templates mode="contents"/>
4271
4611
  <xsl:text> </xsl:text>
4272
4612
  </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']" mode="bookmarks">
4273
4613
  <xsl:apply-templates mode="bookmarks"/>
4274
4614
  <xsl:text> </xsl:text>
4275
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4615
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
4276
4616
  <xsl:value-of select="."/>
4277
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4617
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4278
4618
  <xsl:value-of select="."/>
4279
4619
  </xsl:template><xsl:template match="node()" mode="contents">
4280
4620
  <xsl:apply-templates mode="contents"/>
4281
4621
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4282
4622
  <xsl:apply-templates mode="bookmarks"/>
4283
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4623
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4284
4624
  <xsl:apply-templates select="."/>
4285
4625
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4286
4626
  <xsl:apply-templates mode="bookmarks"/>
@@ -4294,28 +4634,39 @@
4294
4634
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4295
4635
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4296
4636
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4637
+ <xsl:if test="@bundle = 'true'">
4638
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
4639
+ </xsl:if>
4297
4640
  <fo:bookmark-title>
4298
- <xsl:variable name="bookmark-title_">
4299
- <xsl:call-template name="getLangVersion">
4300
- <xsl:with-param name="lang" select="@lang"/>
4301
- <xsl:with-param name="doctype" select="@doctype"/>
4302
- <xsl:with-param name="title" select="@title-part"/>
4303
- </xsl:call-template>
4304
- </xsl:variable>
4305
4641
  <xsl:choose>
4306
- <xsl:when test="normalize-space($bookmark-title_) != ''">
4307
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
4308
- </xsl:when>
4309
- <xsl:otherwise>
4642
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
4643
+ <xsl:variable name="bookmark-title_">
4644
+ <xsl:call-template name="getLangVersion">
4645
+ <xsl:with-param name="lang" select="@lang"/>
4646
+ <xsl:with-param name="doctype" select="@doctype"/>
4647
+ <xsl:with-param name="title" select="@title-part"/>
4648
+ </xsl:call-template>
4649
+ </xsl:variable>
4310
4650
  <xsl:choose>
4311
- <xsl:when test="@lang = 'en'">English</xsl:when>
4312
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
4313
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4314
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4651
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4652
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4653
+ </xsl:when>
4654
+ <xsl:otherwise>
4655
+ <xsl:choose>
4656
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4657
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4658
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4659
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4660
+ </xsl:choose>
4661
+ </xsl:otherwise>
4315
4662
  </xsl:choose>
4663
+ </xsl:when>
4664
+ <xsl:otherwise>
4665
+ <xsl:value-of select="@title-part"/>
4316
4666
  </xsl:otherwise>
4317
4667
  </xsl:choose>
4318
4668
  </fo:bookmark-title>
4669
+
4319
4670
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4320
4671
 
4321
4672
  <xsl:call-template name="insertFigureBookmarks">
@@ -4457,20 +4808,28 @@
4457
4808
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4458
4809
  </xsl:choose>
4459
4810
  </xsl:template><xsl:template match="item" mode="bookmark">
4460
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
4461
- <fo:bookmark-title>
4462
- <xsl:if test="@section != ''">
4463
- <xsl:value-of select="@section"/>
4464
- <xsl:text> </xsl:text>
4465
- </xsl:if>
4466
- <xsl:value-of select="normalize-space(title)"/>
4467
- </fo:bookmark-title>
4468
- <xsl:apply-templates mode="bookmark"/>
4469
- </fo:bookmark>
4811
+ <xsl:choose>
4812
+ <xsl:when test="@id != ''">
4813
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4814
+ <fo:bookmark-title>
4815
+ <xsl:if test="@section != ''">
4816
+ <xsl:value-of select="@section"/>
4817
+ <xsl:text> </xsl:text>
4818
+ </xsl:if>
4819
+ <xsl:value-of select="normalize-space(title)"/>
4820
+ </fo:bookmark-title>
4821
+ <xsl:apply-templates mode="bookmark"/>
4822
+ </fo:bookmark>
4823
+ </xsl:when>
4824
+ <xsl:otherwise>
4825
+ <xsl:apply-templates mode="bookmark"/>
4826
+ </xsl:otherwise>
4827
+ </xsl:choose>
4470
4828
  </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">
4471
4829
  <xsl:if test="normalize-space() != ''">
4472
4830
  <fo:block xsl:use-attribute-sets="figure-name-style">
4473
4831
 
4832
+
4474
4833
  <xsl:apply-templates/>
4475
4834
  </fo:block>
4476
4835
  </xsl:if>
@@ -4522,6 +4881,8 @@
4522
4881
  </fo:list-item-body>
4523
4882
  </fo:list-item>
4524
4883
  </fo:list-block>
4884
+ </xsl:template><xsl:template name="extractSection">
4885
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4525
4886
  </xsl:template><xsl:template name="extractTitle">
4526
4887
  <xsl:choose>
4527
4888
  <xsl:when test="*[local-name() = 'tab']">
@@ -4548,6 +4909,8 @@
4548
4909
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4549
4910
 
4550
4911
  <fo:block-container margin-left="0mm">
4912
+ <xsl:copy-of select="@id"/>
4913
+
4551
4914
  <xsl:if test="parent::*[local-name() = 'note']">
4552
4915
  <xsl:attribute name="margin-left">
4553
4916
  <xsl:choose>
@@ -4558,7 +4921,9 @@
4558
4921
 
4559
4922
  </xsl:if>
4560
4923
  <fo:block-container margin-left="0mm">
4561
-
4924
+
4925
+
4926
+
4562
4927
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4563
4928
  <xsl:variable name="_font-size">
4564
4929
 
@@ -4569,6 +4934,7 @@
4569
4934
 
4570
4935
 
4571
4936
 
4937
+
4572
4938
 
4573
4939
 
4574
4940
 
@@ -4586,10 +4952,14 @@
4586
4952
  </xsl:choose>
4587
4953
  </xsl:attribute>
4588
4954
  </xsl:if>
4589
- <xsl:apply-templates/>
4590
- </fo:block>
4955
+
4956
+ <xsl:apply-templates/>
4957
+ </fo:block>
4958
+
4959
+
4591
4960
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4592
4961
 
4962
+
4593
4963
  </fo:block-container>
4594
4964
  </fo:block-container>
4595
4965
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4832,6 +5202,7 @@
4832
5202
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4833
5203
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4834
5204
 
5205
+
4835
5206
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4836
5207
 
4837
5208
  <xsl:variable name="element">
@@ -4899,7 +5270,7 @@
4899
5270
  </fo:inline>
4900
5271
  </xsl:otherwise>
4901
5272
  </xsl:choose>
4902
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
5273
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4903
5274
  <fo:block xsl:use-attribute-sets="termsource-style">
4904
5275
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4905
5276
  <xsl:variable name="termsource_text">
@@ -4908,11 +5279,13 @@
4908
5279
 
4909
5280
  <xsl:choose>
4910
5281
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4911
- <xsl:apply-templates/>
5282
+ <!-- <xsl:apply-templates /> -->
5283
+ <xsl:copy-of select="$termsource_text"/>
4912
5284
  </xsl:when>
4913
5285
  <xsl:otherwise>
4914
5286
 
4915
- <xsl:apply-templates/>
5287
+ <!-- <xsl:apply-templates /> -->
5288
+ <xsl:copy-of select="$termsource_text"/>
4916
5289
 
4917
5290
  </xsl:otherwise>
4918
5291
  </xsl:choose>
@@ -4921,8 +5294,15 @@
4921
5294
  <xsl:if test="normalize-space() != ''">
4922
5295
  <xsl:value-of select="."/>
4923
5296
  </xsl:if>
4924
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
5297
+ </xsl:template><xsl:variable name="localized.source">
5298
+ <xsl:call-template name="getLocalizedString">
5299
+ <xsl:with-param name="key">source</xsl:with-param>
5300
+ </xsl:call-template>
5301
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4925
5302
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5303
+ <xsl:if test="normalize-space(@citeas) = ''">
5304
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5305
+ </xsl:if>
4926
5306
 
4927
5307
  <fo:inline>
4928
5308
 
@@ -4932,12 +5312,14 @@
4932
5312
 
4933
5313
 
4934
5314
 
5315
+
5316
+
4935
5317
  <xsl:call-template name="getTitle">
4936
5318
  <xsl:with-param name="name" select="'title-source'"/>
4937
5319
  </xsl:call-template>
5320
+ <xsl:text>: </xsl:text>
4938
5321
 
4939
5322
 
4940
- <xsl:text>: </xsl:text>
4941
5323
  </fo:inline>
4942
5324
 
4943
5325
  <fo:inline xsl:use-attribute-sets="origin-style">
@@ -5010,6 +5392,7 @@
5010
5392
  </xsl:if>
5011
5393
 
5012
5394
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5395
+
5013
5396
  <xsl:if test="normalize-space(@citeas) = ''">
5014
5397
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5015
5398
  </xsl:if>
@@ -5050,6 +5433,7 @@
5050
5433
 
5051
5434
 
5052
5435
 
5436
+
5053
5437
  <xsl:choose>
5054
5438
  <xsl:when test="$depth = 2">2</xsl:when>
5055
5439
  <xsl:otherwise>1</xsl:otherwise>
@@ -5146,7 +5530,6 @@
5146
5530
 
5147
5531
 
5148
5532
 
5149
-
5150
5533
  <xsl:apply-templates/>
5151
5534
  </fo:block>
5152
5535
 
@@ -5163,6 +5546,7 @@
5163
5546
  <xsl:call-template name="setId"/>
5164
5547
 
5165
5548
 
5549
+
5166
5550
  <xsl:apply-templates/>
5167
5551
  </fo:block>
5168
5552
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -5189,7 +5573,7 @@
5189
5573
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5190
5574
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5191
5575
  <xsl:choose>
5192
- <xsl:when test="parent::*[local-name() = 'note']">
5576
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
5193
5577
  <fo:block-container>
5194
5578
  <xsl:attribute name="margin-left">
5195
5579
  <xsl:choose>
@@ -5199,6 +5583,7 @@
5199
5583
  </xsl:attribute>
5200
5584
 
5201
5585
 
5586
+
5202
5587
  <fo:block-container margin-left="0mm">
5203
5588
  <fo:block>
5204
5589
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -5542,21 +5927,25 @@
5542
5927
 
5543
5928
 
5544
5929
 
5930
+
5931
+
5932
+
5933
+
5545
5934
  </xsl:template><xsl:template name="processBibitemDocId">
5546
5935
  <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5547
5936
  <xsl:choose>
5548
5937
  <xsl:when test="normalize-space($_doc_ident) != ''">
5549
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
5938
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
5550
5939
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
5551
5940
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5552
- </xsl:if>
5941
+ </xsl:if> -->
5553
5942
  <xsl:value-of select="$_doc_ident"/>
5554
5943
  </xsl:when>
5555
5944
  <xsl:otherwise>
5556
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5945
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5557
5946
  <xsl:if test="$type != ''">
5558
5947
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5559
- </xsl:if>
5948
+ </xsl:if> -->
5560
5949
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5561
5950
  </xsl:otherwise>
5562
5951
  </xsl:choose>
@@ -5598,6 +5987,70 @@
5598
5987
  <xsl:value-of select="substring(.,1,1)"/>
5599
5988
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5600
5989
  <fo:inline><xsl:apply-templates/></fo:inline>
5990
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5991
+ <fo:block>
5992
+ <xsl:apply-templates/>
5993
+ </fo:block>
5994
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5995
+ <fo:inline><xsl:apply-templates/></fo:inline>
5996
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5997
+ <fo:inline>
5998
+ <xsl:call-template name="text_input"/>
5999
+ </fo:inline>
6000
+ </xsl:template><xsl:template name="text_input">
6001
+ <xsl:variable name="count">
6002
+ <xsl:choose>
6003
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
6004
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
6005
+ <xsl:otherwise>10</xsl:otherwise>
6006
+ </xsl:choose>
6007
+ </xsl:variable>
6008
+ <xsl:call-template name="repeat">
6009
+ <xsl:with-param name="char" select="'_'"/>
6010
+ <xsl:with-param name="count" select="$count"/>
6011
+ </xsl:call-template>
6012
+ <xsl:text> </xsl:text>
6013
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
6014
+ <xsl:variable name="caption">
6015
+ <xsl:choose>
6016
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
6017
+ <xsl:otherwise>BUTTON</xsl:otherwise>
6018
+ </xsl:choose>
6019
+ </xsl:variable>
6020
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
6021
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
6022
+ <fo:inline padding-right="1mm">
6023
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
6024
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
6025
+ <xsl:attribute name="content-width">100%</xsl:attribute>
6026
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6027
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6028
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
6029
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
6030
+ </svg>
6031
+ </fo:instream-foreign-object>
6032
+ </fo:inline>
6033
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
6034
+ <fo:inline padding-right="1mm">
6035
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
6036
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
6037
+ <xsl:attribute name="content-width">100%</xsl:attribute>
6038
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6039
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6040
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
6041
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
6042
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
6043
+ </svg>
6044
+ </fo:instream-foreign-object>
6045
+ </fo:inline>
6046
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
6047
+ <fo:inline>
6048
+ <xsl:call-template name="text_input"/>
6049
+ </fo:inline>
6050
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
6051
+ <fo:block-container border="1pt solid black" width="50%">
6052
+ <fo:block> </fo:block>
6053
+ </fo:block-container>
5601
6054
  </xsl:template><xsl:template name="convertDate">
5602
6055
  <xsl:param name="date"/>
5603
6056
  <xsl:param name="format" select="'short'"/>
@@ -5805,6 +6258,9 @@
5805
6258
  <xsl:when test="parent::*[local-name() = 'preface']">
5806
6259
  <xsl:value-of select="$level_total - 1"/>
5807
6260
  </xsl:when>
6261
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
6262
+ <xsl:value-of select="$level_total - 1"/>
6263
+ </xsl:when>
5808
6264
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5809
6265
  <xsl:value-of select="$level_total - 2"/>
5810
6266
  </xsl:when>
@@ -5865,6 +6321,7 @@
5865
6321
 
5866
6322
 
5867
6323
 
6324
+
5868
6325
  <xsl:value-of select="document('')//*/namespace::ogc"/>
5869
6326
 
5870
6327
 
@@ -5929,17 +6386,29 @@
5929
6386
  </xsl:call-template>
5930
6387
  </xsl:if>
5931
6388
  </xsl:template><xsl:template name="getLocalizedString">
5932
- <xsl:param name="key"/>
6389
+ <xsl:param name="key"/>
5933
6390
 
5934
6391
  <xsl:variable name="curr_lang">
5935
6392
  <xsl:call-template name="getLang"/>
5936
6393
  </xsl:variable>
5937
6394
 
6395
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6396
+
5938
6397
  <xsl:choose>
6398
+ <xsl:when test="$data_value != ''">
6399
+ <xsl:value-of select="$data_value"/>
6400
+ </xsl:when>
5939
6401
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5940
6402
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5941
6403
  </xsl:when>
5942
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6404
+ <xsl:otherwise>
6405
+ <xsl:variable name="key_">
6406
+ <xsl:call-template name="capitalize">
6407
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
6408
+ </xsl:call-template>
6409
+ </xsl:variable>
6410
+ <xsl:value-of select="$key_"/>
6411
+ </xsl:otherwise>
5943
6412
  </xsl:choose>
5944
6413
 
5945
6414
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -5982,4 +6451,14 @@
5982
6451
  <xsl:value-of select="$align"/>
5983
6452
  </xsl:when>
5984
6453
  </xsl:choose>
6454
+ </xsl:template><xsl:template name="setTextAlignment">
6455
+ <xsl:param name="default">left</xsl:param>
6456
+ <xsl:attribute name="text-align">
6457
+ <xsl:choose>
6458
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
6459
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
6460
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
6461
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
6462
+ </xsl:choose>
6463
+ </xsl:attribute>
5985
6464
  </xsl:template></xsl:stylesheet>