metanorma-m3aawg 1.6.9 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +3 -7
- data/lib/asciidoctor/m3aawg/biblio.rng +1 -0
- data/lib/asciidoctor/m3aawg/isodoc.rng +321 -4
- data/lib/isodoc/m3aawg/html/htmlstyle.css +7 -0
- data/lib/isodoc/m3aawg/m3aawg.policy.xsl +502 -66
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +502 -66
- data/lib/metanorma/m3aawg/version.rb +1 -1
- data/metanorma-m3d.gemspec +3 -3
- metadata +18 -18
@@ -122,6 +122,13 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
122
122
|
content: ", ";
|
123
123
|
vertical-align: super; }
|
124
124
|
|
125
|
+
.addition {
|
126
|
+
color: blue; }
|
127
|
+
|
128
|
+
.deletion {
|
129
|
+
color: red;
|
130
|
+
text-decoration: line-through; }
|
131
|
+
|
125
132
|
#standard-band {
|
126
133
|
background-color: #0AC442; }
|
127
134
|
|
@@ -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
|
|
@@ -1020,6 +1021,9 @@
|
|
1020
1021
|
<title-continued lang="en">(continued)</title-continued>
|
1021
1022
|
<title-continued lang="fr">(continué)</title-continued>
|
1022
1023
|
|
1024
|
+
</xsl:variable><xsl:variable name="bibdata">
|
1025
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
1026
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
1023
1027
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1024
1028
|
<xsl:param name="name"/>
|
1025
1029
|
<xsl:param name="lang"/>
|
@@ -1045,13 +1049,16 @@
|
|
1045
1049
|
</xsl:choose>
|
1046
1050
|
</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">
|
1047
1051
|
|
1052
|
+
|
1048
1053
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1049
1054
|
|
1055
|
+
|
1050
1056
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1051
1057
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1052
1058
|
|
1053
1059
|
|
1054
1060
|
|
1061
|
+
|
1055
1062
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
1056
1063
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1057
1064
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
@@ -1116,6 +1123,7 @@
|
|
1116
1123
|
|
1117
1124
|
|
1118
1125
|
|
1126
|
+
|
1119
1127
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
1120
1128
|
|
1121
1129
|
|
@@ -1135,9 +1143,7 @@
|
|
1135
1143
|
|
1136
1144
|
|
1137
1145
|
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1146
|
+
|
1141
1147
|
|
1142
1148
|
|
1143
1149
|
|
@@ -1170,6 +1176,7 @@
|
|
1170
1176
|
|
1171
1177
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
1172
1178
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1179
|
+
|
1173
1180
|
|
1174
1181
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1175
1182
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
@@ -1186,6 +1193,7 @@
|
|
1186
1193
|
|
1187
1194
|
|
1188
1195
|
|
1196
|
+
|
1189
1197
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1190
1198
|
|
1191
1199
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
@@ -1207,15 +1215,19 @@
|
|
1207
1215
|
|
1208
1216
|
|
1209
1217
|
|
1218
|
+
|
1219
|
+
|
1210
1220
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1211
1221
|
|
1212
1222
|
|
1213
1223
|
|
1214
1224
|
|
1225
|
+
|
1215
1226
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
1216
1227
|
|
1217
1228
|
|
1218
1229
|
|
1230
|
+
|
1219
1231
|
|
1220
1232
|
|
1221
1233
|
|
@@ -1241,6 +1253,7 @@
|
|
1241
1253
|
|
1242
1254
|
|
1243
1255
|
|
1256
|
+
|
1244
1257
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
1245
1258
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1246
1259
|
|
@@ -1271,7 +1284,9 @@
|
|
1271
1284
|
|
1272
1285
|
|
1273
1286
|
|
1287
|
+
|
1274
1288
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1289
|
+
|
1275
1290
|
|
1276
1291
|
|
1277
1292
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
@@ -1298,14 +1313,18 @@
|
|
1298
1313
|
|
1299
1314
|
|
1300
1315
|
|
1316
|
+
|
1317
|
+
|
1301
1318
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
1302
1319
|
|
1303
1320
|
|
1304
1321
|
|
1322
|
+
|
1305
1323
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1306
1324
|
|
1307
1325
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1308
1326
|
|
1327
|
+
|
1309
1328
|
|
1310
1329
|
|
1311
1330
|
|
@@ -1337,11 +1356,13 @@
|
|
1337
1356
|
|
1338
1357
|
|
1339
1358
|
|
1359
|
+
|
1340
1360
|
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
|
1341
1361
|
|
1342
1362
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
1343
1363
|
|
1344
1364
|
|
1365
|
+
|
1345
1366
|
<xsl:attribute name="width">100%</xsl:attribute>
|
1346
1367
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
1347
1368
|
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
@@ -1367,13 +1388,34 @@
|
|
1367
1388
|
|
1368
1389
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1369
1390
|
|
1370
|
-
|
1391
|
+
|
1392
|
+
|
1371
1393
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1372
1394
|
|
1395
|
+
|
1373
1396
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
1374
1397
|
|
1375
1398
|
|
1376
|
-
|
1399
|
+
|
1400
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1401
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1402
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
1403
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1404
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1405
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
1406
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
1407
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
1408
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
1409
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
1410
|
+
<xsl:text>red</xsl:text>
|
1411
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
1412
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
1413
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1414
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
1415
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1416
|
+
|
1417
|
+
|
1418
|
+
</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">
|
1377
1419
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1378
1420
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1379
1421
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -1422,16 +1464,17 @@
|
|
1422
1464
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1423
1465
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1424
1466
|
|
1467
|
+
<xsl:variable name="table-preamble">
|
1468
|
+
|
1469
|
+
|
1470
|
+
</xsl:variable>
|
1471
|
+
|
1425
1472
|
<xsl:variable name="table">
|
1426
1473
|
|
1427
1474
|
<xsl:variable name="simple-table">
|
1428
1475
|
<xsl:call-template name="getSimpleTable"/>
|
1429
1476
|
</xsl:variable>
|
1430
1477
|
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
1478
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1436
1479
|
<fo:block> </fo:block>
|
1437
1480
|
</xsl:if> -->
|
@@ -1446,7 +1489,7 @@
|
|
1446
1489
|
|
1447
1490
|
|
1448
1491
|
|
1449
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
1492
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
1450
1493
|
|
1451
1494
|
<!-- <xsl:variable name="cols-count">
|
1452
1495
|
<xsl:choose>
|
@@ -1465,8 +1508,6 @@
|
|
1465
1508
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1466
1509
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1467
1510
|
|
1468
|
-
|
1469
|
-
|
1470
1511
|
<xsl:variable name="colwidths">
|
1471
1512
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1472
1513
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1494,9 +1535,11 @@
|
|
1494
1535
|
</xsl:choose>
|
1495
1536
|
</xsl:variable>
|
1496
1537
|
|
1538
|
+
|
1497
1539
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1498
1540
|
|
1499
1541
|
|
1542
|
+
|
1500
1543
|
|
1501
1544
|
|
1502
1545
|
|
@@ -1509,6 +1552,8 @@
|
|
1509
1552
|
|
1510
1553
|
|
1511
1554
|
|
1555
|
+
|
1556
|
+
|
1512
1557
|
<xsl:variable name="table_width">
|
1513
1558
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1514
1559
|
100%
|
@@ -1525,6 +1570,8 @@
|
|
1525
1570
|
|
1526
1571
|
|
1527
1572
|
|
1573
|
+
|
1574
|
+
|
1528
1575
|
|
1529
1576
|
|
1530
1577
|
|
@@ -1614,7 +1661,8 @@
|
|
1614
1661
|
</fo:block-container>
|
1615
1662
|
</xsl:variable>
|
1616
1663
|
|
1617
|
-
|
1664
|
+
<xsl:variable name="isAdded" select="@added"/>
|
1665
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
1618
1666
|
|
1619
1667
|
<xsl:choose>
|
1620
1668
|
<xsl:when test="@width">
|
@@ -1628,7 +1676,14 @@
|
|
1628
1676
|
<fo:table-body>
|
1629
1677
|
<fo:table-row>
|
1630
1678
|
<fo:table-cell column-number="2">
|
1631
|
-
<
|
1679
|
+
<xsl:copy-of select="$table-preamble"/>
|
1680
|
+
<fo:block>
|
1681
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1682
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1683
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1684
|
+
</xsl:call-template>
|
1685
|
+
<xsl:copy-of select="$table"/>
|
1686
|
+
</fo:block>
|
1632
1687
|
</fo:table-cell>
|
1633
1688
|
</fo:table-row>
|
1634
1689
|
</fo:table-body>
|
@@ -1639,16 +1694,42 @@
|
|
1639
1694
|
|
1640
1695
|
</xsl:when>
|
1641
1696
|
<xsl:otherwise>
|
1642
|
-
<xsl:
|
1697
|
+
<xsl:choose>
|
1698
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1699
|
+
<xsl:copy-of select="$table-preamble"/>
|
1700
|
+
<fo:block>
|
1701
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1702
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1703
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1704
|
+
</xsl:call-template>
|
1705
|
+
<xsl:copy-of select="$table"/>
|
1706
|
+
</fo:block>
|
1707
|
+
</xsl:when>
|
1708
|
+
<xsl:otherwise>
|
1709
|
+
<xsl:copy-of select="$table-preamble"/>
|
1710
|
+
<xsl:copy-of select="$table"/>
|
1711
|
+
</xsl:otherwise>
|
1712
|
+
</xsl:choose>
|
1643
1713
|
</xsl:otherwise>
|
1644
1714
|
</xsl:choose>
|
1645
1715
|
|
1646
1716
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1717
|
+
<xsl:param name="continued"/>
|
1647
1718
|
<xsl:if test="normalize-space() != ''">
|
1648
1719
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1649
1720
|
|
1650
1721
|
|
1651
|
-
<xsl:
|
1722
|
+
<xsl:choose>
|
1723
|
+
<xsl:when test="$continued = 'true'">
|
1724
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
1725
|
+
|
1726
|
+
</xsl:when>
|
1727
|
+
<xsl:otherwise>
|
1728
|
+
<xsl:apply-templates/>
|
1729
|
+
</xsl:otherwise>
|
1730
|
+
</xsl:choose>
|
1731
|
+
|
1732
|
+
|
1652
1733
|
</fo:block>
|
1653
1734
|
</xsl:if>
|
1654
1735
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -1700,7 +1781,7 @@
|
|
1700
1781
|
</xsl:for-each>
|
1701
1782
|
</xsl:when>
|
1702
1783
|
<xsl:otherwise>
|
1703
|
-
<xsl:for-each select="xalan:nodeset($table)
|
1784
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
1704
1785
|
<xsl:variable name="td_text">
|
1705
1786
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1706
1787
|
|
@@ -1788,18 +1869,18 @@
|
|
1788
1869
|
<xsl:apply-templates/>
|
1789
1870
|
</fo:table-header>
|
1790
1871
|
</xsl:template><xsl:template name="table-header-title">
|
1791
|
-
<xsl:param name="cols-count"/>
|
1872
|
+
<xsl:param name="cols-count"/>
|
1792
1873
|
<!-- row for title -->
|
1793
1874
|
<fo:table-row>
|
1794
1875
|
<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">
|
1795
|
-
|
1876
|
+
|
1877
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
1878
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
1879
|
+
</xsl:apply-templates>
|
1796
1880
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
1797
1881
|
<xsl:call-template name="fn_name_display"/>
|
1798
|
-
</xsl:for-each>
|
1799
|
-
|
1800
|
-
<xsl:text> </xsl:text>
|
1801
|
-
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
1802
|
-
</fo:block>
|
1882
|
+
</xsl:for-each>
|
1883
|
+
|
1803
1884
|
</fo:table-cell>
|
1804
1885
|
</fo:table-row>
|
1805
1886
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -2020,6 +2101,7 @@
|
|
2020
2101
|
|
2021
2102
|
|
2022
2103
|
|
2104
|
+
|
2023
2105
|
</xsl:if>
|
2024
2106
|
<xsl:if test="$parent-name = 'tfoot'">
|
2025
2107
|
|
@@ -2040,7 +2122,8 @@
|
|
2040
2122
|
<xsl:attribute name="text-align">
|
2041
2123
|
<xsl:choose>
|
2042
2124
|
<xsl:when test="@align">
|
2043
|
-
<xsl:
|
2125
|
+
<xsl:call-template name="setAlignment"/>
|
2126
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2044
2127
|
</xsl:when>
|
2045
2128
|
<xsl:otherwise>center</xsl:otherwise>
|
2046
2129
|
</xsl:choose>
|
@@ -2056,6 +2139,11 @@
|
|
2056
2139
|
|
2057
2140
|
|
2058
2141
|
|
2142
|
+
|
2143
|
+
|
2144
|
+
<xsl:if test="$lang = 'ar'">
|
2145
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2146
|
+
</xsl:if>
|
2059
2147
|
<xsl:if test="@colspan">
|
2060
2148
|
<xsl:attribute name="number-columns-spanned">
|
2061
2149
|
<xsl:value-of select="@colspan"/>
|
@@ -2087,11 +2175,15 @@
|
|
2087
2175
|
<xsl:attribute name="text-align">
|
2088
2176
|
<xsl:choose>
|
2089
2177
|
<xsl:when test="@align">
|
2090
|
-
<xsl:
|
2178
|
+
<xsl:call-template name="setAlignment"/>
|
2179
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2091
2180
|
</xsl:when>
|
2092
2181
|
<xsl:otherwise>left</xsl:otherwise>
|
2093
2182
|
</xsl:choose>
|
2094
2183
|
</xsl:attribute>
|
2184
|
+
<xsl:if test="$lang = 'ar'">
|
2185
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2186
|
+
</xsl:if>
|
2095
2187
|
|
2096
2188
|
|
2097
2189
|
|
@@ -2103,6 +2195,10 @@
|
|
2103
2195
|
|
2104
2196
|
|
2105
2197
|
|
2198
|
+
|
2199
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
2200
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2201
|
+
</xsl:if>
|
2106
2202
|
<xsl:if test="@colspan">
|
2107
2203
|
<xsl:attribute name="number-columns-spanned">
|
2108
2204
|
<xsl:value-of select="@colspan"/>
|
@@ -2230,13 +2326,13 @@
|
|
2230
2326
|
</xsl:choose>
|
2231
2327
|
</xsl:variable>
|
2232
2328
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2233
|
-
<xsl:element name="{$ns}:table">
|
2329
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2234
2330
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2235
2331
|
<tbody>
|
2236
2332
|
<xsl:apply-templates mode="dl"/>
|
2237
2333
|
</tbody>
|
2238
2334
|
</xsl:for-each>
|
2239
|
-
</xsl:element>
|
2335
|
+
<!-- </xsl:element> -->
|
2240
2336
|
</xsl:variable>
|
2241
2337
|
|
2242
2338
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2327,6 +2423,8 @@
|
|
2327
2423
|
<xsl:apply-templates/>
|
2328
2424
|
</fo:inline>
|
2329
2425
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2426
|
+
<xsl:variable name="isAdded" select="@added"/>
|
2427
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2330
2428
|
<fo:block-container>
|
2331
2429
|
|
2332
2430
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -2343,6 +2441,12 @@
|
|
2343
2441
|
</xsl:attribute>
|
2344
2442
|
|
2345
2443
|
</xsl:if>
|
2444
|
+
|
2445
|
+
<xsl:call-template name="setTrackChangesStyles">
|
2446
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
2447
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
2448
|
+
</xsl:call-template>
|
2449
|
+
|
2346
2450
|
<fo:block-container>
|
2347
2451
|
|
2348
2452
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -2398,6 +2502,7 @@
|
|
2398
2502
|
|
2399
2503
|
|
2400
2504
|
|
2505
|
+
|
2401
2506
|
<xsl:variable name="title-key">
|
2402
2507
|
|
2403
2508
|
|
@@ -2450,11 +2555,11 @@
|
|
2450
2555
|
</xsl:choose>
|
2451
2556
|
</xsl:variable>
|
2452
2557
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2453
|
-
<xsl:element name="{$ns}:table">
|
2558
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2454
2559
|
<tbody>
|
2455
2560
|
<xsl:apply-templates mode="dl"/>
|
2456
2561
|
</tbody>
|
2457
|
-
</xsl:element>
|
2562
|
+
<!-- </xsl:element> -->
|
2458
2563
|
</xsl:variable>
|
2459
2564
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
2460
2565
|
<xsl:variable name="colwidths">
|
@@ -2679,6 +2784,8 @@
|
|
2679
2784
|
|
2680
2785
|
<xsl:apply-templates/>
|
2681
2786
|
</fo:inline>
|
2787
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
2788
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
2682
2789
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
2683
2790
|
<fo:inline font-size="80%" vertical-align="super">
|
2684
2791
|
<xsl:apply-templates/>
|
@@ -2699,6 +2806,7 @@
|
|
2699
2806
|
|
2700
2807
|
|
2701
2808
|
|
2809
|
+
|
2702
2810
|
<xsl:choose>
|
2703
2811
|
<xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
|
2704
2812
|
<xsl:otherwise>11</xsl:otherwise>
|
@@ -2726,8 +2834,74 @@
|
|
2726
2834
|
<fo:inline text-decoration="underline">
|
2727
2835
|
<xsl:apply-templates/>
|
2728
2836
|
</fo:inline>
|
2837
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
2838
|
+
<xsl:choose>
|
2839
|
+
<xsl:when test="@amendment">
|
2840
|
+
<fo:inline>
|
2841
|
+
<xsl:call-template name="insertTag">
|
2842
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2843
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2844
|
+
</xsl:call-template>
|
2845
|
+
<xsl:apply-templates/>
|
2846
|
+
<xsl:call-template name="insertTag">
|
2847
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2848
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2849
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2850
|
+
</xsl:call-template>
|
2851
|
+
</fo:inline>
|
2852
|
+
</xsl:when>
|
2853
|
+
<xsl:when test="@corrigenda">
|
2854
|
+
<fo:inline>
|
2855
|
+
<xsl:call-template name="insertTag">
|
2856
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2857
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2858
|
+
</xsl:call-template>
|
2859
|
+
<xsl:apply-templates/>
|
2860
|
+
<xsl:call-template name="insertTag">
|
2861
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2862
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2863
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2864
|
+
</xsl:call-template>
|
2865
|
+
</fo:inline>
|
2866
|
+
</xsl:when>
|
2867
|
+
<xsl:otherwise>
|
2868
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2869
|
+
<xsl:apply-templates/>
|
2870
|
+
</fo:inline>
|
2871
|
+
</xsl:otherwise>
|
2872
|
+
</xsl:choose>
|
2873
|
+
|
2874
|
+
</xsl:template><xsl:template name="insertTag">
|
2875
|
+
<xsl:param name="type"/>
|
2876
|
+
<xsl:param name="kind"/>
|
2877
|
+
<xsl:param name="value"/>
|
2878
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
2879
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
2880
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
2881
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
2882
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
2883
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
2884
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
2885
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2886
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2887
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
2888
|
+
<g>
|
2889
|
+
<xsl:if test="$type = 'closing'">
|
2890
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
2891
|
+
</xsl:if>
|
2892
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
2893
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
2894
|
+
</g>
|
2895
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
2896
|
+
<xsl:if test="$type = 'closing'">
|
2897
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
2898
|
+
</xsl:if>
|
2899
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
2900
|
+
</text>
|
2901
|
+
</svg>
|
2902
|
+
</fo:instream-foreign-object>
|
2729
2903
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2730
|
-
<fo:inline
|
2904
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2731
2905
|
<xsl:apply-templates/>
|
2732
2906
|
</fo:inline>
|
2733
2907
|
</xsl:template><xsl:template match="*[local-name()='hi']">
|
@@ -3024,11 +3198,15 @@
|
|
3024
3198
|
</xsl:apply-templates>
|
3025
3199
|
</xsl:template><xsl:template name="getLang">
|
3026
3200
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3201
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3027
3202
|
<xsl:variable name="language">
|
3028
3203
|
<xsl:choose>
|
3029
3204
|
<xsl:when test="$language_current != ''">
|
3030
3205
|
<xsl:value-of select="$language_current"/>
|
3031
3206
|
</xsl:when>
|
3207
|
+
<xsl:when test="$language_current_2 != ''">
|
3208
|
+
<xsl:value-of select="$language_current_2"/>
|
3209
|
+
</xsl:when>
|
3032
3210
|
<xsl:otherwise>
|
3033
3211
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3034
3212
|
</xsl:otherwise>
|
@@ -3068,13 +3246,23 @@
|
|
3068
3246
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
3069
3247
|
<xsl:value-of select="substring($str, 2)"/>
|
3070
3248
|
</xsl:template><xsl:template match="mathml:math">
|
3071
|
-
<
|
3249
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3250
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3251
|
+
|
3252
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
3253
|
+
|
3254
|
+
|
3255
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3256
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3257
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3258
|
+
</xsl:call-template>
|
3072
3259
|
|
3073
3260
|
<xsl:variable name="mathml">
|
3074
3261
|
<xsl:apply-templates select="." mode="mathml"/>
|
3075
3262
|
</xsl:variable>
|
3076
3263
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3077
3264
|
|
3265
|
+
|
3078
3266
|
<!-- <xsl:copy-of select="."/> -->
|
3079
3267
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3080
3268
|
</fo:instream-foreign-object>
|
@@ -3095,6 +3283,16 @@
|
|
3095
3283
|
<mathml:mspace width="0.5ex"/>
|
3096
3284
|
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
3097
3285
|
<xsl:variable name="target">
|
3286
|
+
<xsl:choose>
|
3287
|
+
<xsl:when test="@updatetype = 'true'">
|
3288
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
3289
|
+
</xsl:when>
|
3290
|
+
<xsl:otherwise>
|
3291
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
3292
|
+
</xsl:otherwise>
|
3293
|
+
</xsl:choose>
|
3294
|
+
</xsl:variable>
|
3295
|
+
<xsl:variable name="target_text">
|
3098
3296
|
<xsl:choose>
|
3099
3297
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
3100
3298
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -3107,19 +3305,19 @@
|
|
3107
3305
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3108
3306
|
|
3109
3307
|
<xsl:choose>
|
3110
|
-
<xsl:when test="$
|
3308
|
+
<xsl:when test="$target_text = ''">
|
3111
3309
|
<xsl:apply-templates/>
|
3112
3310
|
</xsl:when>
|
3113
3311
|
<xsl:otherwise>
|
3114
|
-
<fo:basic-link external-destination="{
|
3312
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
3115
3313
|
<xsl:choose>
|
3116
3314
|
<xsl:when test="normalize-space(.) = ''">
|
3117
|
-
<!-- <xsl:value-of select="$target"/> -->
|
3118
3315
|
<xsl:call-template name="add-zero-spaces-link-java">
|
3119
|
-
<xsl:with-param name="text" select="$
|
3316
|
+
<xsl:with-param name="text" select="$target_text"/>
|
3120
3317
|
</xsl:call-template>
|
3121
3318
|
</xsl:when>
|
3122
3319
|
<xsl:otherwise>
|
3320
|
+
<!-- output text from <link>text</link> -->
|
3123
3321
|
<xsl:apply-templates/>
|
3124
3322
|
</xsl:otherwise>
|
3125
3323
|
</xsl:choose>
|
@@ -3231,6 +3429,7 @@
|
|
3231
3429
|
|
3232
3430
|
|
3233
3431
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3432
|
+
|
3234
3433
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3235
3434
|
</fo:inline>
|
3236
3435
|
<xsl:apply-templates/>
|
@@ -3257,6 +3456,7 @@
|
|
3257
3456
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
3258
3457
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
3259
3458
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
3459
|
+
|
3260
3460
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3261
3461
|
</fo:inline>
|
3262
3462
|
<xsl:apply-templates/>
|
@@ -3324,8 +3524,15 @@
|
|
3324
3524
|
</fo:inline>
|
3325
3525
|
</xsl:if>
|
3326
3526
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3527
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3528
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3327
3529
|
<fo:block-container id="{@id}">
|
3328
3530
|
|
3531
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3532
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3533
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3534
|
+
</xsl:call-template>
|
3535
|
+
|
3329
3536
|
<fo:block>
|
3330
3537
|
<xsl:apply-templates/>
|
3331
3538
|
</fo:block>
|
@@ -3333,7 +3540,10 @@
|
|
3333
3540
|
<xsl:for-each select="*[local-name() = 'note']">
|
3334
3541
|
<xsl:call-template name="note"/>
|
3335
3542
|
</xsl:for-each>
|
3336
|
-
|
3543
|
+
|
3544
|
+
|
3545
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3546
|
+
|
3337
3547
|
</fo:block-container>
|
3338
3548
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
3339
3549
|
<fo:block id="{@id}">
|
@@ -3345,37 +3555,122 @@
|
|
3345
3555
|
<xsl:apply-templates/>
|
3346
3556
|
</fo:block>
|
3347
3557
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3348
|
-
<
|
3349
|
-
|
3350
|
-
|
3351
|
-
<xsl:
|
3352
|
-
<
|
3353
|
-
<xsl:
|
3354
|
-
<xsl:
|
3355
|
-
</xsl:
|
3356
|
-
<
|
3357
|
-
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3558
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
3559
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
3560
|
+
<xsl:choose>
|
3561
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3562
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3563
|
+
<xsl:variable name="src">
|
3564
|
+
<xsl:call-template name="image_src"/>
|
3565
|
+
</xsl:variable>
|
3566
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3567
|
+
</fo:inline>
|
3568
|
+
</xsl:when>
|
3569
|
+
<xsl:otherwise>
|
3570
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3571
|
+
|
3572
|
+
<xsl:variable name="src">
|
3573
|
+
<xsl:call-template name="image_src"/>
|
3574
|
+
</xsl:variable>
|
3575
|
+
|
3576
|
+
<xsl:choose>
|
3577
|
+
<xsl:when test="$isDeleted = 'true'">
|
3578
|
+
<!-- enclose in svg -->
|
3579
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
3580
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3581
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3582
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3583
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3584
|
+
|
3585
|
+
|
3586
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
3587
|
+
|
3588
|
+
</fo:instream-foreign-object>
|
3589
|
+
</xsl:when>
|
3590
|
+
<xsl:otherwise>
|
3591
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3592
|
+
</xsl:otherwise>
|
3593
|
+
</xsl:choose>
|
3594
|
+
|
3595
|
+
</fo:block>
|
3596
|
+
</xsl:otherwise>
|
3597
|
+
</xsl:choose>
|
3598
|
+
</xsl:template><xsl:template name="image_src">
|
3599
|
+
<xsl:choose>
|
3600
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3601
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3602
|
+
</xsl:when>
|
3603
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3604
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3605
|
+
</xsl:when>
|
3606
|
+
<xsl:otherwise>
|
3607
|
+
<xsl:value-of select="@src"/>
|
3608
|
+
</xsl:otherwise>
|
3609
|
+
</xsl:choose>
|
3610
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
3611
|
+
<xsl:choose>
|
3612
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3613
|
+
<xsl:variable name="src">
|
3614
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3615
|
+
</xsl:variable>
|
3616
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
3617
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
3618
|
+
<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">
|
3619
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3620
|
+
</svg>
|
3621
|
+
</xsl:when>
|
3622
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3623
|
+
<xsl:variable name="src">
|
3624
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3625
|
+
</xsl:variable>
|
3626
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
3627
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
3628
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3629
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3630
|
+
<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">
|
3631
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3632
|
+
</svg>
|
3633
|
+
</xsl:when>
|
3634
|
+
<xsl:otherwise>
|
3635
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
3636
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
3637
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
3638
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
3639
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
3640
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3641
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
3642
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3643
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
3644
|
+
<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">
|
3645
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
3646
|
+
<xsl:call-template name="svg_cross">
|
3647
|
+
<xsl:with-param name="width" select="$width"/>
|
3648
|
+
<xsl:with-param name="height" select="$height"/>
|
3649
|
+
</xsl:call-template>
|
3650
|
+
</svg>
|
3651
|
+
</xsl:otherwise>
|
3652
|
+
</xsl:choose>
|
3653
|
+
|
3654
|
+
</xsl:template><xsl:template name="svg_cross">
|
3655
|
+
<xsl:param name="width"/>
|
3656
|
+
<xsl:param name="height"/>
|
3657
|
+
<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; "/>
|
3658
|
+
<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; "/>
|
3364
3659
|
</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">
|
3365
3660
|
<xsl:apply-templates mode="contents"/>
|
3366
3661
|
<xsl:text> </xsl:text>
|
3367
3662
|
</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">
|
3368
3663
|
<xsl:apply-templates mode="bookmarks"/>
|
3369
3664
|
<xsl:text> </xsl:text>
|
3370
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3665
|
+
</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">
|
3371
3666
|
<xsl:value-of select="."/>
|
3372
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3667
|
+
</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">
|
3373
3668
|
<xsl:value-of select="."/>
|
3374
3669
|
</xsl:template><xsl:template match="node()" mode="contents">
|
3375
3670
|
<xsl:apply-templates mode="contents"/>
|
3376
3671
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3377
3672
|
<xsl:apply-templates mode="bookmarks"/>
|
3378
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3673
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
3379
3674
|
<xsl:apply-templates select="."/>
|
3380
3675
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3381
3676
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -3574,6 +3869,8 @@
|
|
3574
3869
|
</fo:list-item-body>
|
3575
3870
|
</fo:list-item>
|
3576
3871
|
</fo:list-block>
|
3872
|
+
</xsl:template><xsl:template name="extractSection">
|
3873
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3577
3874
|
</xsl:template><xsl:template name="extractTitle">
|
3578
3875
|
<xsl:choose>
|
3579
3876
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -3600,6 +3897,7 @@
|
|
3600
3897
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
3601
3898
|
|
3602
3899
|
<fo:block-container margin-left="0mm">
|
3900
|
+
<xsl:copy-of select="@id"/>
|
3603
3901
|
<xsl:if test="parent::*[local-name() = 'note']">
|
3604
3902
|
<xsl:attribute name="margin-left">
|
3605
3903
|
<xsl:choose>
|
@@ -3621,6 +3919,7 @@
|
|
3621
3919
|
|
3622
3920
|
|
3623
3921
|
|
3922
|
+
|
3624
3923
|
|
3625
3924
|
|
3626
3925
|
|
@@ -3876,6 +4175,7 @@
|
|
3876
4175
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
3877
4176
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
3878
4177
|
|
4178
|
+
|
3879
4179
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
3880
4180
|
|
3881
4181
|
<xsl:variable name="element">
|
@@ -3903,6 +4203,7 @@
|
|
3903
4203
|
<xsl:variable name="element">
|
3904
4204
|
|
3905
4205
|
inline
|
4206
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
3906
4207
|
</xsl:variable>
|
3907
4208
|
<xsl:choose>
|
3908
4209
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -3910,7 +4211,7 @@
|
|
3910
4211
|
<xsl:apply-templates/>
|
3911
4212
|
</fo:inline>
|
3912
4213
|
</xsl:when>
|
3913
|
-
<xsl:when test="normalize-space($element)
|
4214
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
3914
4215
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
3915
4216
|
<xsl:apply-templates/>
|
3916
4217
|
</fo:block>
|
@@ -3942,7 +4243,7 @@
|
|
3942
4243
|
</fo:inline>
|
3943
4244
|
</xsl:otherwise>
|
3944
4245
|
</xsl:choose>
|
3945
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
4246
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
3946
4247
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
3947
4248
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
3948
4249
|
<xsl:variable name="termsource_text">
|
@@ -3951,13 +4252,15 @@
|
|
3951
4252
|
|
3952
4253
|
<xsl:choose>
|
3953
4254
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
3954
|
-
<xsl:apply-templates/>
|
4255
|
+
<!-- <xsl:apply-templates /> -->
|
4256
|
+
<xsl:copy-of select="$termsource_text"/>
|
3955
4257
|
</xsl:when>
|
3956
4258
|
<xsl:otherwise>
|
3957
4259
|
|
3958
4260
|
<xsl:text>[</xsl:text>
|
3959
4261
|
|
3960
|
-
<xsl:apply-templates/>
|
4262
|
+
<!-- <xsl:apply-templates /> -->
|
4263
|
+
<xsl:copy-of select="$termsource_text"/>
|
3961
4264
|
|
3962
4265
|
<xsl:text>]</xsl:text>
|
3963
4266
|
|
@@ -3968,8 +4271,15 @@
|
|
3968
4271
|
<xsl:if test="normalize-space() != ''">
|
3969
4272
|
<xsl:value-of select="."/>
|
3970
4273
|
</xsl:if>
|
3971
|
-
</xsl:template><xsl:
|
4274
|
+
</xsl:template><xsl:variable name="localized.source">
|
4275
|
+
<xsl:call-template name="getLocalizedString">
|
4276
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
4277
|
+
</xsl:call-template>
|
4278
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
3972
4279
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4280
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4281
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4282
|
+
</xsl:if>
|
3973
4283
|
|
3974
4284
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
3975
4285
|
<xsl:apply-templates/>
|
@@ -4075,6 +4385,7 @@
|
|
4075
4385
|
|
4076
4386
|
|
4077
4387
|
|
4388
|
+
|
4078
4389
|
|
4079
4390
|
<xsl:variable name="references_num_current">
|
4080
4391
|
<xsl:number level="any" count="m3d:references"/>
|
@@ -4119,7 +4430,8 @@
|
|
4119
4430
|
</fo:inline>
|
4120
4431
|
</xsl:when>
|
4121
4432
|
<xsl:otherwise>
|
4122
|
-
<
|
4433
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
4434
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
4123
4435
|
</xsl:otherwise>
|
4124
4436
|
</xsl:choose>
|
4125
4437
|
|
@@ -4180,7 +4492,6 @@
|
|
4180
4492
|
|
4181
4493
|
|
4182
4494
|
|
4183
|
-
|
4184
4495
|
<xsl:apply-templates/>
|
4185
4496
|
</fo:block>
|
4186
4497
|
|
@@ -4223,7 +4534,7 @@
|
|
4223
4534
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
4224
4535
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
4225
4536
|
<xsl:choose>
|
4226
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
4537
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
4227
4538
|
<fo:block-container>
|
4228
4539
|
<xsl:attribute name="margin-left">
|
4229
4540
|
<xsl:choose>
|
@@ -4233,6 +4544,7 @@
|
|
4233
4544
|
</xsl:attribute>
|
4234
4545
|
|
4235
4546
|
|
4547
|
+
|
4236
4548
|
<fo:block-container margin-left="0mm">
|
4237
4549
|
<fo:block>
|
4238
4550
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -4434,6 +4746,10 @@
|
|
4434
4746
|
|
4435
4747
|
|
4436
4748
|
|
4749
|
+
|
4750
|
+
|
4751
|
+
|
4752
|
+
|
4437
4753
|
</xsl:template><xsl:template name="processBibitemDocId">
|
4438
4754
|
<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')]"/>
|
4439
4755
|
<xsl:choose>
|
@@ -4490,6 +4806,70 @@
|
|
4490
4806
|
<xsl:value-of select="substring(.,1,1)"/>
|
4491
4807
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4492
4808
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4809
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
4810
|
+
<fo:block>
|
4811
|
+
<xsl:apply-templates/>
|
4812
|
+
</fo:block>
|
4813
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
4814
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4815
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
4816
|
+
<fo:inline>
|
4817
|
+
<xsl:call-template name="text_input"/>
|
4818
|
+
</fo:inline>
|
4819
|
+
</xsl:template><xsl:template name="text_input">
|
4820
|
+
<xsl:variable name="count">
|
4821
|
+
<xsl:choose>
|
4822
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
4823
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
4824
|
+
<xsl:otherwise>10</xsl:otherwise>
|
4825
|
+
</xsl:choose>
|
4826
|
+
</xsl:variable>
|
4827
|
+
<xsl:call-template name="repeat">
|
4828
|
+
<xsl:with-param name="char" select="'_'"/>
|
4829
|
+
<xsl:with-param name="count" select="$count"/>
|
4830
|
+
</xsl:call-template>
|
4831
|
+
<xsl:text> </xsl:text>
|
4832
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
4833
|
+
<xsl:variable name="caption">
|
4834
|
+
<xsl:choose>
|
4835
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
4836
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
4837
|
+
</xsl:choose>
|
4838
|
+
</xsl:variable>
|
4839
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
4840
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
4841
|
+
<fo:inline padding-right="1mm">
|
4842
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
4843
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
4844
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
4845
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4846
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4847
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
4848
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
4849
|
+
</svg>
|
4850
|
+
</fo:instream-foreign-object>
|
4851
|
+
</fo:inline>
|
4852
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
4853
|
+
<fo:inline padding-right="1mm">
|
4854
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
4855
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
4856
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
4857
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4858
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4859
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
4860
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
4861
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
4862
|
+
</svg>
|
4863
|
+
</fo:instream-foreign-object>
|
4864
|
+
</fo:inline>
|
4865
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
4866
|
+
<fo:inline>
|
4867
|
+
<xsl:call-template name="text_input"/>
|
4868
|
+
</fo:inline>
|
4869
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
4870
|
+
<fo:block-container border="1pt solid black" width="50%">
|
4871
|
+
<fo:block> </fo:block>
|
4872
|
+
</fo:block-container>
|
4493
4873
|
</xsl:template><xsl:template name="convertDate">
|
4494
4874
|
<xsl:param name="date"/>
|
4495
4875
|
<xsl:param name="format" select="'short'"/>
|
@@ -4697,6 +5077,9 @@
|
|
4697
5077
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
4698
5078
|
<xsl:value-of select="$level_total - 1"/>
|
4699
5079
|
</xsl:when>
|
5080
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
5081
|
+
<xsl:value-of select="$level_total - 1"/>
|
5082
|
+
</xsl:when>
|
4700
5083
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
4701
5084
|
<xsl:value-of select="$level_total - 2"/>
|
4702
5085
|
</xsl:when>
|
@@ -4761,6 +5144,7 @@
|
|
4761
5144
|
|
4762
5145
|
|
4763
5146
|
|
5147
|
+
|
4764
5148
|
<xsl:value-of select="document('')//*/namespace::m3d"/>
|
4765
5149
|
|
4766
5150
|
|
@@ -4821,17 +5205,69 @@
|
|
4821
5205
|
</xsl:call-template>
|
4822
5206
|
</xsl:if>
|
4823
5207
|
</xsl:template><xsl:template name="getLocalizedString">
|
4824
|
-
<xsl:param name="key"/>
|
5208
|
+
<xsl:param name="key"/>
|
4825
5209
|
|
4826
5210
|
<xsl:variable name="curr_lang">
|
4827
5211
|
<xsl:call-template name="getLang"/>
|
4828
5212
|
</xsl:variable>
|
4829
5213
|
|
5214
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5215
|
+
|
4830
5216
|
<xsl:choose>
|
5217
|
+
<xsl:when test="$data_value != ''">
|
5218
|
+
<xsl:value-of select="$data_value"/>
|
5219
|
+
</xsl:when>
|
4831
5220
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4832
5221
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4833
5222
|
</xsl:when>
|
4834
|
-
<xsl:otherwise
|
5223
|
+
<xsl:otherwise>
|
5224
|
+
<xsl:variable name="key_">
|
5225
|
+
<xsl:call-template name="capitalize">
|
5226
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
5227
|
+
</xsl:call-template>
|
5228
|
+
</xsl:variable>
|
5229
|
+
<xsl:value-of select="$key_"/>
|
5230
|
+
</xsl:otherwise>
|
4835
5231
|
</xsl:choose>
|
4836
5232
|
|
5233
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5234
|
+
<xsl:param name="isAdded"/>
|
5235
|
+
<xsl:param name="isDeleted"/>
|
5236
|
+
<xsl:choose>
|
5237
|
+
<xsl:when test="local-name() = 'math'">
|
5238
|
+
<xsl:if test="$isAdded = 'true'">
|
5239
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
5240
|
+
</xsl:if>
|
5241
|
+
<xsl:if test="$isDeleted = 'true'">
|
5242
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
5243
|
+
</xsl:if>
|
5244
|
+
</xsl:when>
|
5245
|
+
<xsl:otherwise>
|
5246
|
+
<xsl:if test="$isAdded = 'true'">
|
5247
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
5248
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5249
|
+
</xsl:if>
|
5250
|
+
<xsl:if test="$isDeleted = 'true'">
|
5251
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
5252
|
+
<xsl:if test="local-name() = 'table'">
|
5253
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
5254
|
+
</xsl:if>
|
5255
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
5256
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5257
|
+
</xsl:if>
|
5258
|
+
</xsl:otherwise>
|
5259
|
+
</xsl:choose>
|
5260
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
5261
|
+
<xsl:if test="$lang = 'ar'">
|
5262
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
5263
|
+
</xsl:if>
|
5264
|
+
</xsl:template><xsl:template name="setAlignment">
|
5265
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
5266
|
+
<xsl:choose>
|
5267
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
5268
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
5269
|
+
<xsl:when test="$align != ''">
|
5270
|
+
<xsl:value-of select="$align"/>
|
5271
|
+
</xsl:when>
|
5272
|
+
</xsl:choose>
|
4837
5273
|
</xsl:template></xsl:stylesheet>
|