metanorma-nist 1.2.12 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -108,6 +108,13 @@ a.FootnoteRef + a.FootnoteRef:before {
108
108
  content: ", ";
109
109
  vertical-align: super; }
110
110
 
111
+ .addition {
112
+ color: blue; }
113
+
114
+ .deletion {
115
+ color: red;
116
+ text-decoration: line-through; }
117
+
111
118
  #nist-sp-band {
112
119
  background-color: #d8eca8; }
113
120
 
@@ -35,7 +35,6 @@ module IsoDoc
35
35
  htmlstylesheet: html_doc_path("htmlstyle.scss"),
36
36
  htmlcoverpage: html_doc_path("html_nist_titlepage.html"),
37
37
  htmlintropage: html_doc_path("html_nist_intro.html"),
38
- scripts: html_doc_path("scripts.html"),
39
38
  }
40
39
  end
41
40
 
@@ -5,7 +5,9 @@
5
5
 
6
6
 
7
7
  <xsl:param name="svg_images"/>
8
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
8
9
  <xsl:variable name="images" select="document($svg_images)"/>
10
+ <xsl:param name="basepath"/>
9
11
 
10
12
 
11
13
 
@@ -92,7 +94,9 @@
92
94
 
93
95
  </fo:layout-master-set>
94
96
 
95
- <xsl:call-template name="addPDFUAmeta"/>
97
+ <fo:declarations>
98
+ <xsl:call-template name="addPDFUAmeta"/>
99
+ </fo:declarations>
96
100
 
97
101
  <xsl:call-template name="addBookmarks">
98
102
  <xsl:with-param name="contents" select="$contents"/>
@@ -234,52 +238,28 @@
234
238
  <fo:block margin-top="18pt">
235
239
 
236
240
  <!-- Abstract -->
237
- <xsl:if test="/nist:nist-standard/nist:preface/nist:abstract">
238
- <xsl:variable name="title-abstract">
239
- <xsl:call-template name="getTitle">
240
- <xsl:with-param name="name" select="'title-abstract'"/>
241
- </xsl:call-template>
242
- </xsl:variable>
243
- <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt"><xsl:value-of select="$title-abstract"/></fo:block>
244
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:abstract"/>
245
- </xsl:if>
241
+ <!-- Keywords -->
242
+ <!-- Acknowledgements -->
243
+ <xsl:apply-templates select="/nist:nist-standard/nist:preface/*"/>
244
+
245
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:abstract"/> -->
246
246
 
247
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:acknowledgements"/> -->
248
+
247
249
  <!-- Keywords -->
248
- <xsl:if test="/nist:nist-standard/nist:bibdata/nist:keyword">
250
+ <!-- <xsl:if test="/nist:nist-standard/nist:bibdata/nist:keyword">
249
251
  <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt">
250
- <xsl:variable name="title-keywords">
251
- <xsl:call-template name="getTitle">
252
- <xsl:with-param name="name" select="'title-keywords'"/>
253
- </xsl:call-template>
254
- </xsl:variable>
255
- <xsl:value-of select="$title-keywords"/>
252
+ <xsl:call-template name="getLocalizedString">
253
+ <xsl:with-param name="key">keywords</xsl:with-param>
254
+ </xsl:call-template>
256
255
  </fo:block>
257
256
  <fo:block margin-bottom="12pt" text-align="justify">
258
257
  <xsl:call-template name="insertKeywords">
259
- <xsl:with-param name="charAtEnd"/>
258
+ <xsl:with-param name="charAtEnd"></xsl:with-param>
260
259
  <xsl:with-param name="charDelim">; </xsl:with-param>
261
260
  </xsl:call-template>
262
- <!-- <xsl:for-each select="/nist:nist-standard/nist:bibdata//nist:keyword">
263
- <xsl:sort data-type="text" order="ascending"/>
264
- <xsl:apply-templates/>
265
- <xsl:choose>
266
- <xsl:when test="position() != last()">; </xsl:when>
267
- <xsl:otherwise></xsl:otherwise>
268
- </xsl:choose>
269
- </xsl:for-each> -->
270
261
  </fo:block>
271
- </xsl:if>
272
-
273
- <xsl:if test="/nist:nist-standard/nist:preface/nist:acknowledgements">
274
- <xsl:variable name="title-acknowledgements">
275
- <xsl:call-template name="getTitle">
276
- <xsl:with-param name="name" select="'title-acknowledgements'"/>
277
- </xsl:call-template>
278
- </xsl:variable>
279
- <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-top="18pt" margin-bottom="12pt"><xsl:value-of select="$title-acknowledgements"/></fo:block>
280
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:acknowledgements"/>
281
- </xsl:if>
282
-
262
+ </xsl:if> -->
283
263
 
284
264
  <!-- Disclaimer -->
285
265
  <!-- Additional Information -->
@@ -291,8 +271,9 @@
291
271
  <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt">Feedback</fo:block>
292
272
  <xsl:text>Feedback on this publication is welcome, and can be sent to: code-signing@nist.gov.</xsl:text>
293
273
 
294
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:clause"/>
295
-
274
+ <!-- Keywords -->
275
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:clause"/> -->
276
+
296
277
  <fo:block break-after="page"/>
297
278
 
298
279
  <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:foreword"/> -->
@@ -422,7 +403,7 @@
422
403
  <xsl:apply-templates select="/nist:nist-standard/nist:annex"/>
423
404
 
424
405
  <!-- Bibliography -->
425
- <xsl:apply-templates select="/nist:nist-standard/nist:bibliography/nist:references"/>
406
+ <xsl:apply-templates select="/nist:nist-standard/nist:bibliography"/>
426
407
 
427
408
  </fo:block>
428
409
 
@@ -621,13 +602,13 @@
621
602
  <!-- ====== -->
622
603
 
623
604
  <xsl:template match="nist:legal-statement//nist:title">
624
- <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" color="{$color}">
605
+ <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" color="{$color}" keep-with-next="always">
625
606
  <xsl:apply-templates/>
626
607
  </fo:block>
627
608
  </xsl:template>
628
609
 
629
610
  <xsl:template match="nist:executivesummary//nist:title">
630
- <fo:block-container color="white" background-color="black" margin-bottom="12pt">
611
+ <fo:block-container color="white" background-color="black" margin-bottom="12pt" keep-with-next="always">
631
612
  <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="left" margin-left="4mm" padding-top="1mm">
632
613
  <xsl:apply-templates/>
633
614
  </fo:block>
@@ -635,11 +616,19 @@
635
616
  </xsl:template>
636
617
 
637
618
  <xsl:template match="nist:preface//nist:title" priority="3">
638
- <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" space-before="12pt" margin-bottom="12pt" color="{$color}">
619
+ <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" space-before="12pt" margin-bottom="12pt" color="{$color}" keep-with-next="always">
620
+ <xsl:if test="local-name(..) = 'acknowledgements'">
621
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
622
+ </xsl:if>
639
623
  <xsl:apply-templates/>
640
624
  </fo:block>
641
625
  </xsl:template>
642
626
 
627
+ <xsl:template match="/nist:nist-standard/nist:bibliography">
628
+ <fo:block break-after="page"/>
629
+ <xsl:apply-templates/>
630
+ </xsl:template>
631
+
643
632
  <xsl:template match="nist:references">
644
633
  <fo:block id="{@id}">
645
634
  <xsl:apply-templates/>
@@ -1300,6 +1289,7 @@
1300
1289
 
1301
1290
 
1302
1291
 
1292
+
1303
1293
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1304
1294
 
1305
1295
 
@@ -1549,203 +1539,237 @@
1549
1539
  <xsl:call-template name="add-zero-spaces-java"/>
1550
1540
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1551
1541
 
1552
- <xsl:variable name="simple-table">
1553
- <xsl:call-template name="getSimpleTable"/>
1554
- </xsl:variable>
1542
+ <xsl:variable name="table">
1555
1543
 
1556
-
1557
-
1558
-
1559
-
1560
- <!-- <xsl:if test="$namespace = 'bipm'">
1561
- <fo:block>&#xA0;</fo:block>
1562
- </xsl:if> -->
1563
-
1564
- <!-- $namespace = 'iso' or -->
1565
-
1566
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1567
-
1568
-
1544
+ <xsl:variable name="simple-table">
1545
+ <xsl:call-template name="getSimpleTable"/>
1546
+ </xsl:variable>
1569
1547
 
1570
1548
 
1571
-
1572
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1573
-
1574
- <!-- <xsl:variable name="cols-count">
1575
- <xsl:choose>
1576
- <xsl:when test="*[local-name()='thead']">
1577
- <xsl:call-template name="calculate-columns-numbers">
1578
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1579
- </xsl:call-template>
1580
- </xsl:when>
1581
- <xsl:otherwise>
1582
- <xsl:call-template name="calculate-columns-numbers">
1583
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1584
- </xsl:call-template>
1585
- </xsl:otherwise>
1586
- </xsl:choose>
1587
- </xsl:variable> -->
1588
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1589
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1590
-
1591
-
1592
-
1593
- <xsl:variable name="colwidths">
1594
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1595
- <xsl:call-template name="calculate-column-widths">
1596
- <xsl:with-param name="cols-count" select="$cols-count"/>
1597
- <xsl:with-param name="table" select="$simple-table"/>
1598
- </xsl:call-template>
1599
- </xsl:if>
1600
- </xsl:variable>
1601
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1602
-
1603
- <!-- <xsl:variable name="colwidths2">
1604
- <xsl:call-template name="calculate-column-widths">
1605
- <xsl:with-param name="cols-count" select="$cols-count"/>
1606
- </xsl:call-template>
1607
- </xsl:variable> -->
1608
-
1609
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1610
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1611
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1612
-
1613
- <xsl:variable name="margin-left">
1614
- <xsl:choose>
1615
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1616
- <xsl:otherwise>0</xsl:otherwise>
1617
- </xsl:choose>
1618
- </xsl:variable>
1619
-
1620
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1621
1549
 
1622
1550
 
1623
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1624
1551
 
1625
-
1626
-
1627
-
1552
+ <!-- <xsl:if test="$namespace = 'bipm'">
1553
+ <fo:block>&#xA0;</fo:block>
1554
+ </xsl:if> -->
1628
1555
 
1556
+ <!-- $namespace = 'iso' or -->
1629
1557
 
1630
- <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1631
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1632
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1633
- </xsl:if>
1634
- <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1635
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1636
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1637
- </xsl:if>
1638
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1558
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1639
1559
 
1640
-
1560
+
1641
1561
 
1562
+
1642
1563
 
1564
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1643
1565
 
1566
+ <!-- <xsl:variable name="cols-count">
1567
+ <xsl:choose>
1568
+ <xsl:when test="*[local-name()='thead']">
1569
+ <xsl:call-template name="calculate-columns-numbers">
1570
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1571
+ </xsl:call-template>
1572
+ </xsl:when>
1573
+ <xsl:otherwise>
1574
+ <xsl:call-template name="calculate-columns-numbers">
1575
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1576
+ </xsl:call-template>
1577
+ </xsl:otherwise>
1578
+ </xsl:choose>
1579
+ </xsl:variable> -->
1580
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1581
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1644
1582
 
1645
1583
 
1646
1584
 
1585
+ <xsl:variable name="colwidths">
1586
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1587
+ <xsl:call-template name="calculate-column-widths">
1588
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1589
+ <xsl:with-param name="table" select="$simple-table"/>
1590
+ </xsl:call-template>
1591
+ </xsl:if>
1592
+ </xsl:variable>
1593
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1647
1594
 
1648
- <xsl:variable name="table_attributes">
1649
- <attribute name="table-layout">fixed</attribute>
1650
- <attribute name="width">
1651
- <xsl:choose>
1652
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1653
- <xsl:otherwise>100%</xsl:otherwise>
1654
- </xsl:choose>
1655
- </attribute>
1656
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1657
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1595
+ <!-- <xsl:variable name="colwidths2">
1596
+ <xsl:call-template name="calculate-column-widths">
1597
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1598
+ </xsl:call-template>
1599
+ </xsl:variable> -->
1600
+
1601
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1602
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1603
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1604
+
1605
+ <xsl:variable name="margin-left">
1606
+ <xsl:choose>
1607
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1608
+ <xsl:otherwise>0</xsl:otherwise>
1609
+ </xsl:choose>
1610
+ </xsl:variable>
1611
+
1612
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1658
1613
 
1659
1614
 
1615
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1660
1616
 
1617
+
1618
+
1619
+
1661
1620
 
1662
-
1663
-
1664
-
1665
1621
 
1666
-
1622
+ <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1623
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1624
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1625
+ </xsl:if>
1626
+ <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1627
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1628
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1629
+ </xsl:if>
1630
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1667
1631
 
1668
- </xsl:variable>
1669
-
1670
-
1671
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1632
+
1672
1633
 
1673
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1674
- <xsl:attribute name="{@name}">
1675
- <xsl:value-of select="."/>
1676
- </xsl:attribute>
1677
- </xsl:for-each>
1678
1634
 
1679
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1680
- <xsl:if test="$isNoteOrFnExist = 'true'">
1681
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1682
- </xsl:if>
1683
1635
 
1684
- <xsl:choose>
1685
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1686
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1687
- <fo:table-column column-width="{@width}"/>
1688
- </xsl:for-each>
1689
- </xsl:when>
1690
- <xsl:otherwise>
1691
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1692
- <xsl:choose>
1693
- <xsl:when test=". = 1 or . = 0">
1694
- <fo:table-column column-width="proportional-column-width(2)"/>
1695
- </xsl:when>
1696
- <xsl:otherwise>
1697
- <fo:table-column column-width="proportional-column-width({.})"/>
1698
- </xsl:otherwise>
1699
- </xsl:choose>
1700
- </xsl:for-each>
1701
- </xsl:otherwise>
1702
- </xsl:choose>
1703
1636
 
1704
- <xsl:choose>
1705
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1706
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1707
- </xsl:when>
1708
- <xsl:otherwise>
1709
- <xsl:apply-templates/>
1710
- </xsl:otherwise>
1711
- </xsl:choose>
1712
1637
 
1713
- </fo:table>
1714
-
1715
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1716
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1717
- <xsl:call-template name="insertTableFooterInSeparateTable">
1718
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1719
- <xsl:with-param name="colwidths" select="$colwidths"/>
1720
- <xsl:with-param name="colgroup" select="$colgroup"/>
1721
- </xsl:call-template>
1722
- </xsl:for-each>
1723
-
1724
- <!-- insert footer as table -->
1725
- <!-- <fo:table>
1726
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1727
- <xsl:attribute name="{@name}">
1728
- <xsl:value-of select="."/>
1729
- </xsl:attribute>
1730
- </xsl:for-each>
1731
1638
 
1732
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1639
+ <xsl:variable name="table_width">
1640
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1641
+ 100%
1642
+
1643
+
1644
+ </xsl:variable>
1645
+
1646
+ <xsl:variable name="table_attributes">
1647
+ <attribute name="table-layout">fixed</attribute>
1648
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1649
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1650
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+ </xsl:variable>
1662
+
1663
+
1664
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1665
+
1666
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1667
+ <xsl:attribute name="{@name}">
1668
+ <xsl:value-of select="."/>
1669
+ </xsl:attribute>
1670
+ </xsl:for-each>
1671
+
1672
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1673
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1674
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1675
+ </xsl:if>
1676
+
1677
+ <xsl:choose>
1678
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1679
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1680
+ <fo:table-column column-width="{@width}"/>
1681
+ </xsl:for-each>
1682
+ </xsl:when>
1683
+ <xsl:otherwise>
1684
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1685
+ <xsl:choose>
1686
+ <xsl:when test=". = 1 or . = 0">
1687
+ <fo:table-column column-width="proportional-column-width(2)"/>
1688
+ </xsl:when>
1689
+ <xsl:otherwise>
1690
+ <fo:table-column column-width="proportional-column-width({.})"/>
1691
+ </xsl:otherwise>
1692
+ </xsl:choose>
1693
+ </xsl:for-each>
1694
+ </xsl:otherwise>
1695
+ </xsl:choose>
1696
+
1733
1697
  <xsl:choose>
1734
- <xsl:when test=". = 1 or . = 0">
1735
- <fo:table-column column-width="proportional-column-width(2)"/>
1698
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1699
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1736
1700
  </xsl:when>
1737
1701
  <xsl:otherwise>
1738
- <fo:table-column column-width="proportional-column-width({.})"/>
1702
+ <xsl:apply-templates/>
1739
1703
  </xsl:otherwise>
1740
1704
  </xsl:choose>
1705
+
1706
+ </fo:table>
1707
+
1708
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1709
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1710
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1711
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1712
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1713
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1714
+ </xsl:call-template>
1741
1715
  </xsl:for-each>
1742
- </fo:table>-->
1743
-
1744
-
1745
-
1746
-
1747
-
1748
- </fo:block-container>
1716
+
1717
+ <!-- insert footer as table -->
1718
+ <!-- <fo:table>
1719
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1720
+ <xsl:attribute name="{@name}">
1721
+ <xsl:value-of select="."/>
1722
+ </xsl:attribute>
1723
+ </xsl:for-each>
1724
+
1725
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1726
+ <xsl:choose>
1727
+ <xsl:when test=". = 1 or . = 0">
1728
+ <fo:table-column column-width="proportional-column-width(2)"/>
1729
+ </xsl:when>
1730
+ <xsl:otherwise>
1731
+ <fo:table-column column-width="proportional-column-width({.})"/>
1732
+ </xsl:otherwise>
1733
+ </xsl:choose>
1734
+ </xsl:for-each>
1735
+ </fo:table>-->
1736
+
1737
+
1738
+
1739
+
1740
+
1741
+ </fo:block-container>
1742
+ </xsl:variable>
1743
+
1744
+
1745
+
1746
+ <xsl:choose>
1747
+ <xsl:when test="@width">
1748
+
1749
+ <!-- centered table when table name is centered (see table-name-style) -->
1750
+
1751
+ <fo:table table-layout="fixed" width="100%">
1752
+ <fo:table-column column-width="proportional-column-width(1)"/>
1753
+ <fo:table-column column-width="{@width}"/>
1754
+ <fo:table-column column-width="proportional-column-width(1)"/>
1755
+ <fo:table-body>
1756
+ <fo:table-row>
1757
+ <fo:table-cell column-number="2">
1758
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1759
+ </fo:table-cell>
1760
+ </fo:table-row>
1761
+ </fo:table-body>
1762
+ </fo:table>
1763
+
1764
+
1765
+
1766
+
1767
+ </xsl:when>
1768
+ <xsl:otherwise>
1769
+ <xsl:copy-of select="$table"/>
1770
+ </xsl:otherwise>
1771
+ </xsl:choose>
1772
+
1749
1773
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1750
1774
  <xsl:if test="normalize-space() != ''">
1751
1775
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -1873,7 +1897,15 @@
1873
1897
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1874
1898
  <xsl:value-of select="@target"/>
1875
1899
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1876
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1900
+ <xsl:variable name="mathml">
1901
+ <xsl:for-each select="*">
1902
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
1903
+ <xsl:copy-of select="."/>
1904
+ </xsl:if>
1905
+ </xsl:for-each>
1906
+ </xsl:variable>
1907
+
1908
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
1877
1909
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1878
1910
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1879
1911
  <xsl:param name="cols-count"/>
@@ -2586,7 +2618,7 @@
2586
2618
  <xsl:with-param name="table" select="$html-table"/>
2587
2619
  </xsl:call-template>
2588
2620
  </xsl:variable>
2589
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2621
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2590
2622
  <xsl:variable name="maxlength_dt">
2591
2623
  <xsl:call-template name="getMaxLength_dt"/>
2592
2624
  </xsl:variable>
@@ -2615,13 +2647,22 @@
2615
2647
  </xsl:when>
2616
2648
  <xsl:otherwise>
2617
2649
  <xsl:choose>
2650
+ <!-- to set width check most wide chars like `W` -->
2618
2651
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2619
- <fo:table-column column-width="5%"/>
2620
- <fo:table-column column-width="95%"/>
2652
+ <fo:table-column column-width="7%"/>
2653
+ <fo:table-column column-width="93%"/>
2654
+ </xsl:when>
2655
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2656
+ <fo:table-column column-width="15%"/>
2657
+ <fo:table-column column-width="85%"/>
2621
2658
  </xsl:when>
2622
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2623
- <fo:table-column column-width="10%"/>
2624
- <fo:table-column column-width="90%"/>
2659
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2660
+ <fo:table-column column-width="20%"/>
2661
+ <fo:table-column column-width="80%"/>
2662
+ </xsl:when>
2663
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2664
+ <fo:table-column column-width="25%"/>
2665
+ <fo:table-column column-width="75%"/>
2625
2666
  </xsl:when>
2626
2667
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2627
2668
  <fo:table-column column-width="60%"/>
@@ -2855,6 +2896,10 @@
2855
2896
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2856
2897
  <xsl:apply-templates/>
2857
2898
  </fo:inline>
2899
+ </xsl:template><xsl:template match="*[local-name()='hi']">
2900
+ <fo:inline background-color="yellow">
2901
+ <xsl:apply-templates/>
2902
+ </fo:inline>
2858
2903
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2859
2904
  <xsl:variable name="text" select="normalize-space(.)"/>
2860
2905
  <fo:inline font-size="75%">
@@ -2944,6 +2989,10 @@
2944
2989
  <xsl:param name="text" select="."/>
2945
2990
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2946
2991
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2992
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2993
+ <xsl:param name="text" select="."/>
2994
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2995
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2947
2996
  </xsl:template><xsl:template name="add-zero-spaces">
2948
2997
  <xsl:param name="text" select="."/>
2949
2998
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3191,6 +3240,7 @@
3191
3240
  <xsl:apply-templates select="." mode="mathml"/>
3192
3241
  </xsl:variable>
3193
3242
  <fo:instream-foreign-object fox:alt-text="Math">
3243
+
3194
3244
  <!-- <xsl:copy-of select="."/> -->
3195
3245
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3196
3246
  </fo:instream-foreign-object>
@@ -3204,7 +3254,12 @@
3204
3254
  <!-- replace start and end spaces to non-break space -->
3205
3255
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3206
3256
  </xsl:copy>
3207
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3257
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3258
+ <xsl:copy>
3259
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3260
+ </xsl:copy>
3261
+ <mathml:mspace width="0.5ex"/>
3262
+ </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">
3208
3263
  <xsl:variable name="target">
3209
3264
  <xsl:choose>
3210
3265
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3225,7 +3280,10 @@
3225
3280
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3226
3281
  <xsl:choose>
3227
3282
  <xsl:when test="normalize-space(.) = ''">
3228
- <xsl:value-of select="$target"/>
3283
+ <!-- <xsl:value-of select="$target"/> -->
3284
+ <xsl:call-template name="add-zero-spaces-link-java">
3285
+ <xsl:with-param name="text" select="$target"/>
3286
+ </xsl:call-template>
3229
3287
  </xsl:when>
3230
3288
  <xsl:otherwise>
3231
3289
  <xsl:apply-templates/>
@@ -3235,8 +3293,6 @@
3235
3293
  </xsl:otherwise>
3236
3294
  </xsl:choose>
3237
3295
  </fo:inline>
3238
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3239
- <fo:inline id="{@id}"/>
3240
3296
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3241
3297
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3242
3298
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3447,6 +3503,7 @@
3447
3503
  <fo:block id="{@id}">
3448
3504
  <xsl:apply-templates/>
3449
3505
  </fo:block>
3506
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3450
3507
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3451
3508
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3452
3509
  <xsl:apply-templates/>
@@ -3460,6 +3517,9 @@
3460
3517
  <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3461
3518
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3462
3519
  </xsl:when>
3520
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3521
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3522
+ </xsl:when>
3463
3523
  <xsl:otherwise>
3464
3524
  <xsl:value-of select="@src"/>
3465
3525
  </xsl:otherwise>
@@ -3704,6 +3764,8 @@
3704
3764
  <xsl:copy>
3705
3765
  <xsl:apply-templates mode="contents_item"/>
3706
3766
  </xsl:copy>
3767
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3768
+ <xsl:copy-of select="."/>
3707
3769
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3708
3770
  <xsl:text> </xsl:text>
3709
3771
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4032,10 +4094,11 @@
4032
4094
  </xsl:choose>
4033
4095
 
4034
4096
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4035
-
4097
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4036
4098
  <xsl:variable name="element">
4037
4099
  block
4038
4100
 
4101
+
4039
4102
  </xsl:variable>
4040
4103
  <xsl:choose>
4041
4104
  <xsl:when test="normalize-space($element) = 'block'">
@@ -4102,11 +4165,13 @@
4102
4165
  </xsl:if>
4103
4166
  </xsl:if>
4104
4167
 
4168
+
4105
4169
  <fo:block-container margin-left="0mm">
4106
4170
 
4107
4171
  <fo:block xsl:use-attribute-sets="quote-style">
4108
4172
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4109
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4173
+
4174
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4110
4175
  </fo:block>
4111
4176
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4112
4177
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4129,31 +4194,49 @@
4129
4194
  <xsl:text>— </xsl:text>
4130
4195
  <xsl:apply-templates/>
4131
4196
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4132
- <fo:inline xsl:use-attribute-sets="eref-style">
4133
- <xsl:if test="@type = 'footnote'">
4134
-
4135
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4136
- <xsl:attribute name="font-size">80%</xsl:attribute>
4137
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4138
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4139
-
4140
-
4141
- </xsl:if>
4142
-
4143
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4144
-
4145
- <xsl:if test="@type = 'inline'">
4146
-
4147
-
4148
-
4149
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
4150
-
4151
- </xsl:if>
4152
-
4153
-
4154
- <xsl:apply-templates/>
4155
- </fo:basic-link>
4156
- </fo:inline>
4197
+
4198
+ <xsl:variable name="bibitemid">
4199
+ <xsl:choose>
4200
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4201
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4202
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4203
+ </xsl:choose>
4204
+ </xsl:variable>
4205
+
4206
+ <xsl:choose>
4207
+ <xsl:when test="normalize-space($bibitemid) != ''">
4208
+ <fo:inline xsl:use-attribute-sets="eref-style">
4209
+ <xsl:if test="@type = 'footnote'">
4210
+
4211
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4212
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4213
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4214
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4215
+
4216
+
4217
+ </xsl:if>
4218
+
4219
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4220
+ <xsl:if test="normalize-space(@citeas) = ''">
4221
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4222
+ </xsl:if>
4223
+ <xsl:if test="@type = 'inline'">
4224
+
4225
+
4226
+
4227
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4228
+
4229
+ </xsl:if>
4230
+
4231
+ <xsl:apply-templates/>
4232
+ </fo:basic-link>
4233
+
4234
+ </fo:inline>
4235
+ </xsl:when>
4236
+ <xsl:otherwise>
4237
+ <fo:inline><xsl:apply-templates/></fo:inline>
4238
+ </xsl:otherwise>
4239
+ </xsl:choose>
4157
4240
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4158
4241
  <!-- zero-space char -->
4159
4242
  <xsl:variable name="depth">
@@ -4337,6 +4420,153 @@
4337
4420
  </fo:block>
4338
4421
  </xsl:otherwise>
4339
4422
  </xsl:choose>
4423
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4424
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4425
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4426
+ </xsl:for-each>
4427
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4428
+ <xsl:copy>
4429
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4430
+ </xsl:copy>
4431
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4432
+ <xsl:variable name="id">
4433
+ <xsl:call-template name="generateIndexXrefId"/>
4434
+ </xsl:variable>
4435
+ <xsl:copy> <!-- add id to xref -->
4436
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4437
+ <xsl:attribute name="id">
4438
+ <xsl:value-of select="$id"/>
4439
+ </xsl:attribute>
4440
+ <xsl:apply-templates mode="index_add_id"/>
4441
+ </xsl:copy>
4442
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4443
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4444
+ <xsl:if test="@to">
4445
+ <xsl:value-of select="$dash"/>
4446
+ <xsl:copy>
4447
+ <xsl:copy-of select="@*"/>
4448
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4449
+ <xsl:attribute name="id">
4450
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4451
+ </xsl:attribute>
4452
+ <xsl:apply-templates mode="index_add_id"/>
4453
+ </xsl:copy>
4454
+ </xsl:if>
4455
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4456
+ <xsl:copy>
4457
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4458
+ </xsl:copy>
4459
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4460
+ <xsl:copy>
4461
+ <xsl:apply-templates select="@*" mode="index_update"/>
4462
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4463
+ </xsl:copy>
4464
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4465
+ <xsl:param name="element"/>
4466
+ <xsl:param name="remove" select="'false'"/>
4467
+ <xsl:param name="target"/>
4468
+ <!-- <node></node> -->
4469
+ <xsl:choose>
4470
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4471
+ <!-- skip text (i.e. remove it) and process next element -->
4472
+ <!-- [removed_<xsl:value-of select="."/>] -->
4473
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4474
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4475
+ </xsl:apply-templates>
4476
+ </xsl:when>
4477
+ <xsl:when test="self::text()">
4478
+ <xsl:value-of select="."/>
4479
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4480
+ </xsl:when>
4481
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4482
+ <xsl:variable name="id" select="@id"/>
4483
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4484
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4485
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4486
+
4487
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4488
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4489
+
4490
+ <xsl:choose>
4491
+ <!-- 2nd pass -->
4492
+ <!-- if page is equal to page for next and page is not the end of range -->
4493
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4494
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4495
+ <!-- [removed_xref] -->
4496
+
4497
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4498
+ <xsl:with-param name="remove">true</xsl:with-param>
4499
+ <xsl:with-param name="target">
4500
+ <xsl:choose>
4501
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4502
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4503
+ </xsl:choose>
4504
+ </xsl:with-param>
4505
+ </xsl:apply-templates>
4506
+ </xsl:when>
4507
+
4508
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4509
+ <!-- remove xref -->
4510
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4511
+ <xsl:with-param name="remove">true</xsl:with-param>
4512
+ </xsl:apply-templates>
4513
+ </xsl:when>
4514
+
4515
+ <xsl:otherwise>
4516
+ <xsl:apply-templates select="." mode="xref_copy">
4517
+ <xsl:with-param name="target" select="$target"/>
4518
+ </xsl:apply-templates>
4519
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4520
+ </xsl:otherwise>
4521
+ </xsl:choose>
4522
+ </xsl:when>
4523
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4524
+ <!-- ul -->
4525
+ <xsl:apply-templates select="." mode="index_update"/>
4526
+ </xsl:when>
4527
+ <xsl:otherwise>
4528
+ <xsl:apply-templates select="." mode="xref_copy">
4529
+ <xsl:with-param name="target" select="$target"/>
4530
+ </xsl:apply-templates>
4531
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4532
+ </xsl:otherwise>
4533
+ </xsl:choose>
4534
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4535
+ <xsl:param name="target"/>
4536
+ <xsl:copy>
4537
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4538
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4539
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4540
+ </xsl:if>
4541
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4542
+ </xsl:copy>
4543
+ </xsl:template><xsl:template name="generateIndexXrefId">
4544
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4545
+
4546
+ <xsl:variable name="docid">
4547
+ <xsl:call-template name="getDocumentId"/>
4548
+ </xsl:variable>
4549
+ <xsl:variable name="item_number">
4550
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4551
+ </xsl:variable>
4552
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4553
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4554
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4555
+ <xsl:apply-templates/>
4556
+ <fo:block>
4557
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4558
+ <fo:block> </fo:block>
4559
+ </xsl:if>
4560
+ </fo:block>
4561
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4562
+ <xsl:apply-templates/>
4563
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4564
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4565
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4566
+ <xsl:apply-templates/>
4567
+ </fo:block>
4568
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4569
+ <fo:inline id="{@id}" font-size="1pt"/>
4340
4570
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4341
4571
  <!-- <row>
4342
4572
  <date>05-07-2013</date>
@@ -4526,7 +4756,7 @@
4526
4756
  <xsl:param name="charDelim" select="', '"/>
4527
4757
  <xsl:choose>
4528
4758
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4529
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4759
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4530
4760
  <xsl:sort data-type="text" order="ascending"/>
4531
4761
  <xsl:call-template name="insertKeyword">
4532
4762
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4535,7 +4765,7 @@
4535
4765
  </xsl:for-each>
4536
4766
  </xsl:when>
4537
4767
  <xsl:otherwise>
4538
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4768
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4539
4769
  <xsl:call-template name="insertKeyword">
4540
4770
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4541
4771
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4552,68 +4782,71 @@
4552
4782
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4553
4783
  </xsl:choose>
4554
4784
  </xsl:template><xsl:template name="addPDFUAmeta">
4555
- <fo:declarations>
4556
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4557
- <pdf:dictionary type="normal" key="ViewerPreferences">
4558
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4559
- </pdf:dictionary>
4560
- </pdf:catalog>
4561
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4562
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4563
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4564
- <!-- Dublin Core properties go here -->
4565
- <dc:title>
4566
- <xsl:variable name="title">
4785
+ <xsl:variable name="lang">
4786
+ <xsl:call-template name="getLang"/>
4787
+ </xsl:variable>
4788
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4789
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4790
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4791
+ </pdf:dictionary>
4792
+ </pdf:catalog>
4793
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4794
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4795
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4796
+ <!-- Dublin Core properties go here -->
4797
+ <dc:title>
4798
+ <xsl:variable name="title">
4799
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4800
+
4801
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4567
4802
 
4568
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
4569
4803
 
4570
4804
 
4571
4805
 
4572
4806
 
4573
4807
 
4574
- </xsl:variable>
4575
- <xsl:choose>
4576
- <xsl:when test="normalize-space($title) != ''">
4577
- <xsl:value-of select="$title"/>
4578
- </xsl:when>
4579
- <xsl:otherwise>
4580
- <xsl:text> </xsl:text>
4581
- </xsl:otherwise>
4582
- </xsl:choose>
4583
- </dc:title>
4584
- <dc:creator>
4808
+ </xsl:for-each>
4809
+ </xsl:variable>
4810
+ <xsl:choose>
4811
+ <xsl:when test="normalize-space($title) != ''">
4812
+ <xsl:value-of select="$title"/>
4813
+ </xsl:when>
4814
+ <xsl:otherwise>
4815
+ <xsl:text> </xsl:text>
4816
+ </xsl:otherwise>
4817
+ </xsl:choose>
4818
+ </dc:title>
4819
+ <dc:creator>
4820
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4585
4821
 
4586
4822
 
4587
4823
 
4588
- <xsl:for-each select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4824
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4589
4825
  <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
4590
4826
  <xsl:if test="position() != last()">; </xsl:if>
4591
4827
  </xsl:for-each>
4592
4828
 
4593
- </dc:creator>
4594
- <dc:description>
4595
- <xsl:variable name="abstract">
4596
-
4597
-
4598
-
4599
- <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4600
-
4601
-
4602
-
4603
- </xsl:variable>
4604
- <xsl:value-of select="normalize-space($abstract)"/>
4605
- </dc:description>
4606
- <pdf:Keywords>
4607
- <xsl:call-template name="insertKeywords"/>
4608
- </pdf:Keywords>
4609
- </rdf:Description>
4610
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4611
- <!-- XMP properties go here -->
4612
- <xmp:CreatorTool/>
4613
- </rdf:Description>
4614
- </rdf:RDF>
4615
- </x:xmpmeta>
4616
- </fo:declarations>
4829
+ </xsl:for-each>
4830
+ </dc:creator>
4831
+ <dc:description>
4832
+ <xsl:variable name="abstract">
4833
+
4834
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4835
+
4836
+
4837
+ </xsl:variable>
4838
+ <xsl:value-of select="normalize-space($abstract)"/>
4839
+ </dc:description>
4840
+ <pdf:Keywords>
4841
+ <xsl:call-template name="insertKeywords"/>
4842
+ </pdf:Keywords>
4843
+ </rdf:Description>
4844
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4845
+ <!-- XMP properties go here -->
4846
+ <xmp:CreatorTool/>
4847
+ </rdf:Description>
4848
+ </rdf:RDF>
4849
+ </x:xmpmeta>
4617
4850
  </xsl:template><xsl:template name="getId">
4618
4851
  <xsl:choose>
4619
4852
  <xsl:when test="../@id">