metanorma-un 0.5.3 → 0.5.8

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.
@@ -16,6 +16,14 @@
16
16
 
17
17
  <xsl:variable name="contents">
18
18
  <contents>
19
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
20
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
21
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
22
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
23
+
24
+ <xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/>
25
+ <xsl:apply-templates select="/un:un-standard/un:annex" mode="contents"/>
26
+ <xsl:apply-templates select="/un:un-standard/un:bibliography/un:references" mode="contents"/>
19
27
  </contents>
20
28
  </xsl:variable>
21
29
 
@@ -29,7 +37,7 @@
29
37
 
30
38
  <xsl:template match="/">
31
39
  <xsl:call-template name="namespaceCheck"/>
32
- <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10pt" xml:lang="{$lang}">
40
+ <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
33
41
  <fo:layout-master-set>
34
42
  <!-- Cover page -->
35
43
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -66,6 +74,10 @@
66
74
 
67
75
  <xsl:call-template name="addPDFUAmeta"/>
68
76
 
77
+ <xsl:call-template name="addBookmarks">
78
+ <xsl:with-param name="contents" select="$contents"/>
79
+ </xsl:call-template>
80
+
69
81
  <!-- Cover Page -->
70
82
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
71
83
  <fo:flow flow-name="xsl-region-body">
@@ -150,7 +162,40 @@
150
162
  <fo:block margin-left="-20mm">
151
163
  <fo:block font-size="17pt" margin-bottom="16pt">
152
164
  <xsl:value-of select="$title"/>
165
+
166
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
167
+ <xsl:variable name="number" select="position()"/>
168
+ <fo:inline font-size="14pt" baseline-shift="15%" font-weight="normal">
169
+ <xsl:if test="$number = 1">
170
+ <xsl:text> </xsl:text>
171
+ </xsl:if>
172
+ <fo:basic-link internal-destination="title-footnote_{$number}" fox:alt-text="title footnote">
173
+ <xsl:call-template name="repeat">
174
+ <xsl:with-param name="char" select="'*'"/>
175
+ <xsl:with-param name="count" select="$number"/>
176
+ </xsl:call-template>
177
+ </fo:basic-link>
178
+ <xsl:if test="position() != last()"><fo:inline baseline-shift="20%">,</fo:inline></xsl:if>
179
+ </fo:inline>
180
+ </xsl:for-each>
181
+
182
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
183
+ <xsl:variable name="number" select="position()"/>
184
+ <fo:block id="title-footnote_{$number}" font-size="14pt" font-weight="normal">
185
+ <xsl:if test="$number = 1">
186
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
187
+ </xsl:if>
188
+ <xsl:call-template name="repeat">
189
+ <xsl:with-param name="char" select="'*'"/>
190
+ <xsl:with-param name="count" select="$number"/>
191
+ </xsl:call-template>
192
+ <xsl:text> </xsl:text>
193
+ <xsl:apply-templates/>
194
+ </fo:block>
195
+ </xsl:for-each>
196
+
153
197
  </fo:block>
198
+
154
199
  <fo:block font-size="14pt" margin-bottom="16pt">
155
200
  <xsl:value-of select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'subtitle']"/>
156
201
  </fo:block>
@@ -173,20 +218,22 @@
173
218
  </fo:block>
174
219
 
175
220
  <fo:block padding-top="1mm">
176
- <fo:instream-foreign-object fox:alt-text="Barcode">
177
- <barcode:barcode message="{$code}">
178
- <barcode:code39>
179
- <barcode:height>8.5mm</barcode:height>
180
- <barcode:module-width>0.24mm</barcode:module-width>
181
- <barcode:human-readable>
182
- <barcode:placement>none</barcode:placement>
183
- <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
184
- <barcode:font-name>Arial</barcode:font-name>
185
- <barcode:font-size>9.7pt</barcode:font-size> -->
186
- </barcode:human-readable>
187
- </barcode:code39>
188
- </barcode:barcode>
189
- </fo:instream-foreign-object>
221
+ <xsl:if test="normalize-space($code) != ''">
222
+ <fo:instream-foreign-object fox:alt-text="Barcode">
223
+ <barcode:barcode message="{$code}">
224
+ <barcode:code39>
225
+ <barcode:height>8.5mm</barcode:height>
226
+ <barcode:module-width>0.24mm</barcode:module-width>
227
+ <barcode:human-readable>
228
+ <barcode:placement>none</barcode:placement>
229
+ <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
230
+ <barcode:font-name>Arial</barcode:font-name>
231
+ <barcode:font-size>9.7pt</barcode:font-size> -->
232
+ </barcode:human-readable>
233
+ </barcode:code39>
234
+ </barcode:barcode>
235
+ </fo:instream-foreign-object>
236
+ </xsl:if>
190
237
  </fo:block>
191
238
  <fo:block padding-top="-0.8mm" text-align="left" font-family="Arial" font-size="8pt" letter-spacing="1.8mm">
192
239
  <xsl:value-of select="concat('*', $code, '*')"/>
@@ -200,14 +247,16 @@
200
247
  </fo:block-container>
201
248
  <fo:block-container absolute-position="fixed" left="170mm" top="253mm">
202
249
  <fo:block>
203
- <fo:instream-foreign-object fox:alt-text="Barcode">
204
- <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
205
- <barcode:qr>
206
- <barcode:module-width>0.55mm</barcode:module-width>
207
- <barcode:ec-level>M</barcode:ec-level>
208
- </barcode:qr>
209
- </barcode:barcode>
210
- </fo:instream-foreign-object>
250
+ <xsl:if test="normalize-space(/un:un-standard/un:bibdata/un:ext/un:session/un:id) != ''">
251
+ <fo:instream-foreign-object fox:alt-text="Barcode">
252
+ <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
253
+ <barcode:qr>
254
+ <barcode:module-width>0.55mm</barcode:module-width>
255
+ <barcode:ec-level>M</barcode:ec-level>
256
+ </barcode:qr>
257
+ </barcode:barcode>
258
+ </fo:instream-foreign-object>
259
+ </xsl:if>
211
260
  </fo:block>
212
261
  </fo:block-container>
213
262
 
@@ -262,6 +311,65 @@
262
311
  </xsl:template>
263
312
 
264
313
 
314
+
315
+ <!-- ============================= -->
316
+ <!-- CONTENTS -->
317
+ <!-- ============================= -->
318
+ <xsl:template match="node()" mode="contents">
319
+ <xsl:apply-templates mode="contents"/>
320
+ </xsl:template>
321
+
322
+ <!-- element with title -->
323
+ <xsl:template match="*[un:title]" mode="contents">
324
+ <xsl:variable name="level">
325
+ <xsl:call-template name="getLevel">
326
+ <xsl:with-param name="depth" select="un:title/@depth"/>
327
+ </xsl:call-template>
328
+ </xsl:variable>
329
+
330
+ <xsl:variable name="display">
331
+ <xsl:choose>
332
+ <xsl:when test="$level &gt; 3">false</xsl:when>
333
+ <xsl:otherwise>true</xsl:otherwise>
334
+ </xsl:choose>
335
+ </xsl:variable>
336
+
337
+ <xsl:variable name="skip">
338
+ <xsl:choose>
339
+ <xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when>
340
+ <xsl:when test="ancestor-or-self::un:term">true</xsl:when>
341
+ <xsl:when test="@inline-header = 'true'">true</xsl:when>
342
+ <xsl:otherwise>false</xsl:otherwise>
343
+ </xsl:choose>
344
+ </xsl:variable>
345
+
346
+ <xsl:if test="$skip = 'false'">
347
+
348
+ <xsl:variable name="section">
349
+ <xsl:call-template name="getSection"/>
350
+ </xsl:variable>
351
+
352
+ <xsl:variable name="title">
353
+ <xsl:call-template name="getName"/>
354
+ </xsl:variable>
355
+
356
+ <xsl:variable name="type">
357
+ <xsl:value-of select="local-name()"/>
358
+ </xsl:variable>
359
+
360
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
361
+ <title>
362
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
363
+ </title>
364
+ <xsl:apply-templates mode="contents"/>
365
+ </item>
366
+ </xsl:if>
367
+
368
+ </xsl:template>
369
+ <xsl:template match="un:references[not(@normative='true')]/un:bibitem" mode="contents"/>
370
+ <!-- ============================= -->
371
+ <!-- ============================= -->
372
+
265
373
 
266
374
  <!-- ============================= -->
267
375
  <!-- PARAGRAPHS -->
@@ -1104,13 +1212,22 @@
1104
1212
 
1105
1213
  </title-edition>
1106
1214
 
1215
+ <title-edition lang="fr">
1216
+
1217
+ <xsl:text>Édition </xsl:text>
1218
+
1219
+ </title-edition>
1220
+
1107
1221
 
1108
1222
  <title-toc lang="en">
1109
1223
 
1110
1224
 
1111
1225
 
1112
1226
  </title-toc>
1113
- <title-toc lang="fr">Sommaire</title-toc>
1227
+ <title-toc lang="fr">
1228
+
1229
+
1230
+ </title-toc>
1114
1231
 
1115
1232
  <title-toc lang="zh">Contents</title-toc>
1116
1233
 
@@ -1130,13 +1247,22 @@
1130
1247
  <title-part lang="en">
1131
1248
 
1132
1249
 
1250
+
1133
1251
  </title-part>
1134
1252
  <title-part lang="fr">
1135
1253
 
1136
1254
 
1255
+
1137
1256
  </title-part>
1138
1257
  <title-part lang="zh">第 # 部分:</title-part>
1139
1258
 
1259
+ <title-subpart lang="en">
1260
+
1261
+ </title-subpart>
1262
+ <title-subpart lang="fr">
1263
+
1264
+ </title-subpart>
1265
+
1140
1266
  <title-modified lang="en">modified</title-modified>
1141
1267
  <title-modified lang="fr">modifiée</title-modified>
1142
1268
 
@@ -1198,10 +1324,19 @@
1198
1324
 
1199
1325
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1200
1326
  <xsl:param name="name"/>
1201
- <xsl:variable name="lang">
1202
- <xsl:call-template name="getLang"/>
1327
+ <xsl:param name="lang"/>
1328
+ <xsl:variable name="lang_">
1329
+ <xsl:choose>
1330
+ <xsl:when test="$lang != ''">
1331
+ <xsl:value-of select="$lang"/>
1332
+ </xsl:when>
1333
+ <xsl:otherwise>
1334
+ <xsl:call-template name="getLang"/>
1335
+ </xsl:otherwise>
1336
+ </xsl:choose>
1203
1337
  </xsl:variable>
1204
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1338
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1339
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1205
1340
  <xsl:choose>
1206
1341
  <xsl:when test="normalize-space($title_) != ''">
1207
1342
  <xsl:value-of select="$title_"/>
@@ -1210,7 +1345,9 @@
1210
1345
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1211
1346
  </xsl:otherwise>
1212
1347
  </xsl:choose>
1213
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1348
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1349
+
1350
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1214
1351
 
1215
1352
 
1216
1353
 
@@ -1344,6 +1481,7 @@
1344
1481
 
1345
1482
 
1346
1483
 
1484
+
1347
1485
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1348
1486
 
1349
1487
 
@@ -1379,6 +1517,7 @@
1379
1517
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1380
1518
 
1381
1519
 
1520
+
1382
1521
  </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">
1383
1522
 
1384
1523
 
@@ -1445,6 +1584,7 @@
1445
1584
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1446
1585
 
1447
1586
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1587
+
1448
1588
 
1449
1589
 
1450
1590
 
@@ -1566,6 +1706,10 @@
1566
1706
 
1567
1707
 
1568
1708
 
1709
+ <!-- <xsl:if test="$namespace = 'bipm'">
1710
+ <fo:block>&#xA0;</fo:block>
1711
+ </xsl:if> -->
1712
+
1569
1713
  <!-- $namespace = 'iso' or -->
1570
1714
 
1571
1715
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1603,6 +1747,7 @@
1603
1747
  <xsl:with-param name="table" select="$simple-table"/>
1604
1748
  </xsl:call-template>
1605
1749
  </xsl:variable>
1750
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1606
1751
 
1607
1752
  <!-- <xsl:variable name="colwidths2">
1608
1753
  <xsl:call-template name="calculate-column-widths">
@@ -1624,32 +1769,54 @@
1624
1769
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1625
1770
 
1626
1771
 
1627
-
1772
+
1773
+
1628
1774
 
1629
1775
  <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
1776
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1777
+
1630
1778
 
1631
1779
 
1632
-
1780
+
1633
1781
 
1634
1782
 
1635
1783
 
1636
- <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">
1637
-
1638
-
1639
-
1640
-
1641
-
1784
+
1785
+
1786
+
1787
+
1788
+ <xsl:variable name="table_attributes">
1789
+ <attribute name="table-layout">fixed</attribute>
1790
+ <attribute name="width">100%</attribute>
1791
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1792
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1642
1793
 
1643
1794
 
1644
1795
 
1645
- <xsl:attribute name="border-top">0.5pt solid black</xsl:attribute>
1646
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1647
1796
 
1797
+
1798
+
1648
1799
 
1800
+ <attribute name="border-top">0.5pt solid black</attribute>
1801
+
1649
1802
 
1803
+
1650
1804
 
1805
+ </xsl:variable>
1806
+
1807
+
1808
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1651
1809
 
1810
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1811
+ <xsl:attribute name="{@name}">
1812
+ <xsl:value-of select="."/>
1813
+ </xsl:attribute>
1814
+ </xsl:for-each>
1652
1815
 
1816
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1817
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1818
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1819
+ </xsl:if>
1653
1820
 
1654
1821
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1655
1822
  <xsl:choose>
@@ -1673,6 +1840,33 @@
1673
1840
 
1674
1841
  </fo:table>
1675
1842
 
1843
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1844
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1845
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1846
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1847
+ </xsl:call-template>
1848
+ </xsl:for-each>
1849
+
1850
+ <!-- insert footer as table -->
1851
+ <!-- <fo:table>
1852
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1853
+ <xsl:attribute name="{@name}">
1854
+ <xsl:value-of select="."/>
1855
+ </xsl:attribute>
1856
+ </xsl:for-each>
1857
+
1858
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1859
+ <xsl:choose>
1860
+ <xsl:when test=". = 1 or . = 0">
1861
+ <fo:table-column column-width="proportional-column-width(2)"/>
1862
+ </xsl:when>
1863
+ <xsl:otherwise>
1864
+ <fo:table-column column-width="proportional-column-width({.})"/>
1865
+ </xsl:otherwise>
1866
+ </xsl:choose>
1867
+ </xsl:for-each>
1868
+ </fo:table>-->
1869
+
1676
1870
 
1677
1871
 
1678
1872
 
@@ -1682,6 +1876,7 @@
1682
1876
  <xsl:if test="normalize-space() != ''">
1683
1877
  <fo:block xsl:use-attribute-sets="table-name-style">
1684
1878
 
1879
+
1685
1880
  <xsl:apply-templates/>
1686
1881
  </fo:block>
1687
1882
  </xsl:if>
@@ -1737,6 +1932,13 @@
1737
1932
  <xsl:for-each select="xalan:nodeset($table)//tr">
1738
1933
  <xsl:variable name="td_text">
1739
1934
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1935
+
1936
+ <!-- <xsl:if test="$namespace = 'bipm'">
1937
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1938
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1939
+ </xsl:for-each>
1940
+ </xsl:if> -->
1941
+
1740
1942
  </xsl:variable>
1741
1943
  <xsl:variable name="words">
1742
1944
  <xsl:variable name="string_with_added_zerospaces">
@@ -1796,11 +1998,14 @@
1796
1998
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1797
1999
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1798
2000
  <xsl:value-of select="@target"/>
2001
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2002
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
2003
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1799
2004
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1800
2005
  <xsl:param name="cols-count"/>
1801
2006
  <!-- font-weight="bold" -->
1802
2007
  <fo:table-header>
1803
-
2008
+
1804
2009
  <xsl:apply-templates/>
1805
2010
  </fo:table-header>
1806
2011
  </xsl:template><xsl:template name="table-header-title">
@@ -1825,6 +2030,13 @@
1825
2030
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1826
2031
  <xsl:apply-templates/>
1827
2032
  </xsl:template><xsl:template name="insertTableFooter">
2033
+ <xsl:param name="cols-count"/>
2034
+ <xsl:if test="../*[local-name()='tfoot']">
2035
+ <fo:table-footer>
2036
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2037
+ </fo:table-footer>
2038
+ </xsl:if>
2039
+ </xsl:template><xsl:template name="insertTableFooter2">
1828
2040
  <xsl:param name="cols-count"/>
1829
2041
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1830
2042
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1846,11 +2058,29 @@
1846
2058
  <!-- fn will be processed inside 'note' processing -->
1847
2059
 
1848
2060
 
2061
+
2062
+
2063
+
2064
+
1849
2065
  <!-- except gb -->
1850
2066
 
1851
2067
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1852
2068
 
1853
2069
 
2070
+ <!-- show Note under table in preface (ex. abstract) sections -->
2071
+ <!-- empty, because notes show at page side in main sections -->
2072
+ <!-- <xsl:if test="$namespace = 'bipm'">
2073
+ <xsl:choose>
2074
+ <xsl:when test="ancestor::*[local-name()='preface']">
2075
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2076
+ </xsl:when>
2077
+ <xsl:otherwise>
2078
+ <fo:block/>
2079
+ </xsl:otherwise>
2080
+ </xsl:choose>
2081
+ </xsl:if> -->
2082
+
2083
+
1854
2084
  <!-- horizontal row separator -->
1855
2085
 
1856
2086
 
@@ -1864,6 +2094,88 @@
1864
2094
  </fo:table-footer>
1865
2095
 
1866
2096
  </xsl:if>
2097
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2098
+ <xsl:param name="table_attributes"/>
2099
+ <xsl:param name="colwidths"/>
2100
+
2101
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2102
+
2103
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2104
+
2105
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2106
+
2107
+ <fo:table keep-with-previous="always">
2108
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2109
+ <xsl:choose>
2110
+ <xsl:when test="@name = 'border-top'">
2111
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2112
+ </xsl:when>
2113
+ <xsl:when test="@name = 'border'">
2114
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2115
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2116
+ </xsl:when>
2117
+ <xsl:otherwise>
2118
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2119
+ </xsl:otherwise>
2120
+ </xsl:choose>
2121
+ </xsl:for-each>
2122
+
2123
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2124
+ <xsl:choose>
2125
+ <xsl:when test=". = 1 or . = 0">
2126
+ <fo:table-column column-width="proportional-column-width(2)"/>
2127
+ </xsl:when>
2128
+ <xsl:otherwise>
2129
+ <fo:table-column column-width="proportional-column-width({.})"/>
2130
+ </xsl:otherwise>
2131
+ </xsl:choose>
2132
+ </xsl:for-each>
2133
+
2134
+ <fo:table-body>
2135
+ <fo:table-row>
2136
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2137
+
2138
+
2139
+
2140
+ <!-- fn will be processed inside 'note' processing -->
2141
+
2142
+
2143
+
2144
+
2145
+
2146
+
2147
+
2148
+ <!-- except gb -->
2149
+
2150
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2151
+
2152
+
2153
+ <!-- <xsl:if test="$namespace = 'bipm'">
2154
+ <xsl:choose>
2155
+ <xsl:when test="ancestor::*[local-name()='preface']">
2156
+ show Note under table in preface (ex. abstract) sections
2157
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2158
+ </xsl:when>
2159
+ <xsl:otherwise>
2160
+ empty, because notes show at page side in main sections
2161
+ <fo:block/>
2162
+ </xsl:otherwise>
2163
+ </xsl:choose>
2164
+ </xsl:if> -->
2165
+
2166
+
2167
+ <!-- horizontal row separator -->
2168
+
2169
+
2170
+ <!-- fn processing -->
2171
+ <xsl:call-template name="fn_display"/>
2172
+
2173
+ </fo:table-cell>
2174
+ </fo:table-row>
2175
+ </fo:table-body>
2176
+
2177
+ </fo:table>
2178
+ </xsl:if>
1867
2179
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1868
2180
 
1869
2181
  <xsl:variable name="cols-count">
@@ -1920,8 +2232,12 @@
1920
2232
  <xsl:if test="not(*[local-name()='th'])">
1921
2233
  <xsl:attribute name="min-height">8mm</xsl:attribute>
1922
2234
  </xsl:if>
1923
-
1924
-
2235
+
2236
+
2237
+
2238
+ <!-- <xsl:if test="$namespace = 'bipm'">
2239
+ <xsl:attribute name="height">8mm</xsl:attribute>
2240
+ </xsl:if> -->
1925
2241
 
1926
2242
  <xsl:apply-templates/>
1927
2243
  </fo:table-row>
@@ -1955,6 +2271,7 @@
1955
2271
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1956
2272
 
1957
2273
 
2274
+
1958
2275
  <xsl:if test="@colspan">
1959
2276
  <xsl:attribute name="number-columns-spanned">
1960
2277
  <xsl:value-of select="@colspan"/>
@@ -1994,7 +2311,7 @@
1994
2311
 
1995
2312
 
1996
2313
 
1997
-
2314
+
1998
2315
 
1999
2316
 
2000
2317
 
@@ -2009,6 +2326,7 @@
2009
2326
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
2010
2327
 
2011
2328
 
2329
+
2012
2330
  <xsl:if test="@colspan">
2013
2331
  <xsl:attribute name="number-columns-spanned">
2014
2332
  <xsl:value-of select="@colspan"/>
@@ -2020,7 +2338,8 @@
2020
2338
  </xsl:attribute>
2021
2339
  </xsl:if>
2022
2340
  <xsl:call-template name="display-align"/>
2023
- <fo:block>
2341
+ <fo:block>
2342
+
2024
2343
  <xsl:apply-templates/>
2025
2344
  </fo:block>
2026
2345
  </fo:table-cell>
@@ -2032,6 +2351,8 @@
2032
2351
 
2033
2352
 
2034
2353
 
2354
+
2355
+
2035
2356
  <fo:inline padding-right="2mm">
2036
2357
 
2037
2358
 
@@ -2046,10 +2367,11 @@
2046
2367
  </fo:inline> -->
2047
2368
  </xsl:if>
2048
2369
 
2049
-
2370
+
2050
2371
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2051
2372
 
2052
2373
  </fo:inline>
2374
+
2053
2375
  <xsl:apply-templates mode="process"/>
2054
2376
  </fo:block>
2055
2377
 
@@ -2073,6 +2395,7 @@
2073
2395
 
2074
2396
 
2075
2397
 
2398
+
2076
2399
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2077
2400
 
2078
2401
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -2082,12 +2405,15 @@
2082
2405
 
2083
2406
 
2084
2407
 
2408
+
2085
2409
  <xsl:value-of select="@reference"/>
2086
2410
 
2411
+
2087
2412
  </fo:inline>
2088
2413
  <fo:inline>
2089
2414
 
2090
- <xsl:apply-templates/>
2415
+ <!-- <xsl:apply-templates /> -->
2416
+ <xsl:copy-of select="./node()"/>
2091
2417
  </fo:inline>
2092
2418
  </fo:block>
2093
2419
  </xsl:if>
@@ -2124,7 +2450,20 @@
2124
2450
  <xsl:variable name="following_dl_colwidths">
2125
2451
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2126
2452
  <xsl:variable name="html-table">
2127
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2453
+ <xsl:variable name="doc_ns">
2454
+
2455
+ </xsl:variable>
2456
+ <xsl:variable name="ns">
2457
+ <xsl:choose>
2458
+ <xsl:when test="normalize-space($doc_ns) != ''">
2459
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2460
+ </xsl:when>
2461
+ <xsl:otherwise>
2462
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2463
+ </xsl:otherwise>
2464
+ </xsl:choose>
2465
+ </xsl:variable>
2466
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2128
2467
  <xsl:element name="{$ns}:table">
2129
2468
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2130
2469
  <tbody>
@@ -2189,7 +2528,8 @@
2189
2528
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2190
2529
  </xsl:if>
2191
2530
 
2192
- <xsl:apply-templates/>
2531
+ <!-- <xsl:apply-templates /> -->
2532
+ <xsl:copy-of select="./node()"/>
2193
2533
  </fo:block>
2194
2534
  </fo:table-cell>
2195
2535
  </fo:table-row>
@@ -2208,9 +2548,12 @@
2208
2548
 
2209
2549
 
2210
2550
 
2551
+
2211
2552
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2212
2553
 
2554
+
2213
2555
  <xsl:value-of select="@reference"/>
2556
+
2214
2557
  </fo:basic-link>
2215
2558
  </fo:inline>
2216
2559
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2218,7 +2561,11 @@
2218
2561
  <xsl:apply-templates/>
2219
2562
  </fo:inline>
2220
2563
  </xsl:template><xsl:template match="*[local-name()='dl']">
2221
- <fo:block-container margin-left="0mm">
2564
+ <fo:block-container>
2565
+
2566
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2567
+
2568
+
2222
2569
  <xsl:if test="parent::*[local-name() = 'note']">
2223
2570
  <xsl:attribute name="margin-left">
2224
2571
  <xsl:choose>
@@ -2228,8 +2575,11 @@
2228
2575
  </xsl:attribute>
2229
2576
 
2230
2577
  </xsl:if>
2231
- <fo:block-container margin-left="0mm">
2232
-
2578
+ <fo:block-container>
2579
+
2580
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2581
+
2582
+
2233
2583
  <xsl:variable name="parent" select="local-name(..)"/>
2234
2584
 
2235
2585
  <xsl:variable name="key_iso">
@@ -2243,9 +2593,12 @@
2243
2593
  <fo:block margin-bottom="12pt" text-align="left">
2244
2594
 
2245
2595
  <xsl:variable name="title-where">
2246
- <xsl:call-template name="getTitle">
2247
- <xsl:with-param name="name" select="'title-where'"/>
2248
- </xsl:call-template>
2596
+
2597
+
2598
+ <xsl:call-template name="getTitle">
2599
+ <xsl:with-param name="name" select="'title-where'"/>
2600
+ </xsl:call-template>
2601
+
2249
2602
  </xsl:variable>
2250
2603
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2251
2604
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2261,9 +2614,12 @@
2261
2614
 
2262
2615
 
2263
2616
  <xsl:variable name="title-where">
2264
- <xsl:call-template name="getTitle">
2265
- <xsl:with-param name="name" select="'title-where'"/>
2266
- </xsl:call-template>
2617
+
2618
+
2619
+ <xsl:call-template name="getTitle">
2620
+ <xsl:with-param name="name" select="'title-where'"/>
2621
+ </xsl:call-template>
2622
+
2267
2623
  </xsl:variable>
2268
2624
  <xsl:value-of select="$title-where"/>
2269
2625
  </fo:block>
@@ -2274,9 +2630,12 @@
2274
2630
 
2275
2631
 
2276
2632
  <xsl:variable name="title-key">
2277
- <xsl:call-template name="getTitle">
2278
- <xsl:with-param name="name" select="'title-key'"/>
2279
- </xsl:call-template>
2633
+
2634
+
2635
+ <xsl:call-template name="getTitle">
2636
+ <xsl:with-param name="name" select="'title-key'"/>
2637
+ </xsl:call-template>
2638
+
2280
2639
  </xsl:variable>
2281
2640
  <xsl:value-of select="$title-key"/>
2282
2641
  </fo:block>
@@ -2308,7 +2667,20 @@
2308
2667
  </xsl:choose>
2309
2668
  <!-- create virtual html table for dl/[dt and dd] -->
2310
2669
  <xsl:variable name="html-table">
2311
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2670
+ <xsl:variable name="doc_ns">
2671
+
2672
+ </xsl:variable>
2673
+ <xsl:variable name="ns">
2674
+ <xsl:choose>
2675
+ <xsl:when test="normalize-space($doc_ns) != ''">
2676
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2677
+ </xsl:when>
2678
+ <xsl:otherwise>
2679
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2680
+ </xsl:otherwise>
2681
+ </xsl:choose>
2682
+ </xsl:variable>
2683
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2312
2684
  <xsl:element name="{$ns}:table">
2313
2685
  <tbody>
2314
2686
  <xsl:apply-templates mode="dl"/>
@@ -2452,6 +2824,7 @@
2452
2824
 
2453
2825
 
2454
2826
 
2827
+
2455
2828
  <xsl:apply-templates/>
2456
2829
  <!-- <xsl:if test="$namespace = 'gb'">
2457
2830
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2505,6 +2878,7 @@
2505
2878
  </fo:inline>
2506
2879
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2507
2880
  <fo:inline font-weight="bold">
2881
+
2508
2882
  <xsl:apply-templates/>
2509
2883
  </fo:inline>
2510
2884
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2518,18 +2892,18 @@
2518
2892
  </xsl:template><xsl:template match="*[local-name()='tt']">
2519
2893
  <fo:inline xsl:use-attribute-sets="tt-style">
2520
2894
  <xsl:variable name="_font-size">
2521
-
2522
-
2523
-
2524
2895
 
2525
2896
 
2526
2897
 
2527
2898
 
2528
2899
 
2529
2900
 
2530
-
2531
2901
 
2532
-
2902
+
2903
+
2904
+
2905
+
2906
+
2533
2907
 
2534
2908
 
2535
2909
  </xsl:variable>
@@ -2833,7 +3207,18 @@
2833
3207
  <xsl:with-param name="previousRow" select="$newRow"/>
2834
3208
  </xsl:apply-templates>
2835
3209
  </xsl:template><xsl:template name="getLang">
2836
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3210
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3211
+ <xsl:variable name="language">
3212
+ <xsl:choose>
3213
+ <xsl:when test="$language_current != ''">
3214
+ <xsl:value-of select="$language_current"/>
3215
+ </xsl:when>
3216
+ <xsl:otherwise>
3217
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3218
+ </xsl:otherwise>
3219
+ </xsl:choose>
3220
+ </xsl:variable>
3221
+
2837
3222
  <xsl:choose>
2838
3223
  <xsl:when test="$language = 'English'">en</xsl:when>
2839
3224
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2867,7 +3252,8 @@
2867
3252
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2868
3253
  <xsl:value-of select="substring($str, 2)"/>
2869
3254
  </xsl:template><xsl:template match="mathml:math">
2870
- <fo:inline font-family="STIX2Math">
3255
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3256
+
2871
3257
  <xsl:variable name="mathml">
2872
3258
  <xsl:apply-templates select="." mode="mathml"/>
2873
3259
  </xsl:variable>
@@ -2897,6 +3283,7 @@
2897
3283
  </xsl:choose>
2898
3284
  </xsl:variable>
2899
3285
  <fo:inline xsl:use-attribute-sets="link-style">
3286
+
2900
3287
  <xsl:choose>
2901
3288
  <xsl:when test="$target = ''">
2902
3289
  <xsl:apply-templates/>
@@ -2950,10 +3337,14 @@
2950
3337
  </fo:inline>
2951
3338
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2952
3339
  <xsl:variable name="title-modified">
2953
- <xsl:call-template name="getTitle">
2954
- <xsl:with-param name="name" select="'title-modified'"/>
2955
- </xsl:call-template>
3340
+
3341
+
3342
+ <xsl:call-template name="getTitle">
3343
+ <xsl:with-param name="name" select="'title-modified'"/>
3344
+ </xsl:call-template>
3345
+
2956
3346
  </xsl:variable>
3347
+
2957
3348
  <xsl:choose>
2958
3349
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2959
3350
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2961,7 +3352,7 @@
2961
3352
  <xsl:apply-templates/>
2962
3353
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2963
3354
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2964
-
3355
+
2965
3356
  <xsl:apply-templates/>
2966
3357
  </fo:basic-link>
2967
3358
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3023,6 +3414,8 @@
3023
3414
 
3024
3415
 
3025
3416
 
3417
+
3418
+
3026
3419
  <fo:inline xsl:use-attribute-sets="note-name-style">
3027
3420
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3028
3421
  </fo:inline>
@@ -3115,7 +3508,8 @@
3115
3508
  </fo:inline>
3116
3509
  </xsl:if>
3117
3510
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3118
- <fo:block-container id="{@id}">
3511
+ <fo:block-container id="{@id}">
3512
+
3119
3513
  <fo:block>
3120
3514
  <xsl:apply-templates/>
3121
3515
  </fo:block>
@@ -3150,15 +3544,109 @@
3150
3544
 
3151
3545
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3152
3546
  </fo:block>
3153
- </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">
3547
+ </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">
3154
3548
  <xsl:apply-templates mode="contents"/>
3155
3549
  <xsl:text> </xsl:text>
3156
- </xsl:template><xsl:template match="text()" mode="contents">
3550
+ </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">
3551
+ <xsl:apply-templates mode="bookmarks"/>
3552
+ <xsl:text> </xsl:text>
3553
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3554
+ <xsl:value-of select="."/>
3555
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3157
3556
  <xsl:value-of select="."/>
3158
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3557
+ </xsl:template><xsl:template match="node()" mode="contents">
3558
+ <xsl:apply-templates mode="contents"/>
3559
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3560
+ <xsl:apply-templates mode="bookmarks"/>
3561
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3562
+ <xsl:apply-templates select="."/>
3563
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3564
+ <xsl:apply-templates mode="bookmarks"/>
3565
+ </xsl:template><xsl:template name="addBookmarks">
3566
+ <xsl:param name="contents"/>
3567
+ <xsl:if test="xalan:nodeset($contents)//item">
3568
+ <fo:bookmark-tree>
3569
+ <xsl:choose>
3570
+ <xsl:when test="xalan:nodeset($contents)/doc">
3571
+ <xsl:choose>
3572
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3573
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3574
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3575
+ <fo:bookmark-title>
3576
+ <xsl:variable name="bookmark-title_">
3577
+ <xsl:call-template name="getLangVersion">
3578
+ <xsl:with-param name="lang" select="@lang"/>
3579
+ </xsl:call-template>
3580
+ </xsl:variable>
3581
+ <xsl:choose>
3582
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3583
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3584
+ </xsl:when>
3585
+ <xsl:otherwise>
3586
+ <xsl:choose>
3587
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3588
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3589
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3590
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3591
+ </xsl:choose>
3592
+ </xsl:otherwise>
3593
+ </xsl:choose>
3594
+ </fo:bookmark-title>
3595
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3596
+ </fo:bookmark>
3597
+
3598
+ </xsl:for-each>
3599
+ </xsl:when>
3600
+ <xsl:otherwise>
3601
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3602
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3603
+ </xsl:for-each>
3604
+ </xsl:otherwise>
3605
+ </xsl:choose>
3606
+ </xsl:when>
3607
+ <xsl:otherwise>
3608
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3609
+ </xsl:otherwise>
3610
+ </xsl:choose>
3611
+
3612
+
3613
+
3614
+
3615
+
3616
+
3617
+
3618
+
3619
+ </fo:bookmark-tree>
3620
+ </xsl:if>
3621
+ </xsl:template><xsl:template name="getLangVersion">
3622
+ <xsl:param name="lang"/>
3623
+ <xsl:choose>
3624
+ <xsl:when test="$lang = 'en'">
3625
+
3626
+
3627
+ </xsl:when>
3628
+ <xsl:when test="$lang = 'fr'">
3629
+
3630
+
3631
+ </xsl:when>
3632
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3633
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3634
+ </xsl:choose>
3635
+ </xsl:template><xsl:template match="item" mode="bookmark">
3636
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3637
+ <fo:bookmark-title>
3638
+ <xsl:if test="@section != ''">
3639
+ <xsl:value-of select="@section"/>
3640
+ <xsl:text> </xsl:text>
3641
+ </xsl:if>
3642
+ <xsl:value-of select="normalize-space(title)"/>
3643
+ </fo:bookmark-title>
3644
+ <xsl:apply-templates mode="bookmark"/>
3645
+ </fo:bookmark>
3646
+ </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">
3159
3647
  <xsl:if test="normalize-space() != ''">
3160
3648
  <fo:block xsl:use-attribute-sets="figure-name-style">
3161
-
3649
+
3162
3650
  <xsl:apply-templates/>
3163
3651
  </fo:block>
3164
3652
  </xsl:if>
@@ -3213,7 +3701,7 @@
3213
3701
  <xsl:apply-templates/>
3214
3702
  </xsl:otherwise>
3215
3703
  </xsl:choose>
3216
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3704
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3217
3705
  <xsl:text> </xsl:text>
3218
3706
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3219
3707
  <xsl:copy>
@@ -3745,9 +4233,12 @@
3745
4233
  </fo:block>
3746
4234
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3747
4235
  <xsl:variable name="title-deprecated">
3748
- <xsl:call-template name="getTitle">
3749
- <xsl:with-param name="name" select="'title-deprecated'"/>
3750
- </xsl:call-template>
4236
+
4237
+
4238
+ <xsl:call-template name="getTitle">
4239
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4240
+ </xsl:call-template>
4241
+
3751
4242
  </xsl:variable>
3752
4243
  <fo:block xsl:use-attribute-sets="deprecates-style">
3753
4244
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3794,13 +4285,14 @@
3794
4285
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3795
4286
  <fo:block>
3796
4287
  <xsl:call-template name="setId"/>
4288
+
3797
4289
  <xsl:apply-templates/>
3798
4290
  </fo:block>
3799
4291
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3800
4292
  <fo:block id="{@id}">
3801
4293
  <xsl:apply-templates/>
3802
4294
  </fo:block>
3803
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4295
+ </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']">
3804
4296
 
3805
4297
  <fo:block id="{@id}">
3806
4298
  <xsl:apply-templates/>
@@ -3824,20 +4316,30 @@
3824
4316
  <!-- 0xA0 to space replacement -->
3825
4317
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3826
4318
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3827
- <fo:block-container margin-left="0mm">
3828
- <xsl:if test="parent::*[local-name() = 'note']">
3829
- <xsl:attribute name="margin-left">
3830
- <xsl:choose>
3831
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3832
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3833
- </xsl:choose>
3834
- </xsl:attribute>
3835
-
3836
- </xsl:if>
3837
- <fo:block-container margin-left="0mm">
3838
- <xsl:apply-templates select="." mode="ul_ol"/>
3839
- </fo:block-container>
3840
- </fo:block-container>
4319
+ <xsl:choose>
4320
+ <xsl:when test="parent::*[local-name() = 'note']">
4321
+ <fo:block-container>
4322
+ <xsl:attribute name="margin-left">
4323
+ <xsl:choose>
4324
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4325
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4326
+ </xsl:choose>
4327
+ </xsl:attribute>
4328
+
4329
+
4330
+ <fo:block-container margin-left="0mm">
4331
+ <fo:block>
4332
+ <xsl:apply-templates select="." mode="ul_ol"/>
4333
+ </fo:block>
4334
+ </fo:block-container>
4335
+ </fo:block-container>
4336
+ </xsl:when>
4337
+ <xsl:otherwise>
4338
+ <fo:block>
4339
+ <xsl:apply-templates select="." mode="ul_ol"/>
4340
+ </fo:block>
4341
+ </xsl:otherwise>
4342
+ </xsl:choose>
3841
4343
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3842
4344
  <!-- <row>
3843
4345
  <date>05-07-2013</date>
@@ -4010,6 +4512,7 @@
4010
4512
 
4011
4513
 
4012
4514
 
4515
+
4013
4516
 
4014
4517
  </xsl:variable>
4015
4518
  <xsl:choose>
@@ -4024,6 +4527,7 @@
4024
4527
  <dc:creator>
4025
4528
 
4026
4529
 
4530
+
4027
4531
  </dc:creator>
4028
4532
  <dc:description>
4029
4533
  <xsl:variable name="abstract">
@@ -4033,6 +4537,7 @@
4033
4537
  <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4034
4538
 
4035
4539
 
4540
+
4036
4541
  </xsl:variable>
4037
4542
  <xsl:value-of select="normalize-space($abstract)"/>
4038
4543
  </dc:description>
@@ -4104,13 +4609,22 @@
4104
4609
  </xsl:template><xsl:template name="split">
4105
4610
  <xsl:param name="pText" select="."/>
4106
4611
  <xsl:param name="sep" select="','"/>
4612
+ <xsl:param name="normalize-space" select="'true'"/>
4107
4613
  <xsl:if test="string-length($pText) &gt;0">
4108
4614
  <item>
4109
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4615
+ <xsl:choose>
4616
+ <xsl:when test="$normalize-space = 'true'">
4617
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4618
+ </xsl:when>
4619
+ <xsl:otherwise>
4620
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4621
+ </xsl:otherwise>
4622
+ </xsl:choose>
4110
4623
  </item>
4111
4624
  <xsl:call-template name="split">
4112
4625
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4113
4626
  <xsl:with-param name="sep" select="$sep"/>
4627
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4114
4628
  </xsl:call-template>
4115
4629
  </xsl:if>
4116
4630
  </xsl:template><xsl:template name="getDocumentId">
@@ -4133,6 +4647,7 @@
4133
4647
 
4134
4648
 
4135
4649
 
4650
+
4136
4651
  </xsl:variable>
4137
4652
  <xsl:if test="$documentNS != $XSLNS">
4138
4653
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4158,4 +4673,40 @@
4158
4673
  </xsl:otherwise>
4159
4674
  </xsl:choose>
4160
4675
  </xsl:attribute>
4676
+ </xsl:template><xsl:template name="add-letter-spacing">
4677
+ <xsl:param name="text"/>
4678
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4679
+ <xsl:if test="string-length($text) &gt; 0">
4680
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4681
+ <fo:inline padding-right="{$letter-spacing}mm">
4682
+ <xsl:if test="$char = '®'">
4683
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4684
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4685
+ </xsl:if>
4686
+ <xsl:value-of select="$char"/>
4687
+ </fo:inline>
4688
+ <xsl:call-template name="add-letter-spacing">
4689
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4690
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4691
+ </xsl:call-template>
4692
+ </xsl:if>
4693
+ </xsl:template><xsl:template name="repeat">
4694
+ <xsl:param name="char" select="'*'"/>
4695
+ <xsl:param name="count"/>
4696
+ <xsl:if test="$count &gt; 0">
4697
+ <xsl:value-of select="$char"/>
4698
+ <xsl:call-template name="repeat">
4699
+ <xsl:with-param name="char" select="$char"/>
4700
+ <xsl:with-param name="count" select="$count - 1"/>
4701
+ </xsl:call-template>
4702
+ </xsl:if>
4703
+ </xsl:template><xsl:template name="getLocalizedString">
4704
+ <xsl:param name="key"/>
4705
+
4706
+ <xsl:variable name="curr_lang">
4707
+ <xsl:call-template name="getLang"/>
4708
+ </xsl:variable>
4709
+
4710
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4711
+
4161
4712
  </xsl:template></xsl:stylesheet>