metanorma-un 0.5.12 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,9 @@
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
+ <xsl:param name="basepath"/>
7
9
 
8
10
 
9
11
 
@@ -72,7 +74,9 @@
72
74
  </fo:page-sequence-master>
73
75
  </fo:layout-master-set>
74
76
 
75
- <xsl:call-template name="addPDFUAmeta"/>
77
+ <fo:declarations>
78
+ <xsl:call-template name="addPDFUAmeta"/>
79
+ </fo:declarations>
76
80
 
77
81
  <xsl:call-template name="addBookmarks">
78
82
  <xsl:with-param name="contents" select="$contents"/>
@@ -1448,6 +1452,7 @@
1448
1452
 
1449
1453
 
1450
1454
 
1455
+
1451
1456
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1452
1457
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1453
1458
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1649,12 +1654,18 @@
1649
1654
 
1650
1655
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1651
1656
 
1652
-
1657
+
1653
1658
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1654
1659
 
1655
1660
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1656
1661
 
1657
1662
 
1663
+ </xsl:attribute-set><xsl:attribute-set name="add-style">
1664
+ <xsl:attribute name="color">red</xsl:attribute>
1665
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1666
+ </xsl:attribute-set><xsl:attribute-set name="del-style">
1667
+ <xsl:attribute name="color">red</xsl:attribute>
1668
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1658
1669
  </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1659
1670
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1660
1671
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1700,198 +1711,226 @@
1700
1711
  <xsl:call-template name="add-zero-spaces-java"/>
1701
1712
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1702
1713
 
1703
- <xsl:variable name="simple-table">
1704
- <xsl:call-template name="getSimpleTable"/>
1705
- </xsl:variable>
1714
+ <xsl:variable name="table">
1706
1715
 
1707
-
1708
-
1709
-
1710
-
1711
- <!-- <xsl:if test="$namespace = 'bipm'">
1712
- <fo:block>&#xA0;</fo:block>
1713
- </xsl:if> -->
1714
-
1715
- <!-- $namespace = 'iso' or -->
1716
-
1717
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1718
-
1719
-
1720
-
1721
- <xsl:call-template name="fn_name_display"/>
1716
+ <xsl:variable name="simple-table">
1717
+ <xsl:call-template name="getSimpleTable"/>
1718
+ </xsl:variable>
1722
1719
 
1723
1720
 
1724
-
1725
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1726
-
1727
- <!-- <xsl:variable name="cols-count">
1728
- <xsl:choose>
1729
- <xsl:when test="*[local-name()='thead']">
1730
- <xsl:call-template name="calculate-columns-numbers">
1731
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1732
- </xsl:call-template>
1733
- </xsl:when>
1734
- <xsl:otherwise>
1735
- <xsl:call-template name="calculate-columns-numbers">
1736
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1737
- </xsl:call-template>
1738
- </xsl:otherwise>
1739
- </xsl:choose>
1740
- </xsl:variable> -->
1741
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1742
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1743
-
1744
-
1745
-
1746
- <xsl:variable name="colwidths">
1747
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1748
- <xsl:call-template name="calculate-column-widths">
1749
- <xsl:with-param name="cols-count" select="$cols-count"/>
1750
- <xsl:with-param name="table" select="$simple-table"/>
1751
- </xsl:call-template>
1752
- </xsl:if>
1753
- </xsl:variable>
1754
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1755
-
1756
- <!-- <xsl:variable name="colwidths2">
1757
- <xsl:call-template name="calculate-column-widths">
1758
- <xsl:with-param name="cols-count" select="$cols-count"/>
1759
- </xsl:call-template>
1760
- </xsl:variable> -->
1761
-
1762
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1763
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1764
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1765
-
1766
- <xsl:variable name="margin-left">
1767
- <xsl:choose>
1768
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1769
- <xsl:otherwise>0</xsl:otherwise>
1770
- </xsl:choose>
1771
- </xsl:variable>
1772
-
1773
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1774
1721
 
1775
1722
 
1776
-
1777
-
1778
1723
 
1779
- <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
1780
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1781
-
1724
+ <!-- <xsl:if test="$namespace = 'bipm'">
1725
+ <fo:block>&#xA0;</fo:block>
1726
+ </xsl:if> -->
1782
1727
 
1728
+ <!-- $namespace = 'iso' or -->
1783
1729
 
1784
-
1730
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1785
1731
 
1732
+
1786
1733
 
1734
+ <xsl:call-template name="fn_name_display"/>
1787
1735
 
1736
+
1788
1737
 
1738
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1789
1739
 
1740
+ <!-- <xsl:variable name="cols-count">
1741
+ <xsl:choose>
1742
+ <xsl:when test="*[local-name()='thead']">
1743
+ <xsl:call-template name="calculate-columns-numbers">
1744
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1745
+ </xsl:call-template>
1746
+ </xsl:when>
1747
+ <xsl:otherwise>
1748
+ <xsl:call-template name="calculate-columns-numbers">
1749
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1750
+ </xsl:call-template>
1751
+ </xsl:otherwise>
1752
+ </xsl:choose>
1753
+ </xsl:variable> -->
1754
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1755
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1790
1756
 
1791
1757
 
1792
- <xsl:variable name="table_attributes">
1793
- <attribute name="table-layout">fixed</attribute>
1794
- <attribute name="width">
1795
- <xsl:choose>
1796
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1797
- <xsl:otherwise>100%</xsl:otherwise>
1798
- </xsl:choose>
1799
- </attribute>
1800
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1801
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1758
+
1759
+ <xsl:variable name="colwidths">
1760
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1761
+ <xsl:call-template name="calculate-column-widths">
1762
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1763
+ <xsl:with-param name="table" select="$simple-table"/>
1764
+ </xsl:call-template>
1765
+ </xsl:if>
1766
+ </xsl:variable>
1767
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1768
+
1769
+ <!-- <xsl:variable name="colwidths2">
1770
+ <xsl:call-template name="calculate-column-widths">
1771
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1772
+ </xsl:call-template>
1773
+ </xsl:variable> -->
1774
+
1775
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1776
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1777
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1778
+
1779
+ <xsl:variable name="margin-left">
1780
+ <xsl:choose>
1781
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1782
+ <xsl:otherwise>0</xsl:otherwise>
1783
+ </xsl:choose>
1784
+ </xsl:variable>
1785
+
1786
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1802
1787
 
1803
1788
 
1789
+
1790
+
1804
1791
 
1792
+ <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
1793
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1794
+
1805
1795
 
1806
-
1807
-
1808
1796
 
1809
- <attribute name="border-top">0.5pt solid black</attribute>
1810
-
1797
+
1811
1798
 
1812
-
1813
1799
 
1814
- </xsl:variable>
1815
-
1816
-
1817
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1818
1800
 
1819
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1820
- <xsl:attribute name="{@name}">
1821
- <xsl:value-of select="."/>
1822
- </xsl:attribute>
1823
- </xsl:for-each>
1824
1801
 
1825
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1826
- <xsl:if test="$isNoteOrFnExist = 'true'">
1827
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1828
- </xsl:if>
1829
1802
 
1830
- <xsl:choose>
1831
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1832
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1833
- <fo:table-column column-width="{@width}"/>
1834
- </xsl:for-each>
1835
- </xsl:when>
1836
- <xsl:otherwise>
1837
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1838
- <xsl:choose>
1839
- <xsl:when test=". = 1 or . = 0">
1840
- <fo:table-column column-width="proportional-column-width(2)"/>
1841
- </xsl:when>
1842
- <xsl:otherwise>
1843
- <fo:table-column column-width="proportional-column-width({.})"/>
1844
- </xsl:otherwise>
1845
- </xsl:choose>
1846
- </xsl:for-each>
1847
- </xsl:otherwise>
1848
- </xsl:choose>
1849
1803
 
1850
- <xsl:choose>
1851
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1852
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1853
- </xsl:when>
1854
- <xsl:otherwise>
1855
- <xsl:apply-templates/>
1856
- </xsl:otherwise>
1857
- </xsl:choose>
1804
+ <xsl:variable name="table_width">
1805
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1806
+
1807
+
1808
+
1809
+ <xsl:choose>
1810
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1811
+ <xsl:otherwise>100%</xsl:otherwise>
1812
+ </xsl:choose>
1813
+
1814
+ </xsl:variable>
1858
1815
 
1859
- </fo:table>
1860
-
1861
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1862
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1863
- <xsl:call-template name="insertTableFooterInSeparateTable">
1864
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1865
- <xsl:with-param name="colwidths" select="$colwidths"/>
1866
- <xsl:with-param name="colgroup" select="$colgroup"/>
1867
- </xsl:call-template>
1868
- </xsl:for-each>
1869
-
1870
- <!-- insert footer as table -->
1871
- <!-- <fo:table>
1872
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1873
- <xsl:attribute name="{@name}">
1874
- <xsl:value-of select="."/>
1875
- </xsl:attribute>
1876
- </xsl:for-each>
1816
+ <xsl:variable name="table_attributes">
1817
+ <attribute name="table-layout">fixed</attribute>
1818
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1819
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1820
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+
1827
+
1828
+ <attribute name="border-top">0.5pt solid black</attribute>
1829
+
1830
+
1831
+
1832
+
1833
+ </xsl:variable>
1877
1834
 
1878
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1835
+
1836
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1837
+
1838
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1839
+ <xsl:attribute name="{@name}">
1840
+ <xsl:value-of select="."/>
1841
+ </xsl:attribute>
1842
+ </xsl:for-each>
1843
+
1844
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1845
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1846
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1847
+ </xsl:if>
1848
+
1849
+ <xsl:choose>
1850
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1851
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1852
+ <fo:table-column column-width="{@width}"/>
1853
+ </xsl:for-each>
1854
+ </xsl:when>
1855
+ <xsl:otherwise>
1856
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1857
+ <xsl:choose>
1858
+ <xsl:when test=". = 1 or . = 0">
1859
+ <fo:table-column column-width="proportional-column-width(2)"/>
1860
+ </xsl:when>
1861
+ <xsl:otherwise>
1862
+ <fo:table-column column-width="proportional-column-width({.})"/>
1863
+ </xsl:otherwise>
1864
+ </xsl:choose>
1865
+ </xsl:for-each>
1866
+ </xsl:otherwise>
1867
+ </xsl:choose>
1868
+
1879
1869
  <xsl:choose>
1880
- <xsl:when test=". = 1 or . = 0">
1881
- <fo:table-column column-width="proportional-column-width(2)"/>
1870
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1871
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1882
1872
  </xsl:when>
1883
1873
  <xsl:otherwise>
1884
- <fo:table-column column-width="proportional-column-width({.})"/>
1874
+ <xsl:apply-templates/>
1885
1875
  </xsl:otherwise>
1886
1876
  </xsl:choose>
1877
+
1878
+ </fo:table>
1879
+
1880
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1881
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1882
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1883
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1884
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1885
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1886
+ </xsl:call-template>
1887
1887
  </xsl:for-each>
1888
- </fo:table>-->
1889
-
1890
-
1891
-
1892
-
1893
-
1894
- </fo:block-container>
1888
+
1889
+ <!-- insert footer as table -->
1890
+ <!-- <fo:table>
1891
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1892
+ <xsl:attribute name="{@name}">
1893
+ <xsl:value-of select="."/>
1894
+ </xsl:attribute>
1895
+ </xsl:for-each>
1896
+
1897
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1898
+ <xsl:choose>
1899
+ <xsl:when test=". = 1 or . = 0">
1900
+ <fo:table-column column-width="proportional-column-width(2)"/>
1901
+ </xsl:when>
1902
+ <xsl:otherwise>
1903
+ <fo:table-column column-width="proportional-column-width({.})"/>
1904
+ </xsl:otherwise>
1905
+ </xsl:choose>
1906
+ </xsl:for-each>
1907
+ </fo:table>-->
1908
+
1909
+
1910
+
1911
+
1912
+
1913
+ </fo:block-container>
1914
+ </xsl:variable>
1915
+
1916
+
1917
+
1918
+ <xsl:choose>
1919
+ <xsl:when test="@width">
1920
+
1921
+ <!-- centered table when table name is centered (see table-name-style) -->
1922
+
1923
+
1924
+
1925
+ <xsl:copy-of select="$table"/>
1926
+
1927
+
1928
+ </xsl:when>
1929
+ <xsl:otherwise>
1930
+ <xsl:copy-of select="$table"/>
1931
+ </xsl:otherwise>
1932
+ </xsl:choose>
1933
+
1895
1934
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1896
1935
  <xsl:if test="normalize-space() != ''">
1897
1936
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2019,7 +2058,15 @@
2019
2058
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2020
2059
  <xsl:value-of select="@target"/>
2021
2060
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2022
- <xsl:variable name="math_text" select="normalize-space(.)"/>
2061
+ <xsl:variable name="mathml">
2062
+ <xsl:for-each select="*">
2063
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2064
+ <xsl:copy-of select="."/>
2065
+ </xsl:if>
2066
+ </xsl:for-each>
2067
+ </xsl:variable>
2068
+
2069
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2023
2070
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2024
2071
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2025
2072
  <xsl:param name="cols-count"/>
@@ -2736,7 +2783,7 @@
2736
2783
  <xsl:with-param name="table" select="$html-table"/>
2737
2784
  </xsl:call-template>
2738
2785
  </xsl:variable>
2739
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2786
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2740
2787
  <xsl:variable name="maxlength_dt">
2741
2788
  <xsl:call-template name="getMaxLength_dt"/>
2742
2789
  </xsl:variable>
@@ -2765,13 +2812,22 @@
2765
2812
  </xsl:when>
2766
2813
  <xsl:otherwise>
2767
2814
  <xsl:choose>
2815
+ <!-- to set width check most wide chars like `W` -->
2768
2816
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2769
- <fo:table-column column-width="5%"/>
2770
- <fo:table-column column-width="95%"/>
2817
+ <fo:table-column column-width="7%"/>
2818
+ <fo:table-column column-width="93%"/>
2771
2819
  </xsl:when>
2772
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2773
- <fo:table-column column-width="10%"/>
2774
- <fo:table-column column-width="90%"/>
2820
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2821
+ <fo:table-column column-width="15%"/>
2822
+ <fo:table-column column-width="85%"/>
2823
+ </xsl:when>
2824
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2825
+ <fo:table-column column-width="20%"/>
2826
+ <fo:table-column column-width="80%"/>
2827
+ </xsl:when>
2828
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2829
+ <fo:table-column column-width="25%"/>
2830
+ <fo:table-column column-width="75%"/>
2775
2831
  </xsl:when>
2776
2832
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2777
2833
  <fo:table-column column-width="60%"/>
@@ -2985,8 +3041,16 @@
2985
3041
  <fo:inline text-decoration="underline">
2986
3042
  <xsl:apply-templates/>
2987
3043
  </fo:inline>
3044
+ </xsl:template><xsl:template match="*[local-name()='add']">
3045
+ <fo:inline xsl:use-attribute-sets="add-style">
3046
+ <xsl:apply-templates/>
3047
+ </fo:inline>
2988
3048
  </xsl:template><xsl:template match="*[local-name()='del']">
2989
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3049
+ <fo:inline xsl:use-attribute-sets="del-style">
3050
+ <xsl:apply-templates/>
3051
+ </fo:inline>
3052
+ </xsl:template><xsl:template match="*[local-name()='hi']">
3053
+ <fo:inline background-color="yellow">
2990
3054
  <xsl:apply-templates/>
2991
3055
  </fo:inline>
2992
3056
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
@@ -3078,6 +3142,10 @@
3078
3142
  <xsl:param name="text" select="."/>
3079
3143
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3080
3144
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
3145
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
3146
+ <xsl:param name="text" select="."/>
3147
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3148
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
3081
3149
  </xsl:template><xsl:template name="add-zero-spaces">
3082
3150
  <xsl:param name="text" select="."/>
3083
3151
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3325,6 +3393,7 @@
3325
3393
  <xsl:apply-templates select="." mode="mathml"/>
3326
3394
  </xsl:variable>
3327
3395
  <fo:instream-foreign-object fox:alt-text="Math">
3396
+
3328
3397
  <!-- <xsl:copy-of select="."/> -->
3329
3398
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3330
3399
  </fo:instream-foreign-object>
@@ -3338,7 +3407,12 @@
3338
3407
  <!-- replace start and end spaces to non-break space -->
3339
3408
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3340
3409
  </xsl:copy>
3341
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3410
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3411
+ <xsl:copy>
3412
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3413
+ </xsl:copy>
3414
+ <mathml:mspace width="0.5ex"/>
3415
+ </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">
3342
3416
  <xsl:variable name="target">
3343
3417
  <xsl:choose>
3344
3418
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3359,7 +3433,10 @@
3359
3433
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3360
3434
  <xsl:choose>
3361
3435
  <xsl:when test="normalize-space(.) = ''">
3362
- <xsl:value-of select="$target"/>
3436
+ <!-- <xsl:value-of select="$target"/> -->
3437
+ <xsl:call-template name="add-zero-spaces-link-java">
3438
+ <xsl:with-param name="text" select="$target"/>
3439
+ </xsl:call-template>
3363
3440
  </xsl:when>
3364
3441
  <xsl:otherwise>
3365
3442
  <xsl:apply-templates/>
@@ -3369,8 +3446,6 @@
3369
3446
  </xsl:otherwise>
3370
3447
  </xsl:choose>
3371
3448
  </fo:inline>
3372
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3373
- <fo:inline id="{@id}"/>
3374
3449
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3375
3450
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3376
3451
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3590,27 +3665,43 @@
3590
3665
  <fo:block id="{@id}">
3591
3666
  <xsl:apply-templates/>
3592
3667
  </fo:block>
3668
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3593
3669
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3594
3670
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3595
3671
  <xsl:apply-templates/>
3596
3672
  </fo:block>
3597
3673
  </xsl:template><xsl:template match="*[local-name() = 'image']">
3598
- <fo:block xsl:use-attribute-sets="image-style">
3599
-
3600
-
3601
- <xsl:variable name="src">
3602
- <xsl:choose>
3603
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3604
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3605
- </xsl:when>
3606
- <xsl:otherwise>
3607
- <xsl:value-of select="@src"/>
3608
- </xsl:otherwise>
3609
- </xsl:choose>
3610
- </xsl:variable>
3611
-
3612
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3613
- </fo:block>
3674
+ <xsl:choose>
3675
+ <xsl:when test="ancestor::*[local-name() = 'title']">
3676
+ <fo:inline padding-left="1mm" padding-right="1mm">
3677
+ <xsl:variable name="src">
3678
+ <xsl:call-template name="image_src"/>
3679
+ </xsl:variable>
3680
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
3681
+ </fo:inline>
3682
+ </xsl:when>
3683
+ <xsl:otherwise>
3684
+ <fo:block xsl:use-attribute-sets="image-style">
3685
+
3686
+ <xsl:variable name="src">
3687
+ <xsl:call-template name="image_src"/>
3688
+ </xsl:variable>
3689
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3690
+ </fo:block>
3691
+ </xsl:otherwise>
3692
+ </xsl:choose>
3693
+ </xsl:template><xsl:template name="image_src">
3694
+ <xsl:choose>
3695
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3696
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3697
+ </xsl:when>
3698
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3699
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3700
+ </xsl:when>
3701
+ <xsl:otherwise>
3702
+ <xsl:value-of select="@src"/>
3703
+ </xsl:otherwise>
3704
+ </xsl:choose>
3614
3705
  </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">
3615
3706
  <xsl:apply-templates mode="contents"/>
3616
3707
  <xsl:text> </xsl:text>
@@ -3843,6 +3934,8 @@
3843
3934
  <xsl:copy>
3844
3935
  <xsl:apply-templates mode="contents_item"/>
3845
3936
  </xsl:copy>
3937
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3938
+ <xsl:copy-of select="."/>
3846
3939
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3847
3940
  <xsl:text> </xsl:text>
3848
3941
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4171,10 +4264,11 @@
4171
4264
  </xsl:choose>
4172
4265
 
4173
4266
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4174
-
4267
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4175
4268
  <xsl:variable name="element">
4176
4269
  block
4177
4270
 
4271
+
4178
4272
  </xsl:variable>
4179
4273
  <xsl:choose>
4180
4274
  <xsl:when test="normalize-space($element) = 'block'">
@@ -4241,11 +4335,13 @@
4241
4335
  </xsl:if>
4242
4336
  </xsl:if>
4243
4337
 
4338
+
4244
4339
  <fo:block-container margin-left="0mm">
4245
4340
 
4246
4341
  <fo:block xsl:use-attribute-sets="quote-style">
4247
4342
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4248
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4343
+
4344
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4249
4345
  </fo:block>
4250
4346
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4251
4347
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4268,31 +4364,49 @@
4268
4364
  <xsl:text>— </xsl:text>
4269
4365
  <xsl:apply-templates/>
4270
4366
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4271
- <fo:inline xsl:use-attribute-sets="eref-style">
4272
- <xsl:if test="@type = 'footnote'">
4273
-
4274
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4275
- <xsl:attribute name="font-size">80%</xsl:attribute>
4276
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4277
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4278
-
4279
-
4280
- </xsl:if>
4281
-
4282
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4283
-
4284
- <xsl:if test="@type = 'inline'">
4285
-
4286
-
4287
-
4288
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
4289
-
4290
- </xsl:if>
4291
-
4292
-
4293
- <xsl:apply-templates/>
4294
- </fo:basic-link>
4295
- </fo:inline>
4367
+
4368
+ <xsl:variable name="bibitemid">
4369
+ <xsl:choose>
4370
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4371
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4372
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4373
+ </xsl:choose>
4374
+ </xsl:variable>
4375
+
4376
+ <xsl:choose>
4377
+ <xsl:when test="normalize-space($bibitemid) != ''">
4378
+ <fo:inline xsl:use-attribute-sets="eref-style">
4379
+ <xsl:if test="@type = 'footnote'">
4380
+
4381
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4382
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4383
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4384
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4385
+
4386
+
4387
+ </xsl:if>
4388
+
4389
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4390
+ <xsl:if test="normalize-space(@citeas) = ''">
4391
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4392
+ </xsl:if>
4393
+ <xsl:if test="@type = 'inline'">
4394
+
4395
+
4396
+
4397
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4398
+
4399
+ </xsl:if>
4400
+
4401
+ <xsl:apply-templates/>
4402
+ </fo:basic-link>
4403
+
4404
+ </fo:inline>
4405
+ </xsl:when>
4406
+ <xsl:otherwise>
4407
+ <fo:inline><xsl:apply-templates/></fo:inline>
4408
+ </xsl:otherwise>
4409
+ </xsl:choose>
4296
4410
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4297
4411
  <!-- zero-space char -->
4298
4412
  <xsl:variable name="depth">
@@ -4480,6 +4594,153 @@
4480
4594
  </fo:block>
4481
4595
  </xsl:otherwise>
4482
4596
  </xsl:choose>
4597
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4598
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4599
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4600
+ </xsl:for-each>
4601
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4602
+ <xsl:copy>
4603
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4604
+ </xsl:copy>
4605
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4606
+ <xsl:variable name="id">
4607
+ <xsl:call-template name="generateIndexXrefId"/>
4608
+ </xsl:variable>
4609
+ <xsl:copy> <!-- add id to xref -->
4610
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4611
+ <xsl:attribute name="id">
4612
+ <xsl:value-of select="$id"/>
4613
+ </xsl:attribute>
4614
+ <xsl:apply-templates mode="index_add_id"/>
4615
+ </xsl:copy>
4616
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4617
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4618
+ <xsl:if test="@to">
4619
+ <xsl:value-of select="$dash"/>
4620
+ <xsl:copy>
4621
+ <xsl:copy-of select="@*"/>
4622
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4623
+ <xsl:attribute name="id">
4624
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4625
+ </xsl:attribute>
4626
+ <xsl:apply-templates mode="index_add_id"/>
4627
+ </xsl:copy>
4628
+ </xsl:if>
4629
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4630
+ <xsl:copy>
4631
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4632
+ </xsl:copy>
4633
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4634
+ <xsl:copy>
4635
+ <xsl:apply-templates select="@*" mode="index_update"/>
4636
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4637
+ </xsl:copy>
4638
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4639
+ <xsl:param name="element"/>
4640
+ <xsl:param name="remove" select="'false'"/>
4641
+ <xsl:param name="target"/>
4642
+ <!-- <node></node> -->
4643
+ <xsl:choose>
4644
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4645
+ <!-- skip text (i.e. remove it) and process next element -->
4646
+ <!-- [removed_<xsl:value-of select="."/>] -->
4647
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4648
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4649
+ </xsl:apply-templates>
4650
+ </xsl:when>
4651
+ <xsl:when test="self::text()">
4652
+ <xsl:value-of select="."/>
4653
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4654
+ </xsl:when>
4655
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4656
+ <xsl:variable name="id" select="@id"/>
4657
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4658
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4659
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4660
+
4661
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4662
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4663
+
4664
+ <xsl:choose>
4665
+ <!-- 2nd pass -->
4666
+ <!-- if page is equal to page for next and page is not the end of range -->
4667
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4668
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4669
+ <!-- [removed_xref] -->
4670
+
4671
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4672
+ <xsl:with-param name="remove">true</xsl:with-param>
4673
+ <xsl:with-param name="target">
4674
+ <xsl:choose>
4675
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4676
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4677
+ </xsl:choose>
4678
+ </xsl:with-param>
4679
+ </xsl:apply-templates>
4680
+ </xsl:when>
4681
+
4682
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4683
+ <!-- remove xref -->
4684
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4685
+ <xsl:with-param name="remove">true</xsl:with-param>
4686
+ </xsl:apply-templates>
4687
+ </xsl:when>
4688
+
4689
+ <xsl:otherwise>
4690
+ <xsl:apply-templates select="." mode="xref_copy">
4691
+ <xsl:with-param name="target" select="$target"/>
4692
+ </xsl:apply-templates>
4693
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4694
+ </xsl:otherwise>
4695
+ </xsl:choose>
4696
+ </xsl:when>
4697
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4698
+ <!-- ul -->
4699
+ <xsl:apply-templates select="." mode="index_update"/>
4700
+ </xsl:when>
4701
+ <xsl:otherwise>
4702
+ <xsl:apply-templates select="." mode="xref_copy">
4703
+ <xsl:with-param name="target" select="$target"/>
4704
+ </xsl:apply-templates>
4705
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4706
+ </xsl:otherwise>
4707
+ </xsl:choose>
4708
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4709
+ <xsl:param name="target"/>
4710
+ <xsl:copy>
4711
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4712
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4713
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4714
+ </xsl:if>
4715
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4716
+ </xsl:copy>
4717
+ </xsl:template><xsl:template name="generateIndexXrefId">
4718
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4719
+
4720
+ <xsl:variable name="docid">
4721
+ <xsl:call-template name="getDocumentId"/>
4722
+ </xsl:variable>
4723
+ <xsl:variable name="item_number">
4724
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4725
+ </xsl:variable>
4726
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4727
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4728
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4729
+ <xsl:apply-templates/>
4730
+ <fo:block>
4731
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4732
+ <fo:block> </fo:block>
4733
+ </xsl:if>
4734
+ </fo:block>
4735
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4736
+ <xsl:apply-templates/>
4737
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4738
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4739
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4740
+ <xsl:apply-templates/>
4741
+ </fo:block>
4742
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4743
+ <fo:inline id="{@id}" font-size="1pt"/>
4483
4744
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4484
4745
  <!-- <row>
4485
4746
  <date>05-07-2013</date>
@@ -4667,7 +4928,7 @@
4667
4928
  <xsl:param name="charDelim" select="', '"/>
4668
4929
  <xsl:choose>
4669
4930
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4670
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4931
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4671
4932
  <xsl:sort data-type="text" order="ascending"/>
4672
4933
  <xsl:call-template name="insertKeyword">
4673
4934
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4676,7 +4937,7 @@
4676
4937
  </xsl:for-each>
4677
4938
  </xsl:when>
4678
4939
  <xsl:otherwise>
4679
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4940
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4680
4941
  <xsl:call-template name="insertKeyword">
4681
4942
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4682
4943
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4693,63 +4954,71 @@
4693
4954
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4694
4955
  </xsl:choose>
4695
4956
  </xsl:template><xsl:template name="addPDFUAmeta">
4696
- <fo:declarations>
4697
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4698
- <pdf:dictionary type="normal" key="ViewerPreferences">
4699
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4700
- </pdf:dictionary>
4701
- </pdf:catalog>
4702
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4703
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4704
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4705
- <!-- Dublin Core properties go here -->
4706
- <dc:title>
4707
- <xsl:variable name="title">
4957
+ <xsl:variable name="lang">
4958
+ <xsl:call-template name="getLang"/>
4959
+ </xsl:variable>
4960
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4961
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4962
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4963
+ </pdf:dictionary>
4964
+ </pdf:catalog>
4965
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4966
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4967
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4968
+ <!-- Dublin Core properties go here -->
4969
+ <dc:title>
4970
+ <xsl:variable name="title">
4971
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4972
+
4973
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4708
4974
 
4709
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
4710
4975
 
4711
4976
 
4712
4977
 
4713
4978
 
4714
4979
 
4715
- </xsl:variable>
4716
- <xsl:choose>
4717
- <xsl:when test="normalize-space($title) != ''">
4718
- <xsl:value-of select="$title"/>
4719
- </xsl:when>
4720
- <xsl:otherwise>
4721
- <xsl:text> </xsl:text>
4722
- </xsl:otherwise>
4723
- </xsl:choose>
4724
- </dc:title>
4725
- <dc:creator>
4980
+ </xsl:for-each>
4981
+ </xsl:variable>
4982
+ <xsl:choose>
4983
+ <xsl:when test="normalize-space($title) != ''">
4984
+ <xsl:value-of select="$title"/>
4985
+ </xsl:when>
4986
+ <xsl:otherwise>
4987
+ <xsl:text> </xsl:text>
4988
+ </xsl:otherwise>
4989
+ </xsl:choose>
4990
+ </dc:title>
4991
+ <dc:creator>
4992
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4726
4993
 
4994
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4995
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4996
+ <xsl:if test="position() != last()">; </xsl:if>
4997
+ </xsl:for-each>
4727
4998
 
4728
4999
 
4729
- </dc:creator>
4730
- <dc:description>
4731
- <xsl:variable name="abstract">
4732
-
4733
-
4734
-
4735
- <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4736
-
4737
-
4738
-
4739
- </xsl:variable>
4740
- <xsl:value-of select="normalize-space($abstract)"/>
4741
- </dc:description>
4742
- <pdf:Keywords>
4743
- <xsl:call-template name="insertKeywords"/>
4744
- </pdf:Keywords>
4745
- </rdf:Description>
4746
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4747
- <!-- XMP properties go here -->
4748
- <xmp:CreatorTool/>
4749
- </rdf:Description>
4750
- </rdf:RDF>
4751
- </x:xmpmeta>
4752
- </fo:declarations>
5000
+
5001
+ </xsl:for-each>
5002
+ </dc:creator>
5003
+ <dc:description>
5004
+ <xsl:variable name="abstract">
5005
+
5006
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5007
+
5008
+
5009
+ </xsl:variable>
5010
+ <xsl:value-of select="normalize-space($abstract)"/>
5011
+ </dc:description>
5012
+ <pdf:Keywords>
5013
+ <xsl:call-template name="insertKeywords"/>
5014
+ </pdf:Keywords>
5015
+ </rdf:Description>
5016
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5017
+ <!-- XMP properties go here -->
5018
+ <xmp:CreatorTool/>
5019
+ </rdf:Description>
5020
+ </rdf:RDF>
5021
+ </x:xmpmeta>
4753
5022
  </xsl:template><xsl:template name="getId">
4754
5023
  <xsl:choose>
4755
5024
  <xsl:when test="../@id">