metanorma-csa 1.7.3 → 1.8.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 +9 -32
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/csa/biblio.rng +4 -6
- data/lib/asciidoctor/csa/csa.rng +6 -0
- data/lib/asciidoctor/csa/isodoc.rng +235 -3
- data/lib/isodoc/csa/csa.standard.xsl +533 -258
- data/lib/isodoc/csa/html/htmlstyle.css +7 -0
- data/lib/metanorma/csa/version.rb +1 -3
- data/metanorma-csa.gemspec +5 -5
- metadata +23 -23
@@ -3,7 +3,9 @@
|
|
3
3
|
<xsl:output version="1.0" method="xml" encoding="UTF-8" indent="yes"/>
|
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="'215.9mm'"/>
|
9
11
|
<xsl:variable name="pageHeight" select="'279.4mm'"/>
|
@@ -52,7 +54,9 @@
|
|
52
54
|
|
53
55
|
</fo:layout-master-set>
|
54
56
|
|
55
|
-
<
|
57
|
+
<fo:declarations>
|
58
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
59
|
+
</fo:declarations>
|
56
60
|
|
57
61
|
<xsl:call-template name="addBookmarks">
|
58
62
|
<xsl:with-param name="contents" select="$contents"/>
|
@@ -1146,6 +1150,7 @@
|
|
1146
1150
|
|
1147
1151
|
|
1148
1152
|
|
1153
|
+
|
1149
1154
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
1150
1155
|
|
1151
1156
|
<xsl:attribute name="padding-right">10mm</xsl:attribute>
|
@@ -1354,7 +1359,7 @@
|
|
1354
1359
|
|
1355
1360
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1356
1361
|
|
1357
|
-
|
1362
|
+
|
1358
1363
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1359
1364
|
|
1360
1365
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
@@ -1362,6 +1367,12 @@
|
|
1362
1367
|
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
1363
1368
|
|
1364
1369
|
|
1370
|
+
</xsl:attribute-set><xsl:attribute-set name="add-style">
|
1371
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1372
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1373
|
+
</xsl:attribute-set><xsl:attribute-set name="del-style">
|
1374
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1375
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1365
1376
|
</xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1366
1377
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1367
1378
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1407,191 +1418,225 @@
|
|
1407
1418
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1408
1419
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1409
1420
|
|
1410
|
-
<xsl:variable name="
|
1411
|
-
<xsl:call-template name="getSimpleTable"/>
|
1412
|
-
</xsl:variable>
|
1421
|
+
<xsl:variable name="table">
|
1413
1422
|
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
<!-- <xsl:if test="$namespace = 'bipm'">
|
1419
|
-
<fo:block> </fo:block>
|
1420
|
-
</xsl:if> -->
|
1421
|
-
|
1422
|
-
<!-- $namespace = 'iso' or -->
|
1423
|
-
|
1424
|
-
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1425
|
-
|
1426
|
-
|
1423
|
+
<xsl:variable name="simple-table">
|
1424
|
+
<xsl:call-template name="getSimpleTable"/>
|
1425
|
+
</xsl:variable>
|
1427
1426
|
|
1428
1427
|
|
1429
|
-
|
1430
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1431
|
-
|
1432
|
-
<!-- <xsl:variable name="cols-count">
|
1433
|
-
<xsl:choose>
|
1434
|
-
<xsl:when test="*[local-name()='thead']">
|
1435
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1436
|
-
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1437
|
-
</xsl:call-template>
|
1438
|
-
</xsl:when>
|
1439
|
-
<xsl:otherwise>
|
1440
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1441
|
-
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1442
|
-
</xsl:call-template>
|
1443
|
-
</xsl:otherwise>
|
1444
|
-
</xsl:choose>
|
1445
|
-
</xsl:variable> -->
|
1446
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1447
|
-
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
<xsl:variable name="colwidths">
|
1452
|
-
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1453
|
-
<xsl:call-template name="calculate-column-widths">
|
1454
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1455
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
1456
|
-
</xsl:call-template>
|
1457
|
-
</xsl:if>
|
1458
|
-
</xsl:variable>
|
1459
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1460
|
-
|
1461
|
-
<!-- <xsl:variable name="colwidths2">
|
1462
|
-
<xsl:call-template name="calculate-column-widths">
|
1463
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1464
|
-
</xsl:call-template>
|
1465
|
-
</xsl:variable> -->
|
1466
|
-
|
1467
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1468
|
-
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1469
|
-
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1470
|
-
|
1471
|
-
<xsl:variable name="margin-left">
|
1472
|
-
<xsl:choose>
|
1473
|
-
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1474
|
-
<xsl:otherwise>0</xsl:otherwise>
|
1475
|
-
</xsl:choose>
|
1476
|
-
</xsl:variable>
|
1477
|
-
|
1478
|
-
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1479
1428
|
|
1480
1429
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
1430
|
|
1431
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1432
|
+
<fo:block> </fo:block>
|
1433
|
+
</xsl:if> -->
|
1485
1434
|
|
1486
|
-
|
1435
|
+
<!-- $namespace = 'iso' or -->
|
1487
1436
|
|
1437
|
+
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1488
1438
|
|
1439
|
+
|
1489
1440
|
|
1441
|
+
|
1490
1442
|
|
1443
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1491
1444
|
|
1445
|
+
<!-- <xsl:variable name="cols-count">
|
1446
|
+
<xsl:choose>
|
1447
|
+
<xsl:when test="*[local-name()='thead']">
|
1448
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1449
|
+
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1450
|
+
</xsl:call-template>
|
1451
|
+
</xsl:when>
|
1452
|
+
<xsl:otherwise>
|
1453
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1454
|
+
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1455
|
+
</xsl:call-template>
|
1456
|
+
</xsl:otherwise>
|
1457
|
+
</xsl:choose>
|
1458
|
+
</xsl:variable> -->
|
1459
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1460
|
+
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1492
1461
|
|
1493
1462
|
|
1494
|
-
|
1495
|
-
|
1496
|
-
<
|
1497
|
-
<xsl:
|
1498
|
-
<xsl:
|
1499
|
-
<xsl:
|
1500
|
-
</xsl:
|
1501
|
-
</
|
1502
|
-
|
1503
|
-
|
1463
|
+
|
1464
|
+
<xsl:variable name="colwidths">
|
1465
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1466
|
+
<xsl:call-template name="calculate-column-widths">
|
1467
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1468
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1469
|
+
</xsl:call-template>
|
1470
|
+
</xsl:if>
|
1471
|
+
</xsl:variable>
|
1472
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1473
|
+
|
1474
|
+
<!-- <xsl:variable name="colwidths2">
|
1475
|
+
<xsl:call-template name="calculate-column-widths">
|
1476
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1477
|
+
</xsl:call-template>
|
1478
|
+
</xsl:variable> -->
|
1479
|
+
|
1480
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1481
|
+
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1482
|
+
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1483
|
+
|
1484
|
+
<xsl:variable name="margin-left">
|
1485
|
+
<xsl:choose>
|
1486
|
+
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1487
|
+
<xsl:otherwise>0</xsl:otherwise>
|
1488
|
+
</xsl:choose>
|
1489
|
+
</xsl:variable>
|
1490
|
+
|
1491
|
+
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1504
1492
|
|
1505
1493
|
|
1494
|
+
|
1495
|
+
|
1496
|
+
|
1506
1497
|
|
1507
1498
|
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1499
|
+
|
1511
1500
|
|
1512
|
-
|
1513
1501
|
|
1514
|
-
</xsl:variable>
|
1515
|
-
|
1516
|
-
|
1517
|
-
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1518
1502
|
|
1519
|
-
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1520
|
-
<xsl:attribute name="{@name}">
|
1521
|
-
<xsl:value-of select="."/>
|
1522
|
-
</xsl:attribute>
|
1523
|
-
</xsl:for-each>
|
1524
1503
|
|
1525
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1526
|
-
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1527
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1528
|
-
</xsl:if>
|
1529
1504
|
|
1530
|
-
<xsl:choose>
|
1531
|
-
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1532
|
-
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1533
|
-
<fo:table-column column-width="{@width}"/>
|
1534
|
-
</xsl:for-each>
|
1535
|
-
</xsl:when>
|
1536
|
-
<xsl:otherwise>
|
1537
|
-
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1538
|
-
<xsl:choose>
|
1539
|
-
<xsl:when test=". = 1 or . = 0">
|
1540
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
1541
|
-
</xsl:when>
|
1542
|
-
<xsl:otherwise>
|
1543
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
1544
|
-
</xsl:otherwise>
|
1545
|
-
</xsl:choose>
|
1546
|
-
</xsl:for-each>
|
1547
|
-
</xsl:otherwise>
|
1548
|
-
</xsl:choose>
|
1549
1505
|
|
1550
|
-
<xsl:
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
</xsl:otherwise>
|
1557
|
-
</xsl:choose>
|
1506
|
+
<xsl:variable name="table_width">
|
1507
|
+
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1508
|
+
100%
|
1509
|
+
|
1510
|
+
|
1511
|
+
</xsl:variable>
|
1558
1512
|
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
</xsl:attribute>
|
1576
|
-
</xsl:for-each>
|
1513
|
+
<xsl:variable name="table_attributes">
|
1514
|
+
<attribute name="table-layout">fixed</attribute>
|
1515
|
+
<attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
|
1516
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1517
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1518
|
+
|
1519
|
+
|
1520
|
+
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
|
1527
|
+
|
1528
|
+
</xsl:variable>
|
1577
1529
|
|
1578
|
-
|
1530
|
+
|
1531
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1532
|
+
|
1533
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1534
|
+
<xsl:attribute name="{@name}">
|
1535
|
+
<xsl:value-of select="."/>
|
1536
|
+
</xsl:attribute>
|
1537
|
+
</xsl:for-each>
|
1538
|
+
|
1539
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1540
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1541
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1542
|
+
</xsl:if>
|
1543
|
+
|
1579
1544
|
<xsl:choose>
|
1580
|
-
<xsl:when test="
|
1581
|
-
<
|
1545
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1546
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1547
|
+
<fo:table-column column-width="{@width}"/>
|
1548
|
+
</xsl:for-each>
|
1582
1549
|
</xsl:when>
|
1583
1550
|
<xsl:otherwise>
|
1584
|
-
<
|
1551
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1552
|
+
<xsl:choose>
|
1553
|
+
<xsl:when test=". = 1 or . = 0">
|
1554
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1555
|
+
</xsl:when>
|
1556
|
+
<xsl:otherwise>
|
1557
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1558
|
+
</xsl:otherwise>
|
1559
|
+
</xsl:choose>
|
1560
|
+
</xsl:for-each>
|
1585
1561
|
</xsl:otherwise>
|
1586
1562
|
</xsl:choose>
|
1563
|
+
|
1564
|
+
<xsl:choose>
|
1565
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1566
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1567
|
+
</xsl:when>
|
1568
|
+
<xsl:otherwise>
|
1569
|
+
<xsl:apply-templates/>
|
1570
|
+
</xsl:otherwise>
|
1571
|
+
</xsl:choose>
|
1572
|
+
|
1573
|
+
</fo:table>
|
1574
|
+
|
1575
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1576
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1577
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1578
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1579
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1580
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1581
|
+
</xsl:call-template>
|
1587
1582
|
</xsl:for-each>
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1583
|
+
|
1584
|
+
<!-- insert footer as table -->
|
1585
|
+
<!-- <fo:table>
|
1586
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1587
|
+
<xsl:attribute name="{@name}">
|
1588
|
+
<xsl:value-of select="."/>
|
1589
|
+
</xsl:attribute>
|
1590
|
+
</xsl:for-each>
|
1591
|
+
|
1592
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1593
|
+
<xsl:choose>
|
1594
|
+
<xsl:when test=". = 1 or . = 0">
|
1595
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1596
|
+
</xsl:when>
|
1597
|
+
<xsl:otherwise>
|
1598
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1599
|
+
</xsl:otherwise>
|
1600
|
+
</xsl:choose>
|
1601
|
+
</xsl:for-each>
|
1602
|
+
</fo:table>-->
|
1603
|
+
|
1604
|
+
|
1605
|
+
|
1606
|
+
|
1607
|
+
|
1608
|
+
</fo:block-container>
|
1609
|
+
</xsl:variable>
|
1610
|
+
|
1611
|
+
|
1612
|
+
|
1613
|
+
<xsl:choose>
|
1614
|
+
<xsl:when test="@width">
|
1615
|
+
|
1616
|
+
<!-- centered table when table name is centered (see table-name-style) -->
|
1617
|
+
|
1618
|
+
<fo:table table-layout="fixed" width="100%">
|
1619
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1620
|
+
<fo:table-column column-width="{@width}"/>
|
1621
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1622
|
+
<fo:table-body>
|
1623
|
+
<fo:table-row>
|
1624
|
+
<fo:table-cell column-number="2">
|
1625
|
+
<fo:block><xsl:copy-of select="$table"/></fo:block>
|
1626
|
+
</fo:table-cell>
|
1627
|
+
</fo:table-row>
|
1628
|
+
</fo:table-body>
|
1629
|
+
</fo:table>
|
1630
|
+
|
1631
|
+
|
1632
|
+
|
1633
|
+
|
1634
|
+
</xsl:when>
|
1635
|
+
<xsl:otherwise>
|
1636
|
+
<xsl:copy-of select="$table"/>
|
1637
|
+
</xsl:otherwise>
|
1638
|
+
</xsl:choose>
|
1639
|
+
|
1595
1640
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1596
1641
|
<xsl:if test="normalize-space() != ''">
|
1597
1642
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -1719,7 +1764,15 @@
|
|
1719
1764
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1720
1765
|
<xsl:value-of select="@target"/>
|
1721
1766
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1722
|
-
<xsl:variable name="
|
1767
|
+
<xsl:variable name="mathml">
|
1768
|
+
<xsl:for-each select="*">
|
1769
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
1770
|
+
<xsl:copy-of select="."/>
|
1771
|
+
</xsl:if>
|
1772
|
+
</xsl:for-each>
|
1773
|
+
</xsl:variable>
|
1774
|
+
|
1775
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
1723
1776
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1724
1777
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1725
1778
|
<xsl:param name="cols-count"/>
|
@@ -2402,7 +2455,7 @@
|
|
2402
2455
|
<xsl:with-param name="table" select="$html-table"/>
|
2403
2456
|
</xsl:call-template>
|
2404
2457
|
</xsl:variable>
|
2405
|
-
<!-- colwidths=<xsl:
|
2458
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2406
2459
|
<xsl:variable name="maxlength_dt">
|
2407
2460
|
<xsl:call-template name="getMaxLength_dt"/>
|
2408
2461
|
</xsl:variable>
|
@@ -2431,13 +2484,22 @@
|
|
2431
2484
|
</xsl:when>
|
2432
2485
|
<xsl:otherwise>
|
2433
2486
|
<xsl:choose>
|
2487
|
+
<!-- to set width check most wide chars like `W` -->
|
2434
2488
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
2435
|
-
<fo:table-column column-width="
|
2436
|
-
<fo:table-column column-width="
|
2489
|
+
<fo:table-column column-width="7%"/>
|
2490
|
+
<fo:table-column column-width="93%"/>
|
2491
|
+
</xsl:when>
|
2492
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like ABC, etc -->
|
2493
|
+
<fo:table-column column-width="15%"/>
|
2494
|
+
<fo:table-column column-width="85%"/>
|
2437
2495
|
</xsl:when>
|
2438
|
-
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <=
|
2439
|
-
<fo:table-column column-width="
|
2440
|
-
<fo:table-column column-width="
|
2496
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 7"> <!-- if dt contains short text like ABCDEF, etc -->
|
2497
|
+
<fo:table-column column-width="20%"/>
|
2498
|
+
<fo:table-column column-width="80%"/>
|
2499
|
+
</xsl:when>
|
2500
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
|
2501
|
+
<fo:table-column column-width="25%"/>
|
2502
|
+
<fo:table-column column-width="75%"/>
|
2441
2503
|
</xsl:when>
|
2442
2504
|
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
2443
2505
|
<fo:table-column column-width="60%"/>
|
@@ -2651,8 +2713,16 @@
|
|
2651
2713
|
<fo:inline text-decoration="underline">
|
2652
2714
|
<xsl:apply-templates/>
|
2653
2715
|
</fo:inline>
|
2716
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
2717
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2718
|
+
<xsl:apply-templates/>
|
2719
|
+
</fo:inline>
|
2654
2720
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2655
|
-
<fo:inline
|
2721
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2722
|
+
<xsl:apply-templates/>
|
2723
|
+
</fo:inline>
|
2724
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
2725
|
+
<fo:inline background-color="yellow">
|
2656
2726
|
<xsl:apply-templates/>
|
2657
2727
|
</fo:inline>
|
2658
2728
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
@@ -2744,6 +2814,10 @@
|
|
2744
2814
|
<xsl:param name="text" select="."/>
|
2745
2815
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2746
2816
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
2817
|
+
</xsl:template><xsl:template name="add-zero-spaces-link-java">
|
2818
|
+
<xsl:param name="text" select="."/>
|
2819
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2820
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
|
2747
2821
|
</xsl:template><xsl:template name="add-zero-spaces">
|
2748
2822
|
<xsl:param name="text" select="."/>
|
2749
2823
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
@@ -2991,6 +3065,7 @@
|
|
2991
3065
|
<xsl:apply-templates select="." mode="mathml"/>
|
2992
3066
|
</xsl:variable>
|
2993
3067
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3068
|
+
|
2994
3069
|
<!-- <xsl:copy-of select="."/> -->
|
2995
3070
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
2996
3071
|
</fo:instream-foreign-object>
|
@@ -3004,7 +3079,12 @@
|
|
3004
3079
|
<!-- replace start and end spaces to non-break space -->
|
3005
3080
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3006
3081
|
</xsl:copy>
|
3007
|
-
</xsl:template><xsl:template match="
|
3082
|
+
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3083
|
+
<xsl:copy>
|
3084
|
+
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3085
|
+
</xsl:copy>
|
3086
|
+
<mathml:mspace width="0.5ex"/>
|
3087
|
+
</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">
|
3008
3088
|
<xsl:variable name="target">
|
3009
3089
|
<xsl:choose>
|
3010
3090
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -3025,7 +3105,10 @@
|
|
3025
3105
|
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
3026
3106
|
<xsl:choose>
|
3027
3107
|
<xsl:when test="normalize-space(.) = ''">
|
3028
|
-
<xsl:value-of select="$target"/>
|
3108
|
+
<!-- <xsl:value-of select="$target"/> -->
|
3109
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
3110
|
+
<xsl:with-param name="text" select="$target"/>
|
3111
|
+
</xsl:call-template>
|
3029
3112
|
</xsl:when>
|
3030
3113
|
<xsl:otherwise>
|
3031
3114
|
<xsl:apply-templates/>
|
@@ -3035,8 +3118,6 @@
|
|
3035
3118
|
</xsl:otherwise>
|
3036
3119
|
</xsl:choose>
|
3037
3120
|
</fo:inline>
|
3038
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
3039
|
-
<fo:inline id="{@id}"/>
|
3040
3121
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
3041
3122
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
3042
3123
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -3247,27 +3328,43 @@
|
|
3247
3328
|
<fo:block id="{@id}">
|
3248
3329
|
<xsl:apply-templates/>
|
3249
3330
|
</fo:block>
|
3331
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3250
3332
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
3251
3333
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
3252
3334
|
<xsl:apply-templates/>
|
3253
3335
|
</fo:block>
|
3254
3336
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3255
|
-
<
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
|
3260
|
-
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
|
3265
|
-
|
3266
|
-
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3270
|
-
|
3337
|
+
<xsl:choose>
|
3338
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3339
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3340
|
+
<xsl:variable name="src">
|
3341
|
+
<xsl:call-template name="image_src"/>
|
3342
|
+
</xsl:variable>
|
3343
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3344
|
+
</fo:inline>
|
3345
|
+
</xsl:when>
|
3346
|
+
<xsl:otherwise>
|
3347
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3348
|
+
|
3349
|
+
<xsl:variable name="src">
|
3350
|
+
<xsl:call-template name="image_src"/>
|
3351
|
+
</xsl:variable>
|
3352
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3353
|
+
</fo:block>
|
3354
|
+
</xsl:otherwise>
|
3355
|
+
</xsl:choose>
|
3356
|
+
</xsl:template><xsl:template name="image_src">
|
3357
|
+
<xsl:choose>
|
3358
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3359
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3360
|
+
</xsl:when>
|
3361
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3362
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3363
|
+
</xsl:when>
|
3364
|
+
<xsl:otherwise>
|
3365
|
+
<xsl:value-of select="@src"/>
|
3366
|
+
</xsl:otherwise>
|
3367
|
+
</xsl:choose>
|
3271
3368
|
</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">
|
3272
3369
|
<xsl:apply-templates mode="contents"/>
|
3273
3370
|
<xsl:text> </xsl:text>
|
@@ -3500,6 +3597,8 @@
|
|
3500
3597
|
<xsl:copy>
|
3501
3598
|
<xsl:apply-templates mode="contents_item"/>
|
3502
3599
|
</xsl:copy>
|
3600
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
|
3601
|
+
<xsl:copy-of select="."/>
|
3503
3602
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
3504
3603
|
<xsl:text> </xsl:text>
|
3505
3604
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -3828,10 +3927,11 @@
|
|
3828
3927
|
</xsl:choose>
|
3829
3928
|
|
3830
3929
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
3831
|
-
|
3930
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
3832
3931
|
<xsl:variable name="element">
|
3833
3932
|
block
|
3834
3933
|
|
3934
|
+
|
3835
3935
|
</xsl:variable>
|
3836
3936
|
<xsl:choose>
|
3837
3937
|
<xsl:when test="normalize-space($element) = 'block'">
|
@@ -3906,11 +4006,13 @@
|
|
3906
4006
|
</xsl:if>
|
3907
4007
|
</xsl:if>
|
3908
4008
|
|
4009
|
+
|
3909
4010
|
<fo:block-container margin-left="0mm">
|
3910
4011
|
|
3911
4012
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3912
4013
|
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
3913
|
-
|
4014
|
+
|
4015
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3914
4016
|
</fo:block>
|
3915
4017
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3916
4018
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -3933,29 +4035,47 @@
|
|
3933
4035
|
<xsl:text>— </xsl:text>
|
3934
4036
|
<xsl:apply-templates/>
|
3935
4037
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
3936
|
-
|
3937
|
-
|
3938
|
-
|
3939
|
-
|
3940
|
-
|
3941
|
-
|
3942
|
-
|
3943
|
-
|
3944
|
-
|
3945
|
-
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3954
|
-
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
4038
|
+
|
4039
|
+
<xsl:variable name="bibitemid">
|
4040
|
+
<xsl:choose>
|
4041
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
4042
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
4043
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
4044
|
+
</xsl:choose>
|
4045
|
+
</xsl:variable>
|
4046
|
+
|
4047
|
+
<xsl:choose>
|
4048
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
4049
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
4050
|
+
<xsl:if test="@type = 'footnote'">
|
4051
|
+
|
4052
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
4053
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
4054
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
4055
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
4056
|
+
|
4057
|
+
|
4058
|
+
</xsl:if>
|
4059
|
+
|
4060
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4061
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4062
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
4063
|
+
</xsl:if>
|
4064
|
+
<xsl:if test="@type = 'inline'">
|
4065
|
+
|
4066
|
+
|
4067
|
+
|
4068
|
+
</xsl:if>
|
4069
|
+
|
4070
|
+
<xsl:apply-templates/>
|
4071
|
+
</fo:basic-link>
|
4072
|
+
|
4073
|
+
</fo:inline>
|
4074
|
+
</xsl:when>
|
4075
|
+
<xsl:otherwise>
|
4076
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4077
|
+
</xsl:otherwise>
|
4078
|
+
</xsl:choose>
|
3959
4079
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
3960
4080
|
<!-- zero-space char -->
|
3961
4081
|
<xsl:variable name="depth">
|
@@ -4133,6 +4253,153 @@
|
|
4133
4253
|
</fo:block>
|
4134
4254
|
</xsl:otherwise>
|
4135
4255
|
</xsl:choose>
|
4256
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
4257
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
4258
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
4259
|
+
</xsl:for-each>
|
4260
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
4261
|
+
<xsl:copy>
|
4262
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
4263
|
+
</xsl:copy>
|
4264
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
4265
|
+
<xsl:variable name="id">
|
4266
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
4267
|
+
</xsl:variable>
|
4268
|
+
<xsl:copy> <!-- add id to xref -->
|
4269
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
4270
|
+
<xsl:attribute name="id">
|
4271
|
+
<xsl:value-of select="$id"/>
|
4272
|
+
</xsl:attribute>
|
4273
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4274
|
+
</xsl:copy>
|
4275
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
4276
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
4277
|
+
<xsl:if test="@to">
|
4278
|
+
<xsl:value-of select="$dash"/>
|
4279
|
+
<xsl:copy>
|
4280
|
+
<xsl:copy-of select="@*"/>
|
4281
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
4282
|
+
<xsl:attribute name="id">
|
4283
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
4284
|
+
</xsl:attribute>
|
4285
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4286
|
+
</xsl:copy>
|
4287
|
+
</xsl:if>
|
4288
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
4289
|
+
<xsl:copy>
|
4290
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
4291
|
+
</xsl:copy>
|
4292
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
4293
|
+
<xsl:copy>
|
4294
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
4295
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
4296
|
+
</xsl:copy>
|
4297
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
4298
|
+
<xsl:param name="element"/>
|
4299
|
+
<xsl:param name="remove" select="'false'"/>
|
4300
|
+
<xsl:param name="target"/>
|
4301
|
+
<!-- <node></node> -->
|
4302
|
+
<xsl:choose>
|
4303
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
4304
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
4305
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
4306
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4307
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
4308
|
+
</xsl:apply-templates>
|
4309
|
+
</xsl:when>
|
4310
|
+
<xsl:when test="self::text()">
|
4311
|
+
<xsl:value-of select="."/>
|
4312
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4313
|
+
</xsl:when>
|
4314
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
4315
|
+
<xsl:variable name="id" select="@id"/>
|
4316
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
4317
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4318
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
4319
|
+
|
4320
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4321
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
4322
|
+
|
4323
|
+
<xsl:choose>
|
4324
|
+
<!-- 2nd pass -->
|
4325
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
4326
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
4327
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
4328
|
+
<!-- [removed_xref] -->
|
4329
|
+
|
4330
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4331
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4332
|
+
<xsl:with-param name="target">
|
4333
|
+
<xsl:choose>
|
4334
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
4335
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
4336
|
+
</xsl:choose>
|
4337
|
+
</xsl:with-param>
|
4338
|
+
</xsl:apply-templates>
|
4339
|
+
</xsl:when>
|
4340
|
+
|
4341
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
4342
|
+
<!-- remove xref -->
|
4343
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4344
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4345
|
+
</xsl:apply-templates>
|
4346
|
+
</xsl:when>
|
4347
|
+
|
4348
|
+
<xsl:otherwise>
|
4349
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4350
|
+
<xsl:with-param name="target" select="$target"/>
|
4351
|
+
</xsl:apply-templates>
|
4352
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4353
|
+
</xsl:otherwise>
|
4354
|
+
</xsl:choose>
|
4355
|
+
</xsl:when>
|
4356
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
4357
|
+
<!-- ul -->
|
4358
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
4359
|
+
</xsl:when>
|
4360
|
+
<xsl:otherwise>
|
4361
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4362
|
+
<xsl:with-param name="target" select="$target"/>
|
4363
|
+
</xsl:apply-templates>
|
4364
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4365
|
+
</xsl:otherwise>
|
4366
|
+
</xsl:choose>
|
4367
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
4368
|
+
<xsl:param name="target"/>
|
4369
|
+
<xsl:copy>
|
4370
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
4371
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
4372
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
4373
|
+
</xsl:if>
|
4374
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
4375
|
+
</xsl:copy>
|
4376
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
4377
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4378
|
+
|
4379
|
+
<xsl:variable name="docid">
|
4380
|
+
<xsl:call-template name="getDocumentId"/>
|
4381
|
+
</xsl:variable>
|
4382
|
+
<xsl:variable name="item_number">
|
4383
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
4384
|
+
</xsl:variable>
|
4385
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
4386
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
4387
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
4388
|
+
<xsl:apply-templates/>
|
4389
|
+
<fo:block>
|
4390
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
4391
|
+
<fo:block> </fo:block>
|
4392
|
+
</xsl:if>
|
4393
|
+
</fo:block>
|
4394
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
4395
|
+
<xsl:apply-templates/>
|
4396
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
4397
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4398
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4399
|
+
<xsl:apply-templates/>
|
4400
|
+
</fo:block>
|
4401
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
4402
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4136
4403
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4137
4404
|
<!-- <row>
|
4138
4405
|
<date>05-07-2013</date>
|
@@ -4320,7 +4587,7 @@
|
|
4320
4587
|
<xsl:param name="charDelim" select="', '"/>
|
4321
4588
|
<xsl:choose>
|
4322
4589
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4323
|
-
<xsl:for-each select="
|
4590
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4324
4591
|
<xsl:sort data-type="text" order="ascending"/>
|
4325
4592
|
<xsl:call-template name="insertKeyword">
|
4326
4593
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -4329,7 +4596,7 @@
|
|
4329
4596
|
</xsl:for-each>
|
4330
4597
|
</xsl:when>
|
4331
4598
|
<xsl:otherwise>
|
4332
|
-
<xsl:for-each select="
|
4599
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4333
4600
|
<xsl:call-template name="insertKeyword">
|
4334
4601
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4335
4602
|
<xsl:with-param name="charDelim" select="$charDelim"/>
|
@@ -4346,63 +4613,71 @@
|
|
4346
4613
|
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4347
4614
|
</xsl:choose>
|
4348
4615
|
</xsl:template><xsl:template name="addPDFUAmeta">
|
4349
|
-
<
|
4350
|
-
<
|
4351
|
-
|
4352
|
-
|
4353
|
-
|
4354
|
-
|
4355
|
-
|
4356
|
-
|
4357
|
-
|
4358
|
-
|
4359
|
-
|
4360
|
-
|
4616
|
+
<xsl:variable name="lang">
|
4617
|
+
<xsl:call-template name="getLang"/>
|
4618
|
+
</xsl:variable>
|
4619
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4620
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4621
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4622
|
+
</pdf:dictionary>
|
4623
|
+
</pdf:catalog>
|
4624
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4625
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4626
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4627
|
+
<!-- Dublin Core properties go here -->
|
4628
|
+
<dc:title>
|
4629
|
+
<xsl:variable name="title">
|
4630
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4631
|
+
|
4361
4632
|
|
4362
4633
|
|
4363
4634
|
|
4364
|
-
<xsl:value-of select="
|
4635
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
4365
4636
|
|
4366
4637
|
|
4367
4638
|
|
4368
|
-
</xsl:
|
4369
|
-
|
4370
|
-
|
4371
|
-
|
4372
|
-
|
4373
|
-
|
4374
|
-
|
4375
|
-
</xsl:
|
4376
|
-
</xsl:
|
4377
|
-
</
|
4378
|
-
|
4639
|
+
</xsl:for-each>
|
4640
|
+
</xsl:variable>
|
4641
|
+
<xsl:choose>
|
4642
|
+
<xsl:when test="normalize-space($title) != ''">
|
4643
|
+
<xsl:value-of select="$title"/>
|
4644
|
+
</xsl:when>
|
4645
|
+
<xsl:otherwise>
|
4646
|
+
<xsl:text> </xsl:text>
|
4647
|
+
</xsl:otherwise>
|
4648
|
+
</xsl:choose>
|
4649
|
+
</dc:title>
|
4650
|
+
<dc:creator>
|
4651
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4379
4652
|
|
4653
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4654
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4655
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
4656
|
+
</xsl:for-each>
|
4380
4657
|
|
4381
4658
|
|
4382
|
-
|
4383
|
-
|
4384
|
-
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4391
|
-
|
4392
|
-
|
4393
|
-
|
4394
|
-
|
4395
|
-
<
|
4396
|
-
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4403
|
-
|
4404
|
-
</x:xmpmeta>
|
4405
|
-
</fo:declarations>
|
4659
|
+
|
4660
|
+
</xsl:for-each>
|
4661
|
+
</dc:creator>
|
4662
|
+
<dc:description>
|
4663
|
+
<xsl:variable name="abstract">
|
4664
|
+
|
4665
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4666
|
+
|
4667
|
+
|
4668
|
+
</xsl:variable>
|
4669
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
4670
|
+
</dc:description>
|
4671
|
+
<pdf:Keywords>
|
4672
|
+
<xsl:call-template name="insertKeywords"/>
|
4673
|
+
</pdf:Keywords>
|
4674
|
+
</rdf:Description>
|
4675
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
4676
|
+
<!-- XMP properties go here -->
|
4677
|
+
<xmp:CreatorTool/>
|
4678
|
+
</rdf:Description>
|
4679
|
+
</rdf:RDF>
|
4680
|
+
</x:xmpmeta>
|
4406
4681
|
</xsl:template><xsl:template name="getId">
|
4407
4682
|
<xsl:choose>
|
4408
4683
|
<xsl:when test="../@id">
|