metanorma-m3aawg 1.6.5 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -122,6 +122,13 @@ a.FootnoteRef + a.FootnoteRef:before {
122
122
  content: ", ";
123
123
  vertical-align: super; }
124
124
 
125
+ .addition {
126
+ color: blue; }
127
+
128
+ .deletion {
129
+ color: red;
130
+ text-decoration: line-through; }
131
+
125
132
  #standard-band {
126
133
  background-color: #0AC442; }
127
134
 
@@ -3,7 +3,9 @@
3
3
  <xsl:output 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
 
9
11
 
@@ -73,7 +75,9 @@
73
75
 
74
76
  </fo:layout-master-set>
75
77
 
76
- <xsl:call-template name="addPDFUAmeta"/>
78
+ <fo:declarations>
79
+ <xsl:call-template name="addPDFUAmeta"/>
80
+ </fo:declarations>
77
81
 
78
82
  <xsl:call-template name="addBookmarks">
79
83
  <xsl:with-param name="contents" select="$contents"/>
@@ -1146,6 +1150,7 @@
1146
1150
 
1147
1151
 
1148
1152
 
1153
+
1149
1154
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
1150
1155
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1151
1156
 
@@ -1363,12 +1368,18 @@
1363
1368
 
1364
1369
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1365
1370
 
1366
-
1371
+
1367
1372
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1368
1373
 
1369
1374
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1370
1375
 
1371
1376
 
1377
+ </xsl:attribute-set><xsl:attribute-set name="add-style">
1378
+ <xsl:attribute name="color">red</xsl:attribute>
1379
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1380
+ </xsl:attribute-set><xsl:attribute-set name="del-style">
1381
+ <xsl:attribute name="color">red</xsl:attribute>
1382
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1372
1383
  </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1373
1384
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1374
1385
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1418,193 +1429,227 @@
1418
1429
  <xsl:call-template name="add-zero-spaces-java"/>
1419
1430
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1420
1431
 
1421
- <xsl:variable name="simple-table">
1422
- <xsl:call-template name="getSimpleTable"/>
1423
- </xsl:variable>
1432
+ <xsl:variable name="table">
1424
1433
 
1425
-
1426
-
1427
-
1428
-
1429
- <!-- <xsl:if test="$namespace = 'bipm'">
1430
- <fo:block>&#xA0;</fo:block>
1431
- </xsl:if> -->
1432
-
1433
- <!-- $namespace = 'iso' or -->
1434
-
1435
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1436
-
1437
-
1438
-
1439
- <xsl:call-template name="fn_name_display"/>
1434
+ <xsl:variable name="simple-table">
1435
+ <xsl:call-template name="getSimpleTable"/>
1436
+ </xsl:variable>
1440
1437
 
1441
1438
 
1442
-
1443
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
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"/> -->
1461
-
1462
-
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) &gt; 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">
1492
1439
 
1493
1440
 
1494
-
1495
-
1496
-
1497
1441
 
1442
+ <!-- <xsl:if test="$namespace = 'bipm'">
1443
+ <fo:block>&#xA0;</fo:block>
1444
+ </xsl:if> -->
1498
1445
 
1499
-
1446
+ <!-- $namespace = 'iso' or -->
1500
1447
 
1448
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1501
1449
 
1450
+
1502
1451
 
1452
+ <xsl:call-template name="fn_name_display"/>
1503
1453
 
1454
+
1504
1455
 
1456
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1505
1457
 
1458
+ <!-- <xsl:variable name="cols-count">
1459
+ <xsl:choose>
1460
+ <xsl:when test="*[local-name()='thead']">
1461
+ <xsl:call-template name="calculate-columns-numbers">
1462
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1463
+ </xsl:call-template>
1464
+ </xsl:when>
1465
+ <xsl:otherwise>
1466
+ <xsl:call-template name="calculate-columns-numbers">
1467
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1468
+ </xsl:call-template>
1469
+ </xsl:otherwise>
1470
+ </xsl:choose>
1471
+ </xsl:variable> -->
1472
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1473
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1506
1474
 
1507
- <xsl:variable name="table_attributes">
1508
- <attribute name="table-layout">fixed</attribute>
1509
- <attribute name="width">
1510
- <xsl:choose>
1511
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1512
- <xsl:otherwise>100%</xsl:otherwise>
1513
- </xsl:choose>
1514
- </attribute>
1515
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1516
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1475
+
1476
+
1477
+ <xsl:variable name="colwidths">
1478
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1479
+ <xsl:call-template name="calculate-column-widths">
1480
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1481
+ <xsl:with-param name="table" select="$simple-table"/>
1482
+ </xsl:call-template>
1483
+ </xsl:if>
1484
+ </xsl:variable>
1485
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1486
+
1487
+ <!-- <xsl:variable name="colwidths2">
1488
+ <xsl:call-template name="calculate-column-widths">
1489
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1490
+ </xsl:call-template>
1491
+ </xsl:variable> -->
1492
+
1493
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1494
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1495
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1496
+
1497
+ <xsl:variable name="margin-left">
1498
+ <xsl:choose>
1499
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1500
+ <xsl:otherwise>0</xsl:otherwise>
1501
+ </xsl:choose>
1502
+ </xsl:variable>
1503
+
1504
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1517
1505
 
1518
1506
 
1507
+
1508
+
1509
+
1519
1510
 
1520
1511
 
1521
-
1522
-
1523
-
1512
+
1524
1513
 
1525
-
1526
1514
 
1527
- </xsl:variable>
1528
-
1529
-
1530
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1531
1515
 
1532
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1533
- <xsl:attribute name="{@name}">
1534
- <xsl:value-of select="."/>
1535
- </xsl:attribute>
1536
- </xsl:for-each>
1537
1516
 
1538
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1539
- <xsl:if test="$isNoteOrFnExist = 'true'">
1540
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1541
- </xsl:if>
1542
1517
 
1543
- <xsl:choose>
1544
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1545
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1546
- <fo:table-column column-width="{@width}"/>
1547
- </xsl:for-each>
1548
- </xsl:when>
1549
- <xsl:otherwise>
1550
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1551
- <xsl:choose>
1552
- <xsl:when test=". = 1 or . = 0">
1553
- <fo:table-column column-width="proportional-column-width(2)"/>
1554
- </xsl:when>
1555
- <xsl:otherwise>
1556
- <fo:table-column column-width="proportional-column-width({.})"/>
1557
- </xsl:otherwise>
1558
- </xsl:choose>
1559
- </xsl:for-each>
1560
- </xsl:otherwise>
1561
- </xsl:choose>
1562
1518
 
1563
- <xsl:choose>
1564
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1565
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1566
- </xsl:when>
1567
- <xsl:otherwise>
1568
- <xsl:apply-templates/>
1569
- </xsl:otherwise>
1570
- </xsl:choose>
1519
+ <xsl:variable name="table_width">
1520
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1521
+ 100%
1522
+
1523
+
1524
+ </xsl:variable>
1571
1525
 
1572
- </fo:table>
1573
-
1574
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1575
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1576
- <xsl:call-template name="insertTableFooterInSeparateTable">
1577
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1578
- <xsl:with-param name="colwidths" select="$colwidths"/>
1579
- <xsl:with-param name="colgroup" select="$colgroup"/>
1580
- </xsl:call-template>
1581
- </xsl:for-each>
1582
-
1583
- <!-- insert footer as table -->
1584
- <!-- <fo:table>
1585
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1586
- <xsl:attribute name="{@name}">
1587
- <xsl:value-of select="."/>
1588
- </xsl:attribute>
1589
- </xsl:for-each>
1526
+ <xsl:variable name="table_attributes">
1527
+ <attribute name="table-layout">fixed</attribute>
1528
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1529
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1530
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+ </xsl:variable>
1590
1542
 
1591
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1543
+
1544
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1545
+
1546
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1547
+ <xsl:attribute name="{@name}">
1548
+ <xsl:value-of select="."/>
1549
+ </xsl:attribute>
1550
+ </xsl:for-each>
1551
+
1552
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1553
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1554
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1555
+ </xsl:if>
1556
+
1592
1557
  <xsl:choose>
1593
- <xsl:when test=". = 1 or . = 0">
1594
- <fo:table-column column-width="proportional-column-width(2)"/>
1558
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1559
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1560
+ <fo:table-column column-width="{@width}"/>
1561
+ </xsl:for-each>
1595
1562
  </xsl:when>
1596
1563
  <xsl:otherwise>
1597
- <fo:table-column column-width="proportional-column-width({.})"/>
1564
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1565
+ <xsl:choose>
1566
+ <xsl:when test=". = 1 or . = 0">
1567
+ <fo:table-column column-width="proportional-column-width(2)"/>
1568
+ </xsl:when>
1569
+ <xsl:otherwise>
1570
+ <fo:table-column column-width="proportional-column-width({.})"/>
1571
+ </xsl:otherwise>
1572
+ </xsl:choose>
1573
+ </xsl:for-each>
1598
1574
  </xsl:otherwise>
1599
1575
  </xsl:choose>
1576
+
1577
+ <xsl:choose>
1578
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1579
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1580
+ </xsl:when>
1581
+ <xsl:otherwise>
1582
+ <xsl:apply-templates/>
1583
+ </xsl:otherwise>
1584
+ </xsl:choose>
1585
+
1586
+ </fo:table>
1587
+
1588
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1589
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1590
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1591
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1592
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1593
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1594
+ </xsl:call-template>
1600
1595
  </xsl:for-each>
1601
- </fo:table>-->
1602
-
1603
-
1604
-
1605
-
1606
-
1607
- </fo:block-container>
1596
+
1597
+ <!-- insert footer as table -->
1598
+ <!-- <fo:table>
1599
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1600
+ <xsl:attribute name="{@name}">
1601
+ <xsl:value-of select="."/>
1602
+ </xsl:attribute>
1603
+ </xsl:for-each>
1604
+
1605
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1606
+ <xsl:choose>
1607
+ <xsl:when test=". = 1 or . = 0">
1608
+ <fo:table-column column-width="proportional-column-width(2)"/>
1609
+ </xsl:when>
1610
+ <xsl:otherwise>
1611
+ <fo:table-column column-width="proportional-column-width({.})"/>
1612
+ </xsl:otherwise>
1613
+ </xsl:choose>
1614
+ </xsl:for-each>
1615
+ </fo:table>-->
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+ </fo:block-container>
1622
+ </xsl:variable>
1623
+
1624
+
1625
+
1626
+ <xsl:choose>
1627
+ <xsl:when test="@width">
1628
+
1629
+ <!-- centered table when table name is centered (see table-name-style) -->
1630
+
1631
+ <fo:table table-layout="fixed" width="100%">
1632
+ <fo:table-column column-width="proportional-column-width(1)"/>
1633
+ <fo:table-column column-width="{@width}"/>
1634
+ <fo:table-column column-width="proportional-column-width(1)"/>
1635
+ <fo:table-body>
1636
+ <fo:table-row>
1637
+ <fo:table-cell column-number="2">
1638
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1639
+ </fo:table-cell>
1640
+ </fo:table-row>
1641
+ </fo:table-body>
1642
+ </fo:table>
1643
+
1644
+
1645
+
1646
+
1647
+ </xsl:when>
1648
+ <xsl:otherwise>
1649
+ <xsl:copy-of select="$table"/>
1650
+ </xsl:otherwise>
1651
+ </xsl:choose>
1652
+
1608
1653
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1609
1654
  <xsl:if test="normalize-space() != ''">
1610
1655
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -1732,7 +1777,15 @@
1732
1777
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1733
1778
  <xsl:value-of select="@target"/>
1734
1779
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1735
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1780
+ <xsl:variable name="mathml">
1781
+ <xsl:for-each select="*">
1782
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
1783
+ <xsl:copy-of select="."/>
1784
+ </xsl:if>
1785
+ </xsl:for-each>
1786
+ </xsl:variable>
1787
+
1788
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
1736
1789
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1737
1790
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1738
1791
  <xsl:param name="cols-count"/>
@@ -2417,7 +2470,7 @@
2417
2470
  <xsl:with-param name="table" select="$html-table"/>
2418
2471
  </xsl:call-template>
2419
2472
  </xsl:variable>
2420
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2473
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2421
2474
  <xsl:variable name="maxlength_dt">
2422
2475
  <xsl:call-template name="getMaxLength_dt"/>
2423
2476
  </xsl:variable>
@@ -2446,13 +2499,22 @@
2446
2499
  </xsl:when>
2447
2500
  <xsl:otherwise>
2448
2501
  <xsl:choose>
2502
+ <!-- to set width check most wide chars like `W` -->
2449
2503
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2450
- <fo:table-column column-width="5%"/>
2451
- <fo:table-column column-width="95%"/>
2504
+ <fo:table-column column-width="7%"/>
2505
+ <fo:table-column column-width="93%"/>
2506
+ </xsl:when>
2507
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2508
+ <fo:table-column column-width="15%"/>
2509
+ <fo:table-column column-width="85%"/>
2510
+ </xsl:when>
2511
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2512
+ <fo:table-column column-width="20%"/>
2513
+ <fo:table-column column-width="80%"/>
2452
2514
  </xsl:when>
2453
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2454
- <fo:table-column column-width="10%"/>
2455
- <fo:table-column column-width="90%"/>
2515
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2516
+ <fo:table-column column-width="25%"/>
2517
+ <fo:table-column column-width="75%"/>
2456
2518
  </xsl:when>
2457
2519
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2458
2520
  <fo:table-column column-width="60%"/>
@@ -2671,8 +2733,16 @@
2671
2733
  <fo:inline text-decoration="underline">
2672
2734
  <xsl:apply-templates/>
2673
2735
  </fo:inline>
2736
+ </xsl:template><xsl:template match="*[local-name()='add']">
2737
+ <fo:inline xsl:use-attribute-sets="add-style">
2738
+ <xsl:apply-templates/>
2739
+ </fo:inline>
2674
2740
  </xsl:template><xsl:template match="*[local-name()='del']">
2675
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2741
+ <fo:inline xsl:use-attribute-sets="del-style">
2742
+ <xsl:apply-templates/>
2743
+ </fo:inline>
2744
+ </xsl:template><xsl:template match="*[local-name()='hi']">
2745
+ <fo:inline background-color="yellow">
2676
2746
  <xsl:apply-templates/>
2677
2747
  </fo:inline>
2678
2748
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
@@ -2764,6 +2834,10 @@
2764
2834
  <xsl:param name="text" select="."/>
2765
2835
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2766
2836
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2837
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2838
+ <xsl:param name="text" select="."/>
2839
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2840
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2767
2841
  </xsl:template><xsl:template name="add-zero-spaces">
2768
2842
  <xsl:param name="text" select="."/>
2769
2843
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3011,6 +3085,7 @@
3011
3085
  <xsl:apply-templates select="." mode="mathml"/>
3012
3086
  </xsl:variable>
3013
3087
  <fo:instream-foreign-object fox:alt-text="Math">
3088
+
3014
3089
  <!-- <xsl:copy-of select="."/> -->
3015
3090
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3016
3091
  </fo:instream-foreign-object>
@@ -3024,7 +3099,12 @@
3024
3099
  <!-- replace start and end spaces to non-break space -->
3025
3100
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3026
3101
  </xsl:copy>
3027
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3102
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3103
+ <xsl:copy>
3104
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3105
+ </xsl:copy>
3106
+ <mathml:mspace width="0.5ex"/>
3107
+ </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">
3028
3108
  <xsl:variable name="target">
3029
3109
  <xsl:choose>
3030
3110
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3045,7 +3125,10 @@
3045
3125
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3046
3126
  <xsl:choose>
3047
3127
  <xsl:when test="normalize-space(.) = ''">
3048
- <xsl:value-of select="$target"/>
3128
+ <!-- <xsl:value-of select="$target"/> -->
3129
+ <xsl:call-template name="add-zero-spaces-link-java">
3130
+ <xsl:with-param name="text" select="$target"/>
3131
+ </xsl:call-template>
3049
3132
  </xsl:when>
3050
3133
  <xsl:otherwise>
3051
3134
  <xsl:apply-templates/>
@@ -3055,8 +3138,6 @@
3055
3138
  </xsl:otherwise>
3056
3139
  </xsl:choose>
3057
3140
  </fo:inline>
3058
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3059
- <fo:inline id="{@id}"/>
3060
3141
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3061
3142
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3062
3143
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3269,27 +3350,43 @@
3269
3350
  <fo:block id="{@id}">
3270
3351
  <xsl:apply-templates/>
3271
3352
  </fo:block>
3353
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3272
3354
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3273
3355
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3274
3356
  <xsl:apply-templates/>
3275
3357
  </fo:block>
3276
3358
  </xsl:template><xsl:template match="*[local-name() = 'image']">
3277
- <fo:block xsl:use-attribute-sets="image-style">
3278
-
3279
-
3280
- <xsl:variable name="src">
3281
- <xsl:choose>
3282
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3283
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3284
- </xsl:when>
3285
- <xsl:otherwise>
3286
- <xsl:value-of select="@src"/>
3287
- </xsl:otherwise>
3288
- </xsl:choose>
3289
- </xsl:variable>
3290
-
3291
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3292
- </fo:block>
3359
+ <xsl:choose>
3360
+ <xsl:when test="ancestor::*[local-name() = 'title']">
3361
+ <fo:inline padding-left="1mm" padding-right="1mm">
3362
+ <xsl:variable name="src">
3363
+ <xsl:call-template name="image_src"/>
3364
+ </xsl:variable>
3365
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
3366
+ </fo:inline>
3367
+ </xsl:when>
3368
+ <xsl:otherwise>
3369
+ <fo:block xsl:use-attribute-sets="image-style">
3370
+
3371
+ <xsl:variable name="src">
3372
+ <xsl:call-template name="image_src"/>
3373
+ </xsl:variable>
3374
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3375
+ </fo:block>
3376
+ </xsl:otherwise>
3377
+ </xsl:choose>
3378
+ </xsl:template><xsl:template name="image_src">
3379
+ <xsl:choose>
3380
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3381
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3382
+ </xsl:when>
3383
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3384
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3385
+ </xsl:when>
3386
+ <xsl:otherwise>
3387
+ <xsl:value-of select="@src"/>
3388
+ </xsl:otherwise>
3389
+ </xsl:choose>
3293
3390
  </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">
3294
3391
  <xsl:apply-templates mode="contents"/>
3295
3392
  <xsl:text> </xsl:text>
@@ -3522,6 +3619,8 @@
3522
3619
  <xsl:copy>
3523
3620
  <xsl:apply-templates mode="contents_item"/>
3524
3621
  </xsl:copy>
3622
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3623
+ <xsl:copy-of select="."/>
3525
3624
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3526
3625
  <xsl:text> </xsl:text>
3527
3626
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3850,10 +3949,11 @@
3850
3949
  </xsl:choose>
3851
3950
 
3852
3951
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3853
-
3952
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
3854
3953
  <xsl:variable name="element">
3855
3954
  block
3856
3955
 
3956
+
3857
3957
  </xsl:variable>
3858
3958
  <xsl:choose>
3859
3959
  <xsl:when test="normalize-space($element) = 'block'">
@@ -3915,11 +4015,13 @@
3915
4015
  </xsl:if>
3916
4016
  </xsl:if>
3917
4017
 
4018
+
3918
4019
  <fo:block-container margin-left="0mm">
3919
4020
 
3920
4021
  <fo:block xsl:use-attribute-sets="quote-style">
3921
4022
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3922
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4023
+
4024
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3923
4025
  </fo:block>
3924
4026
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3925
4027
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3942,29 +4044,47 @@
3942
4044
  <xsl:text>— </xsl:text>
3943
4045
  <xsl:apply-templates/>
3944
4046
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
3945
- <fo:inline xsl:use-attribute-sets="eref-style">
3946
- <xsl:if test="@type = 'footnote'">
3947
-
3948
-
3949
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3950
- <xsl:attribute name="font-size">50%</xsl:attribute>
3951
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3952
- <xsl:attribute name="vertical-align">super</xsl:attribute>
3953
-
3954
- </xsl:if>
3955
-
3956
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3957
-
3958
- <xsl:if test="@type = 'inline'">
3959
-
3960
-
3961
-
3962
- </xsl:if>
3963
-
3964
-
3965
- <xsl:apply-templates/>
3966
- </fo:basic-link>
3967
- </fo:inline>
4047
+
4048
+ <xsl:variable name="bibitemid">
4049
+ <xsl:choose>
4050
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4051
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4052
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4053
+ </xsl:choose>
4054
+ </xsl:variable>
4055
+
4056
+ <xsl:choose>
4057
+ <xsl:when test="normalize-space($bibitemid) != ''">
4058
+ <fo:inline xsl:use-attribute-sets="eref-style">
4059
+ <xsl:if test="@type = 'footnote'">
4060
+
4061
+
4062
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4063
+ <xsl:attribute name="font-size">50%</xsl:attribute>
4064
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4065
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4066
+
4067
+ </xsl:if>
4068
+
4069
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4070
+ <xsl:if test="normalize-space(@citeas) = ''">
4071
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4072
+ </xsl:if>
4073
+ <xsl:if test="@type = 'inline'">
4074
+
4075
+
4076
+
4077
+ </xsl:if>
4078
+
4079
+ <xsl:apply-templates/>
4080
+ </fo:basic-link>
4081
+
4082
+ </fo:inline>
4083
+ </xsl:when>
4084
+ <xsl:otherwise>
4085
+ <fo:inline><xsl:apply-templates/></fo:inline>
4086
+ </xsl:otherwise>
4087
+ </xsl:choose>
3968
4088
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
3969
4089
  <!-- zero-space char -->
3970
4090
  <xsl:variable name="depth">
@@ -4152,6 +4272,153 @@
4152
4272
  </fo:block>
4153
4273
  </xsl:otherwise>
4154
4274
  </xsl:choose>
4275
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4276
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4277
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4278
+ </xsl:for-each>
4279
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4280
+ <xsl:copy>
4281
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4282
+ </xsl:copy>
4283
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4284
+ <xsl:variable name="id">
4285
+ <xsl:call-template name="generateIndexXrefId"/>
4286
+ </xsl:variable>
4287
+ <xsl:copy> <!-- add id to xref -->
4288
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4289
+ <xsl:attribute name="id">
4290
+ <xsl:value-of select="$id"/>
4291
+ </xsl:attribute>
4292
+ <xsl:apply-templates mode="index_add_id"/>
4293
+ </xsl:copy>
4294
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4295
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4296
+ <xsl:if test="@to">
4297
+ <xsl:value-of select="$dash"/>
4298
+ <xsl:copy>
4299
+ <xsl:copy-of select="@*"/>
4300
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4301
+ <xsl:attribute name="id">
4302
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4303
+ </xsl:attribute>
4304
+ <xsl:apply-templates mode="index_add_id"/>
4305
+ </xsl:copy>
4306
+ </xsl:if>
4307
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4308
+ <xsl:copy>
4309
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4310
+ </xsl:copy>
4311
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4312
+ <xsl:copy>
4313
+ <xsl:apply-templates select="@*" mode="index_update"/>
4314
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4315
+ </xsl:copy>
4316
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4317
+ <xsl:param name="element"/>
4318
+ <xsl:param name="remove" select="'false'"/>
4319
+ <xsl:param name="target"/>
4320
+ <!-- <node></node> -->
4321
+ <xsl:choose>
4322
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4323
+ <!-- skip text (i.e. remove it) and process next element -->
4324
+ <!-- [removed_<xsl:value-of select="."/>] -->
4325
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4326
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4327
+ </xsl:apply-templates>
4328
+ </xsl:when>
4329
+ <xsl:when test="self::text()">
4330
+ <xsl:value-of select="."/>
4331
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4332
+ </xsl:when>
4333
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4334
+ <xsl:variable name="id" select="@id"/>
4335
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4336
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4337
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4338
+
4339
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4340
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4341
+
4342
+ <xsl:choose>
4343
+ <!-- 2nd pass -->
4344
+ <!-- if page is equal to page for next and page is not the end of range -->
4345
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4346
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4347
+ <!-- [removed_xref] -->
4348
+
4349
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4350
+ <xsl:with-param name="remove">true</xsl:with-param>
4351
+ <xsl:with-param name="target">
4352
+ <xsl:choose>
4353
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4354
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4355
+ </xsl:choose>
4356
+ </xsl:with-param>
4357
+ </xsl:apply-templates>
4358
+ </xsl:when>
4359
+
4360
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4361
+ <!-- remove xref -->
4362
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4363
+ <xsl:with-param name="remove">true</xsl:with-param>
4364
+ </xsl:apply-templates>
4365
+ </xsl:when>
4366
+
4367
+ <xsl:otherwise>
4368
+ <xsl:apply-templates select="." mode="xref_copy">
4369
+ <xsl:with-param name="target" select="$target"/>
4370
+ </xsl:apply-templates>
4371
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4372
+ </xsl:otherwise>
4373
+ </xsl:choose>
4374
+ </xsl:when>
4375
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4376
+ <!-- ul -->
4377
+ <xsl:apply-templates select="." mode="index_update"/>
4378
+ </xsl:when>
4379
+ <xsl:otherwise>
4380
+ <xsl:apply-templates select="." mode="xref_copy">
4381
+ <xsl:with-param name="target" select="$target"/>
4382
+ </xsl:apply-templates>
4383
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4384
+ </xsl:otherwise>
4385
+ </xsl:choose>
4386
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4387
+ <xsl:param name="target"/>
4388
+ <xsl:copy>
4389
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4390
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4391
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4392
+ </xsl:if>
4393
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4394
+ </xsl:copy>
4395
+ </xsl:template><xsl:template name="generateIndexXrefId">
4396
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4397
+
4398
+ <xsl:variable name="docid">
4399
+ <xsl:call-template name="getDocumentId"/>
4400
+ </xsl:variable>
4401
+ <xsl:variable name="item_number">
4402
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4403
+ </xsl:variable>
4404
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4405
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4406
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4407
+ <xsl:apply-templates/>
4408
+ <fo:block>
4409
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4410
+ <fo:block> </fo:block>
4411
+ </xsl:if>
4412
+ </fo:block>
4413
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4414
+ <xsl:apply-templates/>
4415
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4416
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4417
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4418
+ <xsl:apply-templates/>
4419
+ </fo:block>
4420
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4421
+ <fo:inline id="{@id}" font-size="1pt"/>
4155
4422
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4156
4423
  <!-- <row>
4157
4424
  <date>05-07-2013</date>
@@ -4339,7 +4606,7 @@
4339
4606
  <xsl:param name="charDelim" select="', '"/>
4340
4607
  <xsl:choose>
4341
4608
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4342
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4609
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4343
4610
  <xsl:sort data-type="text" order="ascending"/>
4344
4611
  <xsl:call-template name="insertKeyword">
4345
4612
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4348,7 +4615,7 @@
4348
4615
  </xsl:for-each>
4349
4616
  </xsl:when>
4350
4617
  <xsl:otherwise>
4351
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4618
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4352
4619
  <xsl:call-template name="insertKeyword">
4353
4620
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4354
4621
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4365,63 +4632,71 @@
4365
4632
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4366
4633
  </xsl:choose>
4367
4634
  </xsl:template><xsl:template name="addPDFUAmeta">
4368
- <fo:declarations>
4369
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4370
- <pdf:dictionary type="normal" key="ViewerPreferences">
4371
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4372
- </pdf:dictionary>
4373
- </pdf:catalog>
4374
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4375
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4376
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4377
- <!-- Dublin Core properties go here -->
4378
- <dc:title>
4379
- <xsl:variable name="title">
4635
+ <xsl:variable name="lang">
4636
+ <xsl:call-template name="getLang"/>
4637
+ </xsl:variable>
4638
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4639
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4640
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4641
+ </pdf:dictionary>
4642
+ </pdf:catalog>
4643
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4644
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4645
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4646
+ <!-- Dublin Core properties go here -->
4647
+ <dc:title>
4648
+ <xsl:variable name="title">
4649
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4380
4650
 
4381
4651
 
4382
4652
 
4383
4653
 
4384
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title']"/>
4654
+
4655
+ <xsl:value-of select="*[local-name() = 'title']"/>
4385
4656
 
4386
4657
 
4387
- </xsl:variable>
4388
- <xsl:choose>
4389
- <xsl:when test="normalize-space($title) != ''">
4390
- <xsl:value-of select="$title"/>
4391
- </xsl:when>
4392
- <xsl:otherwise>
4393
- <xsl:text> </xsl:text>
4394
- </xsl:otherwise>
4395
- </xsl:choose>
4396
- </dc:title>
4397
- <dc:creator>
4658
+ </xsl:for-each>
4659
+ </xsl:variable>
4660
+ <xsl:choose>
4661
+ <xsl:when test="normalize-space($title) != ''">
4662
+ <xsl:value-of select="$title"/>
4663
+ </xsl:when>
4664
+ <xsl:otherwise>
4665
+ <xsl:text> </xsl:text>
4666
+ </xsl:otherwise>
4667
+ </xsl:choose>
4668
+ </dc:title>
4669
+ <dc:creator>
4670
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4671
+
4672
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4673
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4674
+ <xsl:if test="position() != last()">; </xsl:if>
4675
+ </xsl:for-each>
4398
4676
 
4399
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
4400
4677
 
4401
4678
 
4679
+ </xsl:for-each>
4680
+ </dc:creator>
4681
+ <dc:description>
4682
+ <xsl:variable name="abstract">
4402
4683
 
4403
- </dc:creator>
4404
- <dc:description>
4405
- <xsl:variable name="abstract">
4406
-
4407
-
4408
-
4409
-
4410
-
4411
- </xsl:variable>
4412
- <xsl:value-of select="normalize-space($abstract)"/>
4413
- </dc:description>
4414
- <pdf:Keywords>
4415
- <xsl:call-template name="insertKeywords"/>
4416
- </pdf:Keywords>
4417
- </rdf:Description>
4418
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4419
- <!-- XMP properties go here -->
4420
- <xmp:CreatorTool/>
4421
- </rdf:Description>
4422
- </rdf:RDF>
4423
- </x:xmpmeta>
4424
- </fo:declarations>
4684
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4685
+
4686
+
4687
+ </xsl:variable>
4688
+ <xsl:value-of select="normalize-space($abstract)"/>
4689
+ </dc:description>
4690
+ <pdf:Keywords>
4691
+ <xsl:call-template name="insertKeywords"/>
4692
+ </pdf:Keywords>
4693
+ </rdf:Description>
4694
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4695
+ <!-- XMP properties go here -->
4696
+ <xmp:CreatorTool/>
4697
+ </rdf:Description>
4698
+ </rdf:RDF>
4699
+ </x:xmpmeta>
4425
4700
  </xsl:template><xsl:template name="getId">
4426
4701
  <xsl:choose>
4427
4702
  <xsl:when test="../@id">