metanorma-nist 1.2.12 → 1.2.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1549,203 +1549,237 @@
1549
1549
  <xsl:call-template name="add-zero-spaces-java"/>
1550
1550
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1551
1551
 
1552
- <xsl:variable name="simple-table">
1553
- <xsl:call-template name="getSimpleTable"/>
1554
- </xsl:variable>
1552
+ <xsl:variable name="table">
1555
1553
 
1556
-
1557
-
1558
-
1559
-
1560
- <!-- <xsl:if test="$namespace = 'bipm'">
1561
- <fo:block>&#xA0;</fo:block>
1562
- </xsl:if> -->
1563
-
1564
- <!-- $namespace = 'iso' or -->
1565
-
1566
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1567
-
1568
-
1554
+ <xsl:variable name="simple-table">
1555
+ <xsl:call-template name="getSimpleTable"/>
1556
+ </xsl:variable>
1569
1557
 
1570
1558
 
1571
-
1572
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1573
-
1574
- <!-- <xsl:variable name="cols-count">
1575
- <xsl:choose>
1576
- <xsl:when test="*[local-name()='thead']">
1577
- <xsl:call-template name="calculate-columns-numbers">
1578
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1579
- </xsl:call-template>
1580
- </xsl:when>
1581
- <xsl:otherwise>
1582
- <xsl:call-template name="calculate-columns-numbers">
1583
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1584
- </xsl:call-template>
1585
- </xsl:otherwise>
1586
- </xsl:choose>
1587
- </xsl:variable> -->
1588
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1589
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1590
-
1591
-
1592
-
1593
- <xsl:variable name="colwidths">
1594
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1595
- <xsl:call-template name="calculate-column-widths">
1596
- <xsl:with-param name="cols-count" select="$cols-count"/>
1597
- <xsl:with-param name="table" select="$simple-table"/>
1598
- </xsl:call-template>
1599
- </xsl:if>
1600
- </xsl:variable>
1601
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1602
-
1603
- <!-- <xsl:variable name="colwidths2">
1604
- <xsl:call-template name="calculate-column-widths">
1605
- <xsl:with-param name="cols-count" select="$cols-count"/>
1606
- </xsl:call-template>
1607
- </xsl:variable> -->
1608
-
1609
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1610
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1611
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1612
-
1613
- <xsl:variable name="margin-left">
1614
- <xsl:choose>
1615
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1616
- <xsl:otherwise>0</xsl:otherwise>
1617
- </xsl:choose>
1618
- </xsl:variable>
1619
-
1620
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1621
1559
 
1622
1560
 
1623
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1624
1561
 
1625
-
1626
-
1627
-
1562
+ <!-- <xsl:if test="$namespace = 'bipm'">
1563
+ <fo:block>&#xA0;</fo:block>
1564
+ </xsl:if> -->
1628
1565
 
1566
+ <!-- $namespace = 'iso' or -->
1629
1567
 
1630
- <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1631
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1632
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1633
- </xsl:if>
1634
- <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1635
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1636
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1637
- </xsl:if>
1638
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1568
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1639
1569
 
1640
-
1570
+
1641
1571
 
1572
+
1642
1573
 
1574
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1643
1575
 
1576
+ <!-- <xsl:variable name="cols-count">
1577
+ <xsl:choose>
1578
+ <xsl:when test="*[local-name()='thead']">
1579
+ <xsl:call-template name="calculate-columns-numbers">
1580
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1581
+ </xsl:call-template>
1582
+ </xsl:when>
1583
+ <xsl:otherwise>
1584
+ <xsl:call-template name="calculate-columns-numbers">
1585
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1586
+ </xsl:call-template>
1587
+ </xsl:otherwise>
1588
+ </xsl:choose>
1589
+ </xsl:variable> -->
1590
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1591
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1644
1592
 
1645
1593
 
1646
1594
 
1595
+ <xsl:variable name="colwidths">
1596
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1597
+ <xsl:call-template name="calculate-column-widths">
1598
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1599
+ <xsl:with-param name="table" select="$simple-table"/>
1600
+ </xsl:call-template>
1601
+ </xsl:if>
1602
+ </xsl:variable>
1603
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1647
1604
 
1648
- <xsl:variable name="table_attributes">
1649
- <attribute name="table-layout">fixed</attribute>
1650
- <attribute name="width">
1651
- <xsl:choose>
1652
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1653
- <xsl:otherwise>100%</xsl:otherwise>
1654
- </xsl:choose>
1655
- </attribute>
1656
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1657
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1605
+ <!-- <xsl:variable name="colwidths2">
1606
+ <xsl:call-template name="calculate-column-widths">
1607
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1608
+ </xsl:call-template>
1609
+ </xsl:variable> -->
1610
+
1611
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1612
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1613
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1614
+
1615
+ <xsl:variable name="margin-left">
1616
+ <xsl:choose>
1617
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1618
+ <xsl:otherwise>0</xsl:otherwise>
1619
+ </xsl:choose>
1620
+ </xsl:variable>
1621
+
1622
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1658
1623
 
1659
1624
 
1625
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1660
1626
 
1627
+
1628
+
1629
+
1661
1630
 
1662
-
1663
-
1664
-
1665
1631
 
1666
-
1632
+ <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1633
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1634
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1635
+ </xsl:if>
1636
+ <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1637
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1638
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1639
+ </xsl:if>
1640
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1667
1641
 
1668
- </xsl:variable>
1669
-
1670
-
1671
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1642
+
1672
1643
 
1673
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1674
- <xsl:attribute name="{@name}">
1675
- <xsl:value-of select="."/>
1676
- </xsl:attribute>
1677
- </xsl:for-each>
1678
1644
 
1679
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1680
- <xsl:if test="$isNoteOrFnExist = 'true'">
1681
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1682
- </xsl:if>
1683
1645
 
1684
- <xsl:choose>
1685
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1686
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1687
- <fo:table-column column-width="{@width}"/>
1688
- </xsl:for-each>
1689
- </xsl:when>
1690
- <xsl:otherwise>
1691
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1692
- <xsl:choose>
1693
- <xsl:when test=". = 1 or . = 0">
1694
- <fo:table-column column-width="proportional-column-width(2)"/>
1695
- </xsl:when>
1696
- <xsl:otherwise>
1697
- <fo:table-column column-width="proportional-column-width({.})"/>
1698
- </xsl:otherwise>
1699
- </xsl:choose>
1700
- </xsl:for-each>
1701
- </xsl:otherwise>
1702
- </xsl:choose>
1703
1646
 
1704
- <xsl:choose>
1705
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1706
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1707
- </xsl:when>
1708
- <xsl:otherwise>
1709
- <xsl:apply-templates/>
1710
- </xsl:otherwise>
1711
- </xsl:choose>
1712
1647
 
1713
- </fo:table>
1714
-
1715
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1716
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1717
- <xsl:call-template name="insertTableFooterInSeparateTable">
1718
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1719
- <xsl:with-param name="colwidths" select="$colwidths"/>
1720
- <xsl:with-param name="colgroup" select="$colgroup"/>
1721
- </xsl:call-template>
1722
- </xsl:for-each>
1723
-
1724
- <!-- insert footer as table -->
1725
- <!-- <fo:table>
1726
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1727
- <xsl:attribute name="{@name}">
1728
- <xsl:value-of select="."/>
1729
- </xsl:attribute>
1730
- </xsl:for-each>
1731
1648
 
1732
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1649
+ <xsl:variable name="table_width">
1650
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1651
+ 100%
1652
+
1653
+
1654
+ </xsl:variable>
1655
+
1656
+ <xsl:variable name="table_attributes">
1657
+ <attribute name="table-layout">fixed</attribute>
1658
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1659
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1660
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+
1671
+ </xsl:variable>
1672
+
1673
+
1674
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1675
+
1676
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1677
+ <xsl:attribute name="{@name}">
1678
+ <xsl:value-of select="."/>
1679
+ </xsl:attribute>
1680
+ </xsl:for-each>
1681
+
1682
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1683
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1684
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1685
+ </xsl:if>
1686
+
1733
1687
  <xsl:choose>
1734
- <xsl:when test=". = 1 or . = 0">
1735
- <fo:table-column column-width="proportional-column-width(2)"/>
1688
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1689
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1690
+ <fo:table-column column-width="{@width}"/>
1691
+ </xsl:for-each>
1736
1692
  </xsl:when>
1737
1693
  <xsl:otherwise>
1738
- <fo:table-column column-width="proportional-column-width({.})"/>
1694
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1695
+ <xsl:choose>
1696
+ <xsl:when test=". = 1 or . = 0">
1697
+ <fo:table-column column-width="proportional-column-width(2)"/>
1698
+ </xsl:when>
1699
+ <xsl:otherwise>
1700
+ <fo:table-column column-width="proportional-column-width({.})"/>
1701
+ </xsl:otherwise>
1702
+ </xsl:choose>
1703
+ </xsl:for-each>
1739
1704
  </xsl:otherwise>
1740
1705
  </xsl:choose>
1706
+
1707
+ <xsl:choose>
1708
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1709
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1710
+ </xsl:when>
1711
+ <xsl:otherwise>
1712
+ <xsl:apply-templates/>
1713
+ </xsl:otherwise>
1714
+ </xsl:choose>
1715
+
1716
+ </fo:table>
1717
+
1718
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1719
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1720
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1721
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1722
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1723
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1724
+ </xsl:call-template>
1741
1725
  </xsl:for-each>
1742
- </fo:table>-->
1743
-
1744
-
1745
-
1746
-
1747
-
1748
- </fo:block-container>
1726
+
1727
+ <!-- insert footer as table -->
1728
+ <!-- <fo:table>
1729
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1730
+ <xsl:attribute name="{@name}">
1731
+ <xsl:value-of select="."/>
1732
+ </xsl:attribute>
1733
+ </xsl:for-each>
1734
+
1735
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1736
+ <xsl:choose>
1737
+ <xsl:when test=". = 1 or . = 0">
1738
+ <fo:table-column column-width="proportional-column-width(2)"/>
1739
+ </xsl:when>
1740
+ <xsl:otherwise>
1741
+ <fo:table-column column-width="proportional-column-width({.})"/>
1742
+ </xsl:otherwise>
1743
+ </xsl:choose>
1744
+ </xsl:for-each>
1745
+ </fo:table>-->
1746
+
1747
+
1748
+
1749
+
1750
+
1751
+ </fo:block-container>
1752
+ </xsl:variable>
1753
+
1754
+
1755
+
1756
+ <xsl:choose>
1757
+ <xsl:when test="@width">
1758
+
1759
+ <!-- centered table when table name is centered (see table-name-style) -->
1760
+
1761
+ <fo:table table-layout="fixed" width="100%">
1762
+ <fo:table-column column-width="proportional-column-width(1)"/>
1763
+ <fo:table-column column-width="{@width}"/>
1764
+ <fo:table-column column-width="proportional-column-width(1)"/>
1765
+ <fo:table-body>
1766
+ <fo:table-row>
1767
+ <fo:table-cell column-number="2">
1768
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1769
+ </fo:table-cell>
1770
+ </fo:table-row>
1771
+ </fo:table-body>
1772
+ </fo:table>
1773
+
1774
+
1775
+
1776
+
1777
+ </xsl:when>
1778
+ <xsl:otherwise>
1779
+ <xsl:copy-of select="$table"/>
1780
+ </xsl:otherwise>
1781
+ </xsl:choose>
1782
+
1749
1783
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1750
1784
  <xsl:if test="normalize-space() != ''">
1751
1785
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2586,7 +2620,7 @@
2586
2620
  <xsl:with-param name="table" select="$html-table"/>
2587
2621
  </xsl:call-template>
2588
2622
  </xsl:variable>
2589
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2623
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2590
2624
  <xsl:variable name="maxlength_dt">
2591
2625
  <xsl:call-template name="getMaxLength_dt"/>
2592
2626
  </xsl:variable>
@@ -2615,13 +2649,22 @@
2615
2649
  </xsl:when>
2616
2650
  <xsl:otherwise>
2617
2651
  <xsl:choose>
2652
+ <!-- to set width check most wide chars like `W` -->
2618
2653
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2619
- <fo:table-column column-width="5%"/>
2620
- <fo:table-column column-width="95%"/>
2654
+ <fo:table-column column-width="7%"/>
2655
+ <fo:table-column column-width="93%"/>
2656
+ </xsl:when>
2657
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2658
+ <fo:table-column column-width="15%"/>
2659
+ <fo:table-column column-width="85%"/>
2621
2660
  </xsl:when>
2622
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2623
- <fo:table-column column-width="10%"/>
2624
- <fo:table-column column-width="90%"/>
2661
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2662
+ <fo:table-column column-width="20%"/>
2663
+ <fo:table-column column-width="80%"/>
2664
+ </xsl:when>
2665
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2666
+ <fo:table-column column-width="25%"/>
2667
+ <fo:table-column column-width="75%"/>
2625
2668
  </xsl:when>
2626
2669
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2627
2670
  <fo:table-column column-width="60%"/>
@@ -2944,6 +2987,10 @@
2944
2987
  <xsl:param name="text" select="."/>
2945
2988
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2946
2989
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2990
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2991
+ <xsl:param name="text" select="."/>
2992
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2993
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2947
2994
  </xsl:template><xsl:template name="add-zero-spaces">
2948
2995
  <xsl:param name="text" select="."/>
2949
2996
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3204,6 +3251,11 @@
3204
3251
  <!-- replace start and end spaces to non-break space -->
3205
3252
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3206
3253
  </xsl:copy>
3254
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3255
+ <xsl:copy>
3256
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3257
+ </xsl:copy>
3258
+ <mathml:mspace width="0.5ex"/>
3207
3259
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3208
3260
  <xsl:variable name="target">
3209
3261
  <xsl:choose>
@@ -3225,7 +3277,10 @@
3225
3277
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3226
3278
  <xsl:choose>
3227
3279
  <xsl:when test="normalize-space(.) = ''">
3228
- <xsl:value-of select="$target"/>
3280
+ <!-- <xsl:value-of select="$target"/> -->
3281
+ <xsl:call-template name="add-zero-spaces-link-java">
3282
+ <xsl:with-param name="text" select="$target"/>
3283
+ </xsl:call-template>
3229
3284
  </xsl:when>
3230
3285
  <xsl:otherwise>
3231
3286
  <xsl:apply-templates/>
@@ -3704,6 +3759,8 @@
3704
3759
  <xsl:copy>
3705
3760
  <xsl:apply-templates mode="contents_item"/>
3706
3761
  </xsl:copy>
3762
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3763
+ <xsl:copy-of select="."/>
3707
3764
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3708
3765
  <xsl:text> </xsl:text>
3709
3766
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4102,11 +4159,13 @@
4102
4159
  </xsl:if>
4103
4160
  </xsl:if>
4104
4161
 
4162
+
4105
4163
  <fo:block-container margin-left="0mm">
4106
4164
 
4107
4165
  <fo:block xsl:use-attribute-sets="quote-style">
4108
4166
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4109
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4167
+
4168
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4110
4169
  </fo:block>
4111
4170
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4112
4171
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4526,7 +4585,7 @@
4526
4585
  <xsl:param name="charDelim" select="', '"/>
4527
4586
  <xsl:choose>
4528
4587
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4529
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4588
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4530
4589
  <xsl:sort data-type="text" order="ascending"/>
4531
4590
  <xsl:call-template name="insertKeyword">
4532
4591
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4535,7 +4594,7 @@
4535
4594
  </xsl:for-each>
4536
4595
  </xsl:when>
4537
4596
  <xsl:otherwise>
4538
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4597
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4539
4598
  <xsl:call-template name="insertKeyword">
4540
4599
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4541
4600
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4552,6 +4611,9 @@
4552
4611
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4553
4612
  </xsl:choose>
4554
4613
  </xsl:template><xsl:template name="addPDFUAmeta">
4614
+ <xsl:variable name="lang">
4615
+ <xsl:call-template name="getLang"/>
4616
+ </xsl:variable>
4555
4617
  <fo:declarations>
4556
4618
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4557
4619
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -4564,13 +4626,16 @@
4564
4626
  <!-- Dublin Core properties go here -->
4565
4627
  <dc:title>
4566
4628
  <xsl:variable name="title">
4567
-
4568
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
4569
-
4570
-
4571
-
4572
-
4573
-
4629
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4630
+
4631
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4632
+
4633
+
4634
+
4635
+
4636
+
4637
+
4638
+ </xsl:for-each>
4574
4639
  </xsl:variable>
4575
4640
  <xsl:choose>
4576
4641
  <xsl:when test="normalize-space($title) != ''">
@@ -4582,22 +4647,21 @@
4582
4647
  </xsl:choose>
4583
4648
  </dc:title>
4584
4649
  <dc:creator>
4585
-
4586
-
4587
-
4588
- <xsl:for-each select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4589
- <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
4590
- <xsl:if test="position() != last()">; </xsl:if>
4591
- </xsl:for-each>
4592
-
4593
- </dc:creator>
4594
- <dc:description>
4595
- <xsl:variable name="abstract">
4650
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4651
+
4596
4652
 
4597
4653
 
4654
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4655
+ <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
4656
+ <xsl:if test="position() != last()">; </xsl:if>
4657
+ </xsl:for-each>
4598
4658
 
4599
- <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4659
+ </xsl:for-each>
4660
+ </dc:creator>
4661
+ <dc:description>
4662
+ <xsl:variable name="abstract">
4600
4663
 
4664
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4601
4665
 
4602
4666
 
4603
4667
  </xsl:variable>