metanorma-ogc 1.2.9 → 1.2.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -124,24 +124,64 @@
124
124
  </fo:block-container>
125
125
  </fo:block-container>
126
126
 
127
- <fo:block font-family="Lato" font-weight="300" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
127
+ <!-- <fo:block font-family="Lato" font-weight="300" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
128
128
  <xsl:text>Additional context, inspirational quote, etc. fits into this subheading area</xsl:text>
129
- </fo:block>
129
+ </fo:block> -->
130
130
 
131
- <fo:block-container absolute-position="fixed" left="20mm" top="91mm" width="175mm" font-size="9pt">
132
- <fo:block margin-top="8pt">
133
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement"/>
134
- </fo:block>
135
- <fo:block margin-top="8pt"> </fo:block>
136
- <fo:block margin-top="8pt">
137
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
131
+ <fo:block text-align="right" font-size="10pt" margin-top="12pt" margin-bottom="24pt">
132
+ <fo:block margin-top="6pt">Submission Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'received']/ogc:on"/></fo:block>
133
+ <fo:block margin-top="6pt">Approval Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'issued']/ogc:on"/></fo:block>
134
+ <fo:block margin-top="6pt">Publication Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'published']/ogc:on"/></fo:block>
135
+ <fo:block margin-top="6pt">External identifier of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docidentifier[@type = 'ogc-external']"/></fo:block>
136
+ <fo:block margin-top="6pt">Internal reference number of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/></fo:block>
137
+
138
+ <xsl:variable name="url" select="/ogc:ogc-standard/ogc:bibdata/ogc:uri"/>
139
+ <xsl:if test="normalize-space($url) != ''">
140
+ <fo:block margin-top="6pt">URL for this OGC® document: <xsl:value-of select="$url"/></fo:block>
141
+ </xsl:if>
142
+
143
+ <xsl:variable name="edition" select="/ogc:ogc-standard/ogc:bibdata/ogc:edition"/>
144
+ <xsl:if test="normalize-space($edition) != ''">
145
+ <fo:block margin-top="6pt">Version: <xsl:value-of select="$edition"/></fo:block>
146
+ </xsl:if>
147
+
148
+ <fo:block margin-top="6pt"><xsl:text>Category: </xsl:text>
149
+ <xsl:call-template name="capitalizeWords">
150
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:doctype"/>
151
+ </xsl:call-template>
138
152
  </fo:block>
153
+
154
+ <xsl:variable name="editors">
155
+ <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
156
+ <xsl:value-of select="."/>
157
+ <xsl:if test="position() != last()">, </xsl:if>
158
+ </xsl:for-each>
159
+ </xsl:variable>
160
+ <xsl:if test="normalize-space($editors) != ''">
161
+ <fo:block margin-top="6pt">Editor: <xsl:value-of select="$editors"/></fo:block>
162
+ </xsl:if>
163
+ </fo:block>
164
+
165
+ <!-- absolute-position="fixed" left="20mm" top="91mm" width="175mm" -->
166
+ <fo:block-container font-size="9pt" margin-left="-5mm" margin-right="-5mm">
167
+ <fo:block-container margin-left="0mm" margin-right="0mm">
168
+ <fo:block margin-top="8pt">
169
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement"/>
170
+ </fo:block>
171
+ <fo:block margin-top="8pt"> </fo:block>
172
+ <fo:block margin-top="8pt">
173
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
174
+ </fo:block>
175
+ </fo:block-container>
139
176
  </fo:block-container>
140
177
 
141
- <fo:block-container absolute-position="fixed" left="79mm" top="168mm">
142
- <fo:block>
143
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-OGC))}" width="57.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo"/>
144
- </fo:block>
178
+ <!-- absolute-position="fixed" left="79mm" top="168mm" -->
179
+ <fo:block-container margin-top="24pt" margin-left="-5mm" margin-right="-5mm">
180
+ <fo:block-container margin-left="0mm" margin-right="0mm">
181
+ <fo:block text-align="center">
182
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-OGC))}" width="57.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo"/>
183
+ </fo:block>
184
+ </fo:block-container>
145
185
  </fo:block-container>
146
186
 
147
187
  </fo:flow>
@@ -1291,6 +1331,7 @@
1291
1331
 
1292
1332
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1293
1333
 
1334
+
1294
1335
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1295
1336
 
1296
1337
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1302,6 +1343,7 @@
1302
1343
 
1303
1344
 
1304
1345
 
1346
+
1305
1347
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1306
1348
 
1307
1349
  <xsl:attribute name="text-align">right</xsl:attribute>
@@ -1449,199 +1491,232 @@
1449
1491
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1450
1492
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1451
1493
  <xsl:call-template name="add-zero-spaces-java"/>
1452
- </xsl:template><xsl:template match="*[local-name()='table']">
1494
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1453
1495
 
1454
- <xsl:variable name="simple-table">
1455
- <xsl:call-template name="getSimpleTable"/>
1456
- </xsl:variable>
1496
+ <xsl:variable name="table">
1457
1497
 
1458
-
1459
-
1460
-
1461
-
1462
- <!-- <xsl:if test="$namespace = 'bipm'">
1463
- <fo:block>&#xA0;</fo:block>
1464
- </xsl:if> -->
1465
-
1466
- <!-- $namespace = 'iso' or -->
1467
-
1468
-
1469
-
1470
- <xsl:call-template name="fn_name_display"/>
1498
+ <xsl:variable name="simple-table">
1499
+ <xsl:call-template name="getSimpleTable"/>
1500
+ </xsl:variable>
1471
1501
 
1472
1502
 
1473
-
1474
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1475
-
1476
- <!-- <xsl:variable name="cols-count">
1477
- <xsl:choose>
1478
- <xsl:when test="*[local-name()='thead']">
1479
- <xsl:call-template name="calculate-columns-numbers">
1480
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1481
- </xsl:call-template>
1482
- </xsl:when>
1483
- <xsl:otherwise>
1484
- <xsl:call-template name="calculate-columns-numbers">
1485
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1486
- </xsl:call-template>
1487
- </xsl:otherwise>
1488
- </xsl:choose>
1489
- </xsl:variable> -->
1490
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1491
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1492
-
1493
-
1494
-
1495
- <xsl:variable name="colwidths">
1496
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1497
- <xsl:call-template name="calculate-column-widths">
1498
- <xsl:with-param name="cols-count" select="$cols-count"/>
1499
- <xsl:with-param name="table" select="$simple-table"/>
1500
- </xsl:call-template>
1501
- </xsl:if>
1502
- </xsl:variable>
1503
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1504
-
1505
- <!-- <xsl:variable name="colwidths2">
1506
- <xsl:call-template name="calculate-column-widths">
1507
- <xsl:with-param name="cols-count" select="$cols-count"/>
1508
- </xsl:call-template>
1509
- </xsl:variable> -->
1510
-
1511
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1512
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1513
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1514
-
1515
- <xsl:variable name="margin-left">
1516
- <xsl:choose>
1517
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1518
- <xsl:otherwise>0</xsl:otherwise>
1519
- </xsl:choose>
1520
- </xsl:variable>
1521
-
1522
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1523
1503
 
1524
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1525
1504
 
1526
1505
 
1527
-
1528
-
1529
-
1506
+ <!-- <xsl:if test="$namespace = 'bipm'">
1507
+ <fo:block>&#xA0;</fo:block>
1508
+ </xsl:if> -->
1530
1509
 
1510
+ <!-- $namespace = 'iso' or -->
1531
1511
 
1512
+
1532
1513
 
1533
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1534
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1535
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1536
-
1514
+ <xsl:call-template name="fn_name_display"/>
1537
1515
 
1516
+
1538
1517
 
1518
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1539
1519
 
1520
+ <!-- <xsl:variable name="cols-count">
1521
+ <xsl:choose>
1522
+ <xsl:when test="*[local-name()='thead']">
1523
+ <xsl:call-template name="calculate-columns-numbers">
1524
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1525
+ </xsl:call-template>
1526
+ </xsl:when>
1527
+ <xsl:otherwise>
1528
+ <xsl:call-template name="calculate-columns-numbers">
1529
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1530
+ </xsl:call-template>
1531
+ </xsl:otherwise>
1532
+ </xsl:choose>
1533
+ </xsl:variable> -->
1534
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1535
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1540
1536
 
1541
1537
 
1542
1538
 
1539
+ <xsl:variable name="colwidths">
1540
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1541
+ <xsl:call-template name="calculate-column-widths">
1542
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1543
+ <xsl:with-param name="table" select="$simple-table"/>
1544
+ </xsl:call-template>
1545
+ </xsl:if>
1546
+ </xsl:variable>
1547
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1543
1548
 
1544
- <xsl:variable name="table_attributes">
1545
- <attribute name="table-layout">fixed</attribute>
1546
- <attribute name="width">100%</attribute>
1547
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1548
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1549
+ <!-- <xsl:variable name="colwidths2">
1550
+ <xsl:call-template name="calculate-column-widths">
1551
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1552
+ </xsl:call-template>
1553
+ </xsl:variable> -->
1554
+
1555
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1556
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1557
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1558
+
1559
+ <xsl:variable name="margin-left">
1560
+ <xsl:choose>
1561
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1562
+ <xsl:otherwise>0</xsl:otherwise>
1563
+ </xsl:choose>
1564
+ </xsl:variable>
1565
+
1566
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1549
1567
 
1568
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1550
1569
 
1551
1570
 
1571
+
1572
+
1573
+
1552
1574
 
1553
1575
 
1554
- <attribute name="margin-left">0mm</attribute>
1555
- <attribute name="margin-right">0mm</attribute>
1556
-
1557
-
1558
-
1559
1576
 
1560
-
1577
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1578
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1579
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1580
+
1561
1581
 
1562
- </xsl:variable>
1563
-
1564
-
1565
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1566
1582
 
1567
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1568
- <xsl:attribute name="{@name}">
1569
- <xsl:value-of select="."/>
1570
- </xsl:attribute>
1571
- </xsl:for-each>
1572
1583
 
1573
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1574
- <xsl:if test="$isNoteOrFnExist = 'true'">
1575
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1576
- </xsl:if>
1577
1584
 
1578
- <xsl:choose>
1579
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1580
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1581
- <fo:table-column column-width="{@width}"/>
1582
- </xsl:for-each>
1583
- </xsl:when>
1584
- <xsl:otherwise>
1585
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1586
- <xsl:choose>
1587
- <xsl:when test=". = 1 or . = 0">
1588
- <fo:table-column column-width="proportional-column-width(2)"/>
1589
- </xsl:when>
1590
- <xsl:otherwise>
1591
- <fo:table-column column-width="proportional-column-width({.})"/>
1592
- </xsl:otherwise>
1593
- </xsl:choose>
1594
- </xsl:for-each>
1595
- </xsl:otherwise>
1596
- </xsl:choose>
1597
1585
 
1598
- <xsl:choose>
1599
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1600
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1601
- </xsl:when>
1602
- <xsl:otherwise>
1603
- <xsl:apply-templates/>
1604
- </xsl:otherwise>
1605
- </xsl:choose>
1606
1586
 
1607
- </fo:table>
1608
-
1609
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1610
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1611
- <xsl:call-template name="insertTableFooterInSeparateTable">
1612
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1613
- <xsl:with-param name="colwidths" select="$colwidths"/>
1614
- <xsl:with-param name="colgroup" select="$colgroup"/>
1615
- </xsl:call-template>
1616
- </xsl:for-each>
1617
-
1618
- <!-- insert footer as table -->
1619
- <!-- <fo:table>
1620
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1621
- <xsl:attribute name="{@name}">
1622
- <xsl:value-of select="."/>
1623
- </xsl:attribute>
1624
- </xsl:for-each>
1587
+ <xsl:variable name="table_width">
1588
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1589
+
1590
+
1591
+
1592
+ <xsl:choose>
1593
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1594
+ <xsl:otherwise>100%</xsl:otherwise>
1595
+ </xsl:choose>
1596
+
1597
+ </xsl:variable>
1598
+
1599
+ <xsl:variable name="table_attributes">
1600
+ <attribute name="table-layout">fixed</attribute>
1601
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1602
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1603
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+ <attribute name="margin-left">0mm</attribute>
1610
+ <attribute name="margin-right">0mm</attribute>
1611
+
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+ </xsl:variable>
1618
+
1625
1619
 
1626
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1620
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1621
+
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:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1629
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1630
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1631
+ </xsl:if>
1632
+
1633
+ <xsl:choose>
1634
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1635
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1636
+ <fo:table-column column-width="{@width}"/>
1637
+ </xsl:for-each>
1638
+ </xsl:when>
1639
+ <xsl:otherwise>
1640
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1641
+ <xsl:choose>
1642
+ <xsl:when test=". = 1 or . = 0">
1643
+ <fo:table-column column-width="proportional-column-width(2)"/>
1644
+ </xsl:when>
1645
+ <xsl:otherwise>
1646
+ <fo:table-column column-width="proportional-column-width({.})"/>
1647
+ </xsl:otherwise>
1648
+ </xsl:choose>
1649
+ </xsl:for-each>
1650
+ </xsl:otherwise>
1651
+ </xsl:choose>
1652
+
1627
1653
  <xsl:choose>
1628
- <xsl:when test=". = 1 or . = 0">
1629
- <fo:table-column column-width="proportional-column-width(2)"/>
1654
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1655
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1630
1656
  </xsl:when>
1631
1657
  <xsl:otherwise>
1632
- <fo:table-column column-width="proportional-column-width({.})"/>
1658
+ <xsl:apply-templates/>
1633
1659
  </xsl:otherwise>
1634
1660
  </xsl:choose>
1661
+
1662
+ </fo:table>
1663
+
1664
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1665
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1666
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1667
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1668
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1669
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1670
+ </xsl:call-template>
1635
1671
  </xsl:for-each>
1636
- </fo:table>-->
1637
-
1638
-
1639
-
1640
-
1641
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1642
-
1643
-
1644
- </fo:block-container>
1672
+
1673
+ <!-- insert footer as table -->
1674
+ <!-- <fo:table>
1675
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1676
+ <xsl:attribute name="{@name}">
1677
+ <xsl:value-of select="."/>
1678
+ </xsl:attribute>
1679
+ </xsl:for-each>
1680
+
1681
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1682
+ <xsl:choose>
1683
+ <xsl:when test=". = 1 or . = 0">
1684
+ <fo:table-column column-width="proportional-column-width(2)"/>
1685
+ </xsl:when>
1686
+ <xsl:otherwise>
1687
+ <fo:table-column column-width="proportional-column-width({.})"/>
1688
+ </xsl:otherwise>
1689
+ </xsl:choose>
1690
+ </xsl:for-each>
1691
+ </fo:table>-->
1692
+
1693
+
1694
+
1695
+
1696
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1697
+
1698
+
1699
+ </fo:block-container>
1700
+ </xsl:variable>
1701
+
1702
+
1703
+
1704
+ <xsl:choose>
1705
+ <xsl:when test="@width">
1706
+
1707
+ <!-- centered table when table name is centered (see table-name-style) -->
1708
+
1709
+
1710
+
1711
+ <xsl:copy-of select="$table"/>
1712
+
1713
+
1714
+ </xsl:when>
1715
+ <xsl:otherwise>
1716
+ <xsl:copy-of select="$table"/>
1717
+ </xsl:otherwise>
1718
+ </xsl:choose>
1719
+
1645
1720
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1646
1721
  <xsl:if test="normalize-space() != ''">
1647
1722
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2346,7 +2421,9 @@
2346
2421
  </xsl:template><xsl:template match="*[local-name()='dl']">
2347
2422
  <fo:block-container>
2348
2423
 
2349
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2424
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2425
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2426
+ </xsl:if>
2350
2427
 
2351
2428
 
2352
2429
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2361,6 +2438,7 @@
2361
2438
  <fo:block-container>
2362
2439
 
2363
2440
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2441
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2364
2442
 
2365
2443
 
2366
2444
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2477,7 +2555,7 @@
2477
2555
  <xsl:with-param name="table" select="$html-table"/>
2478
2556
  </xsl:call-template>
2479
2557
  </xsl:variable>
2480
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2558
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2481
2559
  <xsl:variable name="maxlength_dt">
2482
2560
  <xsl:call-template name="getMaxLength_dt"/>
2483
2561
  </xsl:variable>
@@ -2506,13 +2584,22 @@
2506
2584
  </xsl:when>
2507
2585
  <xsl:otherwise>
2508
2586
  <xsl:choose>
2587
+ <!-- to set width check most wide chars like `W` -->
2509
2588
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2510
- <fo:table-column column-width="5%"/>
2511
- <fo:table-column column-width="95%"/>
2589
+ <fo:table-column column-width="7%"/>
2590
+ <fo:table-column column-width="93%"/>
2591
+ </xsl:when>
2592
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2593
+ <fo:table-column column-width="15%"/>
2594
+ <fo:table-column column-width="85%"/>
2512
2595
  </xsl:when>
2513
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2514
- <fo:table-column column-width="10%"/>
2515
- <fo:table-column column-width="90%"/>
2596
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2597
+ <fo:table-column column-width="20%"/>
2598
+ <fo:table-column column-width="80%"/>
2599
+ </xsl:when>
2600
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2601
+ <fo:table-column column-width="25%"/>
2602
+ <fo:table-column column-width="75%"/>
2516
2603
  </xsl:when>
2517
2604
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2518
2605
  <fo:table-column column-width="60%"/>
@@ -2544,12 +2631,32 @@
2544
2631
  </xsl:otherwise>
2545
2632
  </xsl:choose>
2546
2633
  </xsl:template><xsl:template name="getMaxLength_dt">
2547
- <xsl:for-each select="*[local-name()='dt']">
2548
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2549
- <xsl:if test="position() = 1">
2550
- <xsl:value-of select="string-length(normalize-space(.))"/>
2551
- </xsl:if>
2552
- </xsl:for-each>
2634
+ <xsl:variable name="lengths">
2635
+ <xsl:for-each select="*[local-name()='dt']">
2636
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2637
+ <xsl:variable name="attributes">
2638
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2639
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2640
+ </xsl:variable>
2641
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2642
+ </xsl:for-each>
2643
+ </xsl:variable>
2644
+ <xsl:variable name="maxLength">
2645
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2646
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2647
+ <xsl:if test="position() = 1">
2648
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2649
+ </xsl:if>
2650
+ </xsl:for-each> -->
2651
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2652
+ <xsl:sort select="." data-type="number" order="descending"/>
2653
+ <xsl:if test="position() = 1">
2654
+ <xsl:value-of select="."/>
2655
+ </xsl:if>
2656
+ </xsl:for-each>
2657
+ </xsl:variable>
2658
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2659
+ <xsl:value-of select="$maxLength"/>
2553
2660
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2554
2661
  <xsl:param name="key_iso"/>
2555
2662
 
@@ -2689,6 +2796,7 @@
2689
2796
 
2690
2797
 
2691
2798
 
2799
+
2692
2800
  10
2693
2801
 
2694
2802
 
@@ -2704,6 +2812,10 @@
2704
2812
  </xsl:if>
2705
2813
  <xsl:apply-templates/>
2706
2814
  </fo:inline>
2815
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2816
+ <fo:inline text-decoration="underline">
2817
+ <xsl:apply-templates/>
2818
+ </fo:inline>
2707
2819
  </xsl:template><xsl:template match="*[local-name()='del']">
2708
2820
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2709
2821
  <xsl:apply-templates/>
@@ -2797,6 +2909,10 @@
2797
2909
  <xsl:param name="text" select="."/>
2798
2910
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2799
2911
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2912
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2913
+ <xsl:param name="text" select="."/>
2914
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2915
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2800
2916
  </xsl:template><xsl:template name="add-zero-spaces">
2801
2917
  <xsl:param name="text" select="."/>
2802
2918
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3057,6 +3173,11 @@
3057
3173
  <!-- replace start and end spaces to non-break space -->
3058
3174
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3059
3175
  </xsl:copy>
3176
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3177
+ <xsl:copy>
3178
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3179
+ </xsl:copy>
3180
+ <mathml:mspace width="0.5ex"/>
3060
3181
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3061
3182
  <xsl:variable name="target">
3062
3183
  <xsl:choose>
@@ -3078,7 +3199,10 @@
3078
3199
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3079
3200
  <xsl:choose>
3080
3201
  <xsl:when test="normalize-space(.) = ''">
3081
- <xsl:value-of select="$target"/>
3202
+ <!-- <xsl:value-of select="$target"/> -->
3203
+ <xsl:call-template name="add-zero-spaces-link-java">
3204
+ <xsl:with-param name="text" select="$target"/>
3205
+ </xsl:call-template>
3082
3206
  </xsl:when>
3083
3207
  <xsl:otherwise>
3084
3208
  <xsl:apply-templates/>
@@ -3286,7 +3410,7 @@
3286
3410
  </xsl:if> -->
3287
3411
  </fo:inline>
3288
3412
  </xsl:if>
3289
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3413
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3290
3414
  <fo:block-container id="{@id}">
3291
3415
 
3292
3416
  <fo:block>
@@ -3355,6 +3479,8 @@
3355
3479
  <xsl:variable name="bookmark-title_">
3356
3480
  <xsl:call-template name="getLangVersion">
3357
3481
  <xsl:with-param name="lang" select="@lang"/>
3482
+ <xsl:with-param name="doctype" select="@doctype"/>
3483
+ <xsl:with-param name="title" select="@title-part"/>
3358
3484
  </xsl:call-template>
3359
3485
  </xsl:variable>
3360
3486
  <xsl:choose>
@@ -3372,13 +3498,34 @@
3372
3498
  </xsl:choose>
3373
3499
  </fo:bookmark-title>
3374
3500
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3501
+
3502
+ <xsl:call-template name="insertFigureBookmarks">
3503
+ <xsl:with-param name="contents" select="contents"/>
3504
+ </xsl:call-template>
3505
+
3506
+ <xsl:call-template name="insertTableBookmarks">
3507
+ <xsl:with-param name="contents" select="contents"/>
3508
+ <xsl:with-param name="lang" select="@lang"/>
3509
+ </xsl:call-template>
3510
+
3375
3511
  </fo:bookmark>
3376
3512
 
3377
3513
  </xsl:for-each>
3378
3514
  </xsl:when>
3379
3515
  <xsl:otherwise>
3380
3516
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3517
+
3381
3518
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3519
+
3520
+ <xsl:call-template name="insertFigureBookmarks">
3521
+ <xsl:with-param name="contents" select="contents"/>
3522
+ </xsl:call-template>
3523
+
3524
+ <xsl:call-template name="insertTableBookmarks">
3525
+ <xsl:with-param name="contents" select="contents"/>
3526
+ <xsl:with-param name="lang" select="@lang"/>
3527
+ </xsl:call-template>
3528
+
3382
3529
  </xsl:for-each>
3383
3530
  </xsl:otherwise>
3384
3531
  </xsl:choose>
@@ -3408,8 +3555,44 @@
3408
3555
 
3409
3556
  </fo:bookmark-tree>
3410
3557
  </xsl:if>
3558
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3559
+ <xsl:param name="contents"/>
3560
+ <xsl:if test="xalan:nodeset($contents)/figure">
3561
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3562
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3563
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3564
+ <fo:bookmark internal-destination="{@id}">
3565
+ <fo:bookmark-title>
3566
+ <xsl:value-of select="normalize-space(title)"/>
3567
+ </fo:bookmark-title>
3568
+ </fo:bookmark>
3569
+ </xsl:for-each>
3570
+ </fo:bookmark>
3571
+ </xsl:if>
3572
+ </xsl:template><xsl:template name="insertTableBookmarks">
3573
+ <xsl:param name="contents"/>
3574
+ <xsl:param name="lang"/>
3575
+ <xsl:if test="xalan:nodeset($contents)/table">
3576
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3577
+ <fo:bookmark-title>
3578
+ <xsl:choose>
3579
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3580
+ <xsl:otherwise>Tables</xsl:otherwise>
3581
+ </xsl:choose>
3582
+ </fo:bookmark-title>
3583
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3584
+ <fo:bookmark internal-destination="{@id}">
3585
+ <fo:bookmark-title>
3586
+ <xsl:value-of select="normalize-space(title)"/>
3587
+ </fo:bookmark-title>
3588
+ </fo:bookmark>
3589
+ </xsl:for-each>
3590
+ </fo:bookmark>
3591
+ </xsl:if>
3411
3592
  </xsl:template><xsl:template name="getLangVersion">
3412
3593
  <xsl:param name="lang"/>
3594
+ <xsl:param name="doctype" select="''"/>
3595
+ <xsl:param name="title" select="''"/>
3413
3596
  <xsl:choose>
3414
3597
  <xsl:when test="$lang = 'en'">
3415
3598
 
@@ -3445,6 +3628,12 @@
3445
3628
  <!-- <xsl:text> </xsl:text> -->
3446
3629
  </xsl:template><xsl:template name="getSection">
3447
3630
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3631
+ <!--
3632
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3633
+ <xsl:value-of select="."/>
3634
+ </xsl:for-each>
3635
+ -->
3636
+
3448
3637
  </xsl:template><xsl:template name="getName">
3449
3638
  <xsl:choose>
3450
3639
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3497,6 +3686,12 @@
3497
3686
  <xsl:copy>
3498
3687
  <xsl:apply-templates mode="contents_item"/>
3499
3688
  </xsl:copy>
3689
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3690
+ <xsl:copy>
3691
+ <xsl:apply-templates mode="contents_item"/>
3692
+ </xsl:copy>
3693
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3694
+ <xsl:copy-of select="."/>
3500
3695
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3501
3696
  <xsl:text> </xsl:text>
3502
3697
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3522,6 +3717,7 @@
3522
3717
 
3523
3718
 
3524
3719
 
3720
+
3525
3721
 
3526
3722
 
3527
3723
 
@@ -3910,10 +4106,13 @@
3910
4106
  </xsl:if>
3911
4107
  </xsl:if>
3912
4108
 
4109
+
3913
4110
  <fo:block-container margin-left="0mm">
3914
4111
 
3915
4112
  <fo:block xsl:use-attribute-sets="quote-style">
3916
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4113
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4114
+
4115
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3917
4116
  </fo:block>
3918
4117
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3919
4118
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4071,6 +4270,7 @@
4071
4270
 
4072
4271
 
4073
4272
 
4273
+
4074
4274
 
4075
4275
 
4076
4276
 
@@ -4087,7 +4287,7 @@
4087
4287
 
4088
4288
 
4089
4289
 
4090
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4290
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4091
4291
  <fo:block break-after="page"/>
4092
4292
  <fo:block>
4093
4293
  <xsl:call-template name="setId"/>
@@ -4095,7 +4295,8 @@
4095
4295
  </fo:block>
4096
4296
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4097
4297
  <fo:block>
4098
- <xsl:call-template name="setId"/>
4298
+ <xsl:call-template name="setId"/>
4299
+
4099
4300
 
4100
4301
  <xsl:apply-templates/>
4101
4302
  </fo:block>
@@ -4381,6 +4582,8 @@
4381
4582
  <xsl:value-of select="translate(.,'. ','')"/>
4382
4583
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4383
4584
  <xsl:value-of select="substring(.,1,1)"/>
4585
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4586
+ <fo:inline><xsl:apply-templates/></fo:inline>
4384
4587
  </xsl:template><xsl:template name="convertDate">
4385
4588
  <xsl:param name="date"/>
4386
4589
  <xsl:param name="format" select="'short'"/>
@@ -4405,6 +4608,57 @@
4405
4608
  </xsl:variable>
4406
4609
  <xsl:variable name="result">
4407
4610
  <xsl:choose>
4611
+ <xsl:when test="$format = 'ddMMyyyy'">
4612
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4613
+ <xsl:text> </xsl:text>
4614
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4615
+ </xsl:when>
4616
+ <xsl:when test="$format = 'ddMM'">
4617
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4618
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4619
+ </xsl:when>
4620
+ <xsl:when test="$format = 'short' or $day = ''">
4621
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4622
+ </xsl:when>
4623
+ <xsl:otherwise>
4624
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4625
+ </xsl:otherwise>
4626
+ </xsl:choose>
4627
+ </xsl:variable>
4628
+ <xsl:value-of select="$result"/>
4629
+ </xsl:template><xsl:template name="convertDateLocalized">
4630
+ <xsl:param name="date"/>
4631
+ <xsl:param name="format" select="'short'"/>
4632
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4633
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4634
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4635
+ <xsl:variable name="monthStr">
4636
+ <xsl:choose>
4637
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
4638
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
4639
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
4640
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
4641
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
4642
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
4643
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
4644
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
4645
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
4646
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
4647
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
4648
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
4649
+ </xsl:choose>
4650
+ </xsl:variable>
4651
+ <xsl:variable name="result">
4652
+ <xsl:choose>
4653
+ <xsl:when test="$format = 'ddMMyyyy'">
4654
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4655
+ <xsl:text> </xsl:text>
4656
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4657
+ </xsl:when>
4658
+ <xsl:when test="$format = 'ddMM'">
4659
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4660
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4661
+ </xsl:when>
4408
4662
  <xsl:when test="$format = 'short' or $day = ''">
4409
4663
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4410
4664
  </xsl:when>
@@ -4420,7 +4674,7 @@
4420
4674
  <xsl:param name="charDelim" select="', '"/>
4421
4675
  <xsl:choose>
4422
4676
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4423
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4677
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4424
4678
  <xsl:sort data-type="text" order="ascending"/>
4425
4679
  <xsl:call-template name="insertKeyword">
4426
4680
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4429,7 +4683,7 @@
4429
4683
  </xsl:for-each>
4430
4684
  </xsl:when>
4431
4685
  <xsl:otherwise>
4432
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4686
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4433
4687
  <xsl:call-template name="insertKeyword">
4434
4688
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4435
4689
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4446,6 +4700,9 @@
4446
4700
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4447
4701
  </xsl:choose>
4448
4702
  </xsl:template><xsl:template name="addPDFUAmeta">
4703
+ <xsl:variable name="lang">
4704
+ <xsl:call-template name="getLang"/>
4705
+ </xsl:variable>
4449
4706
  <fo:declarations>
4450
4707
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4451
4708
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -4458,13 +4715,16 @@
4458
4715
  <!-- Dublin Core properties go here -->
4459
4716
  <dc:title>
4460
4717
  <xsl:variable name="title">
4461
-
4462
-
4463
-
4464
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
4465
-
4466
-
4467
-
4718
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4719
+
4720
+
4721
+
4722
+
4723
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
4724
+
4725
+
4726
+
4727
+ </xsl:for-each>
4468
4728
  </xsl:variable>
4469
4729
  <xsl:choose>
4470
4730
  <xsl:when test="normalize-space($title) != ''">
@@ -4476,17 +4736,21 @@
4476
4736
  </xsl:choose>
4477
4737
  </dc:title>
4478
4738
  <dc:creator>
4479
-
4480
-
4481
-
4482
- </dc:creator>
4483
- <dc:description>
4484
- <xsl:variable name="abstract">
4739
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4740
+
4741
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4742
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4743
+ <xsl:if test="position() != last()">; </xsl:if>
4744
+ </xsl:for-each>
4485
4745
 
4486
4746
 
4487
4747
 
4748
+ </xsl:for-each>
4749
+ </dc:creator>
4750
+ <dc:description>
4751
+ <xsl:variable name="abstract">
4488
4752
 
4489
- <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
4753
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4490
4754
 
4491
4755
 
4492
4756
  </xsl:variable>
@@ -4599,6 +4863,7 @@
4599
4863
 
4600
4864
 
4601
4865
 
4866
+
4602
4867
  </xsl:variable>
4603
4868
  <xsl:if test="$documentNS != $XSLNS">
4604
4869
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4658,6 +4923,11 @@
4658
4923
  <xsl:call-template name="getLang"/>
4659
4924
  </xsl:variable>
4660
4925
 
4661
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4926
+ <xsl:choose>
4927
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4928
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4929
+ </xsl:when>
4930
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4931
+ </xsl:choose>
4662
4932
 
4663
4933
  </xsl:template></xsl:stylesheet>