metanorma-un 0.5.8 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -0
- data/lib/asciidoctor/un/basicdoc.rng +52 -3
- data/lib/asciidoctor/un/converter.rb +1 -1
- data/lib/asciidoctor/un/isodoc.rng +114 -3
- data/lib/isodoc/un/base_convert.rb +1 -1
- data/lib/isodoc/un/html/html_unece_intro.html +1 -1
- data/lib/isodoc/un/html/word_unece_intro.html +1 -1
- data/lib/isodoc/un/html_convert.rb +2 -2
- data/lib/isodoc/un/un.plenary-attachment.xsl +454 -187
- data/lib/isodoc/un/un.plenary.xsl +454 -187
- data/lib/isodoc/un/un.recommendation.xsl +460 -193
- data/lib/isodoc/un/word_convert.rb +2 -2
- data/lib/isodoc/un/xref.rb +4 -2
- data/lib/metanorma/un/processor.rb +11 -0
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -2
- metadata +7 -8
- data/lib/metanorma/un/fonts_manifest.yaml +0 -6
@@ -644,7 +644,7 @@
|
|
644
644
|
<xsl:otherwise> <!-- for ordered lists -->
|
645
645
|
<xsl:choose>
|
646
646
|
<xsl:when test="../@type = 'arabic'">
|
647
|
-
<xsl:number format="a)"/>
|
647
|
+
<xsl:number format="a)" lang="en"/>
|
648
648
|
</xsl:when>
|
649
649
|
<xsl:when test="../@type = 'alphabet'">
|
650
650
|
<xsl:number format="1)"/>
|
@@ -652,7 +652,7 @@
|
|
652
652
|
<xsl:when test="ancestor::*[un:annex]">
|
653
653
|
<xsl:choose>
|
654
654
|
<xsl:when test="$level = 1">
|
655
|
-
<xsl:number format="a)"/>
|
655
|
+
<xsl:number format="a)" lang="en"/>
|
656
656
|
</xsl:when>
|
657
657
|
<xsl:when test="$level = 2">
|
658
658
|
<xsl:number format="i)"/>
|
@@ -1420,6 +1420,7 @@
|
|
1420
1420
|
|
1421
1421
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1422
1422
|
|
1423
|
+
|
1423
1424
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1424
1425
|
|
1425
1426
|
|
@@ -1427,6 +1428,7 @@
|
|
1427
1428
|
|
1428
1429
|
|
1429
1430
|
|
1431
|
+
|
1430
1432
|
</xsl:attribute-set><xsl:attribute-set name="quote-source-style">
|
1431
1433
|
|
1432
1434
|
|
@@ -1556,187 +1558,233 @@
|
|
1556
1558
|
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
1557
1559
|
<!-- <xsl:call-template name="add-zero-spaces"/> -->
|
1558
1560
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1559
|
-
</xsl:template><xsl:template match="*[local-name()='table']">
|
1561
|
+
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1560
1562
|
|
1561
|
-
<xsl:variable name="
|
1562
|
-
<xsl:call-template name="getSimpleTable"/>
|
1563
|
-
</xsl:variable>
|
1563
|
+
<xsl:variable name="table">
|
1564
1564
|
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
<!-- <xsl:if test="$namespace = 'bipm'">
|
1570
|
-
<fo:block> </fo:block>
|
1571
|
-
</xsl:if> -->
|
1572
|
-
|
1573
|
-
<!-- $namespace = 'iso' or -->
|
1574
|
-
|
1575
|
-
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
<xsl:call-template name="fn_name_display"/>
|
1565
|
+
<xsl:variable name="simple-table">
|
1566
|
+
<xsl:call-template name="getSimpleTable"/>
|
1567
|
+
</xsl:variable>
|
1580
1568
|
|
1581
1569
|
|
1582
|
-
|
1583
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1584
|
-
|
1585
|
-
<!-- <xsl:variable name="cols-count">
|
1586
|
-
<xsl:choose>
|
1587
|
-
<xsl:when test="*[local-name()='thead']">
|
1588
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1589
|
-
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1590
|
-
</xsl:call-template>
|
1591
|
-
</xsl:when>
|
1592
|
-
<xsl:otherwise>
|
1593
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1594
|
-
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1595
|
-
</xsl:call-template>
|
1596
|
-
</xsl:otherwise>
|
1597
|
-
</xsl:choose>
|
1598
|
-
</xsl:variable> -->
|
1599
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1600
|
-
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
<xsl:variable name="colwidths">
|
1605
|
-
<xsl:call-template name="calculate-column-widths">
|
1606
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1607
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
1608
|
-
</xsl:call-template>
|
1609
|
-
</xsl:variable>
|
1610
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1611
|
-
|
1612
|
-
<!-- <xsl:variable name="colwidths2">
|
1613
|
-
<xsl:call-template name="calculate-column-widths">
|
1614
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1615
|
-
</xsl:call-template>
|
1616
|
-
</xsl:variable> -->
|
1617
|
-
|
1618
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1619
|
-
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1620
|
-
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1621
|
-
|
1622
|
-
<xsl:variable name="margin-left">
|
1623
|
-
<xsl:choose>
|
1624
|
-
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1625
|
-
<xsl:otherwise>0</xsl:otherwise>
|
1626
|
-
</xsl:choose>
|
1627
|
-
</xsl:variable>
|
1628
|
-
|
1629
|
-
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1630
1570
|
|
1631
1571
|
|
1632
|
-
|
1633
1572
|
|
1634
|
-
|
1635
|
-
<
|
1636
|
-
|
1637
|
-
</xsl:if>
|
1638
|
-
|
1639
|
-
|
1573
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1574
|
+
<fo:block> </fo:block>
|
1575
|
+
</xsl:if> -->
|
1640
1576
|
|
1577
|
+
<!-- $namespace = 'iso' or -->
|
1641
1578
|
|
1642
|
-
|
1579
|
+
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1580
|
+
|
1581
|
+
|
1582
|
+
|
1583
|
+
<xsl:call-template name="fn_name_display"/>
|
1584
|
+
|
1585
|
+
|
1586
|
+
|
1587
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1588
|
+
|
1589
|
+
<!-- <xsl:variable name="cols-count">
|
1590
|
+
<xsl:choose>
|
1591
|
+
<xsl:when test="*[local-name()='thead']">
|
1592
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1593
|
+
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1594
|
+
</xsl:call-template>
|
1595
|
+
</xsl:when>
|
1596
|
+
<xsl:otherwise>
|
1597
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1598
|
+
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1599
|
+
</xsl:call-template>
|
1600
|
+
</xsl:otherwise>
|
1601
|
+
</xsl:choose>
|
1602
|
+
</xsl:variable> -->
|
1603
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1604
|
+
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1643
1605
|
|
1644
1606
|
|
1645
1607
|
|
1608
|
+
<xsl:variable name="colwidths">
|
1609
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1610
|
+
<xsl:call-template name="calculate-column-widths">
|
1611
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1612
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1613
|
+
</xsl:call-template>
|
1614
|
+
</xsl:if>
|
1615
|
+
</xsl:variable>
|
1616
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1646
1617
|
|
1618
|
+
<!-- <xsl:variable name="colwidths2">
|
1619
|
+
<xsl:call-template name="calculate-column-widths">
|
1620
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1621
|
+
</xsl:call-template>
|
1622
|
+
</xsl:variable> -->
|
1647
1623
|
|
1624
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1625
|
+
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1626
|
+
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1648
1627
|
|
1628
|
+
<xsl:variable name="margin-left">
|
1629
|
+
<xsl:choose>
|
1630
|
+
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1631
|
+
<xsl:otherwise>0</xsl:otherwise>
|
1632
|
+
</xsl:choose>
|
1633
|
+
</xsl:variable>
|
1649
1634
|
|
1650
|
-
<
|
1651
|
-
<attribute name="table-layout">fixed</attribute>
|
1652
|
-
<attribute name="width">100%</attribute>
|
1653
|
-
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1654
|
-
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1635
|
+
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1655
1636
|
|
1656
1637
|
|
1638
|
+
|
1657
1639
|
|
1640
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
1641
|
+
<xsl:if test="not(ancestor::*[local-name()='sections'])">
|
1642
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1643
|
+
</xsl:if>
|
1644
|
+
|
1645
|
+
|
1658
1646
|
|
1659
|
-
|
1660
1647
|
|
1661
|
-
|
1662
|
-
<attribute name="border-top">1.5pt solid black</attribute>
|
1663
|
-
<attribute name="border-bottom">1.5pt solid black</attribute>
|
1664
|
-
</xsl:if>
|
1665
|
-
|
1666
|
-
|
1648
|
+
|
1667
1649
|
|
1668
|
-
|
1669
1650
|
|
1670
|
-
</xsl:variable>
|
1671
|
-
|
1672
|
-
|
1673
|
-
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1674
1651
|
|
1675
|
-
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1676
|
-
<xsl:attribute name="{@name}">
|
1677
|
-
<xsl:value-of select="."/>
|
1678
|
-
</xsl:attribute>
|
1679
|
-
</xsl:for-each>
|
1680
1652
|
|
1681
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1682
|
-
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1683
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1684
|
-
</xsl:if>
|
1685
1653
|
|
1686
|
-
|
1654
|
+
|
1655
|
+
<xsl:variable name="table_width">
|
1656
|
+
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1657
|
+
|
1658
|
+
|
1659
|
+
|
1660
|
+
<xsl:choose>
|
1661
|
+
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
1662
|
+
<xsl:otherwise>100%</xsl:otherwise>
|
1663
|
+
</xsl:choose>
|
1664
|
+
|
1665
|
+
</xsl:variable>
|
1666
|
+
|
1667
|
+
<xsl:variable name="table_attributes">
|
1668
|
+
<attribute name="table-layout">fixed</attribute>
|
1669
|
+
<attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
|
1670
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1671
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1672
|
+
|
1673
|
+
|
1674
|
+
|
1675
|
+
|
1676
|
+
|
1677
|
+
|
1678
|
+
<xsl:if test="ancestor::*[local-name()='sections']">
|
1679
|
+
<attribute name="border-top">1.5pt solid black</attribute>
|
1680
|
+
<attribute name="border-bottom">1.5pt solid black</attribute>
|
1681
|
+
</xsl:if>
|
1682
|
+
|
1683
|
+
|
1684
|
+
|
1685
|
+
|
1686
|
+
|
1687
|
+
</xsl:variable>
|
1688
|
+
|
1689
|
+
|
1690
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1691
|
+
|
1692
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1693
|
+
<xsl:attribute name="{@name}">
|
1694
|
+
<xsl:value-of select="."/>
|
1695
|
+
</xsl:attribute>
|
1696
|
+
</xsl:for-each>
|
1697
|
+
|
1698
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1699
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1700
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1701
|
+
</xsl:if>
|
1702
|
+
|
1687
1703
|
<xsl:choose>
|
1688
|
-
<xsl:when test="
|
1689
|
-
<
|
1704
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1705
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1706
|
+
<fo:table-column column-width="{@width}"/>
|
1707
|
+
</xsl:for-each>
|
1690
1708
|
</xsl:when>
|
1691
1709
|
<xsl:otherwise>
|
1692
|
-
<
|
1710
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1711
|
+
<xsl:choose>
|
1712
|
+
<xsl:when test=". = 1 or . = 0">
|
1713
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1714
|
+
</xsl:when>
|
1715
|
+
<xsl:otherwise>
|
1716
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1717
|
+
</xsl:otherwise>
|
1718
|
+
</xsl:choose>
|
1719
|
+
</xsl:for-each>
|
1693
1720
|
</xsl:otherwise>
|
1694
1721
|
</xsl:choose>
|
1695
|
-
|
1696
|
-
|
1697
|
-
<xsl:choose>
|
1698
|
-
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1699
|
-
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1700
|
-
</xsl:when>
|
1701
|
-
<xsl:otherwise>
|
1702
|
-
<xsl:apply-templates/>
|
1703
|
-
</xsl:otherwise>
|
1704
|
-
</xsl:choose>
|
1705
|
-
|
1706
|
-
</fo:table>
|
1707
|
-
|
1708
|
-
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1709
|
-
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1710
|
-
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1711
|
-
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1712
|
-
</xsl:call-template>
|
1713
|
-
</xsl:for-each>
|
1714
|
-
|
1715
|
-
<!-- insert footer as table -->
|
1716
|
-
<!-- <fo:table>
|
1717
|
-
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1718
|
-
<xsl:attribute name="{@name}">
|
1719
|
-
<xsl:value-of select="."/>
|
1720
|
-
</xsl:attribute>
|
1721
|
-
</xsl:for-each>
|
1722
|
-
|
1723
|
-
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1722
|
+
|
1724
1723
|
<xsl:choose>
|
1725
|
-
<xsl:when test="
|
1726
|
-
<
|
1724
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1725
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1727
1726
|
</xsl:when>
|
1728
1727
|
<xsl:otherwise>
|
1729
|
-
<
|
1728
|
+
<xsl:apply-templates/>
|
1730
1729
|
</xsl:otherwise>
|
1731
1730
|
</xsl:choose>
|
1731
|
+
|
1732
|
+
</fo:table>
|
1733
|
+
|
1734
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1735
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1736
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1737
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1738
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1739
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1740
|
+
</xsl:call-template>
|
1732
1741
|
</xsl:for-each>
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1742
|
+
|
1743
|
+
<!-- insert footer as table -->
|
1744
|
+
<!-- <fo:table>
|
1745
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1746
|
+
<xsl:attribute name="{@name}">
|
1747
|
+
<xsl:value-of select="."/>
|
1748
|
+
</xsl:attribute>
|
1749
|
+
</xsl:for-each>
|
1750
|
+
|
1751
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1752
|
+
<xsl:choose>
|
1753
|
+
<xsl:when test=". = 1 or . = 0">
|
1754
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1755
|
+
</xsl:when>
|
1756
|
+
<xsl:otherwise>
|
1757
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1758
|
+
</xsl:otherwise>
|
1759
|
+
</xsl:choose>
|
1760
|
+
</xsl:for-each>
|
1761
|
+
</fo:table>-->
|
1762
|
+
|
1763
|
+
|
1764
|
+
|
1765
|
+
|
1766
|
+
|
1767
|
+
</fo:block-container>
|
1768
|
+
</xsl:variable>
|
1769
|
+
|
1770
|
+
|
1771
|
+
|
1772
|
+
<xsl:choose>
|
1773
|
+
<xsl:when test="@width">
|
1774
|
+
|
1775
|
+
<!-- centered table when table name is centered (see table-name-style) -->
|
1776
|
+
|
1777
|
+
|
1778
|
+
|
1779
|
+
<xsl:copy-of select="$table"/>
|
1780
|
+
|
1781
|
+
|
1782
|
+
</xsl:when>
|
1783
|
+
<xsl:otherwise>
|
1784
|
+
<xsl:copy-of select="$table"/>
|
1785
|
+
</xsl:otherwise>
|
1786
|
+
</xsl:choose>
|
1787
|
+
|
1740
1788
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1741
1789
|
<xsl:if test="normalize-space() != ''">
|
1742
1790
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -1962,12 +2010,22 @@
|
|
1962
2010
|
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1963
2011
|
<xsl:param name="table_attributes"/>
|
1964
2012
|
<xsl:param name="colwidths"/>
|
2013
|
+
<xsl:param name="colgroup"/>
|
1965
2014
|
|
1966
2015
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1967
2016
|
|
1968
2017
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1969
2018
|
|
1970
|
-
<xsl:variable name="cols-count"
|
2019
|
+
<xsl:variable name="cols-count">
|
2020
|
+
<xsl:choose>
|
2021
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2022
|
+
<xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
|
2023
|
+
</xsl:when>
|
2024
|
+
<xsl:otherwise>
|
2025
|
+
<xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
|
2026
|
+
</xsl:otherwise>
|
2027
|
+
</xsl:choose>
|
2028
|
+
</xsl:variable>
|
1971
2029
|
|
1972
2030
|
<fo:table keep-with-previous="always">
|
1973
2031
|
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
@@ -1985,16 +2043,25 @@
|
|
1985
2043
|
</xsl:choose>
|
1986
2044
|
</xsl:for-each>
|
1987
2045
|
|
1988
|
-
<xsl:
|
1989
|
-
<xsl:
|
1990
|
-
<xsl:
|
1991
|
-
<fo:table-column column-width="
|
1992
|
-
</xsl:
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
2046
|
+
<xsl:choose>
|
2047
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2048
|
+
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2049
|
+
<fo:table-column column-width="{@width}"/>
|
2050
|
+
</xsl:for-each>
|
2051
|
+
</xsl:when>
|
2052
|
+
<xsl:otherwise>
|
2053
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2054
|
+
<xsl:choose>
|
2055
|
+
<xsl:when test=". = 1 or . = 0">
|
2056
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2057
|
+
</xsl:when>
|
2058
|
+
<xsl:otherwise>
|
2059
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2060
|
+
</xsl:otherwise>
|
2061
|
+
</xsl:choose>
|
2062
|
+
</xsl:for-each>
|
2063
|
+
</xsl:otherwise>
|
2064
|
+
</xsl:choose>
|
1998
2065
|
|
1999
2066
|
<fo:table-body>
|
2000
2067
|
<fo:table-row>
|
@@ -2428,7 +2495,9 @@
|
|
2428
2495
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2429
2496
|
<fo:block-container>
|
2430
2497
|
|
2431
|
-
<xsl:
|
2498
|
+
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
2499
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2500
|
+
</xsl:if>
|
2432
2501
|
|
2433
2502
|
|
2434
2503
|
<xsl:if test="parent::*[local-name() = 'note']">
|
@@ -2443,6 +2512,7 @@
|
|
2443
2512
|
<fo:block-container>
|
2444
2513
|
|
2445
2514
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2515
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2446
2516
|
|
2447
2517
|
|
2448
2518
|
<xsl:variable name="parent" select="local-name(..)"/>
|
@@ -2559,7 +2629,7 @@
|
|
2559
2629
|
<xsl:with-param name="table" select="$html-table"/>
|
2560
2630
|
</xsl:call-template>
|
2561
2631
|
</xsl:variable>
|
2562
|
-
<!-- colwidths=<xsl:
|
2632
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2563
2633
|
<xsl:variable name="maxlength_dt">
|
2564
2634
|
<xsl:call-template name="getMaxLength_dt"/>
|
2565
2635
|
</xsl:variable>
|
@@ -2588,13 +2658,22 @@
|
|
2588
2658
|
</xsl:when>
|
2589
2659
|
<xsl:otherwise>
|
2590
2660
|
<xsl:choose>
|
2661
|
+
<!-- to set width check most wide chars like `W` -->
|
2591
2662
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
2592
|
-
<fo:table-column column-width="
|
2593
|
-
<fo:table-column column-width="
|
2663
|
+
<fo:table-column column-width="7%"/>
|
2664
|
+
<fo:table-column column-width="93%"/>
|
2665
|
+
</xsl:when>
|
2666
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like ABC, etc -->
|
2667
|
+
<fo:table-column column-width="15%"/>
|
2668
|
+
<fo:table-column column-width="85%"/>
|
2669
|
+
</xsl:when>
|
2670
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 7"> <!-- if dt contains short text like ABCDEF, etc -->
|
2671
|
+
<fo:table-column column-width="20%"/>
|
2672
|
+
<fo:table-column column-width="80%"/>
|
2594
2673
|
</xsl:when>
|
2595
|
-
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <=
|
2596
|
-
<fo:table-column column-width="
|
2597
|
-
<fo:table-column column-width="
|
2674
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
|
2675
|
+
<fo:table-column column-width="25%"/>
|
2676
|
+
<fo:table-column column-width="75%"/>
|
2598
2677
|
</xsl:when>
|
2599
2678
|
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
2600
2679
|
<fo:table-column column-width="60%"/>
|
@@ -2626,12 +2705,32 @@
|
|
2626
2705
|
</xsl:otherwise>
|
2627
2706
|
</xsl:choose>
|
2628
2707
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
2629
|
-
<xsl:
|
2630
|
-
<xsl:
|
2631
|
-
|
2632
|
-
<xsl:
|
2633
|
-
|
2634
|
-
|
2708
|
+
<xsl:variable name="lengths">
|
2709
|
+
<xsl:for-each select="*[local-name()='dt']">
|
2710
|
+
<xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
|
2711
|
+
<xsl:variable name="attributes">
|
2712
|
+
<xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
|
2713
|
+
<xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
|
2714
|
+
</xsl:variable>
|
2715
|
+
<length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
|
2716
|
+
</xsl:for-each>
|
2717
|
+
</xsl:variable>
|
2718
|
+
<xsl:variable name="maxLength">
|
2719
|
+
<!-- <xsl:for-each select="*[local-name()='dt']">
|
2720
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
2721
|
+
<xsl:if test="position() = 1">
|
2722
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
2723
|
+
</xsl:if>
|
2724
|
+
</xsl:for-each> -->
|
2725
|
+
<xsl:for-each select="xalan:nodeset($lengths)/length">
|
2726
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2727
|
+
<xsl:if test="position() = 1">
|
2728
|
+
<xsl:value-of select="."/>
|
2729
|
+
</xsl:if>
|
2730
|
+
</xsl:for-each>
|
2731
|
+
</xsl:variable>
|
2732
|
+
<!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
|
2733
|
+
<xsl:value-of select="$maxLength"/>
|
2635
2734
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
2636
2735
|
<xsl:param name="key_iso"/>
|
2637
2736
|
|
@@ -2770,6 +2869,7 @@
|
|
2770
2869
|
|
2771
2870
|
|
2772
2871
|
|
2872
|
+
|
2773
2873
|
|
2774
2874
|
</xsl:variable>
|
2775
2875
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -2783,6 +2883,10 @@
|
|
2783
2883
|
</xsl:if>
|
2784
2884
|
<xsl:apply-templates/>
|
2785
2885
|
</fo:inline>
|
2886
|
+
</xsl:template><xsl:template match="*[local-name()='underline']">
|
2887
|
+
<fo:inline text-decoration="underline">
|
2888
|
+
<xsl:apply-templates/>
|
2889
|
+
</fo:inline>
|
2786
2890
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2787
2891
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
2788
2892
|
<xsl:apply-templates/>
|
@@ -2876,6 +2980,10 @@
|
|
2876
2980
|
<xsl:param name="text" select="."/>
|
2877
2981
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2878
2982
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
2983
|
+
</xsl:template><xsl:template name="add-zero-spaces-link-java">
|
2984
|
+
<xsl:param name="text" select="."/>
|
2985
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2986
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
|
2879
2987
|
</xsl:template><xsl:template name="add-zero-spaces">
|
2880
2988
|
<xsl:param name="text" select="."/>
|
2881
2989
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
@@ -3136,6 +3244,11 @@
|
|
3136
3244
|
<!-- replace start and end spaces to non-break space -->
|
3137
3245
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3138
3246
|
</xsl:copy>
|
3247
|
+
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3248
|
+
<xsl:copy>
|
3249
|
+
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3250
|
+
</xsl:copy>
|
3251
|
+
<mathml:mspace width="0.5ex"/>
|
3139
3252
|
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
3140
3253
|
<xsl:variable name="target">
|
3141
3254
|
<xsl:choose>
|
@@ -3157,7 +3270,10 @@
|
|
3157
3270
|
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
3158
3271
|
<xsl:choose>
|
3159
3272
|
<xsl:when test="normalize-space(.) = ''">
|
3160
|
-
<xsl:value-of select="$target"/>
|
3273
|
+
<!-- <xsl:value-of select="$target"/> -->
|
3274
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
3275
|
+
<xsl:with-param name="text" select="$target"/>
|
3276
|
+
</xsl:call-template>
|
3161
3277
|
</xsl:when>
|
3162
3278
|
<xsl:otherwise>
|
3163
3279
|
<xsl:apply-templates/>
|
@@ -3376,7 +3492,7 @@
|
|
3376
3492
|
</xsl:if> -->
|
3377
3493
|
</fo:inline>
|
3378
3494
|
</xsl:if>
|
3379
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3495
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3380
3496
|
<fo:block-container id="{@id}">
|
3381
3497
|
|
3382
3498
|
<fo:block>
|
@@ -3450,6 +3566,8 @@
|
|
3450
3566
|
<xsl:variable name="bookmark-title_">
|
3451
3567
|
<xsl:call-template name="getLangVersion">
|
3452
3568
|
<xsl:with-param name="lang" select="@lang"/>
|
3569
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3570
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3453
3571
|
</xsl:call-template>
|
3454
3572
|
</xsl:variable>
|
3455
3573
|
<xsl:choose>
|
@@ -3467,13 +3585,34 @@
|
|
3467
3585
|
</xsl:choose>
|
3468
3586
|
</fo:bookmark-title>
|
3469
3587
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3588
|
+
|
3589
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3590
|
+
<xsl:with-param name="contents" select="contents"/>
|
3591
|
+
</xsl:call-template>
|
3592
|
+
|
3593
|
+
<xsl:call-template name="insertTableBookmarks">
|
3594
|
+
<xsl:with-param name="contents" select="contents"/>
|
3595
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3596
|
+
</xsl:call-template>
|
3597
|
+
|
3470
3598
|
</fo:bookmark>
|
3471
3599
|
|
3472
3600
|
</xsl:for-each>
|
3473
3601
|
</xsl:when>
|
3474
3602
|
<xsl:otherwise>
|
3475
3603
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3604
|
+
|
3476
3605
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3606
|
+
|
3607
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3608
|
+
<xsl:with-param name="contents" select="contents"/>
|
3609
|
+
</xsl:call-template>
|
3610
|
+
|
3611
|
+
<xsl:call-template name="insertTableBookmarks">
|
3612
|
+
<xsl:with-param name="contents" select="contents"/>
|
3613
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3614
|
+
</xsl:call-template>
|
3615
|
+
|
3477
3616
|
</xsl:for-each>
|
3478
3617
|
</xsl:otherwise>
|
3479
3618
|
</xsl:choose>
|
@@ -3492,8 +3631,44 @@
|
|
3492
3631
|
|
3493
3632
|
</fo:bookmark-tree>
|
3494
3633
|
</xsl:if>
|
3634
|
+
</xsl:template><xsl:template name="insertFigureBookmarks">
|
3635
|
+
<xsl:param name="contents"/>
|
3636
|
+
<xsl:if test="xalan:nodeset($contents)/figure">
|
3637
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
|
3638
|
+
<fo:bookmark-title>Figures</fo:bookmark-title>
|
3639
|
+
<xsl:for-each select="xalan:nodeset($contents)/figure">
|
3640
|
+
<fo:bookmark internal-destination="{@id}">
|
3641
|
+
<fo:bookmark-title>
|
3642
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3643
|
+
</fo:bookmark-title>
|
3644
|
+
</fo:bookmark>
|
3645
|
+
</xsl:for-each>
|
3646
|
+
</fo:bookmark>
|
3647
|
+
</xsl:if>
|
3648
|
+
</xsl:template><xsl:template name="insertTableBookmarks">
|
3649
|
+
<xsl:param name="contents"/>
|
3650
|
+
<xsl:param name="lang"/>
|
3651
|
+
<xsl:if test="xalan:nodeset($contents)/table">
|
3652
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
|
3653
|
+
<fo:bookmark-title>
|
3654
|
+
<xsl:choose>
|
3655
|
+
<xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
|
3656
|
+
<xsl:otherwise>Tables</xsl:otherwise>
|
3657
|
+
</xsl:choose>
|
3658
|
+
</fo:bookmark-title>
|
3659
|
+
<xsl:for-each select="xalan:nodeset($contents)/table">
|
3660
|
+
<fo:bookmark internal-destination="{@id}">
|
3661
|
+
<fo:bookmark-title>
|
3662
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3663
|
+
</fo:bookmark-title>
|
3664
|
+
</fo:bookmark>
|
3665
|
+
</xsl:for-each>
|
3666
|
+
</fo:bookmark>
|
3667
|
+
</xsl:if>
|
3495
3668
|
</xsl:template><xsl:template name="getLangVersion">
|
3496
3669
|
<xsl:param name="lang"/>
|
3670
|
+
<xsl:param name="doctype" select="''"/>
|
3671
|
+
<xsl:param name="title" select="''"/>
|
3497
3672
|
<xsl:choose>
|
3498
3673
|
<xsl:when test="$lang = 'en'">
|
3499
3674
|
|
@@ -3529,6 +3704,12 @@
|
|
3529
3704
|
<!-- <xsl:text> </xsl:text> -->
|
3530
3705
|
</xsl:template><xsl:template name="getSection">
|
3531
3706
|
<xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3707
|
+
<!--
|
3708
|
+
<xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
|
3709
|
+
<xsl:value-of select="."/>
|
3710
|
+
</xsl:for-each>
|
3711
|
+
-->
|
3712
|
+
|
3532
3713
|
</xsl:template><xsl:template name="getName">
|
3533
3714
|
<xsl:choose>
|
3534
3715
|
<xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
|
@@ -3581,6 +3762,12 @@
|
|
3581
3762
|
<xsl:copy>
|
3582
3763
|
<xsl:apply-templates mode="contents_item"/>
|
3583
3764
|
</xsl:copy>
|
3765
|
+
</xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
|
3766
|
+
<xsl:copy>
|
3767
|
+
<xsl:apply-templates mode="contents_item"/>
|
3768
|
+
</xsl:copy>
|
3769
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
|
3770
|
+
<xsl:copy-of select="."/>
|
3584
3771
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
3585
3772
|
<xsl:text> </xsl:text>
|
3586
3773
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -3606,6 +3793,7 @@
|
|
3606
3793
|
|
3607
3794
|
|
3608
3795
|
|
3796
|
+
|
3609
3797
|
|
3610
3798
|
|
3611
3799
|
|
@@ -3978,10 +4166,13 @@
|
|
3978
4166
|
</xsl:if>
|
3979
4167
|
</xsl:if>
|
3980
4168
|
|
4169
|
+
|
3981
4170
|
<fo:block-container margin-left="0mm">
|
3982
4171
|
|
3983
4172
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3984
|
-
<xsl:apply-templates select=".//*[local-name() = 'p']"/>
|
4173
|
+
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
4174
|
+
|
4175
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3985
4176
|
</fo:block>
|
3986
4177
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3987
4178
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -4134,6 +4325,7 @@
|
|
4134
4325
|
|
4135
4326
|
|
4136
4327
|
|
4328
|
+
|
4137
4329
|
|
4138
4330
|
|
4139
4331
|
|
@@ -4150,7 +4342,7 @@
|
|
4150
4342
|
|
4151
4343
|
|
4152
4344
|
|
4153
|
-
</xsl:template><xsl:template match="
|
4345
|
+
</xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
|
4154
4346
|
<fo:block break-after="page"/>
|
4155
4347
|
<fo:block>
|
4156
4348
|
<xsl:call-template name="setId"/>
|
@@ -4158,7 +4350,8 @@
|
|
4158
4350
|
</fo:block>
|
4159
4351
|
</xsl:template><xsl:template match="*[local-name() = 'clause']">
|
4160
4352
|
<fo:block>
|
4161
|
-
<xsl:call-template name="setId"/>
|
4353
|
+
<xsl:call-template name="setId"/>
|
4354
|
+
|
4162
4355
|
|
4163
4356
|
<xsl:apply-templates/>
|
4164
4357
|
</fo:block>
|
@@ -4228,7 +4421,8 @@
|
|
4228
4421
|
<fo:table-column column-width="107mm"/>
|
4229
4422
|
<fo:table-column column-width="15mm"/>
|
4230
4423
|
<fo:table-body>
|
4231
|
-
<fo:table-row
|
4424
|
+
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
|
4425
|
+
|
4232
4426
|
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
|
4233
4427
|
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
|
4234
4428
|
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
|
@@ -4246,6 +4440,10 @@
|
|
4246
4440
|
<fo:block><xsl:apply-templates/></fo:block>
|
4247
4441
|
</fo:table-cell>
|
4248
4442
|
</xsl:template><xsl:template name="processBibitem">
|
4443
|
+
|
4444
|
+
|
4445
|
+
<!-- end BIPM bibitem processing-->
|
4446
|
+
|
4249
4447
|
|
4250
4448
|
|
4251
4449
|
|
@@ -4304,6 +4502,8 @@
|
|
4304
4502
|
<xsl:value-of select="translate(.,'. ','')"/>
|
4305
4503
|
</xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
4306
4504
|
<xsl:value-of select="substring(.,1,1)"/>
|
4505
|
+
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4506
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4307
4507
|
</xsl:template><xsl:template name="convertDate">
|
4308
4508
|
<xsl:param name="date"/>
|
4309
4509
|
<xsl:param name="format" select="'short'"/>
|
@@ -4328,6 +4528,57 @@
|
|
4328
4528
|
</xsl:variable>
|
4329
4529
|
<xsl:variable name="result">
|
4330
4530
|
<xsl:choose>
|
4531
|
+
<xsl:when test="$format = 'ddMMyyyy'">
|
4532
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4533
|
+
<xsl:text> </xsl:text>
|
4534
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
|
4535
|
+
</xsl:when>
|
4536
|
+
<xsl:when test="$format = 'ddMM'">
|
4537
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4538
|
+
<xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
|
4539
|
+
</xsl:when>
|
4540
|
+
<xsl:when test="$format = 'short' or $day = ''">
|
4541
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4542
|
+
</xsl:when>
|
4543
|
+
<xsl:otherwise>
|
4544
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
|
4545
|
+
</xsl:otherwise>
|
4546
|
+
</xsl:choose>
|
4547
|
+
</xsl:variable>
|
4548
|
+
<xsl:value-of select="$result"/>
|
4549
|
+
</xsl:template><xsl:template name="convertDateLocalized">
|
4550
|
+
<xsl:param name="date"/>
|
4551
|
+
<xsl:param name="format" select="'short'"/>
|
4552
|
+
<xsl:variable name="year" select="substring($date, 1, 4)"/>
|
4553
|
+
<xsl:variable name="month" select="substring($date, 6, 2)"/>
|
4554
|
+
<xsl:variable name="day" select="substring($date, 9, 2)"/>
|
4555
|
+
<xsl:variable name="monthStr">
|
4556
|
+
<xsl:choose>
|
4557
|
+
<xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
|
4558
|
+
<xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
|
4559
|
+
<xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
|
4560
|
+
<xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
|
4561
|
+
<xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
|
4562
|
+
<xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
|
4563
|
+
<xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
|
4564
|
+
<xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
|
4565
|
+
<xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
|
4566
|
+
<xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
|
4567
|
+
<xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
|
4568
|
+
<xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
|
4569
|
+
</xsl:choose>
|
4570
|
+
</xsl:variable>
|
4571
|
+
<xsl:variable name="result">
|
4572
|
+
<xsl:choose>
|
4573
|
+
<xsl:when test="$format = 'ddMMyyyy'">
|
4574
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4575
|
+
<xsl:text> </xsl:text>
|
4576
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
|
4577
|
+
</xsl:when>
|
4578
|
+
<xsl:when test="$format = 'ddMM'">
|
4579
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4580
|
+
<xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
|
4581
|
+
</xsl:when>
|
4331
4582
|
<xsl:when test="$format = 'short' or $day = ''">
|
4332
4583
|
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4333
4584
|
</xsl:when>
|
@@ -4343,7 +4594,7 @@
|
|
4343
4594
|
<xsl:param name="charDelim" select="', '"/>
|
4344
4595
|
<xsl:choose>
|
4345
4596
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4346
|
-
<xsl:for-each select="
|
4597
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4347
4598
|
<xsl:sort data-type="text" order="ascending"/>
|
4348
4599
|
<xsl:call-template name="insertKeyword">
|
4349
4600
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -4352,7 +4603,7 @@
|
|
4352
4603
|
</xsl:for-each>
|
4353
4604
|
</xsl:when>
|
4354
4605
|
<xsl:otherwise>
|
4355
|
-
<xsl:for-each select="
|
4606
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4356
4607
|
<xsl:call-template name="insertKeyword">
|
4357
4608
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4358
4609
|
<xsl:with-param name="charDelim" select="$charDelim"/>
|
@@ -4369,6 +4620,9 @@
|
|
4369
4620
|
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4370
4621
|
</xsl:choose>
|
4371
4622
|
</xsl:template><xsl:template name="addPDFUAmeta">
|
4623
|
+
<xsl:variable name="lang">
|
4624
|
+
<xsl:call-template name="getLang"/>
|
4625
|
+
</xsl:variable>
|
4372
4626
|
<fo:declarations>
|
4373
4627
|
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4374
4628
|
<pdf:dictionary type="normal" key="ViewerPreferences">
|
@@ -4381,13 +4635,16 @@
|
|
4381
4635
|
<!-- Dublin Core properties go here -->
|
4382
4636
|
<dc:title>
|
4383
4637
|
<xsl:variable name="title">
|
4384
|
-
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4638
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4639
|
+
|
4640
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
|
4641
|
+
|
4642
|
+
|
4643
|
+
|
4644
|
+
|
4645
|
+
|
4646
|
+
|
4647
|
+
</xsl:for-each>
|
4391
4648
|
</xsl:variable>
|
4392
4649
|
<xsl:choose>
|
4393
4650
|
<xsl:when test="normalize-space($title) != ''">
|
@@ -4399,17 +4656,21 @@
|
|
4399
4656
|
</xsl:choose>
|
4400
4657
|
</dc:title>
|
4401
4658
|
<dc:creator>
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4659
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4660
|
+
|
4661
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4662
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4663
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
4664
|
+
</xsl:for-each>
|
4408
4665
|
|
4409
4666
|
|
4410
4667
|
|
4411
|
-
|
4668
|
+
</xsl:for-each>
|
4669
|
+
</dc:creator>
|
4670
|
+
<dc:description>
|
4671
|
+
<xsl:variable name="abstract">
|
4412
4672
|
|
4673
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4413
4674
|
|
4414
4675
|
|
4415
4676
|
</xsl:variable>
|
@@ -4522,6 +4783,7 @@
|
|
4522
4783
|
|
4523
4784
|
|
4524
4785
|
|
4786
|
+
|
4525
4787
|
</xsl:variable>
|
4526
4788
|
<xsl:if test="$documentNS != $XSLNS">
|
4527
4789
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4581,6 +4843,11 @@
|
|
4581
4843
|
<xsl:call-template name="getLang"/>
|
4582
4844
|
</xsl:variable>
|
4583
4845
|
|
4584
|
-
<xsl:
|
4846
|
+
<xsl:choose>
|
4847
|
+
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4848
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4849
|
+
</xsl:when>
|
4850
|
+
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4851
|
+
</xsl:choose>
|
4585
4852
|
|
4586
4853
|
</xsl:template></xsl:stylesheet>
|