metanorma-ribose 1.6.12 → 1.7.0
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/isodoc.rng +235 -3
- data/lib/asciidoctor/ribose/rsd.rng +6 -0
- data/lib/isodoc/ribose/html/htmlstyle.css +7 -0
- data/lib/isodoc/ribose/pdf_convert.rb +3 -4
- data/lib/isodoc/ribose/{rsd.standard.xsl → ribose.standard.xsl} +533 -258
- data/lib/metanorma/ribose/version.rb +1 -1
- data/metanorma-ribose.gemspec +3 -3
- metadata +12 -12
@@ -70,6 +70,9 @@
|
|
70
70
|
<zeroOrMore>
|
71
71
|
<ref name="termdocsource"/>
|
72
72
|
</zeroOrMore>
|
73
|
+
<optional>
|
74
|
+
<ref name="misccontainer"/>
|
75
|
+
</optional>
|
73
76
|
<optional>
|
74
77
|
<ref name="boilerplate"/>
|
75
78
|
</optional>
|
@@ -81,6 +84,9 @@
|
|
81
84
|
<ref name="annex"/>
|
82
85
|
</zeroOrMore>
|
83
86
|
<ref name="bibliography"/>
|
87
|
+
<zeroOrMore>
|
88
|
+
<ref name="indexsect"/>
|
89
|
+
</zeroOrMore>
|
84
90
|
</element>
|
85
91
|
</define>
|
86
92
|
</grammar>
|
@@ -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"/>
|
@@ -1161,6 +1165,7 @@
|
|
1161
1165
|
|
1162
1166
|
|
1163
1167
|
|
1168
|
+
|
1164
1169
|
|
1165
1170
|
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
|
1166
1171
|
|
@@ -1390,7 +1395,7 @@
|
|
1390
1395
|
|
1391
1396
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1392
1397
|
|
1393
|
-
|
1398
|
+
|
1394
1399
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1395
1400
|
|
1396
1401
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
@@ -1398,6 +1403,12 @@
|
|
1398
1403
|
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
1399
1404
|
|
1400
1405
|
|
1406
|
+
</xsl:attribute-set><xsl:attribute-set name="add-style">
|
1407
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1408
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1409
|
+
</xsl:attribute-set><xsl:attribute-set name="del-style">
|
1410
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1411
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1401
1412
|
</xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1402
1413
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1403
1414
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1443,191 +1454,225 @@
|
|
1443
1454
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1444
1455
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1445
1456
|
|
1446
|
-
<xsl:variable name="
|
1447
|
-
<xsl:call-template name="getSimpleTable"/>
|
1448
|
-
</xsl:variable>
|
1457
|
+
<xsl:variable name="table">
|
1449
1458
|
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
<!-- <xsl:if test="$namespace = 'bipm'">
|
1455
|
-
<fo:block> </fo:block>
|
1456
|
-
</xsl:if> -->
|
1457
|
-
|
1458
|
-
<!-- $namespace = 'iso' or -->
|
1459
|
-
|
1460
|
-
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1461
|
-
|
1462
|
-
|
1459
|
+
<xsl:variable name="simple-table">
|
1460
|
+
<xsl:call-template name="getSimpleTable"/>
|
1461
|
+
</xsl:variable>
|
1463
1462
|
|
1464
1463
|
|
1465
|
-
|
1466
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1467
|
-
|
1468
|
-
<!-- <xsl:variable name="cols-count">
|
1469
|
-
<xsl:choose>
|
1470
|
-
<xsl:when test="*[local-name()='thead']">
|
1471
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1472
|
-
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1473
|
-
</xsl:call-template>
|
1474
|
-
</xsl:when>
|
1475
|
-
<xsl:otherwise>
|
1476
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1477
|
-
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1478
|
-
</xsl:call-template>
|
1479
|
-
</xsl:otherwise>
|
1480
|
-
</xsl:choose>
|
1481
|
-
</xsl:variable> -->
|
1482
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1483
|
-
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
<xsl:variable name="colwidths">
|
1488
|
-
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1489
|
-
<xsl:call-template name="calculate-column-widths">
|
1490
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1491
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
1492
|
-
</xsl:call-template>
|
1493
|
-
</xsl:if>
|
1494
|
-
</xsl:variable>
|
1495
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1496
|
-
|
1497
|
-
<!-- <xsl:variable name="colwidths2">
|
1498
|
-
<xsl:call-template name="calculate-column-widths">
|
1499
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1500
|
-
</xsl:call-template>
|
1501
|
-
</xsl:variable> -->
|
1502
|
-
|
1503
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1504
|
-
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1505
|
-
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1506
|
-
|
1507
|
-
<xsl:variable name="margin-left">
|
1508
|
-
<xsl:choose>
|
1509
|
-
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1510
|
-
<xsl:otherwise>0</xsl:otherwise>
|
1511
|
-
</xsl:choose>
|
1512
|
-
</xsl:variable>
|
1513
|
-
|
1514
|
-
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1515
1464
|
|
1516
1465
|
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
1466
|
|
1467
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1468
|
+
<fo:block> </fo:block>
|
1469
|
+
</xsl:if> -->
|
1521
1470
|
|
1522
|
-
|
1471
|
+
<!-- $namespace = 'iso' or -->
|
1523
1472
|
|
1473
|
+
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1524
1474
|
|
1475
|
+
|
1525
1476
|
|
1477
|
+
|
1526
1478
|
|
1479
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1527
1480
|
|
1481
|
+
<!-- <xsl:variable name="cols-count">
|
1482
|
+
<xsl:choose>
|
1483
|
+
<xsl:when test="*[local-name()='thead']">
|
1484
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1485
|
+
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1486
|
+
</xsl:call-template>
|
1487
|
+
</xsl:when>
|
1488
|
+
<xsl:otherwise>
|
1489
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1490
|
+
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1491
|
+
</xsl:call-template>
|
1492
|
+
</xsl:otherwise>
|
1493
|
+
</xsl:choose>
|
1494
|
+
</xsl:variable> -->
|
1495
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1496
|
+
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1528
1497
|
|
1529
1498
|
|
1530
|
-
|
1531
|
-
|
1532
|
-
<
|
1533
|
-
<xsl:
|
1534
|
-
<xsl:
|
1535
|
-
<xsl:
|
1536
|
-
</xsl:
|
1537
|
-
</
|
1538
|
-
|
1539
|
-
|
1499
|
+
|
1500
|
+
<xsl:variable name="colwidths">
|
1501
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1502
|
+
<xsl:call-template name="calculate-column-widths">
|
1503
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1504
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1505
|
+
</xsl:call-template>
|
1506
|
+
</xsl:if>
|
1507
|
+
</xsl:variable>
|
1508
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1509
|
+
|
1510
|
+
<!-- <xsl:variable name="colwidths2">
|
1511
|
+
<xsl:call-template name="calculate-column-widths">
|
1512
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1513
|
+
</xsl:call-template>
|
1514
|
+
</xsl:variable> -->
|
1515
|
+
|
1516
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1517
|
+
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1518
|
+
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1519
|
+
|
1520
|
+
<xsl:variable name="margin-left">
|
1521
|
+
<xsl:choose>
|
1522
|
+
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1523
|
+
<xsl:otherwise>0</xsl:otherwise>
|
1524
|
+
</xsl:choose>
|
1525
|
+
</xsl:variable>
|
1526
|
+
|
1527
|
+
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1540
1528
|
|
1541
1529
|
|
1530
|
+
|
1531
|
+
|
1532
|
+
|
1542
1533
|
|
1543
1534
|
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1535
|
+
|
1547
1536
|
|
1548
|
-
|
1549
1537
|
|
1550
|
-
</xsl:variable>
|
1551
|
-
|
1552
|
-
|
1553
|
-
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1554
1538
|
|
1555
|
-
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1556
|
-
<xsl:attribute name="{@name}">
|
1557
|
-
<xsl:value-of select="."/>
|
1558
|
-
</xsl:attribute>
|
1559
|
-
</xsl:for-each>
|
1560
1539
|
|
1561
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1562
|
-
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1563
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1564
|
-
</xsl:if>
|
1565
1540
|
|
1566
|
-
<xsl:choose>
|
1567
|
-
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1568
|
-
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1569
|
-
<fo:table-column column-width="{@width}"/>
|
1570
|
-
</xsl:for-each>
|
1571
|
-
</xsl:when>
|
1572
|
-
<xsl:otherwise>
|
1573
|
-
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1574
|
-
<xsl:choose>
|
1575
|
-
<xsl:when test=". = 1 or . = 0">
|
1576
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
1577
|
-
</xsl:when>
|
1578
|
-
<xsl:otherwise>
|
1579
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
1580
|
-
</xsl:otherwise>
|
1581
|
-
</xsl:choose>
|
1582
|
-
</xsl:for-each>
|
1583
|
-
</xsl:otherwise>
|
1584
|
-
</xsl:choose>
|
1585
1541
|
|
1586
|
-
<xsl:
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1542
|
+
<xsl:variable name="table_width">
|
1543
|
+
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1544
|
+
100%
|
1545
|
+
|
1546
|
+
|
1547
|
+
</xsl:variable>
|
1548
|
+
|
1549
|
+
<xsl:variable name="table_attributes">
|
1550
|
+
<attribute name="table-layout">fixed</attribute>
|
1551
|
+
<attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
|
1552
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1553
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1554
|
+
|
1555
|
+
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
|
1560
|
+
|
1561
|
+
|
1562
|
+
|
1563
|
+
|
1564
|
+
</xsl:variable>
|
1594
1565
|
|
1595
|
-
</fo:table>
|
1596
|
-
|
1597
|
-
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1598
|
-
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1599
|
-
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1600
|
-
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1601
|
-
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1602
|
-
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1603
|
-
</xsl:call-template>
|
1604
|
-
</xsl:for-each>
|
1605
|
-
|
1606
|
-
<!-- insert footer as table -->
|
1607
|
-
<!-- <fo:table>
|
1608
|
-
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1609
|
-
<xsl:attribute name="{@name}">
|
1610
|
-
<xsl:value-of select="."/>
|
1611
|
-
</xsl:attribute>
|
1612
|
-
</xsl:for-each>
|
1613
1566
|
|
1614
|
-
<
|
1567
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1568
|
+
|
1569
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1570
|
+
<xsl:attribute name="{@name}">
|
1571
|
+
<xsl:value-of select="."/>
|
1572
|
+
</xsl:attribute>
|
1573
|
+
</xsl:for-each>
|
1574
|
+
|
1575
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1576
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1577
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1578
|
+
</xsl:if>
|
1579
|
+
|
1615
1580
|
<xsl:choose>
|
1616
|
-
<xsl:when test="
|
1617
|
-
<
|
1581
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1582
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1583
|
+
<fo:table-column column-width="{@width}"/>
|
1584
|
+
</xsl:for-each>
|
1618
1585
|
</xsl:when>
|
1619
1586
|
<xsl:otherwise>
|
1620
|
-
<
|
1587
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1588
|
+
<xsl:choose>
|
1589
|
+
<xsl:when test=". = 1 or . = 0">
|
1590
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1591
|
+
</xsl:when>
|
1592
|
+
<xsl:otherwise>
|
1593
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1594
|
+
</xsl:otherwise>
|
1595
|
+
</xsl:choose>
|
1596
|
+
</xsl:for-each>
|
1621
1597
|
</xsl:otherwise>
|
1622
1598
|
</xsl:choose>
|
1599
|
+
|
1600
|
+
<xsl:choose>
|
1601
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1602
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1603
|
+
</xsl:when>
|
1604
|
+
<xsl:otherwise>
|
1605
|
+
<xsl:apply-templates/>
|
1606
|
+
</xsl:otherwise>
|
1607
|
+
</xsl:choose>
|
1608
|
+
|
1609
|
+
</fo:table>
|
1610
|
+
|
1611
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1612
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1613
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1614
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1615
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1616
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1617
|
+
</xsl:call-template>
|
1623
1618
|
</xsl:for-each>
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1619
|
+
|
1620
|
+
<!-- insert footer as table -->
|
1621
|
+
<!-- <fo:table>
|
1622
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1623
|
+
<xsl:attribute name="{@name}">
|
1624
|
+
<xsl:value-of select="."/>
|
1625
|
+
</xsl:attribute>
|
1626
|
+
</xsl:for-each>
|
1627
|
+
|
1628
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1629
|
+
<xsl:choose>
|
1630
|
+
<xsl:when test=". = 1 or . = 0">
|
1631
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1632
|
+
</xsl:when>
|
1633
|
+
<xsl:otherwise>
|
1634
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1635
|
+
</xsl:otherwise>
|
1636
|
+
</xsl:choose>
|
1637
|
+
</xsl:for-each>
|
1638
|
+
</fo:table>-->
|
1639
|
+
|
1640
|
+
|
1641
|
+
|
1642
|
+
|
1643
|
+
|
1644
|
+
</fo:block-container>
|
1645
|
+
</xsl:variable>
|
1646
|
+
|
1647
|
+
|
1648
|
+
|
1649
|
+
<xsl:choose>
|
1650
|
+
<xsl:when test="@width">
|
1651
|
+
|
1652
|
+
<!-- centered table when table name is centered (see table-name-style) -->
|
1653
|
+
|
1654
|
+
<fo:table table-layout="fixed" width="100%">
|
1655
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1656
|
+
<fo:table-column column-width="{@width}"/>
|
1657
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1658
|
+
<fo:table-body>
|
1659
|
+
<fo:table-row>
|
1660
|
+
<fo:table-cell column-number="2">
|
1661
|
+
<fo:block><xsl:copy-of select="$table"/></fo:block>
|
1662
|
+
</fo:table-cell>
|
1663
|
+
</fo:table-row>
|
1664
|
+
</fo:table-body>
|
1665
|
+
</fo:table>
|
1666
|
+
|
1667
|
+
|
1668
|
+
|
1669
|
+
|
1670
|
+
</xsl:when>
|
1671
|
+
<xsl:otherwise>
|
1672
|
+
<xsl:copy-of select="$table"/>
|
1673
|
+
</xsl:otherwise>
|
1674
|
+
</xsl:choose>
|
1675
|
+
|
1631
1676
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1632
1677
|
<xsl:if test="normalize-space() != ''">
|
1633
1678
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -1755,7 +1800,15 @@
|
|
1755
1800
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1756
1801
|
<xsl:value-of select="@target"/>
|
1757
1802
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1758
|
-
<xsl:variable name="
|
1803
|
+
<xsl:variable name="mathml">
|
1804
|
+
<xsl:for-each select="*">
|
1805
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
1806
|
+
<xsl:copy-of select="."/>
|
1807
|
+
</xsl:if>
|
1808
|
+
</xsl:for-each>
|
1809
|
+
</xsl:variable>
|
1810
|
+
|
1811
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
1759
1812
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1760
1813
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1761
1814
|
<xsl:param name="cols-count"/>
|
@@ -2438,7 +2491,7 @@
|
|
2438
2491
|
<xsl:with-param name="table" select="$html-table"/>
|
2439
2492
|
</xsl:call-template>
|
2440
2493
|
</xsl:variable>
|
2441
|
-
<!-- colwidths=<xsl:
|
2494
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2442
2495
|
<xsl:variable name="maxlength_dt">
|
2443
2496
|
<xsl:call-template name="getMaxLength_dt"/>
|
2444
2497
|
</xsl:variable>
|
@@ -2467,13 +2520,22 @@
|
|
2467
2520
|
</xsl:when>
|
2468
2521
|
<xsl:otherwise>
|
2469
2522
|
<xsl:choose>
|
2523
|
+
<!-- to set width check most wide chars like `W` -->
|
2470
2524
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
2471
|
-
<fo:table-column column-width="
|
2472
|
-
<fo:table-column column-width="
|
2525
|
+
<fo:table-column column-width="7%"/>
|
2526
|
+
<fo:table-column column-width="93%"/>
|
2527
|
+
</xsl:when>
|
2528
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like ABC, etc -->
|
2529
|
+
<fo:table-column column-width="15%"/>
|
2530
|
+
<fo:table-column column-width="85%"/>
|
2531
|
+
</xsl:when>
|
2532
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 7"> <!-- if dt contains short text like ABCDEF, etc -->
|
2533
|
+
<fo:table-column column-width="20%"/>
|
2534
|
+
<fo:table-column column-width="80%"/>
|
2473
2535
|
</xsl:when>
|
2474
|
-
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <=
|
2475
|
-
<fo:table-column column-width="
|
2476
|
-
<fo:table-column column-width="
|
2536
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
|
2537
|
+
<fo:table-column column-width="25%"/>
|
2538
|
+
<fo:table-column column-width="75%"/>
|
2477
2539
|
</xsl:when>
|
2478
2540
|
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
2479
2541
|
<fo:table-column column-width="60%"/>
|
@@ -2689,8 +2751,16 @@
|
|
2689
2751
|
<fo:inline text-decoration="underline">
|
2690
2752
|
<xsl:apply-templates/>
|
2691
2753
|
</fo:inline>
|
2754
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
2755
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2756
|
+
<xsl:apply-templates/>
|
2757
|
+
</fo:inline>
|
2692
2758
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2693
|
-
<fo:inline
|
2759
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2760
|
+
<xsl:apply-templates/>
|
2761
|
+
</fo:inline>
|
2762
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
2763
|
+
<fo:inline background-color="yellow">
|
2694
2764
|
<xsl:apply-templates/>
|
2695
2765
|
</fo:inline>
|
2696
2766
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
@@ -2782,6 +2852,10 @@
|
|
2782
2852
|
<xsl:param name="text" select="."/>
|
2783
2853
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2784
2854
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
2855
|
+
</xsl:template><xsl:template name="add-zero-spaces-link-java">
|
2856
|
+
<xsl:param name="text" select="."/>
|
2857
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2858
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
|
2785
2859
|
</xsl:template><xsl:template name="add-zero-spaces">
|
2786
2860
|
<xsl:param name="text" select="."/>
|
2787
2861
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
@@ -3029,6 +3103,7 @@
|
|
3029
3103
|
<xsl:apply-templates select="." mode="mathml"/>
|
3030
3104
|
</xsl:variable>
|
3031
3105
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3106
|
+
|
3032
3107
|
<!-- <xsl:copy-of select="."/> -->
|
3033
3108
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3034
3109
|
</fo:instream-foreign-object>
|
@@ -3042,7 +3117,12 @@
|
|
3042
3117
|
<!-- replace start and end spaces to non-break space -->
|
3043
3118
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3044
3119
|
</xsl:copy>
|
3045
|
-
</xsl:template><xsl:template match="
|
3120
|
+
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3121
|
+
<xsl:copy>
|
3122
|
+
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3123
|
+
</xsl:copy>
|
3124
|
+
<mathml:mspace width="0.5ex"/>
|
3125
|
+
</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">
|
3046
3126
|
<xsl:variable name="target">
|
3047
3127
|
<xsl:choose>
|
3048
3128
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -3063,7 +3143,10 @@
|
|
3063
3143
|
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
3064
3144
|
<xsl:choose>
|
3065
3145
|
<xsl:when test="normalize-space(.) = ''">
|
3066
|
-
<xsl:value-of select="$target"/>
|
3146
|
+
<!-- <xsl:value-of select="$target"/> -->
|
3147
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
3148
|
+
<xsl:with-param name="text" select="$target"/>
|
3149
|
+
</xsl:call-template>
|
3067
3150
|
</xsl:when>
|
3068
3151
|
<xsl:otherwise>
|
3069
3152
|
<xsl:apply-templates/>
|
@@ -3073,8 +3156,6 @@
|
|
3073
3156
|
</xsl:otherwise>
|
3074
3157
|
</xsl:choose>
|
3075
3158
|
</fo:inline>
|
3076
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
3077
|
-
<fo:inline id="{@id}"/>
|
3078
3159
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
3079
3160
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
3080
3161
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -3289,27 +3370,43 @@
|
|
3289
3370
|
<fo:block id="{@id}">
|
3290
3371
|
<xsl:apply-templates/>
|
3291
3372
|
</fo:block>
|
3373
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3292
3374
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
3293
3375
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
3294
3376
|
<xsl:apply-templates/>
|
3295
3377
|
</fo:block>
|
3296
3378
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3297
|
-
<
|
3298
|
-
|
3299
|
-
|
3300
|
-
|
3301
|
-
|
3302
|
-
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3307
|
-
|
3308
|
-
|
3309
|
-
|
3310
|
-
|
3311
|
-
|
3312
|
-
|
3379
|
+
<xsl:choose>
|
3380
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3381
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3382
|
+
<xsl:variable name="src">
|
3383
|
+
<xsl:call-template name="image_src"/>
|
3384
|
+
</xsl:variable>
|
3385
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3386
|
+
</fo:inline>
|
3387
|
+
</xsl:when>
|
3388
|
+
<xsl:otherwise>
|
3389
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3390
|
+
|
3391
|
+
<xsl:variable name="src">
|
3392
|
+
<xsl:call-template name="image_src"/>
|
3393
|
+
</xsl:variable>
|
3394
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3395
|
+
</fo:block>
|
3396
|
+
</xsl:otherwise>
|
3397
|
+
</xsl:choose>
|
3398
|
+
</xsl:template><xsl:template name="image_src">
|
3399
|
+
<xsl:choose>
|
3400
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3401
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3402
|
+
</xsl:when>
|
3403
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3404
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3405
|
+
</xsl:when>
|
3406
|
+
<xsl:otherwise>
|
3407
|
+
<xsl:value-of select="@src"/>
|
3408
|
+
</xsl:otherwise>
|
3409
|
+
</xsl:choose>
|
3313
3410
|
</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">
|
3314
3411
|
<xsl:apply-templates mode="contents"/>
|
3315
3412
|
<xsl:text> </xsl:text>
|
@@ -3542,6 +3639,8 @@
|
|
3542
3639
|
<xsl:copy>
|
3543
3640
|
<xsl:apply-templates mode="contents_item"/>
|
3544
3641
|
</xsl:copy>
|
3642
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
|
3643
|
+
<xsl:copy-of select="."/>
|
3545
3644
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
3546
3645
|
<xsl:text> </xsl:text>
|
3547
3646
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -3870,10 +3969,11 @@
|
|
3870
3969
|
</xsl:choose>
|
3871
3970
|
|
3872
3971
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
3873
|
-
|
3972
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
3874
3973
|
<xsl:variable name="element">
|
3875
3974
|
block
|
3876
3975
|
|
3976
|
+
|
3877
3977
|
</xsl:variable>
|
3878
3978
|
<xsl:choose>
|
3879
3979
|
<xsl:when test="normalize-space($element) = 'block'">
|
@@ -3948,11 +4048,13 @@
|
|
3948
4048
|
</xsl:if>
|
3949
4049
|
</xsl:if>
|
3950
4050
|
|
4051
|
+
|
3951
4052
|
<fo:block-container margin-left="0mm">
|
3952
4053
|
|
3953
4054
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3954
4055
|
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
3955
|
-
|
4056
|
+
|
4057
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3956
4058
|
</fo:block>
|
3957
4059
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3958
4060
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -3975,29 +4077,47 @@
|
|
3975
4077
|
<xsl:text>— </xsl:text>
|
3976
4078
|
<xsl:apply-templates/>
|
3977
4079
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
3978
|
-
|
3979
|
-
|
3980
|
-
|
3981
|
-
|
3982
|
-
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
|
3996
|
-
|
3997
|
-
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4080
|
+
|
4081
|
+
<xsl:variable name="bibitemid">
|
4082
|
+
<xsl:choose>
|
4083
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
4084
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
4085
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
4086
|
+
</xsl:choose>
|
4087
|
+
</xsl:variable>
|
4088
|
+
|
4089
|
+
<xsl:choose>
|
4090
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
4091
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
4092
|
+
<xsl:if test="@type = 'footnote'">
|
4093
|
+
|
4094
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
4095
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
4096
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
4097
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
4098
|
+
|
4099
|
+
|
4100
|
+
</xsl:if>
|
4101
|
+
|
4102
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4103
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4104
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
4105
|
+
</xsl:if>
|
4106
|
+
<xsl:if test="@type = 'inline'">
|
4107
|
+
|
4108
|
+
|
4109
|
+
|
4110
|
+
</xsl:if>
|
4111
|
+
|
4112
|
+
<xsl:apply-templates/>
|
4113
|
+
</fo:basic-link>
|
4114
|
+
|
4115
|
+
</fo:inline>
|
4116
|
+
</xsl:when>
|
4117
|
+
<xsl:otherwise>
|
4118
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4119
|
+
</xsl:otherwise>
|
4120
|
+
</xsl:choose>
|
4001
4121
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
4002
4122
|
<!-- zero-space char -->
|
4003
4123
|
<xsl:variable name="depth">
|
@@ -4175,6 +4295,153 @@
|
|
4175
4295
|
</fo:block>
|
4176
4296
|
</xsl:otherwise>
|
4177
4297
|
</xsl:choose>
|
4298
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
4299
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
4300
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
4301
|
+
</xsl:for-each>
|
4302
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
4303
|
+
<xsl:copy>
|
4304
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
4305
|
+
</xsl:copy>
|
4306
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
4307
|
+
<xsl:variable name="id">
|
4308
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
4309
|
+
</xsl:variable>
|
4310
|
+
<xsl:copy> <!-- add id to xref -->
|
4311
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
4312
|
+
<xsl:attribute name="id">
|
4313
|
+
<xsl:value-of select="$id"/>
|
4314
|
+
</xsl:attribute>
|
4315
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4316
|
+
</xsl:copy>
|
4317
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
4318
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
4319
|
+
<xsl:if test="@to">
|
4320
|
+
<xsl:value-of select="$dash"/>
|
4321
|
+
<xsl:copy>
|
4322
|
+
<xsl:copy-of select="@*"/>
|
4323
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
4324
|
+
<xsl:attribute name="id">
|
4325
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
4326
|
+
</xsl:attribute>
|
4327
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4328
|
+
</xsl:copy>
|
4329
|
+
</xsl:if>
|
4330
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
4331
|
+
<xsl:copy>
|
4332
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
4333
|
+
</xsl:copy>
|
4334
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
4335
|
+
<xsl:copy>
|
4336
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
4337
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
4338
|
+
</xsl:copy>
|
4339
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
4340
|
+
<xsl:param name="element"/>
|
4341
|
+
<xsl:param name="remove" select="'false'"/>
|
4342
|
+
<xsl:param name="target"/>
|
4343
|
+
<!-- <node></node> -->
|
4344
|
+
<xsl:choose>
|
4345
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
4346
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
4347
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
4348
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4349
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
4350
|
+
</xsl:apply-templates>
|
4351
|
+
</xsl:when>
|
4352
|
+
<xsl:when test="self::text()">
|
4353
|
+
<xsl:value-of select="."/>
|
4354
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4355
|
+
</xsl:when>
|
4356
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
4357
|
+
<xsl:variable name="id" select="@id"/>
|
4358
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
4359
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4360
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
4361
|
+
|
4362
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4363
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
4364
|
+
|
4365
|
+
<xsl:choose>
|
4366
|
+
<!-- 2nd pass -->
|
4367
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
4368
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
4369
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
4370
|
+
<!-- [removed_xref] -->
|
4371
|
+
|
4372
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4373
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4374
|
+
<xsl:with-param name="target">
|
4375
|
+
<xsl:choose>
|
4376
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
4377
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
4378
|
+
</xsl:choose>
|
4379
|
+
</xsl:with-param>
|
4380
|
+
</xsl:apply-templates>
|
4381
|
+
</xsl:when>
|
4382
|
+
|
4383
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
4384
|
+
<!-- remove xref -->
|
4385
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4386
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4387
|
+
</xsl:apply-templates>
|
4388
|
+
</xsl:when>
|
4389
|
+
|
4390
|
+
<xsl:otherwise>
|
4391
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4392
|
+
<xsl:with-param name="target" select="$target"/>
|
4393
|
+
</xsl:apply-templates>
|
4394
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4395
|
+
</xsl:otherwise>
|
4396
|
+
</xsl:choose>
|
4397
|
+
</xsl:when>
|
4398
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
4399
|
+
<!-- ul -->
|
4400
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
4401
|
+
</xsl:when>
|
4402
|
+
<xsl:otherwise>
|
4403
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4404
|
+
<xsl:with-param name="target" select="$target"/>
|
4405
|
+
</xsl:apply-templates>
|
4406
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4407
|
+
</xsl:otherwise>
|
4408
|
+
</xsl:choose>
|
4409
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
4410
|
+
<xsl:param name="target"/>
|
4411
|
+
<xsl:copy>
|
4412
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
4413
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
4414
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
4415
|
+
</xsl:if>
|
4416
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
4417
|
+
</xsl:copy>
|
4418
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
4419
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4420
|
+
|
4421
|
+
<xsl:variable name="docid">
|
4422
|
+
<xsl:call-template name="getDocumentId"/>
|
4423
|
+
</xsl:variable>
|
4424
|
+
<xsl:variable name="item_number">
|
4425
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
4426
|
+
</xsl:variable>
|
4427
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
4428
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
4429
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
4430
|
+
<xsl:apply-templates/>
|
4431
|
+
<fo:block>
|
4432
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
4433
|
+
<fo:block> </fo:block>
|
4434
|
+
</xsl:if>
|
4435
|
+
</fo:block>
|
4436
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
4437
|
+
<xsl:apply-templates/>
|
4438
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
4439
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4440
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4441
|
+
<xsl:apply-templates/>
|
4442
|
+
</fo:block>
|
4443
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
4444
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4178
4445
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4179
4446
|
<!-- <row>
|
4180
4447
|
<date>05-07-2013</date>
|
@@ -4362,7 +4629,7 @@
|
|
4362
4629
|
<xsl:param name="charDelim" select="', '"/>
|
4363
4630
|
<xsl:choose>
|
4364
4631
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4365
|
-
<xsl:for-each select="
|
4632
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4366
4633
|
<xsl:sort data-type="text" order="ascending"/>
|
4367
4634
|
<xsl:call-template name="insertKeyword">
|
4368
4635
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -4371,7 +4638,7 @@
|
|
4371
4638
|
</xsl:for-each>
|
4372
4639
|
</xsl:when>
|
4373
4640
|
<xsl:otherwise>
|
4374
|
-
<xsl:for-each select="
|
4641
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4375
4642
|
<xsl:call-template name="insertKeyword">
|
4376
4643
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4377
4644
|
<xsl:with-param name="charDelim" select="$charDelim"/>
|
@@ -4388,63 +4655,71 @@
|
|
4388
4655
|
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4389
4656
|
</xsl:choose>
|
4390
4657
|
</xsl:template><xsl:template name="addPDFUAmeta">
|
4391
|
-
<
|
4392
|
-
<
|
4393
|
-
|
4394
|
-
|
4395
|
-
|
4396
|
-
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4658
|
+
<xsl:variable name="lang">
|
4659
|
+
<xsl:call-template name="getLang"/>
|
4660
|
+
</xsl:variable>
|
4661
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4662
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4663
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4664
|
+
</pdf:dictionary>
|
4665
|
+
</pdf:catalog>
|
4666
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4667
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4668
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4669
|
+
<!-- Dublin Core properties go here -->
|
4670
|
+
<dc:title>
|
4671
|
+
<xsl:variable name="title">
|
4672
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4673
|
+
|
4403
4674
|
|
4404
4675
|
|
4405
4676
|
|
4406
|
-
<xsl:value-of select="
|
4677
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
4407
4678
|
|
4408
4679
|
|
4409
4680
|
|
4410
|
-
</xsl:
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4417
|
-
</xsl:
|
4418
|
-
</xsl:
|
4419
|
-
</
|
4420
|
-
|
4681
|
+
</xsl:for-each>
|
4682
|
+
</xsl:variable>
|
4683
|
+
<xsl:choose>
|
4684
|
+
<xsl:when test="normalize-space($title) != ''">
|
4685
|
+
<xsl:value-of select="$title"/>
|
4686
|
+
</xsl:when>
|
4687
|
+
<xsl:otherwise>
|
4688
|
+
<xsl:text> </xsl:text>
|
4689
|
+
</xsl:otherwise>
|
4690
|
+
</xsl:choose>
|
4691
|
+
</dc:title>
|
4692
|
+
<dc:creator>
|
4693
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4421
4694
|
|
4695
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4696
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4697
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
4698
|
+
</xsl:for-each>
|
4422
4699
|
|
4423
4700
|
|
4424
|
-
|
4425
|
-
|
4426
|
-
|
4427
|
-
|
4428
|
-
|
4429
|
-
|
4430
|
-
|
4431
|
-
|
4432
|
-
|
4433
|
-
|
4434
|
-
|
4435
|
-
|
4436
|
-
|
4437
|
-
<
|
4438
|
-
|
4439
|
-
|
4440
|
-
|
4441
|
-
|
4442
|
-
|
4443
|
-
|
4444
|
-
|
4445
|
-
|
4446
|
-
</x:xmpmeta>
|
4447
|
-
</fo:declarations>
|
4701
|
+
|
4702
|
+
</xsl:for-each>
|
4703
|
+
</dc:creator>
|
4704
|
+
<dc:description>
|
4705
|
+
<xsl:variable name="abstract">
|
4706
|
+
|
4707
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4708
|
+
|
4709
|
+
|
4710
|
+
</xsl:variable>
|
4711
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
4712
|
+
</dc:description>
|
4713
|
+
<pdf:Keywords>
|
4714
|
+
<xsl:call-template name="insertKeywords"/>
|
4715
|
+
</pdf:Keywords>
|
4716
|
+
</rdf:Description>
|
4717
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
4718
|
+
<!-- XMP properties go here -->
|
4719
|
+
<xmp:CreatorTool/>
|
4720
|
+
</rdf:Description>
|
4721
|
+
</rdf:RDF>
|
4722
|
+
</x:xmpmeta>
|
4448
4723
|
</xsl:template><xsl:template name="getId">
|
4449
4724
|
<xsl:choose>
|
4450
4725
|
<xsl:when test="../@id">
|