metanorma-un 0.5.15 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
|
@@ -1184,6 +1185,9 @@
|
|
1184
1185
|
<title-continued lang="en">(continued)</title-continued>
|
1185
1186
|
<title-continued lang="fr">(continué)</title-continued>
|
1186
1187
|
|
1188
|
+
</xsl:variable><xsl:variable name="bibdata">
|
1189
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
1190
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
1187
1191
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1188
1192
|
<xsl:param name="name"/>
|
1189
1193
|
<xsl:param name="lang"/>
|
@@ -1209,10 +1213,12 @@
|
|
1209
1213
|
</xsl:choose>
|
1210
1214
|
</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">
|
1211
1215
|
|
1216
|
+
|
1212
1217
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1213
1218
|
|
1214
1219
|
|
1215
1220
|
|
1221
|
+
|
1216
1222
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
1217
1223
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1218
1224
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -1326,6 +1332,7 @@
|
|
1326
1332
|
|
1327
1333
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
1328
1334
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1335
|
+
|
1329
1336
|
|
1330
1337
|
|
1331
1338
|
|
@@ -1357,6 +1364,7 @@
|
|
1357
1364
|
|
1358
1365
|
|
1359
1366
|
|
1367
|
+
|
1360
1368
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1361
1369
|
|
1362
1370
|
|
@@ -1366,6 +1374,7 @@
|
|
1366
1374
|
|
1367
1375
|
|
1368
1376
|
|
1377
|
+
|
1369
1378
|
|
1370
1379
|
|
1371
1380
|
|
@@ -1394,6 +1403,7 @@
|
|
1394
1403
|
|
1395
1404
|
|
1396
1405
|
|
1406
|
+
|
1397
1407
|
</xsl:attribute-set><xsl:attribute-set name="note-p-style">
|
1398
1408
|
|
1399
1409
|
|
@@ -1418,11 +1428,13 @@
|
|
1418
1428
|
|
1419
1429
|
|
1420
1430
|
|
1431
|
+
|
1421
1432
|
|
1422
1433
|
<xsl:attribute name="margin-top">4pt</xsl:attribute>
|
1423
1434
|
|
1424
1435
|
|
1425
1436
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1437
|
+
|
1426
1438
|
|
1427
1439
|
|
1428
1440
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
@@ -1443,6 +1455,7 @@
|
|
1443
1455
|
|
1444
1456
|
|
1445
1457
|
|
1458
|
+
|
1446
1459
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
1447
1460
|
|
1448
1461
|
|
@@ -1451,6 +1464,7 @@
|
|
1451
1464
|
|
1452
1465
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1453
1466
|
|
1467
|
+
|
1454
1468
|
|
1455
1469
|
|
1456
1470
|
|
@@ -1482,6 +1496,7 @@
|
|
1482
1496
|
|
1483
1497
|
|
1484
1498
|
|
1499
|
+
|
1485
1500
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1486
1501
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1487
1502
|
|
@@ -1490,6 +1505,7 @@
|
|
1490
1505
|
|
1491
1506
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
1492
1507
|
|
1508
|
+
|
1493
1509
|
<xsl:attribute name="width">100%</xsl:attribute>
|
1494
1510
|
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
1495
1511
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -1513,13 +1529,32 @@
|
|
1513
1529
|
|
1514
1530
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1515
1531
|
|
1516
|
-
|
1532
|
+
|
1517
1533
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1518
1534
|
|
1519
1535
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
1520
1536
|
|
1521
1537
|
|
1522
|
-
|
1538
|
+
|
1539
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1540
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1541
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
1542
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1543
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1544
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
1545
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
1546
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
1547
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
1548
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
1549
|
+
<xsl:text>red</xsl:text>
|
1550
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
1551
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
1552
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1553
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
1554
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1555
|
+
|
1556
|
+
|
1557
|
+
</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">
|
1523
1558
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1524
1559
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1525
1560
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -1564,16 +1599,17 @@
|
|
1564
1599
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1565
1600
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1566
1601
|
|
1602
|
+
<xsl:variable name="table-preamble">
|
1603
|
+
|
1604
|
+
|
1605
|
+
</xsl:variable>
|
1606
|
+
|
1567
1607
|
<xsl:variable name="table">
|
1568
1608
|
|
1569
1609
|
<xsl:variable name="simple-table">
|
1570
1610
|
<xsl:call-template name="getSimpleTable"/>
|
1571
1611
|
</xsl:variable>
|
1572
1612
|
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
1613
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1578
1614
|
<fo:block> </fo:block>
|
1579
1615
|
</xsl:if> -->
|
@@ -1588,7 +1624,7 @@
|
|
1588
1624
|
|
1589
1625
|
|
1590
1626
|
|
1591
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
1627
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
1592
1628
|
|
1593
1629
|
<!-- <xsl:variable name="cols-count">
|
1594
1630
|
<xsl:choose>
|
@@ -1607,8 +1643,6 @@
|
|
1607
1643
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1608
1644
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1609
1645
|
|
1610
|
-
|
1611
|
-
|
1612
1646
|
<xsl:variable name="colwidths">
|
1613
1647
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1614
1648
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1636,9 +1670,11 @@
|
|
1636
1670
|
</xsl:choose>
|
1637
1671
|
</xsl:variable>
|
1638
1672
|
|
1673
|
+
|
1639
1674
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1640
1675
|
|
1641
1676
|
|
1677
|
+
|
1642
1678
|
|
1643
1679
|
|
1644
1680
|
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
@@ -1656,6 +1692,8 @@
|
|
1656
1692
|
|
1657
1693
|
|
1658
1694
|
|
1695
|
+
|
1696
|
+
|
1659
1697
|
<xsl:variable name="table_width">
|
1660
1698
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1661
1699
|
|
@@ -1677,6 +1715,8 @@
|
|
1677
1715
|
|
1678
1716
|
|
1679
1717
|
|
1718
|
+
|
1719
|
+
|
1680
1720
|
|
1681
1721
|
|
1682
1722
|
<xsl:if test="ancestor::*[local-name()='sections']">
|
@@ -1771,7 +1811,8 @@
|
|
1771
1811
|
</fo:block-container>
|
1772
1812
|
</xsl:variable>
|
1773
1813
|
|
1774
|
-
|
1814
|
+
<xsl:variable name="isAdded" select="@added"/>
|
1815
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
1775
1816
|
|
1776
1817
|
<xsl:choose>
|
1777
1818
|
<xsl:when test="@width">
|
@@ -1780,21 +1821,62 @@
|
|
1780
1821
|
|
1781
1822
|
|
1782
1823
|
|
1783
|
-
<xsl:
|
1824
|
+
<xsl:choose>
|
1825
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1826
|
+
<xsl:copy-of select="$table-preamble"/>
|
1827
|
+
<fo:block>
|
1828
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1829
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1830
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1831
|
+
</xsl:call-template>
|
1832
|
+
<xsl:copy-of select="$table"/>
|
1833
|
+
</fo:block>
|
1834
|
+
</xsl:when>
|
1835
|
+
<xsl:otherwise>
|
1836
|
+
<xsl:copy-of select="$table-preamble"/>
|
1837
|
+
<xsl:copy-of select="$table"/>
|
1838
|
+
</xsl:otherwise>
|
1839
|
+
</xsl:choose>
|
1784
1840
|
|
1785
1841
|
|
1786
1842
|
</xsl:when>
|
1787
1843
|
<xsl:otherwise>
|
1788
|
-
<xsl:
|
1844
|
+
<xsl:choose>
|
1845
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1846
|
+
<xsl:copy-of select="$table-preamble"/>
|
1847
|
+
<fo:block>
|
1848
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1849
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1850
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1851
|
+
</xsl:call-template>
|
1852
|
+
<xsl:copy-of select="$table"/>
|
1853
|
+
</fo:block>
|
1854
|
+
</xsl:when>
|
1855
|
+
<xsl:otherwise>
|
1856
|
+
<xsl:copy-of select="$table-preamble"/>
|
1857
|
+
<xsl:copy-of select="$table"/>
|
1858
|
+
</xsl:otherwise>
|
1859
|
+
</xsl:choose>
|
1789
1860
|
</xsl:otherwise>
|
1790
1861
|
</xsl:choose>
|
1791
1862
|
|
1792
1863
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1864
|
+
<xsl:param name="continued"/>
|
1793
1865
|
<xsl:if test="normalize-space() != ''">
|
1794
1866
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1795
1867
|
|
1796
1868
|
|
1797
|
-
<xsl:
|
1869
|
+
<xsl:choose>
|
1870
|
+
<xsl:when test="$continued = 'true'">
|
1871
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
1872
|
+
|
1873
|
+
</xsl:when>
|
1874
|
+
<xsl:otherwise>
|
1875
|
+
<xsl:apply-templates/>
|
1876
|
+
</xsl:otherwise>
|
1877
|
+
</xsl:choose>
|
1878
|
+
|
1879
|
+
|
1798
1880
|
</fo:block>
|
1799
1881
|
</xsl:if>
|
1800
1882
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -1846,7 +1928,7 @@
|
|
1846
1928
|
</xsl:for-each>
|
1847
1929
|
</xsl:when>
|
1848
1930
|
<xsl:otherwise>
|
1849
|
-
<xsl:for-each select="xalan:nodeset($table)
|
1931
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
1850
1932
|
<xsl:variable name="td_text">
|
1851
1933
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1852
1934
|
|
@@ -1934,18 +2016,18 @@
|
|
1934
2016
|
<xsl:apply-templates/>
|
1935
2017
|
</fo:table-header>
|
1936
2018
|
</xsl:template><xsl:template name="table-header-title">
|
1937
|
-
<xsl:param name="cols-count"/>
|
2019
|
+
<xsl:param name="cols-count"/>
|
1938
2020
|
<!-- row for title -->
|
1939
2021
|
<fo:table-row>
|
1940
2022
|
<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">
|
1941
|
-
|
2023
|
+
|
2024
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
2025
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
2026
|
+
</xsl:apply-templates>
|
1942
2027
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
1943
2028
|
<xsl:call-template name="fn_name_display"/>
|
1944
|
-
</xsl:for-each>
|
1945
|
-
|
1946
|
-
<xsl:text> </xsl:text>
|
1947
|
-
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
1948
|
-
</fo:block>
|
2029
|
+
</xsl:for-each>
|
2030
|
+
|
1949
2031
|
</fo:table-cell>
|
1950
2032
|
</fo:table-row>
|
1951
2033
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -2166,6 +2248,7 @@
|
|
2166
2248
|
|
2167
2249
|
|
2168
2250
|
|
2251
|
+
|
2169
2252
|
</xsl:if>
|
2170
2253
|
<xsl:if test="$parent-name = 'tfoot'">
|
2171
2254
|
|
@@ -2186,7 +2269,8 @@
|
|
2186
2269
|
<xsl:attribute name="text-align">
|
2187
2270
|
<xsl:choose>
|
2188
2271
|
<xsl:when test="@align">
|
2189
|
-
<xsl:
|
2272
|
+
<xsl:call-template name="setAlignment"/>
|
2273
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2190
2274
|
</xsl:when>
|
2191
2275
|
<xsl:otherwise>center</xsl:otherwise>
|
2192
2276
|
</xsl:choose>
|
@@ -2198,6 +2282,7 @@
|
|
2198
2282
|
|
2199
2283
|
|
2200
2284
|
|
2285
|
+
|
2201
2286
|
|
2202
2287
|
<xsl:if test="ancestor::*[local-name()='sections']">
|
2203
2288
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
@@ -2218,6 +2303,9 @@
|
|
2218
2303
|
|
2219
2304
|
|
2220
2305
|
|
2306
|
+
<xsl:if test="$lang = 'ar'">
|
2307
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2308
|
+
</xsl:if>
|
2221
2309
|
<xsl:if test="@colspan">
|
2222
2310
|
<xsl:attribute name="number-columns-spanned">
|
2223
2311
|
<xsl:value-of select="@colspan"/>
|
@@ -2249,11 +2337,16 @@
|
|
2249
2337
|
<xsl:attribute name="text-align">
|
2250
2338
|
<xsl:choose>
|
2251
2339
|
<xsl:when test="@align">
|
2252
|
-
<xsl:
|
2340
|
+
<xsl:call-template name="setAlignment"/>
|
2341
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2253
2342
|
</xsl:when>
|
2254
2343
|
<xsl:otherwise>left</xsl:otherwise>
|
2255
2344
|
</xsl:choose>
|
2256
2345
|
</xsl:attribute>
|
2346
|
+
<xsl:if test="$lang = 'ar'">
|
2347
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2348
|
+
</xsl:if>
|
2349
|
+
|
2257
2350
|
|
2258
2351
|
|
2259
2352
|
|
@@ -2271,6 +2364,9 @@
|
|
2271
2364
|
|
2272
2365
|
|
2273
2366
|
|
2367
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
2368
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2369
|
+
</xsl:if>
|
2274
2370
|
<xsl:if test="@colspan">
|
2275
2371
|
<xsl:attribute name="number-columns-spanned">
|
2276
2372
|
<xsl:value-of select="@colspan"/>
|
@@ -2408,13 +2504,13 @@
|
|
2408
2504
|
</xsl:choose>
|
2409
2505
|
</xsl:variable>
|
2410
2506
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2411
|
-
<xsl:element name="{$ns}:table">
|
2507
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2412
2508
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2413
2509
|
<tbody>
|
2414
2510
|
<xsl:apply-templates mode="dl"/>
|
2415
2511
|
</tbody>
|
2416
2512
|
</xsl:for-each>
|
2417
|
-
</xsl:element>
|
2513
|
+
<!-- </xsl:element> -->
|
2418
2514
|
</xsl:variable>
|
2419
2515
|
|
2420
2516
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2505,6 +2601,8 @@
|
|
2505
2601
|
<xsl:apply-templates/>
|
2506
2602
|
</fo:inline>
|
2507
2603
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2604
|
+
<xsl:variable name="isAdded" select="@added"/>
|
2605
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2508
2606
|
<fo:block-container>
|
2509
2607
|
|
2510
2608
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -2521,6 +2619,12 @@
|
|
2521
2619
|
</xsl:attribute>
|
2522
2620
|
|
2523
2621
|
</xsl:if>
|
2622
|
+
|
2623
|
+
<xsl:call-template name="setTrackChangesStyles">
|
2624
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
2625
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
2626
|
+
</xsl:call-template>
|
2627
|
+
|
2524
2628
|
<fo:block-container>
|
2525
2629
|
|
2526
2630
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -2628,11 +2732,11 @@
|
|
2628
2732
|
</xsl:choose>
|
2629
2733
|
</xsl:variable>
|
2630
2734
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2631
|
-
<xsl:element name="{$ns}:table">
|
2735
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2632
2736
|
<tbody>
|
2633
2737
|
<xsl:apply-templates mode="dl"/>
|
2634
2738
|
</tbody>
|
2635
|
-
</xsl:element>
|
2739
|
+
<!-- </xsl:element> -->
|
2636
2740
|
</xsl:variable>
|
2637
2741
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
2638
2742
|
<xsl:variable name="colwidths">
|
@@ -2882,6 +2986,7 @@
|
|
2882
2986
|
|
2883
2987
|
|
2884
2988
|
|
2989
|
+
|
2885
2990
|
|
2886
2991
|
</xsl:variable>
|
2887
2992
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -2899,8 +3004,74 @@
|
|
2899
3004
|
<fo:inline text-decoration="underline">
|
2900
3005
|
<xsl:apply-templates/>
|
2901
3006
|
</fo:inline>
|
3007
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
3008
|
+
<xsl:choose>
|
3009
|
+
<xsl:when test="@amendment">
|
3010
|
+
<fo:inline>
|
3011
|
+
<xsl:call-template name="insertTag">
|
3012
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
3013
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
3014
|
+
</xsl:call-template>
|
3015
|
+
<xsl:apply-templates/>
|
3016
|
+
<xsl:call-template name="insertTag">
|
3017
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
3018
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
3019
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
3020
|
+
</xsl:call-template>
|
3021
|
+
</fo:inline>
|
3022
|
+
</xsl:when>
|
3023
|
+
<xsl:when test="@corrigenda">
|
3024
|
+
<fo:inline>
|
3025
|
+
<xsl:call-template name="insertTag">
|
3026
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
3027
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
3028
|
+
</xsl:call-template>
|
3029
|
+
<xsl:apply-templates/>
|
3030
|
+
<xsl:call-template name="insertTag">
|
3031
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
3032
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
3033
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
3034
|
+
</xsl:call-template>
|
3035
|
+
</fo:inline>
|
3036
|
+
</xsl:when>
|
3037
|
+
<xsl:otherwise>
|
3038
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
3039
|
+
<xsl:apply-templates/>
|
3040
|
+
</fo:inline>
|
3041
|
+
</xsl:otherwise>
|
3042
|
+
</xsl:choose>
|
3043
|
+
|
3044
|
+
</xsl:template><xsl:template name="insertTag">
|
3045
|
+
<xsl:param name="type"/>
|
3046
|
+
<xsl:param name="kind"/>
|
3047
|
+
<xsl:param name="value"/>
|
3048
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
3049
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
3050
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
3051
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
3052
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
3053
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
3054
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
3055
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3056
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3057
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
3058
|
+
<g>
|
3059
|
+
<xsl:if test="$type = 'closing'">
|
3060
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
3061
|
+
</xsl:if>
|
3062
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
3063
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
3064
|
+
</g>
|
3065
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
3066
|
+
<xsl:if test="$type = 'closing'">
|
3067
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
3068
|
+
</xsl:if>
|
3069
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
3070
|
+
</text>
|
3071
|
+
</svg>
|
3072
|
+
</fo:instream-foreign-object>
|
2902
3073
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2903
|
-
<fo:inline
|
3074
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2904
3075
|
<xsl:apply-templates/>
|
2905
3076
|
</fo:inline>
|
2906
3077
|
</xsl:template><xsl:template match="*[local-name()='hi']">
|
@@ -3197,11 +3368,15 @@
|
|
3197
3368
|
</xsl:apply-templates>
|
3198
3369
|
</xsl:template><xsl:template name="getLang">
|
3199
3370
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3371
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3200
3372
|
<xsl:variable name="language">
|
3201
3373
|
<xsl:choose>
|
3202
3374
|
<xsl:when test="$language_current != ''">
|
3203
3375
|
<xsl:value-of select="$language_current"/>
|
3204
3376
|
</xsl:when>
|
3377
|
+
<xsl:when test="$language_current_2 != ''">
|
3378
|
+
<xsl:value-of select="$language_current_2"/>
|
3379
|
+
</xsl:when>
|
3205
3380
|
<xsl:otherwise>
|
3206
3381
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3207
3382
|
</xsl:otherwise>
|
@@ -3241,13 +3416,23 @@
|
|
3241
3416
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
3242
3417
|
<xsl:value-of select="substring($str, 2)"/>
|
3243
3418
|
</xsl:template><xsl:template match="mathml:math">
|
3244
|
-
<
|
3419
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3420
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3421
|
+
|
3422
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
3423
|
+
|
3424
|
+
|
3425
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3426
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3427
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3428
|
+
</xsl:call-template>
|
3245
3429
|
|
3246
3430
|
<xsl:variable name="mathml">
|
3247
3431
|
<xsl:apply-templates select="." mode="mathml"/>
|
3248
3432
|
</xsl:variable>
|
3249
3433
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3250
3434
|
|
3435
|
+
|
3251
3436
|
<!-- <xsl:copy-of select="."/> -->
|
3252
3437
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3253
3438
|
</fo:instream-foreign-object>
|
@@ -3417,6 +3602,7 @@
|
|
3417
3602
|
|
3418
3603
|
|
3419
3604
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3605
|
+
|
3420
3606
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3421
3607
|
</fo:inline>
|
3422
3608
|
<xsl:apply-templates/>
|
@@ -3443,6 +3629,7 @@
|
|
3443
3629
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
3444
3630
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
3445
3631
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
3632
|
+
|
3446
3633
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3447
3634
|
</fo:inline>
|
3448
3635
|
<xsl:apply-templates/>
|
@@ -3508,8 +3695,15 @@
|
|
3508
3695
|
</fo:inline>
|
3509
3696
|
</xsl:if>
|
3510
3697
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3698
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3699
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3511
3700
|
<fo:block-container id="{@id}">
|
3512
3701
|
|
3702
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3703
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3704
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3705
|
+
</xsl:call-template>
|
3706
|
+
|
3513
3707
|
<fo:block>
|
3514
3708
|
<xsl:apply-templates/>
|
3515
3709
|
</fo:block>
|
@@ -3517,7 +3711,10 @@
|
|
3517
3711
|
<xsl:for-each select="*[local-name() = 'note']">
|
3518
3712
|
<xsl:call-template name="note"/>
|
3519
3713
|
</xsl:for-each>
|
3520
|
-
|
3714
|
+
|
3715
|
+
|
3716
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3717
|
+
|
3521
3718
|
</fo:block-container>
|
3522
3719
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
3523
3720
|
<fo:block id="{@id}">
|
@@ -3529,42 +3726,127 @@
|
|
3529
3726
|
<xsl:apply-templates/>
|
3530
3727
|
</fo:block>
|
3531
3728
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3532
|
-
<
|
3533
|
-
|
3534
|
-
|
3535
|
-
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
<xsl:
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3729
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
3730
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
3731
|
+
<xsl:choose>
|
3732
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3733
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3734
|
+
<xsl:variable name="src">
|
3735
|
+
<xsl:call-template name="image_src"/>
|
3736
|
+
</xsl:variable>
|
3737
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3738
|
+
</fo:inline>
|
3739
|
+
</xsl:when>
|
3740
|
+
<xsl:otherwise>
|
3741
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3742
|
+
|
3743
|
+
<xsl:if test="ancestor::un:admonition">
|
3744
|
+
<xsl:attribute name="margin-top">-12mm</xsl:attribute>
|
3745
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3746
|
+
</xsl:if>
|
3747
|
+
|
3748
|
+
<xsl:variable name="src">
|
3749
|
+
<xsl:call-template name="image_src"/>
|
3750
|
+
</xsl:variable>
|
3751
|
+
|
3752
|
+
<xsl:choose>
|
3753
|
+
<xsl:when test="$isDeleted = 'true'">
|
3754
|
+
<!-- enclose in svg -->
|
3755
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
3756
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3757
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3758
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3759
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3760
|
+
|
3761
|
+
|
3762
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
3763
|
+
|
3764
|
+
</fo:instream-foreign-object>
|
3765
|
+
</xsl:when>
|
3766
|
+
<xsl:otherwise>
|
3767
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3768
|
+
</xsl:otherwise>
|
3769
|
+
</xsl:choose>
|
3770
|
+
|
3771
|
+
</fo:block>
|
3772
|
+
</xsl:otherwise>
|
3773
|
+
</xsl:choose>
|
3774
|
+
</xsl:template><xsl:template name="image_src">
|
3775
|
+
<xsl:choose>
|
3776
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3777
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3778
|
+
</xsl:when>
|
3779
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3780
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3781
|
+
</xsl:when>
|
3782
|
+
<xsl:otherwise>
|
3783
|
+
<xsl:value-of select="@src"/>
|
3784
|
+
</xsl:otherwise>
|
3785
|
+
</xsl:choose>
|
3786
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
3787
|
+
<xsl:choose>
|
3788
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3789
|
+
<xsl:variable name="src">
|
3790
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3791
|
+
</xsl:variable>
|
3792
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
3793
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
3794
|
+
<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">
|
3795
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3796
|
+
</svg>
|
3797
|
+
</xsl:when>
|
3798
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3799
|
+
<xsl:variable name="src">
|
3800
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3801
|
+
</xsl:variable>
|
3802
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
3803
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
3804
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3805
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3806
|
+
<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">
|
3807
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3808
|
+
</svg>
|
3809
|
+
</xsl:when>
|
3810
|
+
<xsl:otherwise>
|
3811
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
3812
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
3813
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
3814
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
3815
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
3816
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3817
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
3818
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3819
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
3820
|
+
<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">
|
3821
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
3822
|
+
<xsl:call-template name="svg_cross">
|
3823
|
+
<xsl:with-param name="width" select="$width"/>
|
3824
|
+
<xsl:with-param name="height" select="$height"/>
|
3825
|
+
</xsl:call-template>
|
3826
|
+
</svg>
|
3827
|
+
</xsl:otherwise>
|
3828
|
+
</xsl:choose>
|
3829
|
+
|
3830
|
+
</xsl:template><xsl:template name="svg_cross">
|
3831
|
+
<xsl:param name="width"/>
|
3832
|
+
<xsl:param name="height"/>
|
3833
|
+
<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; "/>
|
3834
|
+
<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; "/>
|
3553
3835
|
</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">
|
3554
3836
|
<xsl:apply-templates mode="contents"/>
|
3555
3837
|
<xsl:text> </xsl:text>
|
3556
3838
|
</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">
|
3557
3839
|
<xsl:apply-templates mode="bookmarks"/>
|
3558
3840
|
<xsl:text> </xsl:text>
|
3559
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3841
|
+
</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">
|
3560
3842
|
<xsl:value-of select="."/>
|
3561
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3843
|
+
</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">
|
3562
3844
|
<xsl:value-of select="."/>
|
3563
3845
|
</xsl:template><xsl:template match="node()" mode="contents">
|
3564
3846
|
<xsl:apply-templates mode="contents"/>
|
3565
3847
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3566
3848
|
<xsl:apply-templates mode="bookmarks"/>
|
3567
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3849
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
3568
3850
|
<xsl:apply-templates select="."/>
|
3569
3851
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3570
3852
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -3763,6 +4045,8 @@
|
|
3763
4045
|
</fo:list-item-body>
|
3764
4046
|
</fo:list-item>
|
3765
4047
|
</fo:list-block>
|
4048
|
+
</xsl:template><xsl:template name="extractSection">
|
4049
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3766
4050
|
</xsl:template><xsl:template name="extractTitle">
|
3767
4051
|
<xsl:choose>
|
3768
4052
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -3810,6 +4094,7 @@
|
|
3810
4094
|
|
3811
4095
|
|
3812
4096
|
|
4097
|
+
|
3813
4098
|
|
3814
4099
|
|
3815
4100
|
|
@@ -4092,6 +4377,7 @@
|
|
4092
4377
|
<xsl:variable name="element">
|
4093
4378
|
block
|
4094
4379
|
|
4380
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
4095
4381
|
</xsl:variable>
|
4096
4382
|
<xsl:choose>
|
4097
4383
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -4099,7 +4385,7 @@
|
|
4099
4385
|
<xsl:apply-templates/>
|
4100
4386
|
</fo:inline>
|
4101
4387
|
</xsl:when>
|
4102
|
-
<xsl:when test="normalize-space($element)
|
4388
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
4103
4389
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
4104
4390
|
<xsl:apply-templates/>
|
4105
4391
|
</fo:block>
|
@@ -4136,7 +4422,7 @@
|
|
4136
4422
|
</fo:inline>
|
4137
4423
|
</xsl:otherwise>
|
4138
4424
|
</xsl:choose>
|
4139
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
4425
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
4140
4426
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
4141
4427
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
4142
4428
|
<xsl:variable name="termsource_text">
|
@@ -4145,13 +4431,15 @@
|
|
4145
4431
|
|
4146
4432
|
<xsl:choose>
|
4147
4433
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4148
|
-
<xsl:apply-templates/>
|
4434
|
+
<!-- <xsl:apply-templates /> -->
|
4435
|
+
<xsl:copy-of select="$termsource_text"/>
|
4149
4436
|
</xsl:when>
|
4150
4437
|
<xsl:otherwise>
|
4151
4438
|
|
4152
4439
|
<xsl:text>[</xsl:text>
|
4153
4440
|
|
4154
|
-
<xsl:apply-templates/>
|
4441
|
+
<!-- <xsl:apply-templates /> -->
|
4442
|
+
<xsl:copy-of select="$termsource_text"/>
|
4155
4443
|
|
4156
4444
|
<xsl:text>]</xsl:text>
|
4157
4445
|
|
@@ -4162,8 +4450,15 @@
|
|
4162
4450
|
<xsl:if test="normalize-space() != ''">
|
4163
4451
|
<xsl:value-of select="."/>
|
4164
4452
|
</xsl:if>
|
4165
|
-
</xsl:template><xsl:
|
4453
|
+
</xsl:template><xsl:variable name="localized.source">
|
4454
|
+
<xsl:call-template name="getLocalizedString">
|
4455
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
4456
|
+
</xsl:call-template>
|
4457
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
4166
4458
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4459
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4460
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4461
|
+
</xsl:if>
|
4167
4462
|
|
4168
4463
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4169
4464
|
<xsl:apply-templates/>
|
@@ -4310,7 +4605,8 @@
|
|
4310
4605
|
</fo:inline>
|
4311
4606
|
</xsl:when>
|
4312
4607
|
<xsl:otherwise>
|
4313
|
-
<
|
4608
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
4609
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
4314
4610
|
</xsl:otherwise>
|
4315
4611
|
</xsl:choose>
|
4316
4612
|
|
@@ -4371,7 +4667,6 @@
|
|
4371
4667
|
<xsl:attribute name="margin-top">3pt</xsl:attribute>
|
4372
4668
|
</xsl:if>
|
4373
4669
|
|
4374
|
-
|
4375
4670
|
<xsl:apply-templates/>
|
4376
4671
|
</fo:block>
|
4377
4672
|
|
@@ -4419,7 +4714,7 @@
|
|
4419
4714
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
4420
4715
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
4421
4716
|
<xsl:choose>
|
4422
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
4717
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
4423
4718
|
<fo:block-container>
|
4424
4719
|
<xsl:attribute name="margin-left">
|
4425
4720
|
<xsl:choose>
|
@@ -4429,6 +4724,7 @@
|
|
4429
4724
|
</xsl:attribute>
|
4430
4725
|
|
4431
4726
|
|
4727
|
+
|
4432
4728
|
<fo:block-container margin-left="0mm">
|
4433
4729
|
<fo:block>
|
4434
4730
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -4587,8 +4883,8 @@
|
|
4587
4883
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4588
4884
|
<xsl:apply-templates/>
|
4589
4885
|
</fo:block>
|
4590
|
-
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
4591
|
-
<fo:inline id="{@id}"/>
|
4886
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
4887
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4592
4888
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4593
4889
|
<!-- <row>
|
4594
4890
|
<date>05-07-2013</date>
|
@@ -4630,6 +4926,10 @@
|
|
4630
4926
|
|
4631
4927
|
|
4632
4928
|
|
4929
|
+
|
4930
|
+
|
4931
|
+
|
4932
|
+
|
4633
4933
|
</xsl:template><xsl:template name="processBibitemDocId">
|
4634
4934
|
<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')]"/>
|
4635
4935
|
<xsl:choose>
|
@@ -4686,6 +4986,70 @@
|
|
4686
4986
|
<xsl:value-of select="substring(.,1,1)"/>
|
4687
4987
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4688
4988
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4989
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
4990
|
+
<fo:block>
|
4991
|
+
<xsl:apply-templates/>
|
4992
|
+
</fo:block>
|
4993
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
4994
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4995
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
4996
|
+
<fo:inline>
|
4997
|
+
<xsl:call-template name="text_input"/>
|
4998
|
+
</fo:inline>
|
4999
|
+
</xsl:template><xsl:template name="text_input">
|
5000
|
+
<xsl:variable name="count">
|
5001
|
+
<xsl:choose>
|
5002
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
5003
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
5004
|
+
<xsl:otherwise>10</xsl:otherwise>
|
5005
|
+
</xsl:choose>
|
5006
|
+
</xsl:variable>
|
5007
|
+
<xsl:call-template name="repeat">
|
5008
|
+
<xsl:with-param name="char" select="'_'"/>
|
5009
|
+
<xsl:with-param name="count" select="$count"/>
|
5010
|
+
</xsl:call-template>
|
5011
|
+
<xsl:text> </xsl:text>
|
5012
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
5013
|
+
<xsl:variable name="caption">
|
5014
|
+
<xsl:choose>
|
5015
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
5016
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
5017
|
+
</xsl:choose>
|
5018
|
+
</xsl:variable>
|
5019
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
5020
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
5021
|
+
<fo:inline padding-right="1mm">
|
5022
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5023
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5024
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5025
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5026
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5027
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5028
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
5029
|
+
</svg>
|
5030
|
+
</fo:instream-foreign-object>
|
5031
|
+
</fo:inline>
|
5032
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
5033
|
+
<fo:inline padding-right="1mm">
|
5034
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5035
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5036
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5037
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5038
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5039
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5040
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
5041
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
5042
|
+
</svg>
|
5043
|
+
</fo:instream-foreign-object>
|
5044
|
+
</fo:inline>
|
5045
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
5046
|
+
<fo:inline>
|
5047
|
+
<xsl:call-template name="text_input"/>
|
5048
|
+
</fo:inline>
|
5049
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
5050
|
+
<fo:block-container border="1pt solid black" width="50%">
|
5051
|
+
<fo:block> </fo:block>
|
5052
|
+
</fo:block-container>
|
4689
5053
|
</xsl:template><xsl:template name="convertDate">
|
4690
5054
|
<xsl:param name="date"/>
|
4691
5055
|
<xsl:param name="format" select="'short'"/>
|
@@ -4951,6 +5315,7 @@
|
|
4951
5315
|
|
4952
5316
|
|
4953
5317
|
|
5318
|
+
|
4954
5319
|
<xsl:value-of select="document('')//*/namespace::un"/>
|
4955
5320
|
|
4956
5321
|
|
@@ -5017,17 +5382,62 @@
|
|
5017
5382
|
</xsl:call-template>
|
5018
5383
|
</xsl:if>
|
5019
5384
|
</xsl:template><xsl:template name="getLocalizedString">
|
5020
|
-
<xsl:param name="key"/>
|
5385
|
+
<xsl:param name="key"/>
|
5021
5386
|
|
5022
5387
|
<xsl:variable name="curr_lang">
|
5023
5388
|
<xsl:call-template name="getLang"/>
|
5024
5389
|
</xsl:variable>
|
5025
5390
|
|
5391
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5392
|
+
|
5026
5393
|
<xsl:choose>
|
5394
|
+
<xsl:when test="$data_value != ''">
|
5395
|
+
<xsl:value-of select="$data_value"/>
|
5396
|
+
</xsl:when>
|
5027
5397
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5028
5398
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5029
5399
|
</xsl:when>
|
5030
5400
|
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
5031
5401
|
</xsl:choose>
|
5032
5402
|
|
5403
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5404
|
+
<xsl:param name="isAdded"/>
|
5405
|
+
<xsl:param name="isDeleted"/>
|
5406
|
+
<xsl:choose>
|
5407
|
+
<xsl:when test="local-name() = 'math'">
|
5408
|
+
<xsl:if test="$isAdded = 'true'">
|
5409
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
5410
|
+
</xsl:if>
|
5411
|
+
<xsl:if test="$isDeleted = 'true'">
|
5412
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
5413
|
+
</xsl:if>
|
5414
|
+
</xsl:when>
|
5415
|
+
<xsl:otherwise>
|
5416
|
+
<xsl:if test="$isAdded = 'true'">
|
5417
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
5418
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5419
|
+
</xsl:if>
|
5420
|
+
<xsl:if test="$isDeleted = 'true'">
|
5421
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
5422
|
+
<xsl:if test="local-name() = 'table'">
|
5423
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
5424
|
+
</xsl:if>
|
5425
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
5426
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5427
|
+
</xsl:if>
|
5428
|
+
</xsl:otherwise>
|
5429
|
+
</xsl:choose>
|
5430
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
5431
|
+
<xsl:if test="$lang = 'ar'">
|
5432
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
5433
|
+
</xsl:if>
|
5434
|
+
</xsl:template><xsl:template name="setAlignment">
|
5435
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
5436
|
+
<xsl:choose>
|
5437
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
5438
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
5439
|
+
<xsl:when test="$align != ''">
|
5440
|
+
<xsl:value-of select="$align"/>
|
5441
|
+
</xsl:when>
|
5442
|
+
</xsl:choose>
|
5033
5443
|
</xsl:template></xsl:stylesheet>
|