metanorma-iho 0.2.3 → 0.2.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.
@@ -111,6 +111,10 @@
111
111
 
112
112
  <xsl:call-template name="addPDFUAmeta"/>
113
113
 
114
+ <xsl:call-template name="addBookmarks">
115
+ <xsl:with-param name="contents" select="$contents"/>
116
+ </xsl:call-template>
117
+
114
118
  <!-- =========================== -->
115
119
  <!-- Cover Page -->
116
120
  <fo:page-sequence master-reference="cover">
@@ -217,7 +221,7 @@
217
221
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
218
222
  </xsl:if>
219
223
 
220
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
224
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
221
225
  <fo:block>
222
226
  <xsl:if test="@level = 1">
223
227
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -243,8 +247,8 @@
243
247
  </fo:list-item-label>
244
248
  <fo:list-item-body start-indent="body-start()">
245
249
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
247
- <xsl:apply-templates/>
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
251
+ <xsl:apply-templates select="title"/>
248
252
  <fo:inline keep-together.within-line="always">
249
253
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
250
254
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -361,15 +365,21 @@
361
365
  </xsl:variable>
362
366
 
363
367
  <xsl:variable name="display">
364
- <xsl:choose>
365
- <xsl:when test="ancestor-or-self::iho:bibitem">false</xsl:when>
366
- <xsl:when test="ancestor-or-self::iho:term">false</xsl:when>
368
+ <xsl:choose>
367
369
  <xsl:when test="$level &lt;= 2">true</xsl:when>
368
370
  <xsl:otherwise>false</xsl:otherwise>
369
371
  </xsl:choose>
370
372
  </xsl:variable>
371
373
 
372
- <xsl:if test="$display = 'true'">
374
+ <xsl:variable name="skip">
375
+ <xsl:choose>
376
+ <xsl:when test="ancestor-or-self::iho:bibitem">true</xsl:when>
377
+ <xsl:when test="ancestor-or-self::iho:term">true</xsl:when>
378
+ <xsl:otherwise>false</xsl:otherwise>
379
+ </xsl:choose>
380
+ </xsl:variable>
381
+
382
+ <xsl:if test="$skip = 'false'">
373
383
 
374
384
  <xsl:variable name="section">
375
385
  <xsl:call-template name="getSection"/>
@@ -388,10 +398,13 @@
388
398
  <xsl:if test="ancestor-or-self::iho:annex">annex</xsl:if>
389
399
  </xsl:variable>
390
400
 
391
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
392
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
401
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
402
+ <title>
403
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
404
+ </title>
405
+ <xsl:apply-templates mode="contents"/>
393
406
  </item>
394
- <xsl:apply-templates mode="contents"/>
407
+
395
408
  </xsl:if>
396
409
 
397
410
  </xsl:template>
@@ -954,6 +967,12 @@
954
967
 
955
968
  </title-edition>
956
969
 
970
+ <title-edition lang="fr">
971
+
972
+ <xsl:text>Édition </xsl:text>
973
+
974
+ </title-edition>
975
+
957
976
 
958
977
  <title-toc lang="en">
959
978
 
@@ -962,7 +981,12 @@
962
981
 
963
982
 
964
983
  </title-toc>
965
- <title-toc lang="fr">Sommaire</title-toc>
984
+ <title-toc lang="fr">
985
+
986
+ <xsl:text>Sommaire</xsl:text>
987
+
988
+
989
+ </title-toc>
966
990
 
967
991
  <title-toc lang="zh">Contents</title-toc>
968
992
 
@@ -982,13 +1006,22 @@
982
1006
  <title-part lang="en">
983
1007
 
984
1008
 
1009
+
985
1010
  </title-part>
986
1011
  <title-part lang="fr">
987
1012
 
988
1013
 
1014
+
989
1015
  </title-part>
990
1016
  <title-part lang="zh">第 # 部分:</title-part>
991
1017
 
1018
+ <title-subpart lang="en">
1019
+
1020
+ </title-subpart>
1021
+ <title-subpart lang="fr">
1022
+
1023
+ </title-subpart>
1024
+
992
1025
  <title-modified lang="en">modified</title-modified>
993
1026
  <title-modified lang="fr">modifiée</title-modified>
994
1027
 
@@ -1050,10 +1083,19 @@
1050
1083
 
1051
1084
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1052
1085
  <xsl:param name="name"/>
1053
- <xsl:variable name="lang">
1054
- <xsl:call-template name="getLang"/>
1086
+ <xsl:param name="lang"/>
1087
+ <xsl:variable name="lang_">
1088
+ <xsl:choose>
1089
+ <xsl:when test="$lang != ''">
1090
+ <xsl:value-of select="$lang"/>
1091
+ </xsl:when>
1092
+ <xsl:otherwise>
1093
+ <xsl:call-template name="getLang"/>
1094
+ </xsl:otherwise>
1095
+ </xsl:choose>
1055
1096
  </xsl:variable>
1056
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1097
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1098
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1057
1099
  <xsl:choose>
1058
1100
  <xsl:when test="normalize-space($title_) != ''">
1059
1101
  <xsl:value-of select="$title_"/>
@@ -1062,7 +1104,9 @@
1062
1104
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1063
1105
  </xsl:otherwise>
1064
1106
  </xsl:choose>
1065
- </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">
1107
+ </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">
1108
+
1109
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1066
1110
 
1067
1111
  <xsl:attribute name="color">blue</xsl:attribute>
1068
1112
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1081,7 +1125,7 @@
1081
1125
 
1082
1126
 
1083
1127
 
1084
- <xsl:attribute name="font-family">SFMono-Regular</xsl:attribute>
1128
+ <xsl:attribute name="font-family">SF Mono</xsl:attribute>
1085
1129
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1086
1130
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1087
1131
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1205,6 +1249,7 @@
1205
1249
 
1206
1250
 
1207
1251
 
1252
+
1208
1253
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1209
1254
 
1210
1255
 
@@ -1244,6 +1289,7 @@
1244
1289
 
1245
1290
 
1246
1291
 
1292
+
1247
1293
  </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">
1248
1294
 
1249
1295
 
@@ -1326,6 +1372,7 @@
1326
1372
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
1327
1373
 
1328
1374
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1375
+
1329
1376
 
1330
1377
 
1331
1378
 
@@ -1449,6 +1496,10 @@
1449
1496
 
1450
1497
 
1451
1498
 
1499
+ <!-- <xsl:if test="$namespace = 'bipm'">
1500
+ <fo:block>&#xA0;</fo:block>
1501
+ </xsl:if> -->
1502
+
1452
1503
  <!-- $namespace = 'iso' or -->
1453
1504
 
1454
1505
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1486,6 +1537,7 @@
1486
1537
  <xsl:with-param name="table" select="$simple-table"/>
1487
1538
  </xsl:call-template>
1488
1539
  </xsl:variable>
1540
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1489
1541
 
1490
1542
  <!-- <xsl:variable name="colwidths2">
1491
1543
  <xsl:call-template name="calculate-column-widths">
@@ -1507,10 +1559,13 @@
1507
1559
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1508
1560
 
1509
1561
 
1562
+
1563
+
1564
+
1510
1565
 
1511
1566
 
1567
+
1512
1568
 
1513
-
1514
1569
 
1515
1570
 
1516
1571
  <xsl:attribute name="space-after">18pt</xsl:attribute>
@@ -1518,23 +1573,42 @@
1518
1573
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
1519
1574
 
1520
1575
 
1521
- <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">
1522
-
1523
-
1524
-
1525
-
1526
-
1527
-
1576
+
1577
+
1578
+
1579
+ <xsl:variable name="table_attributes">
1580
+ <attribute name="table-layout">fixed</attribute>
1581
+ <attribute name="width">100%</attribute>
1582
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1583
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1528
1584
 
1529
1585
 
1530
1586
 
1531
1587
 
1588
+
1589
+
1590
+
1591
+
1592
+ <attribute name="margin-left">0mm</attribute>
1593
+ <attribute name="margin-right">0mm</attribute>
1532
1594
 
1533
1595
 
1534
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1535
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1536
1596
 
1597
+ </xsl:variable>
1598
+
1599
+
1600
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1537
1601
 
1602
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1603
+ <xsl:attribute name="{@name}">
1604
+ <xsl:value-of select="."/>
1605
+ </xsl:attribute>
1606
+ </xsl:for-each>
1607
+
1608
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1609
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1610
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1611
+ </xsl:if>
1538
1612
 
1539
1613
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1540
1614
  <xsl:choose>
@@ -1558,6 +1632,33 @@
1558
1632
 
1559
1633
  </fo:table>
1560
1634
 
1635
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1636
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1637
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1638
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1639
+ </xsl:call-template>
1640
+ </xsl:for-each>
1641
+
1642
+ <!-- insert footer as table -->
1643
+ <!-- <fo:table>
1644
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1645
+ <xsl:attribute name="{@name}">
1646
+ <xsl:value-of select="."/>
1647
+ </xsl:attribute>
1648
+ </xsl:for-each>
1649
+
1650
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1651
+ <xsl:choose>
1652
+ <xsl:when test=". = 1 or . = 0">
1653
+ <fo:table-column column-width="proportional-column-width(2)"/>
1654
+ </xsl:when>
1655
+ <xsl:otherwise>
1656
+ <fo:table-column column-width="proportional-column-width({.})"/>
1657
+ </xsl:otherwise>
1658
+ </xsl:choose>
1659
+ </xsl:for-each>
1660
+ </fo:table>-->
1661
+
1561
1662
 
1562
1663
 
1563
1664
 
@@ -1567,6 +1668,7 @@
1567
1668
  <xsl:if test="normalize-space() != ''">
1568
1669
  <fo:block xsl:use-attribute-sets="table-name-style">
1569
1670
 
1671
+
1570
1672
  <xsl:apply-templates/>
1571
1673
  </fo:block>
1572
1674
  </xsl:if>
@@ -1622,6 +1724,13 @@
1622
1724
  <xsl:for-each select="xalan:nodeset($table)//tr">
1623
1725
  <xsl:variable name="td_text">
1624
1726
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1727
+
1728
+ <!-- <xsl:if test="$namespace = 'bipm'">
1729
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1730
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1731
+ </xsl:for-each>
1732
+ </xsl:if> -->
1733
+
1625
1734
  </xsl:variable>
1626
1735
  <xsl:variable name="words">
1627
1736
  <xsl:variable name="string_with_added_zerospaces">
@@ -1681,11 +1790,14 @@
1681
1790
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1682
1791
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1683
1792
  <xsl:value-of select="@target"/>
1793
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1794
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1795
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1684
1796
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1685
1797
  <xsl:param name="cols-count"/>
1686
1798
  <!-- font-weight="bold" -->
1687
1799
  <fo:table-header>
1688
-
1800
+
1689
1801
  <xsl:apply-templates/>
1690
1802
  </fo:table-header>
1691
1803
  </xsl:template><xsl:template name="table-header-title">
@@ -1710,6 +1822,13 @@
1710
1822
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1711
1823
  <xsl:apply-templates/>
1712
1824
  </xsl:template><xsl:template name="insertTableFooter">
1825
+ <xsl:param name="cols-count"/>
1826
+ <xsl:if test="../*[local-name()='tfoot']">
1827
+ <fo:table-footer>
1828
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1829
+ </fo:table-footer>
1830
+ </xsl:if>
1831
+ </xsl:template><xsl:template name="insertTableFooter2">
1713
1832
  <xsl:param name="cols-count"/>
1714
1833
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1715
1834
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1731,11 +1850,29 @@
1731
1850
  <!-- fn will be processed inside 'note' processing -->
1732
1851
 
1733
1852
 
1853
+
1854
+
1855
+
1856
+
1734
1857
  <!-- except gb -->
1735
1858
 
1736
1859
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1737
1860
 
1738
1861
 
1862
+ <!-- show Note under table in preface (ex. abstract) sections -->
1863
+ <!-- empty, because notes show at page side in main sections -->
1864
+ <!-- <xsl:if test="$namespace = 'bipm'">
1865
+ <xsl:choose>
1866
+ <xsl:when test="ancestor::*[local-name()='preface']">
1867
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1868
+ </xsl:when>
1869
+ <xsl:otherwise>
1870
+ <fo:block/>
1871
+ </xsl:otherwise>
1872
+ </xsl:choose>
1873
+ </xsl:if> -->
1874
+
1875
+
1739
1876
  <!-- horizontal row separator -->
1740
1877
 
1741
1878
 
@@ -1749,6 +1886,88 @@
1749
1886
  </fo:table-footer>
1750
1887
 
1751
1888
  </xsl:if>
1889
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1890
+ <xsl:param name="table_attributes"/>
1891
+ <xsl:param name="colwidths"/>
1892
+
1893
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1894
+
1895
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1896
+
1897
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1898
+
1899
+ <fo:table keep-with-previous="always">
1900
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1901
+ <xsl:choose>
1902
+ <xsl:when test="@name = 'border-top'">
1903
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1904
+ </xsl:when>
1905
+ <xsl:when test="@name = 'border'">
1906
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1907
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1908
+ </xsl:when>
1909
+ <xsl:otherwise>
1910
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1911
+ </xsl:otherwise>
1912
+ </xsl:choose>
1913
+ </xsl:for-each>
1914
+
1915
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1916
+ <xsl:choose>
1917
+ <xsl:when test=". = 1 or . = 0">
1918
+ <fo:table-column column-width="proportional-column-width(2)"/>
1919
+ </xsl:when>
1920
+ <xsl:otherwise>
1921
+ <fo:table-column column-width="proportional-column-width({.})"/>
1922
+ </xsl:otherwise>
1923
+ </xsl:choose>
1924
+ </xsl:for-each>
1925
+
1926
+ <fo:table-body>
1927
+ <fo:table-row>
1928
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1929
+
1930
+
1931
+
1932
+ <!-- fn will be processed inside 'note' processing -->
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+
1940
+ <!-- except gb -->
1941
+
1942
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1943
+
1944
+
1945
+ <!-- <xsl:if test="$namespace = 'bipm'">
1946
+ <xsl:choose>
1947
+ <xsl:when test="ancestor::*[local-name()='preface']">
1948
+ show Note under table in preface (ex. abstract) sections
1949
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1950
+ </xsl:when>
1951
+ <xsl:otherwise>
1952
+ empty, because notes show at page side in main sections
1953
+ <fo:block/>
1954
+ </xsl:otherwise>
1955
+ </xsl:choose>
1956
+ </xsl:if> -->
1957
+
1958
+
1959
+ <!-- horizontal row separator -->
1960
+
1961
+
1962
+ <!-- fn processing -->
1963
+ <xsl:call-template name="fn_display"/>
1964
+
1965
+ </fo:table-cell>
1966
+ </fo:table-row>
1967
+ </fo:table-body>
1968
+
1969
+ </fo:table>
1970
+ </xsl:if>
1752
1971
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1753
1972
 
1754
1973
  <xsl:variable name="cols-count">
@@ -1801,8 +2020,12 @@
1801
2020
 
1802
2021
  </xsl:if>
1803
2022
 
1804
-
1805
-
2023
+
2024
+
2025
+
2026
+ <!-- <xsl:if test="$namespace = 'bipm'">
2027
+ <xsl:attribute name="height">8mm</xsl:attribute>
2028
+ </xsl:if> -->
1806
2029
 
1807
2030
  <xsl:apply-templates/>
1808
2031
  </fo:table-row>
@@ -1826,6 +2049,7 @@
1826
2049
 
1827
2050
 
1828
2051
 
2052
+
1829
2053
  <xsl:if test="@colspan">
1830
2054
  <xsl:attribute name="number-columns-spanned">
1831
2055
  <xsl:value-of select="@colspan"/>
@@ -1867,7 +2091,8 @@
1867
2091
 
1868
2092
 
1869
2093
 
1870
-
2094
+
2095
+
1871
2096
 
1872
2097
 
1873
2098
 
@@ -1885,7 +2110,8 @@
1885
2110
  </xsl:attribute>
1886
2111
  </xsl:if>
1887
2112
  <xsl:call-template name="display-align"/>
1888
- <fo:block>
2113
+ <fo:block>
2114
+
1889
2115
  <xsl:apply-templates/>
1890
2116
  </fo:block>
1891
2117
  </fo:table-cell>
@@ -1899,6 +2125,8 @@
1899
2125
 
1900
2126
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1901
2127
 
2128
+
2129
+
1902
2130
  <fo:inline padding-right="2mm">
1903
2131
 
1904
2132
 
@@ -1906,10 +2134,11 @@
1906
2134
  <xsl:attribute name="padding-right">3mm</xsl:attribute>
1907
2135
 
1908
2136
 
1909
-
2137
+
1910
2138
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1911
2139
 
1912
2140
  </fo:inline>
2141
+
1913
2142
  <xsl:apply-templates mode="process"/>
1914
2143
  </fo:block>
1915
2144
 
@@ -1933,6 +2162,7 @@
1933
2162
 
1934
2163
 
1935
2164
 
2165
+
1936
2166
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1937
2167
 
1938
2168
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1942,12 +2172,15 @@
1942
2172
 
1943
2173
 
1944
2174
 
2175
+
1945
2176
  <xsl:value-of select="@reference"/>
1946
2177
 
2178
+
1947
2179
  </fo:inline>
1948
2180
  <fo:inline>
1949
2181
 
1950
- <xsl:apply-templates/>
2182
+ <!-- <xsl:apply-templates /> -->
2183
+ <xsl:copy-of select="./node()"/>
1951
2184
  </fo:inline>
1952
2185
  </fo:block>
1953
2186
  </xsl:if>
@@ -1984,7 +2217,20 @@
1984
2217
  <xsl:variable name="following_dl_colwidths">
1985
2218
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1986
2219
  <xsl:variable name="html-table">
1987
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2220
+ <xsl:variable name="doc_ns">
2221
+
2222
+ </xsl:variable>
2223
+ <xsl:variable name="ns">
2224
+ <xsl:choose>
2225
+ <xsl:when test="normalize-space($doc_ns) != ''">
2226
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2227
+ </xsl:when>
2228
+ <xsl:otherwise>
2229
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2230
+ </xsl:otherwise>
2231
+ </xsl:choose>
2232
+ </xsl:variable>
2233
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1988
2234
  <xsl:element name="{$ns}:table">
1989
2235
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1990
2236
  <tbody>
@@ -2049,7 +2295,8 @@
2049
2295
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2050
2296
  </xsl:if>
2051
2297
 
2052
- <xsl:apply-templates/>
2298
+ <!-- <xsl:apply-templates /> -->
2299
+ <xsl:copy-of select="./node()"/>
2053
2300
  </fo:block>
2054
2301
  </fo:table-cell>
2055
2302
  </fo:table-row>
@@ -2068,9 +2315,12 @@
2068
2315
 
2069
2316
 
2070
2317
 
2318
+
2071
2319
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2072
2320
 
2321
+
2073
2322
  <xsl:value-of select="@reference"/>
2323
+
2074
2324
  </fo:basic-link>
2075
2325
  </fo:inline>
2076
2326
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2078,7 +2328,11 @@
2078
2328
  <xsl:apply-templates/>
2079
2329
  </fo:inline>
2080
2330
  </xsl:template><xsl:template match="*[local-name()='dl']">
2081
- <fo:block-container margin-left="0mm">
2331
+ <fo:block-container>
2332
+
2333
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2334
+
2335
+
2082
2336
  <xsl:if test="parent::*[local-name() = 'note']">
2083
2337
  <xsl:attribute name="margin-left">
2084
2338
  <xsl:choose>
@@ -2088,8 +2342,11 @@
2088
2342
  </xsl:attribute>
2089
2343
 
2090
2344
  </xsl:if>
2091
- <fo:block-container margin-left="0mm">
2092
-
2345
+ <fo:block-container>
2346
+
2347
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2348
+
2349
+
2093
2350
  <xsl:variable name="parent" select="local-name(..)"/>
2094
2351
 
2095
2352
  <xsl:variable name="key_iso">
@@ -2103,9 +2360,12 @@
2103
2360
  <fo:block margin-bottom="12pt" text-align="left">
2104
2361
 
2105
2362
  <xsl:variable name="title-where">
2106
- <xsl:call-template name="getTitle">
2107
- <xsl:with-param name="name" select="'title-where'"/>
2108
- </xsl:call-template>
2363
+
2364
+
2365
+ <xsl:call-template name="getTitle">
2366
+ <xsl:with-param name="name" select="'title-where'"/>
2367
+ </xsl:call-template>
2368
+
2109
2369
  </xsl:variable>
2110
2370
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2111
2371
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2121,9 +2381,12 @@
2121
2381
 
2122
2382
 
2123
2383
  <xsl:variable name="title-where">
2124
- <xsl:call-template name="getTitle">
2125
- <xsl:with-param name="name" select="'title-where'"/>
2126
- </xsl:call-template>
2384
+
2385
+
2386
+ <xsl:call-template name="getTitle">
2387
+ <xsl:with-param name="name" select="'title-where'"/>
2388
+ </xsl:call-template>
2389
+
2127
2390
  </xsl:variable>
2128
2391
  <xsl:value-of select="$title-where"/>
2129
2392
  </fo:block>
@@ -2134,9 +2397,12 @@
2134
2397
 
2135
2398
 
2136
2399
  <xsl:variable name="title-key">
2137
- <xsl:call-template name="getTitle">
2138
- <xsl:with-param name="name" select="'title-key'"/>
2139
- </xsl:call-template>
2400
+
2401
+
2402
+ <xsl:call-template name="getTitle">
2403
+ <xsl:with-param name="name" select="'title-key'"/>
2404
+ </xsl:call-template>
2405
+
2140
2406
  </xsl:variable>
2141
2407
  <xsl:value-of select="$title-key"/>
2142
2408
  </fo:block>
@@ -2172,7 +2438,20 @@
2172
2438
  </xsl:choose>
2173
2439
  <!-- create virtual html table for dl/[dt and dd] -->
2174
2440
  <xsl:variable name="html-table">
2175
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2441
+ <xsl:variable name="doc_ns">
2442
+
2443
+ </xsl:variable>
2444
+ <xsl:variable name="ns">
2445
+ <xsl:choose>
2446
+ <xsl:when test="normalize-space($doc_ns) != ''">
2447
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2448
+ </xsl:when>
2449
+ <xsl:otherwise>
2450
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2451
+ </xsl:otherwise>
2452
+ </xsl:choose>
2453
+ </xsl:variable>
2454
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2176
2455
  <xsl:element name="{$ns}:table">
2177
2456
  <tbody>
2178
2457
  <xsl:apply-templates mode="dl"/>
@@ -2319,6 +2598,7 @@
2319
2598
 
2320
2599
 
2321
2600
 
2601
+
2322
2602
  <xsl:apply-templates/>
2323
2603
  <!-- <xsl:if test="$namespace = 'gb'">
2324
2604
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2372,6 +2652,7 @@
2372
2652
  </fo:inline>
2373
2653
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2374
2654
  <fo:inline font-weight="bold">
2655
+
2375
2656
  <xsl:apply-templates/>
2376
2657
  </fo:inline>
2377
2658
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2385,18 +2666,18 @@
2385
2666
  </xsl:template><xsl:template match="*[local-name()='tt']">
2386
2667
  <fo:inline xsl:use-attribute-sets="tt-style">
2387
2668
  <xsl:variable name="_font-size">
2388
-
2389
-
2390
-
2669
+
2670
+
2671
+
2391
2672
 
2392
2673
  10
2393
2674
 
2394
2675
 
2395
2676
 
2396
2677
 
2397
-
2398
2678
 
2399
-
2679
+
2680
+
2400
2681
 
2401
2682
 
2402
2683
  </xsl:variable>
@@ -2700,7 +2981,18 @@
2700
2981
  <xsl:with-param name="previousRow" select="$newRow"/>
2701
2982
  </xsl:apply-templates>
2702
2983
  </xsl:template><xsl:template name="getLang">
2703
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2984
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2985
+ <xsl:variable name="language">
2986
+ <xsl:choose>
2987
+ <xsl:when test="$language_current != ''">
2988
+ <xsl:value-of select="$language_current"/>
2989
+ </xsl:when>
2990
+ <xsl:otherwise>
2991
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2992
+ </xsl:otherwise>
2993
+ </xsl:choose>
2994
+ </xsl:variable>
2995
+
2704
2996
  <xsl:choose>
2705
2997
  <xsl:when test="$language = 'English'">en</xsl:when>
2706
2998
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2734,7 +3026,8 @@
2734
3026
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2735
3027
  <xsl:value-of select="substring($str, 2)"/>
2736
3028
  </xsl:template><xsl:template match="mathml:math">
2737
- <fo:inline font-family="STIX2Math">
3029
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3030
+
2738
3031
  <xsl:variable name="mathml">
2739
3032
  <xsl:apply-templates select="." mode="mathml"/>
2740
3033
  </xsl:variable>
@@ -2764,6 +3057,7 @@
2764
3057
  </xsl:choose>
2765
3058
  </xsl:variable>
2766
3059
  <fo:inline xsl:use-attribute-sets="link-style">
3060
+
2767
3061
  <xsl:choose>
2768
3062
  <xsl:when test="$target = ''">
2769
3063
  <xsl:apply-templates/>
@@ -2817,10 +3111,14 @@
2817
3111
  </fo:inline>
2818
3112
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2819
3113
  <xsl:variable name="title-modified">
2820
- <xsl:call-template name="getTitle">
2821
- <xsl:with-param name="name" select="'title-modified'"/>
2822
- </xsl:call-template>
3114
+
3115
+
3116
+ <xsl:call-template name="getTitle">
3117
+ <xsl:with-param name="name" select="'title-modified'"/>
3118
+ </xsl:call-template>
3119
+
2823
3120
  </xsl:variable>
3121
+
2824
3122
  <xsl:choose>
2825
3123
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2826
3124
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2828,7 +3126,7 @@
2828
3126
  <xsl:apply-templates/>
2829
3127
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2830
3128
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2831
-
3129
+
2832
3130
  <xsl:apply-templates/>
2833
3131
  </fo:basic-link>
2834
3132
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -2885,6 +3183,8 @@
2885
3183
 
2886
3184
 
2887
3185
 
3186
+
3187
+
2888
3188
  <fo:inline xsl:use-attribute-sets="note-name-style">
2889
3189
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2890
3190
  </fo:inline>
@@ -2973,7 +3273,8 @@
2973
3273
  </fo:inline>
2974
3274
  </xsl:if>
2975
3275
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
2976
- <fo:block-container id="{@id}">
3276
+ <fo:block-container id="{@id}">
3277
+
2977
3278
  <fo:block>
2978
3279
  <xsl:apply-templates/>
2979
3280
  </fo:block>
@@ -3008,15 +3309,109 @@
3008
3309
 
3009
3310
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3010
3311
  </fo:block>
3011
- </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">
3312
+ </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">
3012
3313
  <xsl:apply-templates mode="contents"/>
3013
3314
  <xsl:text> </xsl:text>
3014
- </xsl:template><xsl:template match="text()" mode="contents">
3315
+ </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">
3316
+ <xsl:apply-templates mode="bookmarks"/>
3317
+ <xsl:text> </xsl:text>
3318
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3319
+ <xsl:value-of select="."/>
3320
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3015
3321
  <xsl:value-of select="."/>
3016
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3322
+ </xsl:template><xsl:template match="node()" mode="contents">
3323
+ <xsl:apply-templates mode="contents"/>
3324
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3325
+ <xsl:apply-templates mode="bookmarks"/>
3326
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3327
+ <xsl:apply-templates select="."/>
3328
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3329
+ <xsl:apply-templates mode="bookmarks"/>
3330
+ </xsl:template><xsl:template name="addBookmarks">
3331
+ <xsl:param name="contents"/>
3332
+ <xsl:if test="xalan:nodeset($contents)//item">
3333
+ <fo:bookmark-tree>
3334
+ <xsl:choose>
3335
+ <xsl:when test="xalan:nodeset($contents)/doc">
3336
+ <xsl:choose>
3337
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3338
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3339
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3340
+ <fo:bookmark-title>
3341
+ <xsl:variable name="bookmark-title_">
3342
+ <xsl:call-template name="getLangVersion">
3343
+ <xsl:with-param name="lang" select="@lang"/>
3344
+ </xsl:call-template>
3345
+ </xsl:variable>
3346
+ <xsl:choose>
3347
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3348
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3349
+ </xsl:when>
3350
+ <xsl:otherwise>
3351
+ <xsl:choose>
3352
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3353
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3354
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3355
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3356
+ </xsl:choose>
3357
+ </xsl:otherwise>
3358
+ </xsl:choose>
3359
+ </fo:bookmark-title>
3360
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3361
+ </fo:bookmark>
3362
+
3363
+ </xsl:for-each>
3364
+ </xsl:when>
3365
+ <xsl:otherwise>
3366
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3367
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3368
+ </xsl:for-each>
3369
+ </xsl:otherwise>
3370
+ </xsl:choose>
3371
+ </xsl:when>
3372
+ <xsl:otherwise>
3373
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3374
+ </xsl:otherwise>
3375
+ </xsl:choose>
3376
+
3377
+
3378
+
3379
+
3380
+
3381
+
3382
+
3383
+
3384
+ </fo:bookmark-tree>
3385
+ </xsl:if>
3386
+ </xsl:template><xsl:template name="getLangVersion">
3387
+ <xsl:param name="lang"/>
3388
+ <xsl:choose>
3389
+ <xsl:when test="$lang = 'en'">
3390
+
3391
+
3392
+ </xsl:when>
3393
+ <xsl:when test="$lang = 'fr'">
3394
+
3395
+
3396
+ </xsl:when>
3397
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3398
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3399
+ </xsl:choose>
3400
+ </xsl:template><xsl:template match="item" mode="bookmark">
3401
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3402
+ <fo:bookmark-title>
3403
+ <xsl:if test="@section != ''">
3404
+ <xsl:value-of select="@section"/>
3405
+ <xsl:text> </xsl:text>
3406
+ </xsl:if>
3407
+ <xsl:value-of select="normalize-space(title)"/>
3408
+ </fo:bookmark-title>
3409
+ <xsl:apply-templates mode="bookmark"/>
3410
+ </fo:bookmark>
3411
+ </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">
3017
3412
  <xsl:if test="normalize-space() != ''">
3018
3413
  <fo:block xsl:use-attribute-sets="figure-name-style">
3019
-
3414
+
3020
3415
  <xsl:apply-templates/>
3021
3416
  </fo:block>
3022
3417
  </xsl:if>
@@ -3071,7 +3466,7 @@
3071
3466
  <xsl:apply-templates/>
3072
3467
  </xsl:otherwise>
3073
3468
  </xsl:choose>
3074
- </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">
3469
+ </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">
3075
3470
  <xsl:text> </xsl:text>
3076
3471
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3077
3472
  <xsl:copy>
@@ -3453,9 +3848,14 @@
3453
3848
 
3454
3849
  <fo:inline>
3455
3850
 
3456
- <xsl:call-template name="getTitle">
3457
- <xsl:with-param name="name" select="'title-source'"/>
3458
- </xsl:call-template>
3851
+
3852
+
3853
+
3854
+ <xsl:call-template name="getTitle">
3855
+ <xsl:with-param name="name" select="'title-source'"/>
3856
+ </xsl:call-template>
3857
+
3858
+
3459
3859
  <xsl:text>: </xsl:text>
3460
3860
  </fo:inline>
3461
3861
 
@@ -3608,9 +4008,12 @@
3608
4008
  </fo:block>
3609
4009
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3610
4010
  <xsl:variable name="title-deprecated">
3611
- <xsl:call-template name="getTitle">
3612
- <xsl:with-param name="name" select="'title-deprecated'"/>
3613
- </xsl:call-template>
4011
+
4012
+
4013
+ <xsl:call-template name="getTitle">
4014
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4015
+ </xsl:call-template>
4016
+
3614
4017
  </xsl:variable>
3615
4018
  <fo:block xsl:use-attribute-sets="deprecates-style">
3616
4019
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3652,13 +4055,14 @@
3652
4055
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3653
4056
  <fo:block>
3654
4057
  <xsl:call-template name="setId"/>
4058
+
3655
4059
  <xsl:apply-templates/>
3656
4060
  </fo:block>
3657
4061
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3658
4062
  <fo:block id="{@id}">
3659
4063
  <xsl:apply-templates/>
3660
4064
  </fo:block>
3661
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4065
+ </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']">
3662
4066
 
3663
4067
  <fo:block id="{@id}">
3664
4068
  <xsl:apply-templates/>
@@ -3677,20 +4081,30 @@
3677
4081
  <!-- 0xA0 to space replacement -->
3678
4082
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3679
4083
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3680
- <fo:block-container margin-left="0mm">
3681
- <xsl:if test="parent::*[local-name() = 'note']">
3682
- <xsl:attribute name="margin-left">
3683
- <xsl:choose>
3684
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3685
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3686
- </xsl:choose>
3687
- </xsl:attribute>
3688
-
3689
- </xsl:if>
3690
- <fo:block-container margin-left="0mm">
3691
- <xsl:apply-templates select="." mode="ul_ol"/>
3692
- </fo:block-container>
3693
- </fo:block-container>
4084
+ <xsl:choose>
4085
+ <xsl:when test="parent::*[local-name() = 'note']">
4086
+ <fo:block-container>
4087
+ <xsl:attribute name="margin-left">
4088
+ <xsl:choose>
4089
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4090
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4091
+ </xsl:choose>
4092
+ </xsl:attribute>
4093
+
4094
+
4095
+ <fo:block-container margin-left="0mm">
4096
+ <fo:block>
4097
+ <xsl:apply-templates select="." mode="ul_ol"/>
4098
+ </fo:block>
4099
+ </fo:block-container>
4100
+ </fo:block-container>
4101
+ </xsl:when>
4102
+ <xsl:otherwise>
4103
+ <fo:block>
4104
+ <xsl:apply-templates select="." mode="ul_ol"/>
4105
+ </fo:block>
4106
+ </xsl:otherwise>
4107
+ </xsl:choose>
3694
4108
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3695
4109
  <!-- <row>
3696
4110
  <date>05-07-2013</date>
@@ -3958,6 +4372,7 @@
3958
4372
  <dc:title>
3959
4373
  <xsl:variable name="title">
3960
4374
 
4375
+
3961
4376
 
3962
4377
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3963
4378
 
@@ -3978,6 +4393,7 @@
3978
4393
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
3979
4394
 
3980
4395
 
4396
+
3981
4397
  </dc:creator>
3982
4398
  <dc:description>
3983
4399
  <xsl:variable name="abstract">
@@ -3987,6 +4403,7 @@
3987
4403
 
3988
4404
 
3989
4405
 
4406
+
3990
4407
  </xsl:variable>
3991
4408
  <xsl:value-of select="normalize-space($abstract)"/>
3992
4409
  </dc:description>
@@ -4058,13 +4475,22 @@
4058
4475
  </xsl:template><xsl:template name="split">
4059
4476
  <xsl:param name="pText" select="."/>
4060
4477
  <xsl:param name="sep" select="','"/>
4478
+ <xsl:param name="normalize-space" select="'true'"/>
4061
4479
  <xsl:if test="string-length($pText) &gt;0">
4062
4480
  <item>
4063
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4481
+ <xsl:choose>
4482
+ <xsl:when test="$normalize-space = 'true'">
4483
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4484
+ </xsl:when>
4485
+ <xsl:otherwise>
4486
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4487
+ </xsl:otherwise>
4488
+ </xsl:choose>
4064
4489
  </item>
4065
4490
  <xsl:call-template name="split">
4066
4491
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4067
4492
  <xsl:with-param name="sep" select="$sep"/>
4493
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4068
4494
  </xsl:call-template>
4069
4495
  </xsl:if>
4070
4496
  </xsl:template><xsl:template name="getDocumentId">
@@ -4087,6 +4513,7 @@
4087
4513
 
4088
4514
 
4089
4515
 
4516
+
4090
4517
  </xsl:variable>
4091
4518
  <xsl:if test="$documentNS != $XSLNS">
4092
4519
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4112,4 +4539,40 @@
4112
4539
  </xsl:otherwise>
4113
4540
  </xsl:choose>
4114
4541
  </xsl:attribute>
4542
+ </xsl:template><xsl:template name="add-letter-spacing">
4543
+ <xsl:param name="text"/>
4544
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4545
+ <xsl:if test="string-length($text) &gt; 0">
4546
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4547
+ <fo:inline padding-right="{$letter-spacing}mm">
4548
+ <xsl:if test="$char = '®'">
4549
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4550
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4551
+ </xsl:if>
4552
+ <xsl:value-of select="$char"/>
4553
+ </fo:inline>
4554
+ <xsl:call-template name="add-letter-spacing">
4555
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4556
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4557
+ </xsl:call-template>
4558
+ </xsl:if>
4559
+ </xsl:template><xsl:template name="repeat">
4560
+ <xsl:param name="char" select="'*'"/>
4561
+ <xsl:param name="count"/>
4562
+ <xsl:if test="$count &gt; 0">
4563
+ <xsl:value-of select="$char"/>
4564
+ <xsl:call-template name="repeat">
4565
+ <xsl:with-param name="char" select="$char"/>
4566
+ <xsl:with-param name="count" select="$count - 1"/>
4567
+ </xsl:call-template>
4568
+ </xsl:if>
4569
+ </xsl:template><xsl:template name="getLocalizedString">
4570
+ <xsl:param name="key"/>
4571
+
4572
+ <xsl:variable name="curr_lang">
4573
+ <xsl:call-template name="getLang"/>
4574
+ </xsl:variable>
4575
+
4576
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4577
+
4115
4578
  </xsl:template></xsl:stylesheet>