metanorma-un 0.5.15 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -4
- data/lib/asciidoctor/un/biblio.rng +5 -6
- data/lib/asciidoctor/un/isodoc.rng +305 -4
- data/lib/isodoc/un/html/htmlstyle.css +7 -0
- data/lib/isodoc/un/html_convert.rb +0 -1
- data/lib/isodoc/un/un.plenary-attachment.xsl +470 -60
- data/lib/isodoc/un/un.plenary.xsl +470 -60
- data/lib/isodoc/un/un.recommendation.xsl +475 -65
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +6 -6
- metadata +27 -27
@@ -5,6 +5,7 @@
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
6
|
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
8
9
|
|
9
10
|
|
10
11
|
|
@@ -1325,6 +1326,9 @@
|
|
1325
1326
|
<title-continued lang="en">(continued)</title-continued>
|
1326
1327
|
<title-continued lang="fr">(continué)</title-continued>
|
1327
1328
|
|
1329
|
+
</xsl:variable><xsl:variable name="bibdata">
|
1330
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
1331
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
1328
1332
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1329
1333
|
<xsl:param name="name"/>
|
1330
1334
|
<xsl:param name="lang"/>
|
@@ -1350,10 +1354,12 @@
|
|
1350
1354
|
</xsl:choose>
|
1351
1355
|
</xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'
'"/><xsl:attribute-set name="root-style">
|
1352
1356
|
|
1357
|
+
|
1353
1358
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1354
1359
|
|
1355
1360
|
|
1356
1361
|
|
1362
|
+
|
1357
1363
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
1358
1364
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1359
1365
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -1467,6 +1473,7 @@
|
|
1467
1473
|
|
1468
1474
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
1469
1475
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1476
|
+
|
1470
1477
|
|
1471
1478
|
|
1472
1479
|
|
@@ -1498,6 +1505,7 @@
|
|
1498
1505
|
|
1499
1506
|
|
1500
1507
|
|
1508
|
+
|
1501
1509
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1502
1510
|
|
1503
1511
|
|
@@ -1509,6 +1517,7 @@
|
|
1509
1517
|
|
1510
1518
|
|
1511
1519
|
|
1520
|
+
|
1512
1521
|
|
1513
1522
|
|
1514
1523
|
|
@@ -1534,6 +1543,7 @@
|
|
1534
1543
|
|
1535
1544
|
|
1536
1545
|
|
1546
|
+
|
1537
1547
|
<xsl:attribute name="padding-right">4mm</xsl:attribute>
|
1538
1548
|
|
1539
1549
|
|
@@ -1558,11 +1568,13 @@
|
|
1558
1568
|
|
1559
1569
|
|
1560
1570
|
|
1571
|
+
|
1561
1572
|
|
1562
1573
|
<xsl:attribute name="margin-top">4pt</xsl:attribute>
|
1563
1574
|
|
1564
1575
|
|
1565
1576
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1577
|
+
|
1566
1578
|
|
1567
1579
|
|
1568
1580
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
@@ -1583,6 +1595,7 @@
|
|
1583
1595
|
|
1584
1596
|
|
1585
1597
|
|
1598
|
+
|
1586
1599
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
1587
1600
|
|
1588
1601
|
|
@@ -1591,6 +1604,7 @@
|
|
1591
1604
|
|
1592
1605
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1593
1606
|
|
1607
|
+
|
1594
1608
|
|
1595
1609
|
|
1596
1610
|
|
@@ -1619,6 +1633,7 @@
|
|
1619
1633
|
|
1620
1634
|
|
1621
1635
|
|
1636
|
+
|
1622
1637
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1623
1638
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1624
1639
|
<xsl:attribute name="border">2pt solid black</xsl:attribute>
|
@@ -1630,6 +1645,7 @@
|
|
1630
1645
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
1631
1646
|
|
1632
1647
|
|
1648
|
+
|
1633
1649
|
<xsl:attribute name="width">100%</xsl:attribute>
|
1634
1650
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
1635
1651
|
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
@@ -1653,13 +1669,32 @@
|
|
1653
1669
|
|
1654
1670
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1655
1671
|
|
1656
|
-
|
1672
|
+
|
1657
1673
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1658
1674
|
|
1659
1675
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
1660
1676
|
|
1661
1677
|
|
1662
|
-
|
1678
|
+
|
1679
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1680
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1681
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
1682
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1683
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1684
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
1685
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
1686
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
1687
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
1688
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
1689
|
+
<xsl:text>red</xsl:text>
|
1690
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
1691
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
1692
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1693
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
1694
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1695
|
+
|
1696
|
+
|
1697
|
+
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1663
1698
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1664
1699
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1665
1700
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -1704,16 +1739,17 @@
|
|
1704
1739
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1705
1740
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1706
1741
|
|
1742
|
+
<xsl:variable name="table-preamble">
|
1743
|
+
|
1744
|
+
|
1745
|
+
</xsl:variable>
|
1746
|
+
|
1707
1747
|
<xsl:variable name="table">
|
1708
1748
|
|
1709
1749
|
<xsl:variable name="simple-table">
|
1710
1750
|
<xsl:call-template name="getSimpleTable"/>
|
1711
1751
|
</xsl:variable>
|
1712
1752
|
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
1753
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1718
1754
|
<fo:block> </fo:block>
|
1719
1755
|
</xsl:if> -->
|
@@ -1728,7 +1764,7 @@
|
|
1728
1764
|
|
1729
1765
|
|
1730
1766
|
|
1731
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
1767
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
1732
1768
|
|
1733
1769
|
<!-- <xsl:variable name="cols-count">
|
1734
1770
|
<xsl:choose>
|
@@ -1747,8 +1783,6 @@
|
|
1747
1783
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1748
1784
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1749
1785
|
|
1750
|
-
|
1751
|
-
|
1752
1786
|
<xsl:variable name="colwidths">
|
1753
1787
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1754
1788
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1776,9 +1810,11 @@
|
|
1776
1810
|
</xsl:choose>
|
1777
1811
|
</xsl:variable>
|
1778
1812
|
|
1813
|
+
|
1779
1814
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1780
1815
|
|
1781
1816
|
|
1817
|
+
|
1782
1818
|
|
1783
1819
|
|
1784
1820
|
|
@@ -1794,6 +1830,8 @@
|
|
1794
1830
|
|
1795
1831
|
|
1796
1832
|
|
1833
|
+
|
1834
|
+
|
1797
1835
|
<xsl:variable name="table_width">
|
1798
1836
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1799
1837
|
|
@@ -1815,6 +1853,8 @@
|
|
1815
1853
|
|
1816
1854
|
|
1817
1855
|
|
1856
|
+
|
1857
|
+
|
1818
1858
|
|
1819
1859
|
|
1820
1860
|
|
@@ -1906,7 +1946,8 @@
|
|
1906
1946
|
</fo:block-container>
|
1907
1947
|
</xsl:variable>
|
1908
1948
|
|
1909
|
-
|
1949
|
+
<xsl:variable name="isAdded" select="@added"/>
|
1950
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
1910
1951
|
|
1911
1952
|
<xsl:choose>
|
1912
1953
|
<xsl:when test="@width">
|
@@ -1915,21 +1956,62 @@
|
|
1915
1956
|
|
1916
1957
|
|
1917
1958
|
|
1918
|
-
<xsl:
|
1959
|
+
<xsl:choose>
|
1960
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1961
|
+
<xsl:copy-of select="$table-preamble"/>
|
1962
|
+
<fo:block>
|
1963
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1964
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1965
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1966
|
+
</xsl:call-template>
|
1967
|
+
<xsl:copy-of select="$table"/>
|
1968
|
+
</fo:block>
|
1969
|
+
</xsl:when>
|
1970
|
+
<xsl:otherwise>
|
1971
|
+
<xsl:copy-of select="$table-preamble"/>
|
1972
|
+
<xsl:copy-of select="$table"/>
|
1973
|
+
</xsl:otherwise>
|
1974
|
+
</xsl:choose>
|
1919
1975
|
|
1920
1976
|
|
1921
1977
|
</xsl:when>
|
1922
1978
|
<xsl:otherwise>
|
1923
|
-
<xsl:
|
1979
|
+
<xsl:choose>
|
1980
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1981
|
+
<xsl:copy-of select="$table-preamble"/>
|
1982
|
+
<fo:block>
|
1983
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1984
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1985
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1986
|
+
</xsl:call-template>
|
1987
|
+
<xsl:copy-of select="$table"/>
|
1988
|
+
</fo:block>
|
1989
|
+
</xsl:when>
|
1990
|
+
<xsl:otherwise>
|
1991
|
+
<xsl:copy-of select="$table-preamble"/>
|
1992
|
+
<xsl:copy-of select="$table"/>
|
1993
|
+
</xsl:otherwise>
|
1994
|
+
</xsl:choose>
|
1924
1995
|
</xsl:otherwise>
|
1925
1996
|
</xsl:choose>
|
1926
1997
|
|
1927
1998
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1999
|
+
<xsl:param name="continued"/>
|
1928
2000
|
<xsl:if test="normalize-space() != ''">
|
1929
2001
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1930
2002
|
|
1931
2003
|
|
1932
|
-
<xsl:
|
2004
|
+
<xsl:choose>
|
2005
|
+
<xsl:when test="$continued = 'true'">
|
2006
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
2007
|
+
|
2008
|
+
</xsl:when>
|
2009
|
+
<xsl:otherwise>
|
2010
|
+
<xsl:apply-templates/>
|
2011
|
+
</xsl:otherwise>
|
2012
|
+
</xsl:choose>
|
2013
|
+
|
2014
|
+
|
1933
2015
|
</fo:block>
|
1934
2016
|
</xsl:if>
|
1935
2017
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -1981,7 +2063,7 @@
|
|
1981
2063
|
</xsl:for-each>
|
1982
2064
|
</xsl:when>
|
1983
2065
|
<xsl:otherwise>
|
1984
|
-
<xsl:for-each select="xalan:nodeset($table)
|
2066
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
1985
2067
|
<xsl:variable name="td_text">
|
1986
2068
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1987
2069
|
|
@@ -2069,18 +2151,18 @@
|
|
2069
2151
|
<xsl:apply-templates/>
|
2070
2152
|
</fo:table-header>
|
2071
2153
|
</xsl:template><xsl:template name="table-header-title">
|
2072
|
-
<xsl:param name="cols-count"/>
|
2154
|
+
<xsl:param name="cols-count"/>
|
2073
2155
|
<!-- row for title -->
|
2074
2156
|
<fo:table-row>
|
2075
2157
|
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
|
2076
|
-
|
2158
|
+
|
2159
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
2160
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
2161
|
+
</xsl:apply-templates>
|
2077
2162
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
2078
2163
|
<xsl:call-template name="fn_name_display"/>
|
2079
|
-
</xsl:for-each>
|
2080
|
-
|
2081
|
-
<xsl:text> </xsl:text>
|
2082
|
-
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
2083
|
-
</fo:block>
|
2164
|
+
</xsl:for-each>
|
2165
|
+
|
2084
2166
|
</fo:table-cell>
|
2085
2167
|
</fo:table-row>
|
2086
2168
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -2301,6 +2383,7 @@
|
|
2301
2383
|
|
2302
2384
|
|
2303
2385
|
|
2386
|
+
|
2304
2387
|
</xsl:if>
|
2305
2388
|
<xsl:if test="$parent-name = 'tfoot'">
|
2306
2389
|
|
@@ -2325,7 +2408,8 @@
|
|
2325
2408
|
<xsl:attribute name="text-align">
|
2326
2409
|
<xsl:choose>
|
2327
2410
|
<xsl:when test="@align">
|
2328
|
-
<xsl:
|
2411
|
+
<xsl:call-template name="setAlignment"/>
|
2412
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2329
2413
|
</xsl:when>
|
2330
2414
|
<xsl:otherwise>center</xsl:otherwise>
|
2331
2415
|
</xsl:choose>
|
@@ -2339,6 +2423,7 @@
|
|
2339
2423
|
|
2340
2424
|
|
2341
2425
|
|
2426
|
+
|
2342
2427
|
<xsl:attribute name="display-align">center</xsl:attribute>
|
2343
2428
|
<xsl:attribute name="font-style">italic</xsl:attribute>
|
2344
2429
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
@@ -2351,6 +2436,9 @@
|
|
2351
2436
|
|
2352
2437
|
|
2353
2438
|
|
2439
|
+
<xsl:if test="$lang = 'ar'">
|
2440
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2441
|
+
</xsl:if>
|
2354
2442
|
<xsl:if test="@colspan">
|
2355
2443
|
<xsl:attribute name="number-columns-spanned">
|
2356
2444
|
<xsl:value-of select="@colspan"/>
|
@@ -2382,11 +2470,16 @@
|
|
2382
2470
|
<xsl:attribute name="text-align">
|
2383
2471
|
<xsl:choose>
|
2384
2472
|
<xsl:when test="@align">
|
2385
|
-
<xsl:
|
2473
|
+
<xsl:call-template name="setAlignment"/>
|
2474
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2386
2475
|
</xsl:when>
|
2387
2476
|
<xsl:otherwise>left</xsl:otherwise>
|
2388
2477
|
</xsl:choose>
|
2389
2478
|
</xsl:attribute>
|
2479
|
+
<xsl:if test="$lang = 'ar'">
|
2480
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2481
|
+
</xsl:if>
|
2482
|
+
|
2390
2483
|
|
2391
2484
|
|
2392
2485
|
|
@@ -2406,6 +2499,9 @@
|
|
2406
2499
|
|
2407
2500
|
|
2408
2501
|
|
2502
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
2503
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2504
|
+
</xsl:if>
|
2409
2505
|
<xsl:if test="@colspan">
|
2410
2506
|
<xsl:attribute name="number-columns-spanned">
|
2411
2507
|
<xsl:value-of select="@colspan"/>
|
@@ -2543,13 +2639,13 @@
|
|
2543
2639
|
</xsl:choose>
|
2544
2640
|
</xsl:variable>
|
2545
2641
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2546
|
-
<xsl:element name="{$ns}:table">
|
2642
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2547
2643
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2548
2644
|
<tbody>
|
2549
2645
|
<xsl:apply-templates mode="dl"/>
|
2550
2646
|
</tbody>
|
2551
2647
|
</xsl:for-each>
|
2552
|
-
</xsl:element>
|
2648
|
+
<!-- </xsl:element> -->
|
2553
2649
|
</xsl:variable>
|
2554
2650
|
|
2555
2651
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2640,6 +2736,8 @@
|
|
2640
2736
|
<xsl:apply-templates/>
|
2641
2737
|
</fo:inline>
|
2642
2738
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2739
|
+
<xsl:variable name="isAdded" select="@added"/>
|
2740
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2643
2741
|
<fo:block-container>
|
2644
2742
|
|
2645
2743
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -2656,6 +2754,12 @@
|
|
2656
2754
|
</xsl:attribute>
|
2657
2755
|
|
2658
2756
|
</xsl:if>
|
2757
|
+
|
2758
|
+
<xsl:call-template name="setTrackChangesStyles">
|
2759
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
2760
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
2761
|
+
</xsl:call-template>
|
2762
|
+
|
2659
2763
|
<fo:block-container>
|
2660
2764
|
|
2661
2765
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -2763,11 +2867,11 @@
|
|
2763
2867
|
</xsl:choose>
|
2764
2868
|
</xsl:variable>
|
2765
2869
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2766
|
-
<xsl:element name="{$ns}:table">
|
2870
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2767
2871
|
<tbody>
|
2768
2872
|
<xsl:apply-templates mode="dl"/>
|
2769
2873
|
</tbody>
|
2770
|
-
</xsl:element>
|
2874
|
+
<!-- </xsl:element> -->
|
2771
2875
|
</xsl:variable>
|
2772
2876
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
2773
2877
|
<xsl:variable name="colwidths">
|
@@ -3017,6 +3121,7 @@
|
|
3017
3121
|
|
3018
3122
|
|
3019
3123
|
|
3124
|
+
|
3020
3125
|
|
3021
3126
|
</xsl:variable>
|
3022
3127
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -3034,8 +3139,74 @@
|
|
3034
3139
|
<fo:inline text-decoration="underline">
|
3035
3140
|
<xsl:apply-templates/>
|
3036
3141
|
</fo:inline>
|
3142
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
3143
|
+
<xsl:choose>
|
3144
|
+
<xsl:when test="@amendment">
|
3145
|
+
<fo:inline>
|
3146
|
+
<xsl:call-template name="insertTag">
|
3147
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
3148
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
3149
|
+
</xsl:call-template>
|
3150
|
+
<xsl:apply-templates/>
|
3151
|
+
<xsl:call-template name="insertTag">
|
3152
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
3153
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
3154
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
3155
|
+
</xsl:call-template>
|
3156
|
+
</fo:inline>
|
3157
|
+
</xsl:when>
|
3158
|
+
<xsl:when test="@corrigenda">
|
3159
|
+
<fo:inline>
|
3160
|
+
<xsl:call-template name="insertTag">
|
3161
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
3162
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
3163
|
+
</xsl:call-template>
|
3164
|
+
<xsl:apply-templates/>
|
3165
|
+
<xsl:call-template name="insertTag">
|
3166
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
3167
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
3168
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
3169
|
+
</xsl:call-template>
|
3170
|
+
</fo:inline>
|
3171
|
+
</xsl:when>
|
3172
|
+
<xsl:otherwise>
|
3173
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
3174
|
+
<xsl:apply-templates/>
|
3175
|
+
</fo:inline>
|
3176
|
+
</xsl:otherwise>
|
3177
|
+
</xsl:choose>
|
3178
|
+
|
3179
|
+
</xsl:template><xsl:template name="insertTag">
|
3180
|
+
<xsl:param name="type"/>
|
3181
|
+
<xsl:param name="kind"/>
|
3182
|
+
<xsl:param name="value"/>
|
3183
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
3184
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
3185
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
3186
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
3187
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
3188
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
3189
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
3190
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3191
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3192
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
3193
|
+
<g>
|
3194
|
+
<xsl:if test="$type = 'closing'">
|
3195
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
3196
|
+
</xsl:if>
|
3197
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
3198
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
3199
|
+
</g>
|
3200
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
3201
|
+
<xsl:if test="$type = 'closing'">
|
3202
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
3203
|
+
</xsl:if>
|
3204
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
3205
|
+
</text>
|
3206
|
+
</svg>
|
3207
|
+
</fo:instream-foreign-object>
|
3037
3208
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
3038
|
-
<fo:inline
|
3209
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
3039
3210
|
<xsl:apply-templates/>
|
3040
3211
|
</fo:inline>
|
3041
3212
|
</xsl:template><xsl:template match="*[local-name()='hi']">
|
@@ -3332,11 +3503,15 @@
|
|
3332
3503
|
</xsl:apply-templates>
|
3333
3504
|
</xsl:template><xsl:template name="getLang">
|
3334
3505
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3506
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3335
3507
|
<xsl:variable name="language">
|
3336
3508
|
<xsl:choose>
|
3337
3509
|
<xsl:when test="$language_current != ''">
|
3338
3510
|
<xsl:value-of select="$language_current"/>
|
3339
3511
|
</xsl:when>
|
3512
|
+
<xsl:when test="$language_current_2 != ''">
|
3513
|
+
<xsl:value-of select="$language_current_2"/>
|
3514
|
+
</xsl:when>
|
3340
3515
|
<xsl:otherwise>
|
3341
3516
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3342
3517
|
</xsl:otherwise>
|
@@ -3376,13 +3551,23 @@
|
|
3376
3551
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
3377
3552
|
<xsl:value-of select="substring($str, 2)"/>
|
3378
3553
|
</xsl:template><xsl:template match="mathml:math">
|
3379
|
-
<
|
3554
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3555
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3556
|
+
|
3557
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
3558
|
+
|
3559
|
+
|
3560
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3561
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3562
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3563
|
+
</xsl:call-template>
|
3380
3564
|
|
3381
3565
|
<xsl:variable name="mathml">
|
3382
3566
|
<xsl:apply-templates select="." mode="mathml"/>
|
3383
3567
|
</xsl:variable>
|
3384
3568
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3385
3569
|
|
3570
|
+
|
3386
3571
|
<!-- <xsl:copy-of select="."/> -->
|
3387
3572
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3388
3573
|
</fo:instream-foreign-object>
|
@@ -3548,6 +3733,7 @@
|
|
3548
3733
|
|
3549
3734
|
|
3550
3735
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3736
|
+
|
3551
3737
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3552
3738
|
</fo:inline>
|
3553
3739
|
<xsl:apply-templates/>
|
@@ -3574,6 +3760,7 @@
|
|
3574
3760
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
3575
3761
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
3576
3762
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
3763
|
+
|
3577
3764
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3578
3765
|
</fo:inline>
|
3579
3766
|
<xsl:apply-templates/>
|
@@ -3639,8 +3826,15 @@
|
|
3639
3826
|
</fo:inline>
|
3640
3827
|
</xsl:if>
|
3641
3828
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3829
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3830
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3642
3831
|
<fo:block-container id="{@id}">
|
3643
3832
|
|
3833
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3834
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3835
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3836
|
+
</xsl:call-template>
|
3837
|
+
|
3644
3838
|
<fo:block>
|
3645
3839
|
<xsl:apply-templates/>
|
3646
3840
|
</fo:block>
|
@@ -3648,7 +3842,10 @@
|
|
3648
3842
|
<xsl:for-each select="*[local-name() = 'note']">
|
3649
3843
|
<xsl:call-template name="note"/>
|
3650
3844
|
</xsl:for-each>
|
3651
|
-
|
3845
|
+
|
3846
|
+
|
3847
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3848
|
+
|
3652
3849
|
</fo:block-container>
|
3653
3850
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
3654
3851
|
<fo:block id="{@id}">
|
@@ -3660,37 +3857,122 @@
|
|
3660
3857
|
<xsl:apply-templates/>
|
3661
3858
|
</fo:block>
|
3662
3859
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3663
|
-
<
|
3664
|
-
|
3665
|
-
|
3666
|
-
<xsl:
|
3667
|
-
<
|
3668
|
-
<xsl:
|
3669
|
-
<xsl:
|
3670
|
-
</xsl:
|
3671
|
-
<
|
3672
|
-
|
3673
|
-
|
3674
|
-
|
3675
|
-
|
3676
|
-
|
3677
|
-
|
3678
|
-
|
3860
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
3861
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
3862
|
+
<xsl:choose>
|
3863
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3864
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3865
|
+
<xsl:variable name="src">
|
3866
|
+
<xsl:call-template name="image_src"/>
|
3867
|
+
</xsl:variable>
|
3868
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3869
|
+
</fo:inline>
|
3870
|
+
</xsl:when>
|
3871
|
+
<xsl:otherwise>
|
3872
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3873
|
+
|
3874
|
+
<xsl:variable name="src">
|
3875
|
+
<xsl:call-template name="image_src"/>
|
3876
|
+
</xsl:variable>
|
3877
|
+
|
3878
|
+
<xsl:choose>
|
3879
|
+
<xsl:when test="$isDeleted = 'true'">
|
3880
|
+
<!-- enclose in svg -->
|
3881
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
3882
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3883
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3884
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3885
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3886
|
+
|
3887
|
+
|
3888
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
3889
|
+
|
3890
|
+
</fo:instream-foreign-object>
|
3891
|
+
</xsl:when>
|
3892
|
+
<xsl:otherwise>
|
3893
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3894
|
+
</xsl:otherwise>
|
3895
|
+
</xsl:choose>
|
3896
|
+
|
3897
|
+
</fo:block>
|
3898
|
+
</xsl:otherwise>
|
3899
|
+
</xsl:choose>
|
3900
|
+
</xsl:template><xsl:template name="image_src">
|
3901
|
+
<xsl:choose>
|
3902
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3903
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3904
|
+
</xsl:when>
|
3905
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3906
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3907
|
+
</xsl:when>
|
3908
|
+
<xsl:otherwise>
|
3909
|
+
<xsl:value-of select="@src"/>
|
3910
|
+
</xsl:otherwise>
|
3911
|
+
</xsl:choose>
|
3912
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
3913
|
+
<xsl:choose>
|
3914
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3915
|
+
<xsl:variable name="src">
|
3916
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3917
|
+
</xsl:variable>
|
3918
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
3919
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
3920
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3921
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3922
|
+
</svg>
|
3923
|
+
</xsl:when>
|
3924
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3925
|
+
<xsl:variable name="src">
|
3926
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3927
|
+
</xsl:variable>
|
3928
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
3929
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
3930
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3931
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3932
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3933
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3934
|
+
</svg>
|
3935
|
+
</xsl:when>
|
3936
|
+
<xsl:otherwise>
|
3937
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
3938
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
3939
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
3940
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
3941
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
3942
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3943
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
3944
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3945
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
3946
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3947
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
3948
|
+
<xsl:call-template name="svg_cross">
|
3949
|
+
<xsl:with-param name="width" select="$width"/>
|
3950
|
+
<xsl:with-param name="height" select="$height"/>
|
3951
|
+
</xsl:call-template>
|
3952
|
+
</svg>
|
3953
|
+
</xsl:otherwise>
|
3954
|
+
</xsl:choose>
|
3955
|
+
|
3956
|
+
</xsl:template><xsl:template name="svg_cross">
|
3957
|
+
<xsl:param name="width"/>
|
3958
|
+
<xsl:param name="height"/>
|
3959
|
+
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3960
|
+
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3679
3961
|
</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">
|
3680
3962
|
<xsl:apply-templates mode="contents"/>
|
3681
3963
|
<xsl:text> </xsl:text>
|
3682
3964
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
3683
3965
|
<xsl:apply-templates mode="bookmarks"/>
|
3684
3966
|
<xsl:text> </xsl:text>
|
3685
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3967
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3686
3968
|
<xsl:value-of select="."/>
|
3687
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3969
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3688
3970
|
<xsl:value-of select="."/>
|
3689
3971
|
</xsl:template><xsl:template match="node()" mode="contents">
|
3690
3972
|
<xsl:apply-templates mode="contents"/>
|
3691
3973
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3692
3974
|
<xsl:apply-templates mode="bookmarks"/>
|
3693
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3975
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
3694
3976
|
<xsl:apply-templates select="."/>
|
3695
3977
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3696
3978
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -3889,6 +4171,8 @@
|
|
3889
4171
|
</fo:list-item-body>
|
3890
4172
|
</fo:list-item>
|
3891
4173
|
</fo:list-block>
|
4174
|
+
</xsl:template><xsl:template name="extractSection">
|
4175
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3892
4176
|
</xsl:template><xsl:template name="extractTitle">
|
3893
4177
|
<xsl:choose>
|
3894
4178
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -3936,6 +4220,7 @@
|
|
3936
4220
|
|
3937
4221
|
|
3938
4222
|
|
4223
|
+
|
3939
4224
|
|
3940
4225
|
|
3941
4226
|
|
@@ -4218,6 +4503,7 @@
|
|
4218
4503
|
<xsl:variable name="element">
|
4219
4504
|
block
|
4220
4505
|
|
4506
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
4221
4507
|
</xsl:variable>
|
4222
4508
|
<xsl:choose>
|
4223
4509
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -4225,7 +4511,7 @@
|
|
4225
4511
|
<xsl:apply-templates/>
|
4226
4512
|
</fo:inline>
|
4227
4513
|
</xsl:when>
|
4228
|
-
<xsl:when test="normalize-space($element)
|
4514
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
4229
4515
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
4230
4516
|
<xsl:apply-templates/>
|
4231
4517
|
</fo:block>
|
@@ -4262,7 +4548,7 @@
|
|
4262
4548
|
</fo:inline>
|
4263
4549
|
</xsl:otherwise>
|
4264
4550
|
</xsl:choose>
|
4265
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
4551
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
4266
4552
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
4267
4553
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
4268
4554
|
<xsl:variable name="termsource_text">
|
@@ -4271,13 +4557,15 @@
|
|
4271
4557
|
|
4272
4558
|
<xsl:choose>
|
4273
4559
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4274
|
-
<xsl:apply-templates/>
|
4560
|
+
<!-- <xsl:apply-templates /> -->
|
4561
|
+
<xsl:copy-of select="$termsource_text"/>
|
4275
4562
|
</xsl:when>
|
4276
4563
|
<xsl:otherwise>
|
4277
4564
|
|
4278
4565
|
<xsl:text>[</xsl:text>
|
4279
4566
|
|
4280
|
-
<xsl:apply-templates/>
|
4567
|
+
<!-- <xsl:apply-templates /> -->
|
4568
|
+
<xsl:copy-of select="$termsource_text"/>
|
4281
4569
|
|
4282
4570
|
<xsl:text>]</xsl:text>
|
4283
4571
|
|
@@ -4288,8 +4576,15 @@
|
|
4288
4576
|
<xsl:if test="normalize-space() != ''">
|
4289
4577
|
<xsl:value-of select="."/>
|
4290
4578
|
</xsl:if>
|
4291
|
-
</xsl:template><xsl:
|
4579
|
+
</xsl:template><xsl:variable name="localized.source">
|
4580
|
+
<xsl:call-template name="getLocalizedString">
|
4581
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
4582
|
+
</xsl:call-template>
|
4583
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
4292
4584
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4585
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4586
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4587
|
+
</xsl:if>
|
4293
4588
|
|
4294
4589
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4295
4590
|
<xsl:apply-templates/>
|
@@ -4438,7 +4733,8 @@
|
|
4438
4733
|
</fo:inline>
|
4439
4734
|
</xsl:when>
|
4440
4735
|
<xsl:otherwise>
|
4441
|
-
<
|
4736
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
4737
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
4442
4738
|
</xsl:otherwise>
|
4443
4739
|
</xsl:choose>
|
4444
4740
|
|
@@ -4497,7 +4793,6 @@
|
|
4497
4793
|
</xsl:if>
|
4498
4794
|
|
4499
4795
|
|
4500
|
-
|
4501
4796
|
<xsl:apply-templates/>
|
4502
4797
|
</fo:block>
|
4503
4798
|
|
@@ -4545,7 +4840,7 @@
|
|
4545
4840
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
4546
4841
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
4547
4842
|
<xsl:choose>
|
4548
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
4843
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
4549
4844
|
<fo:block-container>
|
4550
4845
|
<xsl:attribute name="margin-left">
|
4551
4846
|
<xsl:choose>
|
@@ -4555,6 +4850,7 @@
|
|
4555
4850
|
</xsl:attribute>
|
4556
4851
|
|
4557
4852
|
|
4853
|
+
|
4558
4854
|
<fo:block-container margin-left="0mm">
|
4559
4855
|
<fo:block>
|
4560
4856
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -4713,8 +5009,8 @@
|
|
4713
5009
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4714
5010
|
<xsl:apply-templates/>
|
4715
5011
|
</fo:block>
|
4716
|
-
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
4717
|
-
<fo:inline id="{@id}"/>
|
5012
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
5013
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4718
5014
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4719
5015
|
<!-- <row>
|
4720
5016
|
<date>05-07-2013</date>
|
@@ -4756,6 +5052,10 @@
|
|
4756
5052
|
|
4757
5053
|
|
4758
5054
|
|
5055
|
+
|
5056
|
+
|
5057
|
+
|
5058
|
+
|
4759
5059
|
</xsl:template><xsl:template name="processBibitemDocId">
|
4760
5060
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
4761
5061
|
<xsl:choose>
|
@@ -4812,6 +5112,70 @@
|
|
4812
5112
|
<xsl:value-of select="substring(.,1,1)"/>
|
4813
5113
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4814
5114
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5115
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
5116
|
+
<fo:block>
|
5117
|
+
<xsl:apply-templates/>
|
5118
|
+
</fo:block>
|
5119
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
5120
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
5121
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
5122
|
+
<fo:inline>
|
5123
|
+
<xsl:call-template name="text_input"/>
|
5124
|
+
</fo:inline>
|
5125
|
+
</xsl:template><xsl:template name="text_input">
|
5126
|
+
<xsl:variable name="count">
|
5127
|
+
<xsl:choose>
|
5128
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
5129
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
5130
|
+
<xsl:otherwise>10</xsl:otherwise>
|
5131
|
+
</xsl:choose>
|
5132
|
+
</xsl:variable>
|
5133
|
+
<xsl:call-template name="repeat">
|
5134
|
+
<xsl:with-param name="char" select="'_'"/>
|
5135
|
+
<xsl:with-param name="count" select="$count"/>
|
5136
|
+
</xsl:call-template>
|
5137
|
+
<xsl:text> </xsl:text>
|
5138
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
5139
|
+
<xsl:variable name="caption">
|
5140
|
+
<xsl:choose>
|
5141
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
5142
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
5143
|
+
</xsl:choose>
|
5144
|
+
</xsl:variable>
|
5145
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
5146
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
5147
|
+
<fo:inline padding-right="1mm">
|
5148
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5149
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5150
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5151
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5152
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5153
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5154
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
5155
|
+
</svg>
|
5156
|
+
</fo:instream-foreign-object>
|
5157
|
+
</fo:inline>
|
5158
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
5159
|
+
<fo:inline padding-right="1mm">
|
5160
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5161
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5162
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5163
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5164
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5165
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5166
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
5167
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
5168
|
+
</svg>
|
5169
|
+
</fo:instream-foreign-object>
|
5170
|
+
</fo:inline>
|
5171
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
5172
|
+
<fo:inline>
|
5173
|
+
<xsl:call-template name="text_input"/>
|
5174
|
+
</fo:inline>
|
5175
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
5176
|
+
<fo:block-container border="1pt solid black" width="50%">
|
5177
|
+
<fo:block> </fo:block>
|
5178
|
+
</fo:block-container>
|
4815
5179
|
</xsl:template><xsl:template name="convertDate">
|
4816
5180
|
<xsl:param name="date"/>
|
4817
5181
|
<xsl:param name="format" select="'short'"/>
|
@@ -5077,6 +5441,7 @@
|
|
5077
5441
|
|
5078
5442
|
|
5079
5443
|
|
5444
|
+
|
5080
5445
|
<xsl:value-of select="document('')//*/namespace::un"/>
|
5081
5446
|
|
5082
5447
|
|
@@ -5143,17 +5508,62 @@
|
|
5143
5508
|
</xsl:call-template>
|
5144
5509
|
</xsl:if>
|
5145
5510
|
</xsl:template><xsl:template name="getLocalizedString">
|
5146
|
-
<xsl:param name="key"/>
|
5511
|
+
<xsl:param name="key"/>
|
5147
5512
|
|
5148
5513
|
<xsl:variable name="curr_lang">
|
5149
5514
|
<xsl:call-template name="getLang"/>
|
5150
5515
|
</xsl:variable>
|
5151
5516
|
|
5517
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5518
|
+
|
5152
5519
|
<xsl:choose>
|
5520
|
+
<xsl:when test="$data_value != ''">
|
5521
|
+
<xsl:value-of select="$data_value"/>
|
5522
|
+
</xsl:when>
|
5153
5523
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5154
5524
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5155
5525
|
</xsl:when>
|
5156
5526
|
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
5157
5527
|
</xsl:choose>
|
5158
5528
|
|
5529
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5530
|
+
<xsl:param name="isAdded"/>
|
5531
|
+
<xsl:param name="isDeleted"/>
|
5532
|
+
<xsl:choose>
|
5533
|
+
<xsl:when test="local-name() = 'math'">
|
5534
|
+
<xsl:if test="$isAdded = 'true'">
|
5535
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
5536
|
+
</xsl:if>
|
5537
|
+
<xsl:if test="$isDeleted = 'true'">
|
5538
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
5539
|
+
</xsl:if>
|
5540
|
+
</xsl:when>
|
5541
|
+
<xsl:otherwise>
|
5542
|
+
<xsl:if test="$isAdded = 'true'">
|
5543
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
5544
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5545
|
+
</xsl:if>
|
5546
|
+
<xsl:if test="$isDeleted = 'true'">
|
5547
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
5548
|
+
<xsl:if test="local-name() = 'table'">
|
5549
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
5550
|
+
</xsl:if>
|
5551
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
5552
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5553
|
+
</xsl:if>
|
5554
|
+
</xsl:otherwise>
|
5555
|
+
</xsl:choose>
|
5556
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
5557
|
+
<xsl:if test="$lang = 'ar'">
|
5558
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
5559
|
+
</xsl:if>
|
5560
|
+
</xsl:template><xsl:template name="setAlignment">
|
5561
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
5562
|
+
<xsl:choose>
|
5563
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
5564
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
5565
|
+
<xsl:when test="$align != ''">
|
5566
|
+
<xsl:value-of select="$align"/>
|
5567
|
+
</xsl:when>
|
5568
|
+
</xsl:choose>
|
5159
5569
|
</xsl:template></xsl:stylesheet>
|