metanorma-ribose 1.6.13 → 1.7.1
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 +11 -44
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/ribose/biblio.rng +4 -6
- data/lib/asciidoctor/ribose/boilerplate.xml +6 -6
- data/lib/asciidoctor/ribose/isodoc.rng +172 -3
- data/lib/asciidoctor/ribose/rsd.rng +6 -0
- data/lib/isodoc/ribose/html/header.html +10 -10
- data/lib/isodoc/ribose/html/html_rsd_titlepage.html +6 -6
- data/lib/isodoc/ribose/html/htmlstyle.css +7 -0
- data/lib/isodoc/ribose/html/word_rsd_intro.html +1 -1
- data/lib/isodoc/ribose/pdf_convert.rb +3 -4
- data/lib/isodoc/ribose/{rsd.standard.xsl → ribose.standard.xsl} +587 -129
- data/lib/metanorma/ribose/version.rb +1 -1
- data/metanorma-ribose.gemspec +3 -3
- metadata +11 -11
@@ -76,16 +76,16 @@
|
|
76
76
|
<div id="boilerplate-copyright-destination"/>
|
77
77
|
</div>
|
78
78
|
|
79
|
-
<div class="message">
|
80
|
-
<div id="boilerplate-legal-destination"/>
|
81
|
-
</div>
|
82
|
-
|
83
79
|
<div class="contact-info">
|
84
80
|
<div id="boilerplate-feedback-destination"/>
|
85
|
-
</div>
|
86
81
|
</div>
|
87
82
|
|
88
|
-
<div class="
|
83
|
+
<div class="message">
|
84
|
+
<div id="boilerplate-legal-destination"/>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<div class="rule"></div>
|
89
89
|
</div>
|
90
90
|
</div>
|
91
91
|
|
@@ -115,6 +115,13 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
115
115
|
content: ", ";
|
116
116
|
vertical-align: super; }
|
117
117
|
|
118
|
+
.addition {
|
119
|
+
color: blue; }
|
120
|
+
|
121
|
+
.deletion {
|
122
|
+
color: red;
|
123
|
+
text-decoration: line-through; }
|
124
|
+
|
118
125
|
#standard-band {
|
119
126
|
background-color: #0AC442; }
|
120
127
|
|
@@ -4,16 +4,15 @@ module IsoDoc
|
|
4
4
|
module Ribose
|
5
5
|
# A {Converter} implementation that generates PDF HTML output, and a
|
6
6
|
# document schema encapsulation of the document for validation
|
7
|
-
class PdfConvert <
|
7
|
+
class PdfConvert < IsoDoc::XslfoPdfConvert
|
8
8
|
def initialize(options)
|
9
9
|
@libdir = File.dirname(__FILE__)
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
-
def pdf_stylesheet(
|
14
|
-
"
|
13
|
+
def pdf_stylesheet(_docxml)
|
14
|
+
"ribose.standard.xsl"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
@@ -3,7 +3,9 @@
|
|
3
3
|
<xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
6
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
7
9
|
|
8
10
|
<xsl:variable name="pageWidth" select="'210mm'"/>
|
9
11
|
<xsl:variable name="pageHeight" select="'297mm'"/>
|
@@ -89,7 +91,9 @@
|
|
89
91
|
</fo:page-sequence-master>
|
90
92
|
</fo:layout-master-set>
|
91
93
|
|
92
|
-
<
|
94
|
+
<fo:declarations>
|
95
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
96
|
+
</fo:declarations>
|
93
97
|
|
94
98
|
<xsl:call-template name="addBookmarks">
|
95
99
|
<xsl:with-param name="contents" select="$contents"/>
|
@@ -210,6 +214,8 @@
|
|
210
214
|
|
211
215
|
<xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:legal-statement"/>
|
212
216
|
|
217
|
+
<xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:feedback-statement"/>
|
218
|
+
|
213
219
|
</fo:flow>
|
214
220
|
</fo:page-sequence>
|
215
221
|
|
@@ -343,9 +349,11 @@
|
|
343
349
|
</xsl:template>
|
344
350
|
|
345
351
|
<xsl:template match="rsd:feedback-statement">
|
346
|
-
<fo:block
|
347
|
-
<
|
348
|
-
|
352
|
+
<fo:block-container border="1pt solid black" padding="1mm" padding-left="2mm">
|
353
|
+
<fo:block>
|
354
|
+
<xsl:apply-templates/>
|
355
|
+
</fo:block>
|
356
|
+
</fo:block-container>
|
349
357
|
</xsl:template>
|
350
358
|
|
351
359
|
<xsl:template match="rsd:copyright-statement//rsd:title">
|
@@ -474,6 +482,7 @@
|
|
474
482
|
<xsl:attribute name="space-after">
|
475
483
|
<xsl:choose>
|
476
484
|
<xsl:when test="ancestor::rsd:li">0pt</xsl:when>
|
485
|
+
<xsl:when test="ancestor::rsd:feedback-statement and not(following-sibling::rsd:p)">0pt</xsl:when>
|
477
486
|
<xsl:otherwise>12pt</xsl:otherwise>
|
478
487
|
</xsl:choose>
|
479
488
|
</xsl:attribute>
|
@@ -1050,6 +1059,7 @@
|
|
1050
1059
|
</xsl:choose>
|
1051
1060
|
</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">
|
1052
1061
|
|
1062
|
+
|
1053
1063
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1054
1064
|
|
1055
1065
|
<xsl:attribute name="color">blue</xsl:attribute>
|
@@ -1161,6 +1171,7 @@
|
|
1161
1171
|
|
1162
1172
|
|
1163
1173
|
|
1174
|
+
|
1164
1175
|
|
1165
1176
|
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
|
1166
1177
|
|
@@ -1390,7 +1401,7 @@
|
|
1390
1401
|
|
1391
1402
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1392
1403
|
|
1393
|
-
|
1404
|
+
|
1394
1405
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1395
1406
|
|
1396
1407
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
@@ -1398,7 +1409,25 @@
|
|
1398
1409
|
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
1399
1410
|
|
1400
1411
|
|
1401
|
-
</xsl:attribute-set><xsl:
|
1412
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1413
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1414
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
1415
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1416
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1417
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
1418
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
1419
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
1420
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
1421
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
1422
|
+
<xsl:text>red</xsl:text>
|
1423
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
1424
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
1425
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1426
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
1427
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1428
|
+
|
1429
|
+
|
1430
|
+
</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">
|
1402
1431
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1403
1432
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1404
1433
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -1443,16 +1472,17 @@
|
|
1443
1472
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1444
1473
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1445
1474
|
|
1475
|
+
<xsl:variable name="table-preamble">
|
1476
|
+
|
1477
|
+
|
1478
|
+
</xsl:variable>
|
1479
|
+
|
1446
1480
|
<xsl:variable name="table">
|
1447
1481
|
|
1448
1482
|
<xsl:variable name="simple-table">
|
1449
1483
|
<xsl:call-template name="getSimpleTable"/>
|
1450
1484
|
</xsl:variable>
|
1451
1485
|
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
1486
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1457
1487
|
<fo:block> </fo:block>
|
1458
1488
|
</xsl:if> -->
|
@@ -1465,7 +1495,7 @@
|
|
1465
1495
|
|
1466
1496
|
|
1467
1497
|
|
1468
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
1498
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
1469
1499
|
|
1470
1500
|
<!-- <xsl:variable name="cols-count">
|
1471
1501
|
<xsl:choose>
|
@@ -1484,8 +1514,6 @@
|
|
1484
1514
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1485
1515
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1486
1516
|
|
1487
|
-
|
1488
|
-
|
1489
1517
|
<xsl:variable name="colwidths">
|
1490
1518
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1491
1519
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1513,6 +1541,7 @@
|
|
1513
1541
|
</xsl:choose>
|
1514
1542
|
</xsl:variable>
|
1515
1543
|
|
1544
|
+
|
1516
1545
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1517
1546
|
|
1518
1547
|
|
@@ -1544,6 +1573,7 @@
|
|
1544
1573
|
|
1545
1574
|
|
1546
1575
|
|
1576
|
+
|
1547
1577
|
|
1548
1578
|
|
1549
1579
|
|
@@ -1633,7 +1663,8 @@
|
|
1633
1663
|
</fo:block-container>
|
1634
1664
|
</xsl:variable>
|
1635
1665
|
|
1636
|
-
|
1666
|
+
<xsl:variable name="isAdded" select="@added"/>
|
1667
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
1637
1668
|
|
1638
1669
|
<xsl:choose>
|
1639
1670
|
<xsl:when test="@width">
|
@@ -1647,7 +1678,14 @@
|
|
1647
1678
|
<fo:table-body>
|
1648
1679
|
<fo:table-row>
|
1649
1680
|
<fo:table-cell column-number="2">
|
1650
|
-
<
|
1681
|
+
<xsl:copy-of select="$table-preamble"/>
|
1682
|
+
<fo:block>
|
1683
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1684
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1685
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1686
|
+
</xsl:call-template>
|
1687
|
+
<xsl:copy-of select="$table"/>
|
1688
|
+
</fo:block>
|
1651
1689
|
</fo:table-cell>
|
1652
1690
|
</fo:table-row>
|
1653
1691
|
</fo:table-body>
|
@@ -1658,7 +1696,22 @@
|
|
1658
1696
|
|
1659
1697
|
</xsl:when>
|
1660
1698
|
<xsl:otherwise>
|
1661
|
-
<xsl:
|
1699
|
+
<xsl:choose>
|
1700
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1701
|
+
<xsl:copy-of select="$table-preamble"/>
|
1702
|
+
<fo:block>
|
1703
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1704
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1705
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1706
|
+
</xsl:call-template>
|
1707
|
+
<xsl:copy-of select="$table"/>
|
1708
|
+
</fo:block>
|
1709
|
+
</xsl:when>
|
1710
|
+
<xsl:otherwise>
|
1711
|
+
<xsl:copy-of select="$table-preamble"/>
|
1712
|
+
<xsl:copy-of select="$table"/>
|
1713
|
+
</xsl:otherwise>
|
1714
|
+
</xsl:choose>
|
1662
1715
|
</xsl:otherwise>
|
1663
1716
|
</xsl:choose>
|
1664
1717
|
|
@@ -1719,7 +1772,7 @@
|
|
1719
1772
|
</xsl:for-each>
|
1720
1773
|
</xsl:when>
|
1721
1774
|
<xsl:otherwise>
|
1722
|
-
<xsl:for-each select="xalan:nodeset($table)
|
1775
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
1723
1776
|
<xsl:variable name="td_text">
|
1724
1777
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1725
1778
|
|
@@ -1789,7 +1842,15 @@
|
|
1789
1842
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1790
1843
|
<xsl:value-of select="@target"/>
|
1791
1844
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1792
|
-
<xsl:variable name="
|
1845
|
+
<xsl:variable name="mathml">
|
1846
|
+
<xsl:for-each select="*">
|
1847
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
1848
|
+
<xsl:copy-of select="."/>
|
1849
|
+
</xsl:if>
|
1850
|
+
</xsl:for-each>
|
1851
|
+
</xsl:variable>
|
1852
|
+
|
1853
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
1793
1854
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1794
1855
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1795
1856
|
<xsl:param name="cols-count"/>
|
@@ -2051,7 +2112,8 @@
|
|
2051
2112
|
<xsl:attribute name="text-align">
|
2052
2113
|
<xsl:choose>
|
2053
2114
|
<xsl:when test="@align">
|
2054
|
-
<xsl:
|
2115
|
+
<xsl:call-template name="setAlignment"/>
|
2116
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2055
2117
|
</xsl:when>
|
2056
2118
|
<xsl:otherwise>center</xsl:otherwise>
|
2057
2119
|
</xsl:choose>
|
@@ -2067,6 +2129,9 @@
|
|
2067
2129
|
|
2068
2130
|
|
2069
2131
|
|
2132
|
+
<xsl:if test="$lang = 'ar'">
|
2133
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2134
|
+
</xsl:if>
|
2070
2135
|
<xsl:if test="@colspan">
|
2071
2136
|
<xsl:attribute name="number-columns-spanned">
|
2072
2137
|
<xsl:value-of select="@colspan"/>
|
@@ -2098,11 +2163,15 @@
|
|
2098
2163
|
<xsl:attribute name="text-align">
|
2099
2164
|
<xsl:choose>
|
2100
2165
|
<xsl:when test="@align">
|
2101
|
-
<xsl:
|
2166
|
+
<xsl:call-template name="setAlignment"/>
|
2167
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2102
2168
|
</xsl:when>
|
2103
2169
|
<xsl:otherwise>left</xsl:otherwise>
|
2104
2170
|
</xsl:choose>
|
2105
2171
|
</xsl:attribute>
|
2172
|
+
<xsl:if test="$lang = 'ar'">
|
2173
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2174
|
+
</xsl:if>
|
2106
2175
|
|
2107
2176
|
|
2108
2177
|
|
@@ -2114,6 +2183,9 @@
|
|
2114
2183
|
|
2115
2184
|
|
2116
2185
|
|
2186
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
2187
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2188
|
+
</xsl:if>
|
2117
2189
|
<xsl:if test="@colspan">
|
2118
2190
|
<xsl:attribute name="number-columns-spanned">
|
2119
2191
|
<xsl:value-of select="@colspan"/>
|
@@ -2239,13 +2311,13 @@
|
|
2239
2311
|
</xsl:choose>
|
2240
2312
|
</xsl:variable>
|
2241
2313
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2242
|
-
<xsl:element name="{$ns}:table">
|
2314
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2243
2315
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2244
2316
|
<tbody>
|
2245
2317
|
<xsl:apply-templates mode="dl"/>
|
2246
2318
|
</tbody>
|
2247
2319
|
</xsl:for-each>
|
2248
|
-
</xsl:element>
|
2320
|
+
<!-- </xsl:element> -->
|
2249
2321
|
</xsl:variable>
|
2250
2322
|
|
2251
2323
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2336,6 +2408,8 @@
|
|
2336
2408
|
<xsl:apply-templates/>
|
2337
2409
|
</fo:inline>
|
2338
2410
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2411
|
+
<xsl:variable name="isAdded" select="@added"/>
|
2412
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2339
2413
|
<fo:block-container>
|
2340
2414
|
|
2341
2415
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -2352,6 +2426,12 @@
|
|
2352
2426
|
</xsl:attribute>
|
2353
2427
|
|
2354
2428
|
</xsl:if>
|
2429
|
+
|
2430
|
+
<xsl:call-template name="setTrackChangesStyles">
|
2431
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
2432
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
2433
|
+
</xsl:call-template>
|
2434
|
+
|
2355
2435
|
<fo:block-container>
|
2356
2436
|
|
2357
2437
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -2459,11 +2539,11 @@
|
|
2459
2539
|
</xsl:choose>
|
2460
2540
|
</xsl:variable>
|
2461
2541
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2462
|
-
<xsl:element name="{$ns}:table">
|
2542
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2463
2543
|
<tbody>
|
2464
2544
|
<xsl:apply-templates mode="dl"/>
|
2465
2545
|
</tbody>
|
2466
|
-
</xsl:element>
|
2546
|
+
<!-- </xsl:element> -->
|
2467
2547
|
</xsl:variable>
|
2468
2548
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
2469
2549
|
<xsl:variable name="colwidths">
|
@@ -2732,8 +2812,78 @@
|
|
2732
2812
|
<fo:inline text-decoration="underline">
|
2733
2813
|
<xsl:apply-templates/>
|
2734
2814
|
</fo:inline>
|
2815
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
2816
|
+
<xsl:choose>
|
2817
|
+
<xsl:when test="@amendment">
|
2818
|
+
<fo:inline>
|
2819
|
+
<xsl:call-template name="insertTag">
|
2820
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2821
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2822
|
+
</xsl:call-template>
|
2823
|
+
<xsl:apply-templates/>
|
2824
|
+
<xsl:call-template name="insertTag">
|
2825
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2826
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2827
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2828
|
+
</xsl:call-template>
|
2829
|
+
</fo:inline>
|
2830
|
+
</xsl:when>
|
2831
|
+
<xsl:when test="@corrigenda">
|
2832
|
+
<fo:inline>
|
2833
|
+
<xsl:call-template name="insertTag">
|
2834
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2835
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2836
|
+
</xsl:call-template>
|
2837
|
+
<xsl:apply-templates/>
|
2838
|
+
<xsl:call-template name="insertTag">
|
2839
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2840
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2841
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2842
|
+
</xsl:call-template>
|
2843
|
+
</fo:inline>
|
2844
|
+
</xsl:when>
|
2845
|
+
<xsl:otherwise>
|
2846
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2847
|
+
<xsl:apply-templates/>
|
2848
|
+
</fo:inline>
|
2849
|
+
</xsl:otherwise>
|
2850
|
+
</xsl:choose>
|
2851
|
+
|
2852
|
+
</xsl:template><xsl:template name="insertTag">
|
2853
|
+
<xsl:param name="type"/>
|
2854
|
+
<xsl:param name="kind"/>
|
2855
|
+
<xsl:param name="value"/>
|
2856
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
2857
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
2858
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
2859
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
2860
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
2861
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
2862
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
2863
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2864
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2865
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
2866
|
+
<g>
|
2867
|
+
<xsl:if test="$type = 'closing'">
|
2868
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
2869
|
+
</xsl:if>
|
2870
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
2871
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
2872
|
+
</g>
|
2873
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
2874
|
+
<xsl:if test="$type = 'closing'">
|
2875
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
2876
|
+
</xsl:if>
|
2877
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
2878
|
+
</text>
|
2879
|
+
</svg>
|
2880
|
+
</fo:instream-foreign-object>
|
2735
2881
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2736
|
-
<fo:inline
|
2882
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2883
|
+
<xsl:apply-templates/>
|
2884
|
+
</fo:inline>
|
2885
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
2886
|
+
<fo:inline background-color="yellow">
|
2737
2887
|
<xsl:apply-templates/>
|
2738
2888
|
</fo:inline>
|
2739
2889
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
@@ -3070,12 +3220,23 @@
|
|
3070
3220
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
3071
3221
|
<xsl:value-of select="substring($str, 2)"/>
|
3072
3222
|
</xsl:template><xsl:template match="mathml:math">
|
3073
|
-
<
|
3223
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3224
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3225
|
+
|
3226
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
3227
|
+
|
3228
|
+
|
3229
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3230
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3231
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3232
|
+
</xsl:call-template>
|
3074
3233
|
|
3075
3234
|
<xsl:variable name="mathml">
|
3076
3235
|
<xsl:apply-templates select="." mode="mathml"/>
|
3077
3236
|
</xsl:variable>
|
3078
3237
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3238
|
+
|
3239
|
+
|
3079
3240
|
<!-- <xsl:copy-of select="."/> -->
|
3080
3241
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3081
3242
|
</fo:instream-foreign-object>
|
@@ -3094,7 +3255,7 @@
|
|
3094
3255
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3095
3256
|
</xsl:copy>
|
3096
3257
|
<mathml:mspace width="0.5ex"/>
|
3097
|
-
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
3258
|
+
</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">
|
3098
3259
|
<xsl:variable name="target">
|
3099
3260
|
<xsl:choose>
|
3100
3261
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -3128,8 +3289,6 @@
|
|
3128
3289
|
</xsl:otherwise>
|
3129
3290
|
</xsl:choose>
|
3130
3291
|
</fo:inline>
|
3131
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
3132
|
-
<fo:inline id="{@id}"/>
|
3133
3292
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
3134
3293
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
3135
3294
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -3329,8 +3488,15 @@
|
|
3329
3488
|
</fo:inline>
|
3330
3489
|
</xsl:if>
|
3331
3490
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3491
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3492
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3332
3493
|
<fo:block-container id="{@id}">
|
3333
3494
|
|
3495
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3496
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3497
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3498
|
+
</xsl:call-template>
|
3499
|
+
|
3334
3500
|
<fo:block>
|
3335
3501
|
<xsl:apply-templates/>
|
3336
3502
|
</fo:block>
|
@@ -3344,27 +3510,113 @@
|
|
3344
3510
|
<fo:block id="{@id}">
|
3345
3511
|
<xsl:apply-templates/>
|
3346
3512
|
</fo:block>
|
3513
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3347
3514
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
3348
3515
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
3349
3516
|
<xsl:apply-templates/>
|
3350
3517
|
</fo:block>
|
3351
3518
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3352
|
-
<
|
3353
|
-
|
3354
|
-
|
3355
|
-
<xsl:
|
3356
|
-
<
|
3357
|
-
<xsl:
|
3358
|
-
<xsl:
|
3359
|
-
</xsl:
|
3360
|
-
<
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3365
|
-
|
3366
|
-
|
3367
|
-
|
3519
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
3520
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
3521
|
+
<xsl:choose>
|
3522
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3523
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3524
|
+
<xsl:variable name="src">
|
3525
|
+
<xsl:call-template name="image_src"/>
|
3526
|
+
</xsl:variable>
|
3527
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3528
|
+
</fo:inline>
|
3529
|
+
</xsl:when>
|
3530
|
+
<xsl:otherwise>
|
3531
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3532
|
+
|
3533
|
+
<xsl:variable name="src">
|
3534
|
+
<xsl:call-template name="image_src"/>
|
3535
|
+
</xsl:variable>
|
3536
|
+
|
3537
|
+
<xsl:choose>
|
3538
|
+
<xsl:when test="$isDeleted = 'true'">
|
3539
|
+
<!-- enclose in svg -->
|
3540
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
3541
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3542
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3543
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3544
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3545
|
+
|
3546
|
+
|
3547
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
3548
|
+
|
3549
|
+
</fo:instream-foreign-object>
|
3550
|
+
</xsl:when>
|
3551
|
+
<xsl:otherwise>
|
3552
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3553
|
+
</xsl:otherwise>
|
3554
|
+
</xsl:choose>
|
3555
|
+
|
3556
|
+
</fo:block>
|
3557
|
+
</xsl:otherwise>
|
3558
|
+
</xsl:choose>
|
3559
|
+
</xsl:template><xsl:template name="image_src">
|
3560
|
+
<xsl:choose>
|
3561
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3562
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3563
|
+
</xsl:when>
|
3564
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3565
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3566
|
+
</xsl:when>
|
3567
|
+
<xsl:otherwise>
|
3568
|
+
<xsl:value-of select="@src"/>
|
3569
|
+
</xsl:otherwise>
|
3570
|
+
</xsl:choose>
|
3571
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
3572
|
+
<xsl:choose>
|
3573
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3574
|
+
<xsl:variable name="src">
|
3575
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3576
|
+
</xsl:variable>
|
3577
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
3578
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
3579
|
+
<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">
|
3580
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3581
|
+
</svg>
|
3582
|
+
</xsl:when>
|
3583
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3584
|
+
<xsl:variable name="src">
|
3585
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3586
|
+
</xsl:variable>
|
3587
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
3588
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
3589
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3590
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3591
|
+
<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">
|
3592
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3593
|
+
</svg>
|
3594
|
+
</xsl:when>
|
3595
|
+
<xsl:otherwise>
|
3596
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
3597
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
3598
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
3599
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
3600
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
3601
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3602
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
3603
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3604
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
3605
|
+
<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">
|
3606
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
3607
|
+
<xsl:call-template name="svg_cross">
|
3608
|
+
<xsl:with-param name="width" select="$width"/>
|
3609
|
+
<xsl:with-param name="height" select="$height"/>
|
3610
|
+
</xsl:call-template>
|
3611
|
+
</svg>
|
3612
|
+
</xsl:otherwise>
|
3613
|
+
</xsl:choose>
|
3614
|
+
|
3615
|
+
</xsl:template><xsl:template name="svg_cross">
|
3616
|
+
<xsl:param name="width"/>
|
3617
|
+
<xsl:param name="height"/>
|
3618
|
+
<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; "/>
|
3619
|
+
<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; "/>
|
3368
3620
|
</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">
|
3369
3621
|
<xsl:apply-templates mode="contents"/>
|
3370
3622
|
<xsl:text> </xsl:text>
|
@@ -3907,6 +4159,7 @@
|
|
3907
4159
|
<xsl:variable name="element">
|
3908
4160
|
block
|
3909
4161
|
|
4162
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
3910
4163
|
</xsl:variable>
|
3911
4164
|
<xsl:choose>
|
3912
4165
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -3914,7 +4167,7 @@
|
|
3914
4167
|
<xsl:apply-templates/>
|
3915
4168
|
</fo:inline>
|
3916
4169
|
</xsl:when>
|
3917
|
-
<xsl:when test="normalize-space($element)
|
4170
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
3918
4171
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
3919
4172
|
<xsl:apply-templates/>
|
3920
4173
|
</fo:block>
|
@@ -3927,10 +4180,11 @@
|
|
3927
4180
|
</xsl:choose>
|
3928
4181
|
|
3929
4182
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
3930
|
-
|
4183
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
3931
4184
|
<xsl:variable name="element">
|
3932
4185
|
block
|
3933
4186
|
|
4187
|
+
|
3934
4188
|
</xsl:variable>
|
3935
4189
|
<xsl:choose>
|
3936
4190
|
<xsl:when test="normalize-space($element) = 'block'">
|
@@ -4034,29 +4288,47 @@
|
|
4034
4288
|
<xsl:text>— </xsl:text>
|
4035
4289
|
<xsl:apply-templates/>
|
4036
4290
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
4037
|
-
|
4038
|
-
|
4039
|
-
|
4040
|
-
|
4041
|
-
|
4042
|
-
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4048
|
-
|
4049
|
-
|
4050
|
-
|
4051
|
-
|
4052
|
-
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
|
4291
|
+
|
4292
|
+
<xsl:variable name="bibitemid">
|
4293
|
+
<xsl:choose>
|
4294
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
4295
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
4296
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
4297
|
+
</xsl:choose>
|
4298
|
+
</xsl:variable>
|
4299
|
+
|
4300
|
+
<xsl:choose>
|
4301
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
4302
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
4303
|
+
<xsl:if test="@type = 'footnote'">
|
4304
|
+
|
4305
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
4306
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
4307
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
4308
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
4309
|
+
|
4310
|
+
|
4311
|
+
</xsl:if>
|
4312
|
+
|
4313
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4314
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4315
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
4316
|
+
</xsl:if>
|
4317
|
+
<xsl:if test="@type = 'inline'">
|
4318
|
+
|
4319
|
+
|
4320
|
+
|
4321
|
+
</xsl:if>
|
4322
|
+
|
4323
|
+
<xsl:apply-templates/>
|
4324
|
+
</fo:basic-link>
|
4325
|
+
|
4326
|
+
</fo:inline>
|
4327
|
+
</xsl:when>
|
4328
|
+
<xsl:otherwise>
|
4329
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4330
|
+
</xsl:otherwise>
|
4331
|
+
</xsl:choose>
|
4060
4332
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
4061
4333
|
<!-- zero-space char -->
|
4062
4334
|
<xsl:variable name="depth">
|
@@ -4109,7 +4381,8 @@
|
|
4109
4381
|
</fo:inline>
|
4110
4382
|
</xsl:when>
|
4111
4383
|
<xsl:otherwise>
|
4112
|
-
<
|
4384
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
4385
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
4113
4386
|
</xsl:otherwise>
|
4114
4387
|
</xsl:choose>
|
4115
4388
|
|
@@ -4234,6 +4507,153 @@
|
|
4234
4507
|
</fo:block>
|
4235
4508
|
</xsl:otherwise>
|
4236
4509
|
</xsl:choose>
|
4510
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
4511
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
4512
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
4513
|
+
</xsl:for-each>
|
4514
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
4515
|
+
<xsl:copy>
|
4516
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
4517
|
+
</xsl:copy>
|
4518
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
4519
|
+
<xsl:variable name="id">
|
4520
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
4521
|
+
</xsl:variable>
|
4522
|
+
<xsl:copy> <!-- add id to xref -->
|
4523
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
4524
|
+
<xsl:attribute name="id">
|
4525
|
+
<xsl:value-of select="$id"/>
|
4526
|
+
</xsl:attribute>
|
4527
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4528
|
+
</xsl:copy>
|
4529
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
4530
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
4531
|
+
<xsl:if test="@to">
|
4532
|
+
<xsl:value-of select="$dash"/>
|
4533
|
+
<xsl:copy>
|
4534
|
+
<xsl:copy-of select="@*"/>
|
4535
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
4536
|
+
<xsl:attribute name="id">
|
4537
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
4538
|
+
</xsl:attribute>
|
4539
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4540
|
+
</xsl:copy>
|
4541
|
+
</xsl:if>
|
4542
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
4543
|
+
<xsl:copy>
|
4544
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
4545
|
+
</xsl:copy>
|
4546
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
4547
|
+
<xsl:copy>
|
4548
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
4549
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
4550
|
+
</xsl:copy>
|
4551
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
4552
|
+
<xsl:param name="element"/>
|
4553
|
+
<xsl:param name="remove" select="'false'"/>
|
4554
|
+
<xsl:param name="target"/>
|
4555
|
+
<!-- <node></node> -->
|
4556
|
+
<xsl:choose>
|
4557
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
4558
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
4559
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
4560
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4561
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
4562
|
+
</xsl:apply-templates>
|
4563
|
+
</xsl:when>
|
4564
|
+
<xsl:when test="self::text()">
|
4565
|
+
<xsl:value-of select="."/>
|
4566
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4567
|
+
</xsl:when>
|
4568
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
4569
|
+
<xsl:variable name="id" select="@id"/>
|
4570
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
4571
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4572
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
4573
|
+
|
4574
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4575
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
4576
|
+
|
4577
|
+
<xsl:choose>
|
4578
|
+
<!-- 2nd pass -->
|
4579
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
4580
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
4581
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
4582
|
+
<!-- [removed_xref] -->
|
4583
|
+
|
4584
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4585
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4586
|
+
<xsl:with-param name="target">
|
4587
|
+
<xsl:choose>
|
4588
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
4589
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
4590
|
+
</xsl:choose>
|
4591
|
+
</xsl:with-param>
|
4592
|
+
</xsl:apply-templates>
|
4593
|
+
</xsl:when>
|
4594
|
+
|
4595
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
4596
|
+
<!-- remove xref -->
|
4597
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4598
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4599
|
+
</xsl:apply-templates>
|
4600
|
+
</xsl:when>
|
4601
|
+
|
4602
|
+
<xsl:otherwise>
|
4603
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4604
|
+
<xsl:with-param name="target" select="$target"/>
|
4605
|
+
</xsl:apply-templates>
|
4606
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4607
|
+
</xsl:otherwise>
|
4608
|
+
</xsl:choose>
|
4609
|
+
</xsl:when>
|
4610
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
4611
|
+
<!-- ul -->
|
4612
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
4613
|
+
</xsl:when>
|
4614
|
+
<xsl:otherwise>
|
4615
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4616
|
+
<xsl:with-param name="target" select="$target"/>
|
4617
|
+
</xsl:apply-templates>
|
4618
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4619
|
+
</xsl:otherwise>
|
4620
|
+
</xsl:choose>
|
4621
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
4622
|
+
<xsl:param name="target"/>
|
4623
|
+
<xsl:copy>
|
4624
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
4625
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
4626
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
4627
|
+
</xsl:if>
|
4628
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
4629
|
+
</xsl:copy>
|
4630
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
4631
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4632
|
+
|
4633
|
+
<xsl:variable name="docid">
|
4634
|
+
<xsl:call-template name="getDocumentId"/>
|
4635
|
+
</xsl:variable>
|
4636
|
+
<xsl:variable name="item_number">
|
4637
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
4638
|
+
</xsl:variable>
|
4639
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
4640
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
4641
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
4642
|
+
<xsl:apply-templates/>
|
4643
|
+
<fo:block>
|
4644
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
4645
|
+
<fo:block> </fo:block>
|
4646
|
+
</xsl:if>
|
4647
|
+
</fo:block>
|
4648
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
4649
|
+
<xsl:apply-templates/>
|
4650
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
4651
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4652
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4653
|
+
<xsl:apply-templates/>
|
4654
|
+
</fo:block>
|
4655
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
4656
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4237
4657
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4238
4658
|
<!-- <row>
|
4239
4659
|
<date>05-07-2013</date>
|
@@ -4450,70 +4870,68 @@
|
|
4450
4870
|
<xsl:variable name="lang">
|
4451
4871
|
<xsl:call-template name="getLang"/>
|
4452
4872
|
</xsl:variable>
|
4453
|
-
<
|
4454
|
-
|
4455
|
-
<pdf:
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
<
|
4460
|
-
<rdf:
|
4461
|
-
|
4462
|
-
|
4463
|
-
<
|
4464
|
-
<xsl:variable name="title">
|
4465
|
-
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
</xsl:for-each>
|
4475
|
-
</xsl:variable>
|
4476
|
-
<xsl:choose>
|
4477
|
-
<xsl:when test="normalize-space($title) != ''">
|
4478
|
-
<xsl:value-of select="$title"/>
|
4479
|
-
</xsl:when>
|
4480
|
-
<xsl:otherwise>
|
4481
|
-
<xsl:text> </xsl:text>
|
4482
|
-
</xsl:otherwise>
|
4483
|
-
</xsl:choose>
|
4484
|
-
</dc:title>
|
4485
|
-
<dc:creator>
|
4873
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4874
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4875
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4876
|
+
</pdf:dictionary>
|
4877
|
+
</pdf:catalog>
|
4878
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4879
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4880
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4881
|
+
<!-- Dublin Core properties go here -->
|
4882
|
+
<dc:title>
|
4883
|
+
<xsl:variable name="title">
|
4486
4884
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4487
4885
|
|
4488
|
-
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4489
|
-
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4490
|
-
<xsl:if test="position() != last()">; </xsl:if>
|
4491
|
-
</xsl:for-each>
|
4492
|
-
|
4493
|
-
|
4494
4886
|
|
4495
|
-
</xsl:for-each>
|
4496
|
-
</dc:creator>
|
4497
|
-
<dc:description>
|
4498
|
-
<xsl:variable name="abstract">
|
4499
4887
|
|
4500
|
-
|
4888
|
+
|
4889
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
4501
4890
|
|
4502
4891
|
|
4503
|
-
|
4504
|
-
|
4505
|
-
</
|
4506
|
-
<
|
4507
|
-
<xsl:
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
4515
|
-
|
4516
|
-
|
4892
|
+
|
4893
|
+
</xsl:for-each>
|
4894
|
+
</xsl:variable>
|
4895
|
+
<xsl:choose>
|
4896
|
+
<xsl:when test="normalize-space($title) != ''">
|
4897
|
+
<xsl:value-of select="$title"/>
|
4898
|
+
</xsl:when>
|
4899
|
+
<xsl:otherwise>
|
4900
|
+
<xsl:text> </xsl:text>
|
4901
|
+
</xsl:otherwise>
|
4902
|
+
</xsl:choose>
|
4903
|
+
</dc:title>
|
4904
|
+
<dc:creator>
|
4905
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4906
|
+
|
4907
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4908
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4909
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
4910
|
+
</xsl:for-each>
|
4911
|
+
|
4912
|
+
|
4913
|
+
|
4914
|
+
</xsl:for-each>
|
4915
|
+
</dc:creator>
|
4916
|
+
<dc:description>
|
4917
|
+
<xsl:variable name="abstract">
|
4918
|
+
|
4919
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4920
|
+
|
4921
|
+
|
4922
|
+
</xsl:variable>
|
4923
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
4924
|
+
</dc:description>
|
4925
|
+
<pdf:Keywords>
|
4926
|
+
<xsl:call-template name="insertKeywords"/>
|
4927
|
+
</pdf:Keywords>
|
4928
|
+
</rdf:Description>
|
4929
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
4930
|
+
<!-- XMP properties go here -->
|
4931
|
+
<xmp:CreatorTool/>
|
4932
|
+
</rdf:Description>
|
4933
|
+
</rdf:RDF>
|
4934
|
+
</x:xmpmeta>
|
4517
4935
|
</xsl:template><xsl:template name="getId">
|
4518
4936
|
<xsl:choose>
|
4519
4937
|
<xsl:when test="../@id">
|
@@ -4677,4 +5095,44 @@
|
|
4677
5095
|
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4678
5096
|
</xsl:choose>
|
4679
5097
|
|
5098
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5099
|
+
<xsl:param name="isAdded"/>
|
5100
|
+
<xsl:param name="isDeleted"/>
|
5101
|
+
<xsl:choose>
|
5102
|
+
<xsl:when test="local-name() = 'math'">
|
5103
|
+
<xsl:if test="$isAdded = 'true'">
|
5104
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
5105
|
+
</xsl:if>
|
5106
|
+
<xsl:if test="$isDeleted = 'true'">
|
5107
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
5108
|
+
</xsl:if>
|
5109
|
+
</xsl:when>
|
5110
|
+
<xsl:otherwise>
|
5111
|
+
<xsl:if test="$isAdded = 'true'">
|
5112
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
5113
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5114
|
+
</xsl:if>
|
5115
|
+
<xsl:if test="$isDeleted = 'true'">
|
5116
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
5117
|
+
<xsl:if test="local-name() = 'table'">
|
5118
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
5119
|
+
</xsl:if>
|
5120
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
5121
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5122
|
+
</xsl:if>
|
5123
|
+
</xsl:otherwise>
|
5124
|
+
</xsl:choose>
|
5125
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
5126
|
+
<xsl:if test="$lang = 'ar'">
|
5127
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
5128
|
+
</xsl:if>
|
5129
|
+
</xsl:template><xsl:template name="setAlignment">
|
5130
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
5131
|
+
<xsl:choose>
|
5132
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
5133
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
5134
|
+
<xsl:when test="$align != ''">
|
5135
|
+
<xsl:value-of select="$align"/>
|
5136
|
+
</xsl:when>
|
5137
|
+
</xsl:choose>
|
4680
5138
|
</xsl:template></xsl:stylesheet>
|