metanorma-iec 1.4.4 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +4 -32
  3. data/.gitignore +14 -0
  4. data/Gemfile +4 -0
  5. data/lib/isodoc/iec/base_convert.rb +25 -14
  6. data/lib/isodoc/iec/html/htmlstyle.css +36 -21
  7. data/lib/isodoc/iec/html/htmlstyle.scss +13 -7
  8. data/lib/isodoc/iec/html/wordstyle.css +13 -11
  9. data/lib/isodoc/iec/html/wordstyle.scss +13 -11
  10. data/lib/isodoc/iec/html_convert.rb +2 -1
  11. data/lib/isodoc/iec/i18n-fr.yaml +1 -1
  12. data/lib/isodoc/iec/iec.international-standard.xsl +1637 -1280
  13. data/lib/isodoc/iec/presentation_xml_convert.rb +37 -7
  14. data/lib/isodoc/iec/word_convert.rb +2 -0
  15. data/lib/isodoc/iec/xref.rb +9 -8
  16. data/lib/{asciidoctor → metanorma}/iec/basicdoc.rng +0 -0
  17. data/lib/{asciidoctor → metanorma}/iec/biblio.rng +2 -2
  18. data/lib/{asciidoctor → metanorma}/iec/converter.rb +22 -8
  19. data/lib/{asciidoctor → metanorma}/iec/front.rb +1 -1
  20. data/lib/{asciidoctor → metanorma}/iec/iec.rng +48 -0
  21. data/lib/{asciidoctor → metanorma}/iec/iec_intro_en.xml +0 -0
  22. data/lib/{asciidoctor → metanorma}/iec/iec_intro_fr.xml +0 -0
  23. data/lib/{asciidoctor → metanorma}/iec/isodoc.rng +104 -3
  24. data/lib/{asciidoctor → metanorma}/iec/isostandard.rng +0 -0
  25. data/lib/{asciidoctor → metanorma}/iec/reqt.rng +0 -0
  26. data/lib/metanorma/iec/version.rb +1 -1
  27. data/lib/metanorma-iec.rb +1 -1
  28. data/metanorma-iec.gemspec +1 -1
  29. data/spec/isodoc/i18n_spec.rb +2 -2
  30. data/spec/isodoc/iev_spec.rb +67 -57
  31. data/spec/isodoc/ref_spec.rb +359 -353
  32. data/spec/{asciidoctor → metanorma}/base_spec.rb +1 -1
  33. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  34. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +1 -1
  35. data/spec/{asciidoctor → metanorma}/iev_spec.rb +10 -2
  36. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  37. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  38. data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
  39. data/spec/{asciidoctor → metanorma}/validate_spec.rb +1 -1
  40. data/spec/spec_helper.rb +2 -2
  41. metadata +22 -22
@@ -22,8 +22,7 @@
22
22
 
23
23
 
24
24
  <xsl:variable name="debug">false</xsl:variable>
25
- <xsl:variable name="pageWidth" select="210"/>
26
- <xsl:variable name="pageHeight" select="297"/>
25
+
27
26
  <xsl:variable name="marginLeftRight1" select="25"/>
28
27
  <xsl:variable name="marginLeftRight2" select="25"/>
29
28
  <xsl:variable name="marginTop" select="31"/>
@@ -166,7 +165,7 @@
166
165
  <xsl:call-template name="namespaceCheck"/>
167
166
  <!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
168
167
  <!-- https://xmlgraphics.apache.org/fop/knownissues.html -->
169
- <fo:root font-family="Arial, Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
168
+ <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
170
169
  <fo:layout-master-set>
171
170
  <!-- cover pages -->
172
171
  <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -502,24 +501,34 @@
502
501
  <fo:block font-size="9pt" color="{$color_blue}" line-height="150%">
503
502
  <fo:block-container width="40mm">
504
503
  <fo:block>
505
- <!-- <xsl:variable name="publisher" select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:contributor[iec:role/@type = 'publisher']/iec:organization/iec:name))"/> -->
506
- <!-- <xsl:value-of select="$publisher"/> -->
507
- <xsl:value-of select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/>
504
+ <xsl:call-template name="getLocalizedString">
505
+ <xsl:with-param name="key">IEC</xsl:with-param>
506
+ <xsl:with-param name="lang"><xsl:value-of select="$lang"/></xsl:with-param>
507
+ </xsl:call-template>
508
508
  </fo:block>
509
509
  </fo:block-container>
510
510
  </fo:block>
511
- <xsl:if test="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang_second]">
511
+
512
+ <xsl:variable name="IEC_lang_second">
513
+ <xsl:call-template name="getLocalizedString">
514
+ <xsl:with-param name="key">IEC</xsl:with-param>
515
+ <xsl:with-param name="lang"><xsl:value-of select="$lang_second"/></xsl:with-param>
516
+ </xsl:call-template>
517
+ </xsl:variable>
518
+
519
+ <xsl:if test="normalize-space($IEC_lang_second) != ''">
512
520
  <fo:block font-size="9pt" line-height="150%" margin-top="8pt">
513
521
  <fo:block-container width="40mm">
514
522
  <fo:block>
515
523
  <!-- <xsl:value-of select="'COMMISSION ELECTROTECHNIQUE INTERNATIONALE'"/> -->
516
- <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang_second]"/>
524
+ <xsl:value-of select="$IEC_lang_second"/>
517
525
  </fo:block>
518
526
  </fo:block-container>
519
527
  </fo:block>
520
528
  </xsl:if>
521
529
  </fo:block-container>
522
530
 
531
+ <xsl:variable name="price_code_value" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:price-code"/>
523
532
  <fo:table table-layout="fixed" width="102%" margin-top="-9mm" margin-bottom="2mm">
524
533
  <fo:table-column column-width="148mm"/>
525
534
  <fo:table-column column-width="16mm"/>
@@ -527,29 +536,34 @@
527
536
  <fo:table-row border-bottom="0.5pt solid {$color_gray}" height="16mm">
528
537
  <fo:table-cell font-size="8pt" text-align="right" display-align="center">
529
538
  <fo:block>
530
- <fo:block color="{$color_blue}" margin-bottom="3pt">
531
- <!-- PRICE CODE -->
532
- <xsl:variable name="price_code">
533
- <!-- <xsl:call-template name="getLocalizedString">
534
- <xsl:with-param name="key">price-code</xsl:with-param>
535
- </xsl:call-template> -->
536
- <xsl:value-of select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='price-code' and @language=$lang]"/>
537
- </xsl:variable>
538
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
539
- </fo:block>
540
- <!-- <xsl:if test="$lang != 'fr'">
541
- <fo:block>CODE PRIX</fo:block>
542
- </xsl:if> -->
543
- <fo:block>
544
- <xsl:variable name="price_code">
545
- <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='price-code' and @language=$lang_second]"/>
546
- </xsl:variable>
547
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
548
- </fo:block>
539
+ <xsl:if test="normalize-space($price_code_value) != ''">
540
+ <fo:block color="{$color_blue}" margin-bottom="3pt">
541
+ <!-- PRICE CODE -->
542
+ <xsl:variable name="price_code">
543
+ <xsl:call-template name="getLocalizedString">
544
+ <xsl:with-param name="key">price-code</xsl:with-param>
545
+ <xsl:with-param name="lang"><xsl:value-of select="$lang"/></xsl:with-param>
546
+ </xsl:call-template>
547
+ </xsl:variable>
548
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
549
+ </fo:block>
550
+ <!-- <xsl:if test="$lang != 'fr'">
551
+ <fo:block>CODE PRIX</fo:block>
552
+ </xsl:if> -->
553
+ <fo:block>
554
+ <xsl:variable name="price_code">
555
+ <xsl:call-template name="getLocalizedString">
556
+ <xsl:with-param name="key">price-code</xsl:with-param>
557
+ <xsl:with-param name="lang"><xsl:value-of select="$lang_second"/></xsl:with-param>
558
+ </xsl:call-template>
559
+ </xsl:variable>
560
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
561
+ </fo:block>
562
+ </xsl:if>
549
563
  </fo:block>
550
564
  </fo:table-cell>
551
565
  <fo:table-cell font-size="25pt" font-weight="bold" color="{$color_gray}" text-align="right" display-align="center">
552
- <fo:block padding-top="1mm"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:price-code"/></fo:block>
566
+ <fo:block padding-top="1mm"><xsl:value-of select="$price_code_value"/></fo:block>
553
567
  </fo:table-cell>
554
568
  </fo:table-row>
555
569
  </fo:table-body>
@@ -1378,7 +1392,13 @@
1378
1392
  <xsl:text> — </xsl:text>
1379
1393
  <xsl:value-of select="$linebreak"/>
1380
1394
  <xsl:if test="$part != ''">
1381
- <xsl:variable name="localized_part" select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang]"/>
1395
+ <xsl:variable name="localized_part">
1396
+ <xsl:call-template name="getLocalizedString">
1397
+ <xsl:with-param name="key">locality.part</xsl:with-param>
1398
+ <xsl:with-param name="lang"><xsl:value-of select="$lang"/></xsl:with-param>
1399
+ </xsl:call-template>
1400
+ </xsl:variable>
1401
+
1382
1402
  <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($localized_part),'#',$part)"/> -->
1383
1403
  <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1384
1404
  <!-- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
@@ -1404,10 +1424,17 @@
1404
1424
  <xsl:value-of select="$linebreak"/>
1405
1425
  <xsl:if test="$part != ''">
1406
1426
 
1427
+ <xsl:variable name="locality_part_lang_second">
1428
+ <xsl:call-template name="getLocalizedString">
1429
+ <xsl:with-param name="key">locality.part</xsl:with-param>
1430
+ <xsl:with-param name="lang"><xsl:value-of select="$lang_second"/></xsl:with-param>
1431
+ </xsl:call-template>
1432
+ </xsl:variable>
1433
+
1407
1434
  <xsl:choose>
1408
- <xsl:when test="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]">
1435
+ <xsl:when test="normalize-space($locality_part_lang_second)">
1409
1436
  <xsl:variable name="localized_part">
1410
- <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]"/>
1437
+ <xsl:value-of select="$locality_part_lang_second"/>
1411
1438
  </xsl:variable>
1412
1439
  <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1413
1440
  </xsl:when>
@@ -1434,8 +1461,8 @@
1434
1461
  <fo:block role="TOC">
1435
1462
  <fo:block font-size="12pt" text-align="center" margin-bottom="22pt" role="H1">
1436
1463
  <xsl:variable name="title-toc">
1437
- <xsl:call-template name="getTitle">
1438
- <xsl:with-param name="name" select="'title-toc'"/>
1464
+ <xsl:call-template name="getLocalizedString">
1465
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1439
1466
  </xsl:call-template>
1440
1467
  </xsl:variable>
1441
1468
  <xsl:call-template name="addLetterSpacing">
@@ -1459,6 +1486,9 @@
1459
1486
  <xsl:if test="@type = 'indexsect'">
1460
1487
  <xsl:attribute name="space-before">16pt</xsl:attribute>
1461
1488
  </xsl:if>
1489
+ <xsl:if test="@type = 'references'">
1490
+ <xsl:attribute name="space-before">5pt</xsl:attribute>
1491
+ </xsl:if>
1462
1492
  <!-- <xsl:if test="@level &gt;= 2 and @section != ''">
1463
1493
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
1464
1494
  </xsl:if> -->
@@ -1468,6 +1498,7 @@
1468
1498
  <fo:list-block>
1469
1499
  <xsl:attribute name="margin-left">
1470
1500
  <xsl:choose>
1501
+ <xsl:when test="title/@variant-title = 'true'">0mm</xsl:when>
1471
1502
  <xsl:when test="@level = 2">8mm</xsl:when>
1472
1503
  <xsl:when test="@level &gt;= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
1473
1504
  <xsl:otherwise>0mm</xsl:otherwise>
@@ -1547,8 +1578,12 @@
1547
1578
  <xsl:param name="lang" select="$lang"/>
1548
1579
  <fo:block break-after="page"/>
1549
1580
  <fo:block-container font-size="12pt" text-align="center" margin-bottom="18pt">
1550
- <!-- <fo:block><xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:contributor/iec:organization/iec:name))"/></fo:block> -->
1551
- <fo:block><xsl:value-of select="/iec:iec-standard/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/></fo:block>
1581
+ <fo:block>
1582
+ <xsl:call-template name="getLocalizedString">
1583
+ <xsl:with-param name="key">IEC</xsl:with-param>
1584
+ <xsl:with-param name="lang"><xsl:value-of select="$lang"/></xsl:with-param>
1585
+ </xsl:call-template>
1586
+ </fo:block>
1552
1587
  <fo:block>___________</fo:block>
1553
1588
  <fo:block> </fo:block>
1554
1589
  <fo:block font-weight="bold" role="H1">
@@ -1563,9 +1598,13 @@
1563
1598
  <fo:block>
1564
1599
  <xsl:if test="$part != ''">
1565
1600
  <!-- Example: Part 1: Riz -->
1566
- <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1567
- <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1568
- <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1601
+ <xsl:variable name="localized_part">
1602
+ <xsl:call-template name="getLocalizedString">
1603
+ <xsl:with-param name="key">Part.sg</xsl:with-param>
1604
+ <xsl:with-param name="lang" select="$lang"/>
1605
+ </xsl:call-template>
1606
+ </xsl:variable>
1607
+ <xsl:value-of select="concat($localized_part ,' ', $part, ': ')"/>
1569
1608
  </xsl:if>
1570
1609
  <xsl:value-of select="$title-part"/>
1571
1610
  </fo:block>
@@ -1608,8 +1647,12 @@
1608
1647
  <fo:block>
1609
1648
  <xsl:if test="$part != ''">
1610
1649
  <!-- Example: Part 1: Rice -->
1611
- <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1612
- <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1650
+ <xsl:variable name="localized_part">
1651
+ <xsl:call-template name="getLocalizedString">
1652
+ <xsl:with-param name="key">Part.sg</xsl:with-param>
1653
+ <xsl:with-param name="lang" select="$lang"/>
1654
+ </xsl:call-template>
1655
+ </xsl:variable>
1613
1656
  <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1614
1657
  </xsl:if>
1615
1658
  <xsl:value-of select="$title-part"/>
@@ -1661,35 +1704,21 @@
1661
1704
 
1662
1705
  <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//text()" priority="3">
1663
1706
  <!-- Example: Attention IEC-CENELEC parallel voting -->
1664
- <xsl:if test="normalize-space() ! = ''">
1707
+ <xsl:if test="normalize-space() != ''">
1665
1708
  <xsl:call-template name="addLetterSpacing">
1666
1709
  <xsl:with-param name="text" select="."/>
1667
1710
  </xsl:call-template>
1668
1711
  </xsl:if>
1669
1712
  </xsl:template>
1670
1713
 
1671
- <xsl:template match="iec:boilerplate/iec:feedback-statement">
1714
+ <xsl:template match="iec:boilerplate/iec:feedback-statement" priority="2">
1672
1715
  <fo:block margin-top="6pt" font-size="1pt" span="all">
1673
1716
  </fo:block>
1674
1717
  <xsl:apply-templates select="*[not(@id) or @id != 'boilerplate-cenelec-attention']"/>
1675
1718
  </xsl:template>
1676
1719
 
1677
- <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1678
- <xsl:variable name="level">
1679
- <xsl:call-template name="getLevel"/>
1680
- </xsl:variable>
1681
- <fo:block font-weight="bold" keep-with-next="always" role="H{$level}"><xsl:apply-templates/></fo:block>
1682
- </xsl:template>
1683
-
1684
- <xsl:template match="iec:feedback-statement//iec:clause/iec:p" priority="2">
1685
- <fo:block margin-bottom="6pt"><xsl:apply-templates/></fo:block>
1686
- </xsl:template>
1687
-
1688
1720
  <xsl:template match="iec:feedback-statement/iec:clause[not(iec:clause)]" priority="2">
1689
1721
  <fo:block span="all" text-align="justify">
1690
- <!-- <xsl:if test="not(preceding-sibling::iec:clause)">
1691
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1692
- </xsl:if> -->
1693
1722
  <xsl:apply-templates/>
1694
1723
  </fo:block>
1695
1724
  </xsl:template>
@@ -1708,9 +1737,6 @@
1708
1737
  <!-- ============================= -->
1709
1738
  <!-- CONTENTS -->
1710
1739
  <!-- ============================= -->
1711
- <xsl:template match="node()" mode="contents">
1712
- <xsl:apply-templates mode="contents"/>
1713
- </xsl:template>
1714
1740
 
1715
1741
  <!-- element with title -->
1716
1742
  <xsl:template match="*[iec:title]" mode="contents">
@@ -1751,6 +1777,10 @@
1751
1777
  <xsl:call-template name="getName"/>
1752
1778
  </xsl:variable>
1753
1779
 
1780
+ <xsl:variable name="variant_title">
1781
+ <xsl:copy-of select="iec:variant-title/node()"/>
1782
+ </xsl:variable>
1783
+
1754
1784
  <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
1755
1785
  <xsl:if test="$type ='appendix'">
1756
1786
  <xsl:attribute name="section"/>
@@ -1763,6 +1793,10 @@
1763
1793
  <!-- <xsl:when test="$type = 'foreword' or $type = 'introduction'">
1764
1794
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
1765
1795
  </xsl:when> -->
1796
+ <xsl:when test="normalize-space($variant_title) != ''">
1797
+ <xsl:attribute name="variant-title">true</xsl:attribute>
1798
+ <xsl:apply-templates select="xalan:nodeset($variant_title)" mode="contents_item"/>
1799
+ </xsl:when>
1766
1800
  <xsl:when test="$type = 'indexsect'">
1767
1801
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
1768
1802
  </xsl:when>
@@ -1788,25 +1822,6 @@
1788
1822
  <!-- ============================= -->
1789
1823
  <!-- ============================= -->
1790
1824
 
1791
- <xsl:template match="iec:license-statement//iec:title">
1792
- <xsl:variable name="level">
1793
- <xsl:call-template name="getLevel"/>
1794
- </xsl:variable>
1795
- <fo:block text-align="center" font-weight="bold" role="H{$level}">
1796
- <xsl:apply-templates/>
1797
- </fo:block>
1798
- </xsl:template>
1799
-
1800
- <xsl:template match="iec:license-statement//iec:p">
1801
- <fo:block margin-left="1.5mm" margin-right="1.5mm">
1802
- <xsl:if test="following-sibling::iec:p">
1803
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1804
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1805
- </xsl:if>
1806
- <xsl:apply-templates/>
1807
- </fo:block>
1808
- </xsl:template>
1809
-
1810
1825
  <xsl:template match="iec:license-statement//iec:title" mode="cover-page-internal">
1811
1826
  <xsl:variable name="level">
1812
1827
  <xsl:call-template name="getLevel"/>
@@ -1846,17 +1861,12 @@
1846
1861
  <xsl:value-of select="$linebreak"/>
1847
1862
  </xsl:template>
1848
1863
 
1849
- <xsl:template match="iec:copyright-statement//iec:p">
1864
+ <xsl:template match="iec:copyright-statement//iec:p" priority="2">
1850
1865
  <fo:block>
1851
- <xsl:if test="preceding-sibling::iec:p">
1852
- <!-- <xsl:attribute name="font-size">10pt</xsl:attribute> -->
1853
- </xsl:if>
1854
1866
  <xsl:if test="following-sibling::iec:p">
1855
- <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
1856
1867
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1857
1868
  </xsl:if>
1858
1869
  <xsl:if test="not(following-sibling::iec:p)">
1859
- <!-- <xsl:attribute name="margin-left">7.1mm</xsl:attribute> -->
1860
1870
  <xsl:attribute name="margin-left">4mm</xsl:attribute>
1861
1871
  </xsl:if>
1862
1872
  <xsl:apply-templates/>
@@ -1865,7 +1875,7 @@
1865
1875
 
1866
1876
  <!-- copyright text in footer internal footer -->
1867
1877
  <xsl:template match="iec:copyright-statement//iec:p[not(@id)]//text()">
1868
- <xsl:if test="normalize-space() ! = ''">
1878
+ <xsl:if test="normalize-space() != ''">
1869
1879
  <xsl:call-template name="addLetterSpacing">
1870
1880
  <xsl:with-param name="text" select="normalize-space(.)"/>
1871
1881
  </xsl:call-template>
@@ -1962,7 +1972,7 @@
1962
1972
  </xsl:template>
1963
1973
 
1964
1974
 
1965
- <xsl:template match="iec:title">
1975
+ <xsl:template match="iec:title" name="title">
1966
1976
 
1967
1977
  <xsl:variable name="level">
1968
1978
  <xsl:call-template name="getLevel"/>
@@ -2011,7 +2021,7 @@
2011
2021
  <!-- ====== -->
2012
2022
 
2013
2023
 
2014
- <xsl:template match="iec:p">
2024
+ <xsl:template match="iec:p" name="paragraph">
2015
2025
  <xsl:param name="inline" select="'false'"/>
2016
2026
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
2017
2027
  <xsl:variable name="element-name">
@@ -2058,6 +2068,7 @@
2058
2068
  <!-- <xsl:if test="ancestor::iec:dl and ancestor::iec:figure">
2059
2069
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2060
2070
  </xsl:if> -->
2071
+ <xsl:apply-templates select="@language"/>
2061
2072
  <xsl:apply-templates/>
2062
2073
  </xsl:element>
2063
2074
  </xsl:when>
@@ -2093,55 +2104,6 @@
2093
2104
  <fo:block margin-bottom="10pt"><xsl:apply-templates/></fo:block>
2094
2105
  </xsl:template>
2095
2106
 
2096
-
2097
-
2098
-
2099
- <xsl:template match="iec:bibitem">
2100
- <fo:block id="{@id}" margin-top="5pt" margin-bottom="10pt"> <!-- letter-spacing="0.4pt" -->
2101
- <!-- iec:docidentifier -->
2102
- <xsl:if test="iec:docidentifier">
2103
- <xsl:choose>
2104
- <xsl:when test="iec:docidentifier/@type = 'metanorma'"/>
2105
- <xsl:otherwise><fo:inline><xsl:value-of select="iec:docidentifier"/></fo:inline></xsl:otherwise>
2106
- </xsl:choose>
2107
- </xsl:if>
2108
- <xsl:apply-templates select="iec:note"/>
2109
- <xsl:if test="iec:docidentifier">, </xsl:if>
2110
- <fo:inline font-style="italic">
2111
- <xsl:choose>
2112
- <xsl:when test="iec:title[@type = 'main' and @language = 'en']">
2113
- <xsl:value-of select="iec:title[@type = 'main' and @language = 'en']"/>
2114
- </xsl:when>
2115
- <xsl:otherwise>
2116
- <xsl:value-of select="iec:title"/>
2117
- </xsl:otherwise>
2118
- </xsl:choose>
2119
- </fo:inline>
2120
- </fo:block>
2121
- </xsl:template>
2122
-
2123
-
2124
- <xsl:template match="iec:bibitem/iec:note" priority="2">
2125
- <fo:footnote>
2126
- <xsl:variable name="number">
2127
- <xsl:number level="any" count="iec:bibitem/iec:note"/>
2128
- </xsl:variable>
2129
- <fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="15%"> <!--font-size="85%" vertical-align="super"60% -->
2130
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
2131
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
2132
- </fo:basic-link>
2133
- </fo:inline>
2134
- <fo:footnote-body>
2135
- <fo:block font-size="8pt" margin-bottom="5pt">
2136
- <fo:inline id="{generate-id()}" keep-with-next.within-line="always" baseline-shift="15%" padding-right="3mm"><!-- padding-right="9mm" alignment-baseline="hanging" font-size="60%" -->
2137
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
2138
- </fo:inline>
2139
- <xsl:apply-templates/>
2140
- </fo:block>
2141
- </fo:footnote-body>
2142
- </fo:footnote>
2143
- </xsl:template>
2144
-
2145
2107
 
2146
2108
 
2147
2109
  <xsl:template match="iec:ul | iec:ol" mode="ul_ol">
@@ -2162,12 +2124,11 @@
2162
2124
  <xsl:template match="iec:li">
2163
2125
  <fo:list-item>
2164
2126
  <fo:list-item-label end-indent="label-end()">
2165
- <xsl:if test="local-name(..) = 'ul'">
2166
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2167
- </xsl:if>
2168
2127
  <fo:block>
2169
2128
  <xsl:choose>
2170
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
2129
+ <xsl:when test="local-name(..) = 'ul'">
2130
+ <xsl:call-template name="setULLabel"/>
2131
+ </xsl:when>
2171
2132
  <xsl:otherwise> <!-- for ordered lists -->
2172
2133
  <xsl:choose>
2173
2134
  <xsl:when test="../@type = 'arabic'">
@@ -2201,7 +2162,7 @@
2201
2162
  </fo:list-item>
2202
2163
  </xsl:template>
2203
2164
 
2204
- <xsl:template match="iec:li/iec:p">
2165
+ <xsl:template match="iec:li/iec:p" priority="2">
2205
2166
  <fo:block margin-bottom="6pt">
2206
2167
  <xsl:if test="ancestor::iec:ul">
2207
2168
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
@@ -2219,9 +2180,12 @@
2219
2180
  <xsl:call-template name="getLevelTermName"/>
2220
2181
  </xsl:variable>
2221
2182
  <fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
2222
- <xsl:if test="parent::iec:term">
2183
+ <xsl:if test="preceding-sibling::*[1][self::iec:preferred]">
2184
+ <xsl:attribute name="space-before">1pt</xsl:attribute>
2185
+ </xsl:if>
2186
+ <xsl:if test="parent::iec:term and not(preceding-sibling::iec:preferred)"> <!-- if first preffered in term, then display term's name -->
2223
2187
  <fo:block font-weight="bold" keep-with-next="always">
2224
- <xsl:apply-templates select="ancestor::iec:term[1]/iec:name" mode="presentation"/>
2188
+ <xsl:apply-templates select="ancestor::iec:term[1]/iec:name"/>
2225
2189
  </fo:block>
2226
2190
  </xsl:if>
2227
2191
  <fo:block font-weight="bold" keep-with-next="always">
@@ -2231,77 +2195,6 @@
2231
2195
  </fo:block>
2232
2196
  </xsl:template>
2233
2197
 
2234
-
2235
- <xsl:template match="iec:references[not(@normative='true')]">
2236
- <fo:block break-after="page"/>
2237
- <fo:block id="{@id}">
2238
- <xsl:apply-templates/>
2239
- </fo:block>
2240
- <fo:block-container text-align="center" margin-top="10mm">
2241
- <fo:block>_____________</fo:block>
2242
- </fo:block-container>
2243
- </xsl:template>
2244
-
2245
-
2246
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
2247
- <xsl:template match="iec:references[not(@normative='true')]/iec:bibitem">
2248
- <fo:list-block margin-top="5pt" margin-bottom="14pt" provisional-distance-between-starts="12mm"> <!-- provisional-distance-between-starts="0mm" -->
2249
- <fo:list-item>
2250
- <fo:list-item-label end-indent="label-end()">
2251
- <fo:block id="{@id}">
2252
- <xsl:number format="[1]"/>
2253
- </fo:block>
2254
- </fo:list-item-label>
2255
- <fo:list-item-body start-indent="body-start()">
2256
- <fo:block>
2257
- <xsl:if test="iec:docidentifier">
2258
- <xsl:choose>
2259
- <xsl:when test="iec:docidentifier/@type = 'metanorma'"/>
2260
- <xsl:otherwise><fo:inline><xsl:value-of select="iec:docidentifier"/>, </fo:inline></xsl:otherwise>
2261
- </xsl:choose>
2262
- </xsl:if>
2263
- <xsl:choose>
2264
- <xsl:when test="iec:title[@type = 'main' and @language = 'en']">
2265
- <xsl:apply-templates select="iec:title[@type = 'main' and @language = 'en']"/>
2266
- </xsl:when>
2267
- <xsl:otherwise>
2268
- <xsl:apply-templates select="iec:title"/>
2269
- </xsl:otherwise>
2270
- </xsl:choose>
2271
- <xsl:apply-templates select="iec:formattedref"/>
2272
- </fo:block>
2273
- </fo:list-item-body>
2274
- </fo:list-item>
2275
- </fo:list-block>
2276
- </xsl:template>
2277
-
2278
- <xsl:template match="iec:references[not(@normative='true')]/iec:bibitem" mode="contents"/>
2279
-
2280
- <xsl:template match="iec:references[not(@normative='true')]/iec:bibitem/iec:title">
2281
- <fo:inline font-style="italic">
2282
- <xsl:apply-templates/>
2283
- </fo:inline>
2284
- </xsl:template>
2285
-
2286
-
2287
-
2288
-
2289
- <xsl:template match="iec:admonition">
2290
- <fo:block-container border="0.5pt solid black" margin-left="-2mm" margin-right="-2mm" space-before="18pt" space-after="12pt">
2291
- <fo:block-container margin-left="0mm" margin-right="0mm" font-weight="bold" padding="1mm" padding-top="2mm">
2292
- <fo:block text-align="justify">
2293
- <fo:inline><xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/> – </fo:inline>
2294
- <xsl:apply-templates/>
2295
- </fo:block>
2296
- </fo:block-container>
2297
- </fo:block-container>
2298
- <!-- <fo:block font-weight="bold">
2299
- <fo:block text-align="center" margin-top="5pt" margin-bottom="10pt">
2300
- <xsl:value-of select="translate(@type, $lower, $upper)"/>
2301
- </fo:block>
2302
- <xsl:apply-templates />
2303
- </fo:block> -->
2304
- </xsl:template>
2305
2198
 
2306
2199
  <xsl:template match="iec:admonition//iec:p//text()">
2307
2200
  <xsl:call-template name="addLetterSpacing">
@@ -2326,7 +2219,7 @@
2326
2219
  </fo:table-cell>
2327
2220
  <fo:table-cell display-align="center">
2328
2221
  <fo:block text-align="right" margin-right="-10mm">
2329
- <xsl:apply-templates select="../iec:name" mode="presentation"/>
2222
+ <xsl:apply-templates select="../iec:name" mode="formula_number"/>
2330
2223
  </fo:block>
2331
2224
  </fo:table-cell>
2332
2225
  </fo:table-row>
@@ -2555,55 +2448,36 @@
2555
2448
  </xsl:copy>
2556
2449
  </xsl:template> -->
2557
2450
 
2558
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
2559
-
2560
- <title-annex lang="en">Annex </title-annex>
2561
- <title-annex lang="fr">Annexe </title-annex>
2562
-
2563
- <title-annex lang="zh">Annex </title-annex>
2564
-
2565
-
2451
+ <xsl:variable name="pageWidth_">
2452
+ 210
2453
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
2454
+ 297
2455
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
2566
2456
 
2567
2457
  <title-edition lang="en">
2568
2458
 
2569
- <xsl:text>Edition </xsl:text>
2570
-
2571
-
2459
+ <xsl:text>Edition </xsl:text>
2460
+
2572
2461
  </title-edition>
2573
2462
 
2574
2463
  <title-edition lang="fr">
2575
-
2576
- <xsl:text>Édition </xsl:text>
2577
-
2464
+ <xsl:text>Édition </xsl:text>
2578
2465
  </title-edition>
2579
2466
 
2580
-
2467
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
2581
2468
  <title-toc lang="en">
2582
2469
 
2583
- <xsl:text>Contents</xsl:text>
2584
-
2585
2470
 
2586
2471
 
2587
2472
  </title-toc>
2588
2473
  <title-toc lang="fr">
2474
+ <xsl:text>Sommaire</xsl:text>
2475
+ </title-toc>
2476
+ <title-toc lang="zh">
2589
2477
 
2590
- <xsl:text>Sommaire</xsl:text>
2591
-
2592
-
2593
- </title-toc>
2594
-
2595
- <title-toc lang="zh">Contents</title-toc>
2596
-
2597
-
2598
-
2599
- <title-page lang="en">Page</title-page>
2600
- <title-page lang="fr">Page</title-page>
2601
-
2602
- <title-key lang="en">Key</title-key>
2603
- <title-key lang="fr">Légende</title-key>
2604
-
2605
- <title-where lang="en">where</title-where>
2606
- <title-where lang="fr">où</title-where>
2478
+ <xsl:text>Contents</xsl:text>
2479
+
2480
+ </title-toc>
2607
2481
 
2608
2482
  <title-descriptors lang="en">Descriptors</title-descriptors>
2609
2483
 
@@ -2623,32 +2497,9 @@
2623
2497
  </title-part>
2624
2498
  <title-part lang="zh">第 # 部分:</title-part>
2625
2499
 
2626
- <title-subpart lang="en">
2627
-
2628
- </title-subpart>
2629
- <title-subpart lang="fr">
2630
-
2631
- </title-subpart>
2632
-
2633
- <title-modified lang="en">modified</title-modified>
2634
- <title-modified lang="fr">modifiée</title-modified>
2635
-
2636
- <title-modified lang="zh">modified</title-modified>
2637
-
2500
+ <title-subpart lang="en">Sub-part #</title-subpart>
2501
+ <title-subpart lang="fr">Partie de sub #</title-subpart>
2638
2502
 
2639
-
2640
- <title-source lang="en">
2641
-
2642
- <xsl:text>SOURCE</xsl:text>
2643
-
2644
-
2645
- </title-source>
2646
-
2647
- <title-keywords lang="en">Keywords</title-keywords>
2648
-
2649
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
2650
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
2651
-
2652
2503
  <title-list-tables lang="en">List of Tables</title-list-tables>
2653
2504
 
2654
2505
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -2657,41 +2508,12 @@
2657
2508
 
2658
2509
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
2659
2510
 
2660
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2661
-
2662
- <title-abstract lang="en">Abstract</title-abstract>
2663
-
2664
2511
  <title-summary lang="en">Summary</title-summary>
2665
2512
 
2666
- <title-in lang="en">in </title-in>
2667
-
2668
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
2669
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2670
-
2671
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
2672
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
2673
-
2674
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
2675
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
2676
-
2677
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
2678
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
2679
-
2680
- <title-obligation-normative lang="en">normative</title-obligation-normative>
2681
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
2682
-
2683
- <title-caution lang="en">CAUTION</title-caution>
2684
- <title-caution lang="zh">注意</title-caution>
2685
-
2686
- <title-warning lang="en">WARNING</title-warning>
2687
- <title-warning lang="zh">警告</title-warning>
2688
-
2689
- <title-amendment lang="en">AMENDMENT</title-amendment>
2690
-
2691
2513
  <title-continued lang="en">(continued)</title-continued>
2692
2514
  <title-continued lang="fr">(continué)</title-continued>
2693
2515
 
2694
- </xsl:variable><xsl:variable name="bibdata">
2516
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
2695
2517
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2696
2518
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2697
2519
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
@@ -2720,12 +2542,83 @@
2720
2542
  </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
2721
2543
 
2722
2544
 
2545
+
2546
+
2547
+
2548
+
2549
+ <xsl:attribute name="font-family">Arial, Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute>
2550
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+
2560
+
2561
+
2562
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
2563
+
2564
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
2565
+
2566
+
2567
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
2568
+
2569
+
2570
+
2571
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
2572
+
2573
+
2574
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
2575
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
2583
+
2584
+
2585
+
2586
+
2587
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
2588
+
2589
+
2590
+
2591
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
2592
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
2599
+
2600
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
2601
+
2602
+
2603
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
2604
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2605
+
2606
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2607
+
2608
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
2609
+
2610
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2611
+
2612
+
2723
2613
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2724
2614
 
2725
2615
 
2726
2616
 
2727
2617
 
2728
2618
 
2619
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
2620
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2621
+
2729
2622
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2730
2623
  <xsl:attribute name="white-space">pre</xsl:attribute>
2731
2624
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2734,15 +2627,22 @@
2734
2627
 
2735
2628
 
2736
2629
 
2630
+
2631
+
2737
2632
  <xsl:attribute name="font-family">Courier New</xsl:attribute>
2738
2633
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2739
2634
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
2740
2635
 
2741
2636
 
2637
+
2638
+
2639
+
2742
2640
 
2743
2641
 
2744
2642
 
2745
2643
 
2644
+
2645
+
2746
2646
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
2747
2647
 
2748
2648
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -2786,6 +2686,10 @@
2786
2686
 
2787
2687
 
2788
2688
 
2689
+ <xsl:attribute name="space-before">8pt</xsl:attribute>
2690
+ <xsl:attribute name="space-after">8pt</xsl:attribute>
2691
+
2692
+
2789
2693
 
2790
2694
 
2791
2695
 
@@ -2798,7 +2702,11 @@
2798
2702
 
2799
2703
 
2800
2704
 
2705
+ <xsl:attribute name="margin-left">10mm</xsl:attribute>
2706
+
2707
+
2801
2708
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2709
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2802
2710
 
2803
2711
 
2804
2712
 
@@ -2823,6 +2731,9 @@
2823
2731
 
2824
2732
 
2825
2733
 
2734
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
2735
+
2736
+
2826
2737
 
2827
2738
 
2828
2739
 
@@ -2843,8 +2754,62 @@
2843
2754
 
2844
2755
  </xsl:attribute-set><xsl:variable name="table-border_">
2845
2756
 
2846
- </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
2847
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2757
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
2758
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2759
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2760
+
2761
+
2762
+
2763
+
2764
+
2765
+
2766
+
2767
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
2768
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
2769
+
2770
+
2771
+
2772
+
2773
+
2774
+
2775
+
2776
+
2777
+
2778
+
2779
+
2780
+
2781
+
2782
+
2783
+
2784
+ </xsl:attribute-set><xsl:attribute-set name="table-style">
2785
+ <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2786
+ <xsl:attribute name="table-layout">fixed</xsl:attribute>
2787
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2788
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2789
+
2790
+
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
2797
+
2798
+
2799
+
2800
+
2801
+
2802
+
2803
+
2804
+
2805
+
2806
+
2807
+
2808
+
2809
+
2810
+
2811
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2812
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2848
2813
 
2849
2814
 
2850
2815
 
@@ -2864,7 +2829,177 @@
2864
2829
 
2865
2830
 
2866
2831
 
2832
+ </xsl:attribute-set><xsl:attribute-set name="table-row-style">
2833
+ <xsl:attribute name="min-height">4mm</xsl:attribute>
2834
+
2835
+
2836
+
2837
+
2838
+ </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
2839
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2840
+
2841
+
2842
+
2843
+ <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
2844
+ <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
2845
+
2846
+
2847
+
2848
+
2849
+
2850
+
2851
+
2852
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2853
+
2854
+
2855
+ <xsl:attribute name="border-left">solid black 0.5pt</xsl:attribute>
2856
+ <xsl:attribute name="border-right">solid black 0.5pt</xsl:attribute>
2857
+
2858
+
2859
+ </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2860
+
2861
+ </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style">
2862
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2863
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2864
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2865
+ <xsl:attribute name="display-align">center</xsl:attribute>
2866
+
2867
+
2868
+
2869
+
2870
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2871
+ <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
2872
+ <xsl:attribute name="text-align">center</xsl:attribute>
2873
+
2874
+
2875
+
2876
+
2877
+
2878
+
2879
+
2880
+
2881
+
2882
+
2883
+ </xsl:attribute-set><xsl:attribute-set name="table-cell-style">
2884
+ <xsl:attribute name="display-align">center</xsl:attribute>
2885
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2886
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2887
+
2888
+
2889
+
2890
+
2891
+
2892
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2893
+ <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
2894
+
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+
2901
+
2902
+
2867
2903
  </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
2904
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2905
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2906
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2907
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2908
+
2909
+
2910
+
2911
+
2912
+
2913
+
2914
+
2915
+ <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
2916
+
2917
+
2918
+
2919
+
2920
+
2921
+ </xsl:attribute-set><xsl:attribute-set name="table-note-style">
2922
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2923
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2924
+
2925
+
2926
+
2927
+
2928
+
2929
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
2930
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2931
+
2932
+
2933
+
2934
+
2935
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
2936
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2937
+
2938
+
2939
+
2940
+
2941
+
2942
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
2943
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2944
+ <xsl:attribute name="text-indent">-6mm</xsl:attribute>
2945
+ <xsl:attribute name="margin-left">6mm</xsl:attribute>
2946
+
2947
+
2948
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
2949
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2950
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2951
+
2952
+
2953
+
2954
+
2955
+
2956
+
2957
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
2958
+ <xsl:attribute name="font-size">70%</xsl:attribute>
2959
+
2960
+
2961
+
2962
+
2963
+
2964
+
2965
+
2966
+ </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
2967
+ <xsl:attribute name="text-indent">0</xsl:attribute>
2968
+ <xsl:attribute name="start-indent">0</xsl:attribute>
2969
+
2970
+
2971
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style">
2972
+
2973
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style">
2974
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2975
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2976
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2977
+
2978
+ <xsl:attribute name="baseline-shift">65%</xsl:attribute>
2979
+
2980
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style">
2981
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2982
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2983
+
2984
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
2985
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2986
+
2987
+ </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
2988
+
2989
+
2990
+ </xsl:attribute-set><xsl:attribute-set name="dt-style">
2991
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2992
+
2993
+
2994
+
2995
+
2996
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2997
+
2998
+
2999
+
3000
+
3001
+
3002
+
2868
3003
 
2869
3004
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2870
3005
 
@@ -2932,6 +3067,7 @@
2932
3067
 
2933
3068
 
2934
3069
  </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
3070
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
2935
3071
 
2936
3072
 
2937
3073
 
@@ -3003,6 +3139,9 @@
3003
3139
 
3004
3140
 
3005
3141
 
3142
+ </xsl:attribute-set><xsl:attribute-set name="termsource-text-style">
3143
+
3144
+
3006
3145
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
3007
3146
 
3008
3147
 
@@ -3010,6 +3149,8 @@
3010
3149
 
3011
3150
  </xsl:attribute-set><xsl:attribute-set name="term-style">
3012
3151
 
3152
+ </xsl:attribute-set><xsl:attribute-set name="figure-style">
3153
+
3013
3154
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
3014
3155
 
3015
3156
 
@@ -3110,24 +3251,210 @@
3110
3251
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
3111
3252
 
3112
3253
 
3113
- </xsl:attribute-set><xsl:attribute-set name="list-style">
3254
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
3255
+
3256
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
3257
+ <xsl:attribute name="line-height">135%</xsl:attribute>
3258
+ </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
3259
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3260
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3261
+
3262
+
3263
+
3264
+
3265
+
3266
+
3267
+
3268
+
3269
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
3270
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3271
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
3272
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3273
+
3274
+
3275
+
3276
+
3277
+
3278
+
3279
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3280
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3281
+
3282
+
3283
+
3284
+
3285
+
3286
+
3287
+
3288
+
3289
+
3290
+
3291
+
3292
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
3293
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3294
+ <xsl:attribute name="font-style">normal</xsl:attribute>
3295
+ <xsl:attribute name="text-indent">0</xsl:attribute>
3296
+ <xsl:attribute name="start-indent">0</xsl:attribute>
3297
+
3298
+
3299
+
3300
+
3301
+
3302
+
3303
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3304
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
3305
+
3306
+
3307
+
3308
+
3309
+
3310
+
3311
+
3312
+
3313
+
3314
+
3315
+
3316
+
3317
+
3318
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
3319
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+
3326
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3327
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
3328
+
3329
+
3330
+
3331
+
3332
+
3333
+
3334
+
3335
+
3336
+
3337
+
3338
+
3339
+
3340
+ </xsl:attribute-set><xsl:attribute-set name="admonition-style">
3341
+
3342
+
3343
+
3344
+
3345
+
3346
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3347
+ <xsl:attribute name="margin-left">-2mm</xsl:attribute>
3348
+ <xsl:attribute name="margin-right">-2mm</xsl:attribute>
3349
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3350
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3351
+
3352
+
3353
+
3354
+
3355
+
3356
+
3357
+
3358
+
3359
+
3360
+
3361
+ </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
3362
+
3363
+
3364
+
3365
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3366
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3367
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3368
+ <xsl:attribute name="padding">1mm</xsl:attribute>
3369
+ <xsl:attribute name="padding-top">2mm</xsl:attribute>
3370
+
3371
+
3372
+
3373
+
3374
+
3375
+
3376
+
3377
+
3378
+ </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
3379
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3380
+
3381
+
3382
+
3383
+
3384
+
3385
+
3386
+
3387
+
3388
+
3389
+
3390
+
3391
+
3392
+
3393
+ </xsl:attribute-set><xsl:attribute-set name="admonition-p-style">
3394
+
3395
+
3396
+
3397
+
3398
+
3399
+
3400
+
3401
+
3402
+
3403
+
3404
+
3405
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
3406
+
3407
+
3408
+
3409
+
3410
+
3411
+
3412
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
3413
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
3414
+
3415
+
3416
+
3417
+
3418
+
3419
+
3420
+
3421
+
3422
+
3423
+
3424
+
3425
+
3426
+
3427
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style">
3428
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
3429
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3430
+
3431
+
3432
+
3433
+
3434
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
3435
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
3436
+
3437
+
3438
+
3439
+
3440
+
3441
+
3442
+
3114
3443
 
3115
- </xsl:attribute-set><xsl:attribute-set name="toc-style">
3116
- <xsl:attribute name="line-height">135%</xsl:attribute>
3117
- </xsl:attribute-set><xsl:attribute-set name="fn-style">
3118
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3119
- </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
3120
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3444
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
3121
3445
 
3122
3446
 
3123
3447
 
3124
3448
 
3449
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style">
3450
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
3451
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3125
3452
 
3126
3453
 
3127
- <xsl:attribute name="font-size">8pt</xsl:attribute>
3128
- <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3129
3454
 
3130
3455
 
3456
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
3457
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
3131
3458
 
3132
3459
 
3133
3460
 
@@ -3136,24 +3463,24 @@
3136
3463
 
3137
3464
 
3138
3465
 
3466
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
3139
3467
 
3140
- </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
3141
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3142
- <xsl:attribute name="font-style">normal</xsl:attribute>
3143
- <xsl:attribute name="text-indent">0</xsl:attribute>
3144
- <xsl:attribute name="start-indent">0</xsl:attribute>
3145
3468
 
3469
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
3146
3470
 
3147
3471
 
3148
3472
 
3473
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
3474
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3475
+ <xsl:attribute name="font-size">65%</xsl:attribute>
3149
3476
 
3150
3477
 
3151
- <xsl:attribute name="font-size">8pt</xsl:attribute>
3152
- <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
3153
3478
 
3154
3479
 
3155
3480
 
3156
3481
 
3482
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3483
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3157
3484
 
3158
3485
 
3159
3486
 
@@ -3163,7 +3490,9 @@
3163
3490
 
3164
3491
 
3165
3492
 
3166
- </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
3493
+
3494
+
3495
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
3167
3496
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3168
3497
 
3169
3498
 
@@ -3184,31 +3513,33 @@
3184
3513
 
3185
3514
 
3186
3515
 
3516
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
3517
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
3518
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3519
+ <xsl:attribute name="start-indent">0pt</xsl:attribute>
3520
+
3521
+
3522
+
3523
+
3524
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3525
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
3526
+
3527
+
3528
+
3529
+
3530
+
3531
+
3532
+
3533
+
3534
+ </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
3187
3535
 
3188
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
3189
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
3190
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
3191
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
3192
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
3193
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
3194
- </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
3536
+
3537
+
3538
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
3195
3539
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3196
3540
  <xsl:sort select="@displayorder" data-type="number"/>
3197
3541
  <xsl:apply-templates select="." mode="contents"/>
3198
3542
  </xsl:for-each>
3199
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
3200
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
3201
-
3202
- <!-- Normative references -->
3203
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
3204
- <!-- Terms and definitions -->
3205
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
3206
- <!-- Another main sections -->
3207
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
3208
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
3209
- <!-- Bibliography -->
3210
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
3211
-
3212
3543
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3213
3544
 
3214
3545
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
@@ -3225,29 +3556,11 @@
3225
3556
  <xsl:sort select="@displayorder" data-type="number"/>
3226
3557
  <xsl:apply-templates select="." mode="contents"/>
3227
3558
  </xsl:for-each>
3228
- </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
3229
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
3230
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
3231
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
3232
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
3233
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
3234
3559
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3235
3560
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3236
3561
  <xsl:sort select="@displayorder" data-type="number"/>
3237
3562
  <xsl:apply-templates select="."/>
3238
3563
  </xsl:for-each>
3239
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
3240
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
3241
-
3242
- <!-- Normative references -->
3243
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
3244
- <!-- Terms and definitions -->
3245
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
3246
- <!-- Another main sections -->
3247
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
3248
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
3249
- <!-- Bibliography -->
3250
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
3251
3564
  </xsl:template><xsl:template name="processMainSectionsDefault">
3252
3565
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3253
3566
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3268,6 +3581,69 @@
3268
3581
  <xsl:value-of select="."/>
3269
3582
  </xsl:template><xsl:template match="*[local-name()='br']">
3270
3583
  <xsl:value-of select="$linebreak"/>
3584
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
3585
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
3586
+ <xsl:apply-templates/>
3587
+ </fo:block>
3588
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
3589
+
3590
+ <!-- process in the template 'title' -->
3591
+ <xsl:call-template name="title"/>
3592
+
3593
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
3594
+
3595
+
3596
+ <!-- process in the template 'paragraph' -->
3597
+ <xsl:call-template name="paragraph"/>
3598
+
3599
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
3600
+ <fo:block xsl:use-attribute-sets="license-statement-style">
3601
+ <xsl:apply-templates/>
3602
+ </fo:block>
3603
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
3604
+
3605
+ <!-- process in the template 'title' -->
3606
+ <xsl:call-template name="title"/>
3607
+
3608
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
3609
+
3610
+ <!-- process in the template 'paragraph' -->
3611
+ <xsl:call-template name="paragraph"/>
3612
+
3613
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
3614
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
3615
+ <xsl:apply-templates/>
3616
+ </fo:block>
3617
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
3618
+
3619
+ <!-- process in the template 'title' -->
3620
+ <xsl:call-template name="title"/>
3621
+
3622
+
3623
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3624
+
3625
+ <!-- process in the template 'paragraph' -->
3626
+ <xsl:call-template name="paragraph"/>
3627
+
3628
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3629
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
3630
+ <xsl:apply-templates/>
3631
+ </fo:block>
3632
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
3633
+
3634
+ <xsl:variable name="level">
3635
+ <xsl:call-template name="getLevel"/>
3636
+ </xsl:variable>
3637
+ <fo:block role="H{$level}" xsl:use-attribute-sets="feedback-statement-title-style">
3638
+ <xsl:apply-templates/>
3639
+ </fo:block>
3640
+
3641
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3642
+
3643
+ <fo:block xsl:use-attribute-sets="feedback-statement-p-style">
3644
+ <xsl:apply-templates/>
3645
+ </fo:block>
3646
+
3271
3647
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3272
3648
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
3273
3649
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -3284,43 +3660,19 @@
3284
3660
  <xsl:call-template name="getSimpleTable"/>
3285
3661
  </xsl:variable>
3286
3662
 
3287
- <!-- <xsl:if test="$namespace = 'bipm'">
3288
- <fo:block>&#xA0;</fo:block>
3289
- </xsl:if> -->
3290
-
3291
3663
 
3292
3664
  <!-- Display table's name before table as standalone block -->
3293
3665
  <!-- $namespace = 'iso' or -->
3294
3666
 
3295
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3296
-
3297
-
3298
-
3299
-
3667
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table -->
3668
+
3300
3669
 
3301
- <xsl:call-template name="fn_name_display"/>
3302
3670
 
3671
+ <xsl:call-template name="table_name_fn_display"/>
3303
3672
 
3304
3673
 
3305
3674
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
3306
3675
 
3307
- <!-- <xsl:variable name="cols-count">
3308
- <xsl:choose>
3309
- <xsl:when test="*[local-name()='thead']">
3310
- <xsl:call-template name="calculate-columns-numbers">
3311
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
3312
- </xsl:call-template>
3313
- </xsl:when>
3314
- <xsl:otherwise>
3315
- <xsl:call-template name="calculate-columns-numbers">
3316
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
3317
- </xsl:call-template>
3318
- </xsl:otherwise>
3319
- </xsl:choose>
3320
- </xsl:variable> -->
3321
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
3322
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
3323
-
3324
3676
  <xsl:variable name="colwidths">
3325
3677
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3326
3678
  <xsl:call-template name="calculate-column-widths">
@@ -3331,17 +3683,8 @@
3331
3683
  </xsl:variable>
3332
3684
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3333
3685
 
3334
- <!-- <xsl:variable name="colwidths2">
3335
- <xsl:call-template name="calculate-column-widths">
3336
- <xsl:with-param name="cols-count" select="$cols-count"/>
3337
- </xsl:call-template>
3338
- </xsl:variable> -->
3339
-
3340
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
3341
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
3342
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
3343
3686
 
3344
- <xsl:variable name="margin-left">
3687
+ <xsl:variable name="margin-side">
3345
3688
  <xsl:choose>
3346
3689
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3347
3690
  <xsl:otherwise>0</xsl:otherwise>
@@ -3349,71 +3692,71 @@
3349
3692
  </xsl:variable>
3350
3693
 
3351
3694
 
3352
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
3695
+ <fo:block-container xsl:use-attribute-sets="table-container-style">
3696
+
3353
3697
 
3698
+ <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
3699
+ <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
3354
3700
 
3701
+
3702
+
3703
+
3355
3704
 
3705
+
3356
3706
 
3357
- <xsl:attribute name="font-size">8pt</xsl:attribute>
3358
- <xsl:attribute name="space-after">12pt</xsl:attribute>
3359
3707
  <xsl:if test="ancestor::*[local-name() = 'preface']">
3360
3708
  <xsl:attribute name="space-after">16pt</xsl:attribute>
3361
3709
  </xsl:if>
3362
-
3363
-
3364
-
3365
-
3366
-
3367
-
3368
-
3369
-
3370
3710
 
3371
3711
 
3372
3712
 
3713
+
3373
3714
 
3374
3715
 
3375
3716
 
3376
3717
 
3377
3718
 
3719
+ <!-- end table block-container attributes -->
3378
3720
 
3379
3721
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3380
3722
 
3381
3723
 
3724
+ <xsl:variable name="table_width_default">100%</xsl:variable>
3382
3725
  <xsl:variable name="table_width">
3383
3726
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3384
- 100%
3385
-
3386
-
3727
+ <xsl:value-of select="$table_width_default"/>
3387
3728
  </xsl:variable>
3388
3729
 
3730
+
3389
3731
  <xsl:variable name="table_attributes">
3390
- <attribute name="table-layout">fixed</attribute>
3391
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
3392
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3393
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3394
-
3395
-
3396
-
3397
-
3398
-
3399
- <attribute name="border">0.5pt solid black</attribute>
3400
-
3401
-
3402
-
3403
-
3404
-
3405
-
3406
-
3407
-
3408
-
3409
-
3732
+
3733
+ <xsl:element name="table_attributes" use-attribute-sets="table-style">
3734
+ <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3735
+
3736
+
3737
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
3738
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
3739
+
3740
+
3741
+
3742
+
3743
+
3744
+
3745
+
3746
+
3747
+
3748
+
3749
+
3750
+
3751
+
3752
+ </xsl:element>
3410
3753
  </xsl:variable>
3411
3754
 
3412
3755
 
3413
- <fo:table id="{@id}" table-omit-footer-at-break="true">
3756
+ <fo:table id="{@id}">
3414
3757
 
3415
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3416
- <xsl:attribute name="{@name}">
3758
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
3759
+ <xsl:attribute name="{local-name()}">
3417
3760
  <xsl:value-of select="."/>
3418
3761
  </xsl:attribute>
3419
3762
  </xsl:for-each>
@@ -3424,7 +3767,6 @@
3424
3767
  </xsl:if>
3425
3768
 
3426
3769
 
3427
-
3428
3770
  <xsl:choose>
3429
3771
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3430
3772
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3450,7 +3792,7 @@
3450
3792
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3451
3793
  </xsl:when>
3452
3794
  <xsl:otherwise>
3453
- <xsl:apply-templates/>
3795
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
3454
3796
  </xsl:otherwise>
3455
3797
  </xsl:choose>
3456
3798
 
@@ -3465,25 +3807,6 @@
3465
3807
  </xsl:call-template>
3466
3808
  </xsl:for-each>
3467
3809
 
3468
- <!-- insert footer as table -->
3469
- <!-- <fo:table>
3470
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3471
- <xsl:attribute name="{@name}">
3472
- <xsl:value-of select="."/>
3473
- </xsl:attribute>
3474
- </xsl:for-each>
3475
-
3476
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3477
- <xsl:choose>
3478
- <xsl:when test=". = 1 or . = 0">
3479
- <fo:table-column column-width="proportional-column-width(2)"/>
3480
- </xsl:when>
3481
- <xsl:otherwise>
3482
- <fo:table-column column-width="proportional-column-width({.})"/>
3483
- </xsl:otherwise>
3484
- </xsl:choose>
3485
- </xsl:for-each>
3486
- </fo:table>-->
3487
3810
 
3488
3811
 
3489
3812
 
@@ -3544,18 +3867,17 @@
3544
3867
  </xsl:otherwise>
3545
3868
  </xsl:choose>
3546
3869
 
3547
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3870
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3548
3871
  <xsl:param name="continued"/>
3549
3872
  <xsl:if test="normalize-space() != ''">
3550
3873
  <fo:block xsl:use-attribute-sets="table-name-style">
3551
-
3874
+
3552
3875
 
3553
3876
 
3554
3877
 
3555
3878
 
3556
3879
  <xsl:choose>
3557
3880
  <xsl:when test="$continued = 'true'">
3558
- <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
3559
3881
 
3560
3882
  </xsl:when>
3561
3883
  <xsl:otherwise>
@@ -3618,13 +3940,6 @@
3618
3940
  <xsl:for-each select="xalan:nodeset($table)/*/tr">
3619
3941
  <xsl:variable name="td_text">
3620
3942
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
3621
-
3622
- <!-- <xsl:if test="$namespace = 'bipm'">
3623
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
3624
- <word><xsl:value-of select="normalize-space(.)"/></word>
3625
- </xsl:for-each>
3626
- </xsl:if> -->
3627
-
3628
3943
  </xsl:variable>
3629
3944
  <xsl:variable name="words">
3630
3945
  <xsl:variable name="string_with_added_zerospaces">
@@ -3661,7 +3976,6 @@
3661
3976
  </xsl:otherwise>
3662
3977
  </xsl:choose>
3663
3978
  </xsl:variable>
3664
-
3665
3979
 
3666
3980
  <column>
3667
3981
  <xsl:for-each select="xalan:nodeset($widths)//width">
@@ -3675,131 +3989,59 @@
3675
3989
  <xsl:with-param name="cols-count" select="$cols-count"/>
3676
3990
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
3677
3991
  <xsl:with-param name="table" select="$table"/>
3678
- </xsl:call-template>
3679
- </xsl:if>
3680
- </xsl:template><xsl:template match="text()" mode="td_text">
3681
- <xsl:variable name="zero-space">​</xsl:variable>
3682
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3683
- </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3684
- <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3685
- </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
3686
- <xsl:value-of select="@target"/>
3687
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
3688
- <xsl:variable name="mathml">
3689
- <xsl:for-each select="*">
3690
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
3691
- <xsl:copy-of select="."/>
3692
- </xsl:if>
3693
- </xsl:for-each>
3694
- </xsl:variable>
3695
-
3696
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
3697
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3698
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3699
- <xsl:param name="cols-count"/>
3700
- <!-- font-weight="bold" -->
3701
- <fo:table-header>
3702
-
3703
-
3704
- <xsl:apply-templates/>
3705
- </fo:table-header>
3706
- </xsl:template><xsl:template name="table-header-title">
3707
- <xsl:param name="cols-count"/>
3708
- <!-- row for title -->
3709
- <fo:table-row>
3710
- <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3711
-
3712
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3713
- <xsl:with-param name="continued">true</xsl:with-param>
3714
- </xsl:apply-templates>
3715
-
3716
-
3717
-
3718
-
3719
- </fo:table-cell>
3720
- </fo:table-row>
3721
- </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
3722
- <fo:table-body>
3723
- <xsl:apply-templates/>
3724
- </fo:table-body>
3725
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
3726
- <xsl:apply-templates/>
3727
- </xsl:template><xsl:template name="insertTableFooter">
3728
- <xsl:param name="cols-count"/>
3729
- <xsl:if test="../*[local-name()='tfoot']">
3730
- <fo:table-footer>
3731
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3732
- </fo:table-footer>
3733
- </xsl:if>
3734
- </xsl:template><xsl:template name="insertTableFooter2">
3735
- <xsl:param name="cols-count"/>
3736
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3737
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
3738
-
3739
- <fo:table-footer>
3740
-
3741
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3742
-
3743
- <!-- if there are note(s) or fn(s) then create footer row -->
3744
- <xsl:if test="$isNoteOrFnExist = 'true'">
3745
-
3746
-
3747
-
3748
- <fo:table-row>
3749
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3750
-
3751
-
3752
- <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
3753
-
3754
-
3755
- <!-- fn will be processed inside 'note' processing -->
3756
-
3757
- <xsl:if test="../*[local-name()='note']">
3758
- <fo:block margin-bottom="6pt"> </fo:block>
3759
- </xsl:if>
3760
-
3761
-
3762
-
3763
-
3764
-
3765
-
3766
- <!-- except gb -->
3767
-
3768
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3769
-
3770
-
3771
- <!-- show Note under table in preface (ex. abstract) sections -->
3772
- <!-- empty, because notes show at page side in main sections -->
3773
- <!-- <xsl:if test="$namespace = 'bipm'">
3774
- <xsl:choose>
3775
- <xsl:when test="ancestor::*[local-name()='preface']">
3776
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3777
- </xsl:when>
3778
- <xsl:otherwise>
3779
- <fo:block/>
3780
- </xsl:otherwise>
3781
- </xsl:choose>
3782
- </xsl:if> -->
3783
-
3784
-
3785
- <!-- horizontal row separator -->
3786
-
3787
- <xsl:if test="../*[local-name()='note']">
3788
- <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3789
- <fo:block font-size="1pt"> </fo:block>
3790
- </fo:block-container>
3791
- </xsl:if>
3792
-
3793
-
3794
- <!-- fn processing -->
3795
- <xsl:call-template name="fn_display"/>
3796
-
3797
- </fo:table-cell>
3798
- </fo:table-row>
3799
-
3992
+ </xsl:call-template>
3993
+ </xsl:if>
3994
+ </xsl:template><xsl:template match="text()" mode="td_text">
3995
+ <xsl:variable name="zero-space">​</xsl:variable>
3996
+ <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3997
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3998
+ <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3999
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
4000
+ <xsl:value-of select="@target"/>
4001
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
4002
+ <xsl:variable name="mathml">
4003
+ <xsl:for-each select="*">
4004
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
4005
+ <xsl:copy-of select="."/>
3800
4006
  </xsl:if>
3801
- </fo:table-footer>
4007
+ </xsl:for-each>
4008
+ </xsl:variable>
3802
4009
 
4010
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
4011
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
4012
+ </xsl:template><xsl:template match="*[local-name()='thead']">
4013
+ <xsl:param name="cols-count"/>
4014
+ <fo:table-header>
4015
+
4016
+
4017
+ <xsl:apply-templates/>
4018
+ </fo:table-header>
4019
+ </xsl:template><xsl:template name="table-header-title">
4020
+ <xsl:param name="cols-count"/>
4021
+ <!-- row for title -->
4022
+ <fo:table-row>
4023
+ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
4024
+
4025
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4026
+ <xsl:with-param name="continued">true</xsl:with-param>
4027
+ </xsl:apply-templates>
4028
+
4029
+
4030
+
4031
+ </fo:table-cell>
4032
+ </fo:table-row>
4033
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
4034
+ <fo:table-body>
4035
+ <xsl:apply-templates/>
4036
+ </fo:table-body>
4037
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
4038
+ <xsl:apply-templates/>
4039
+ </xsl:template><xsl:template name="insertTableFooter">
4040
+ <xsl:param name="cols-count"/>
4041
+ <xsl:if test="../*[local-name()='tfoot']">
4042
+ <fo:table-footer>
4043
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
4044
+ </fo:table-footer>
3803
4045
  </xsl:if>
3804
4046
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3805
4047
  <xsl:param name="table_attributes"/>
@@ -3826,17 +4068,18 @@
3826
4068
  </xsl:variable>
3827
4069
 
3828
4070
  <fo:table keep-with-previous="always">
3829
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
4071
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
4072
+ <xsl:variable name="name" select="local-name()"/>
3830
4073
  <xsl:choose>
3831
- <xsl:when test="@name = 'border-top'">
3832
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
4074
+ <xsl:when test="$name = 'border-top'">
4075
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
3833
4076
  </xsl:when>
3834
- <xsl:when test="@name = 'border'">
3835
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
4077
+ <xsl:when test="$name = 'border'">
4078
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
3836
4079
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3837
4080
  </xsl:when>
3838
4081
  <xsl:otherwise>
3839
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
4082
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
3840
4083
  </xsl:otherwise>
3841
4084
  </xsl:choose>
3842
4085
  </xsl:for-each>
@@ -3865,11 +4108,10 @@
3865
4108
 
3866
4109
  <fo:table-body>
3867
4110
  <fo:table-row>
3868
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
4111
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3869
4112
 
3870
4113
 
3871
-
3872
- <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
4114
+
3873
4115
 
3874
4116
 
3875
4117
  <!-- fn will be processed inside 'note' processing -->
@@ -3883,29 +4125,13 @@
3883
4125
 
3884
4126
 
3885
4127
 
3886
-
3887
-
3888
-
3889
4128
  <!-- for BSI (not PAS) display Notes before footnotes -->
3890
4129
 
3891
4130
 
3892
- <!-- except gb -->
3893
-
3894
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
4131
+ <!-- except gb and bsi -->
3895
4132
 
3896
-
3897
- <!-- <xsl:if test="$namespace = 'bipm'">
3898
- <xsl:choose>
3899
- <xsl:when test="ancestor::*[local-name()='preface']">
3900
- show Note under table in preface (ex. abstract) sections
3901
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3902
- </xsl:when>
3903
- <xsl:otherwise>
3904
- empty, because notes show at page side in main sections
3905
- <fo:block/>
3906
- </xsl:otherwise>
3907
- </xsl:choose>
3908
- </xsl:if> -->
4133
+ <xsl:apply-templates select="../*[local-name()='note']"/>
4134
+
3909
4135
 
3910
4136
 
3911
4137
  <!-- horizontal row separator -->
@@ -3918,8 +4144,7 @@
3918
4144
 
3919
4145
 
3920
4146
  <!-- fn processing -->
3921
- <xsl:call-template name="fn_display"/>
3922
-
4147
+ <xsl:call-template name="table_fn_display"/>
3923
4148
 
3924
4149
  <!-- for PAS display Notes after footnotes -->
3925
4150
 
@@ -3949,7 +4174,7 @@
3949
4174
 
3950
4175
 
3951
4176
 
3952
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
4177
+ <xsl:apply-templates select="../*[local-name()='thead']">
3953
4178
  <xsl:with-param name="cols-count" select="$cols-count"/>
3954
4179
  </xsl:apply-templates>
3955
4180
 
@@ -3961,92 +4186,62 @@
3961
4186
 
3962
4187
 
3963
4188
  <xsl:apply-templates/>
3964
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
3965
-
4189
+
3966
4190
  </fo:table-body>
3967
4191
 
3968
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3969
- <xsl:choose>
3970
- <xsl:when test="substring-after(., '—') != ''">
3971
- <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3972
- </xsl:when>
3973
- <xsl:otherwise>
3974
- <xsl:value-of select="."/>
3975
- </xsl:otherwise>
3976
- </xsl:choose>
3977
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3978
- <xsl:apply-templates mode="presentation_name"/>
3979
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3980
- <xsl:apply-templates select="."/>
4192
+ </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4193
+ <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4194
+
4195
+
4196
+
4197
+
4198
+
4199
+
4200
+
4201
+ <xsl:call-template name="setTableRowAttributes"/>
4202
+
4203
+ <xsl:apply-templates/>
4204
+ </fo:table-row>
4205
+ </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4206
+ <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4207
+
4208
+ <xsl:call-template name="setTableRowAttributes"/>
4209
+ <xsl:apply-templates/>
4210
+ </fo:table-row>
3981
4211
  </xsl:template><xsl:template match="*[local-name()='tr']">
3982
- <xsl:variable name="parent-name" select="local-name(..)"/>
3983
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
3984
- <fo:table-row min-height="4mm">
3985
- <xsl:if test="$parent-name = 'thead'">
3986
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3987
-
3988
-
3989
-
3990
-
3991
-
3992
- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
3993
- <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
3994
-
3995
-
3996
-
3997
-
3998
- </xsl:if>
3999
- <xsl:if test="$parent-name = 'tfoot'">
4000
-
4001
-
4002
-
4003
- <xsl:attribute name="border-left">solid black 0.5pt</xsl:attribute>
4004
- <xsl:attribute name="border-right">solid black 0.5pt</xsl:attribute>
4005
-
4006
- </xsl:if>
4007
-
4008
-
4009
-
4010
-
4011
-
4012
-
4013
-
4014
-
4015
-
4016
-
4017
- <!-- <xsl:if test="$namespace = 'bipm'">
4018
- <xsl:attribute name="height">8mm</xsl:attribute>
4019
- </xsl:if> -->
4020
-
4212
+ <fo:table-row xsl:use-attribute-sets="table-body-row-style">
4213
+
4214
+
4215
+
4216
+
4217
+
4218
+ <xsl:call-template name="setTableRowAttributes"/>
4021
4219
  <xsl:apply-templates/>
4022
4220
  </fo:table-row>
4221
+ </xsl:template><xsl:template name="setTableRowAttributes">
4222
+
4223
+
4224
+
4225
+
4226
+
4227
+
4228
+
4229
+
4023
4230
  </xsl:template><xsl:template match="*[local-name()='th']">
4024
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
4025
- <xsl:attribute name="text-align">
4026
- <xsl:choose>
4027
- <xsl:when test="@align">
4028
- <xsl:call-template name="setAlignment"/>
4029
- <!-- <xsl:value-of select="@align"/> -->
4030
- </xsl:when>
4031
- <xsl:otherwise>center</xsl:otherwise>
4032
- </xsl:choose>
4033
- </xsl:attribute>
4231
+ <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
4232
+ <xsl:call-template name="setTextAlignment">
4233
+ <xsl:with-param name="default">center</xsl:with-param>
4234
+ </xsl:call-template>
4034
4235
 
4035
4236
 
4036
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
4037
4237
 
4038
4238
 
4039
- <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
4239
+
4240
+
4241
+ <xsl:attribute name="text-align">center</xsl:attribute>
4040
4242
  <xsl:if test="ancestor::*[local-name()='preface']">
4041
4243
  <xsl:attribute name="font-weight">normal</xsl:attribute>
4042
4244
  </xsl:if>
4043
- <xsl:attribute name="text-align">center</xsl:attribute>
4044
-
4045
-
4046
-
4047
-
4048
-
4049
-
4050
4245
 
4051
4246
 
4052
4247
 
@@ -4055,21 +4250,25 @@
4055
4250
  <xsl:if test="$lang = 'ar'">
4056
4251
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4057
4252
  </xsl:if>
4058
- <xsl:if test="@colspan">
4059
- <xsl:attribute name="number-columns-spanned">
4060
- <xsl:value-of select="@colspan"/>
4061
- </xsl:attribute>
4062
- </xsl:if>
4063
- <xsl:if test="@rowspan">
4064
- <xsl:attribute name="number-rows-spanned">
4065
- <xsl:value-of select="@rowspan"/>
4066
- </xsl:attribute>
4067
- </xsl:if>
4068
- <xsl:call-template name="display-align"/>
4253
+
4254
+ <xsl:call-template name="setTableCellAttributes"/>
4255
+
4069
4256
  <fo:block>
4070
4257
  <xsl:apply-templates/>
4071
4258
  </fo:block>
4072
4259
  </fo:table-cell>
4260
+ </xsl:template><xsl:template name="setTableCellAttributes">
4261
+ <xsl:if test="@colspan">
4262
+ <xsl:attribute name="number-columns-spanned">
4263
+ <xsl:value-of select="@colspan"/>
4264
+ </xsl:attribute>
4265
+ </xsl:if>
4266
+ <xsl:if test="@rowspan">
4267
+ <xsl:attribute name="number-rows-spanned">
4268
+ <xsl:value-of select="@rowspan"/>
4269
+ </xsl:attribute>
4270
+ </xsl:if>
4271
+ <xsl:call-template name="display-align"/>
4073
4272
  </xsl:template><xsl:template name="display-align">
4074
4273
  <xsl:if test="@valign">
4075
4274
  <xsl:attribute name="display-align">
@@ -4082,33 +4281,22 @@
4082
4281
  </xsl:attribute>
4083
4282
  </xsl:if>
4084
4283
  </xsl:template><xsl:template match="*[local-name()='td']">
4085
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
4086
- <xsl:attribute name="text-align">
4087
- <xsl:choose>
4088
- <xsl:when test="@align">
4089
- <xsl:call-template name="setAlignment"/>
4090
- <!-- <xsl:value-of select="@align"/> -->
4091
- </xsl:when>
4092
- <xsl:otherwise>left</xsl:otherwise>
4093
- </xsl:choose>
4094
- </xsl:attribute>
4284
+ <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
4285
+ <xsl:call-template name="setTextAlignment">
4286
+ <xsl:with-param name="default">left</xsl:with-param>
4287
+ </xsl:call-template>
4288
+
4095
4289
  <xsl:if test="$lang = 'ar'">
4096
4290
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4097
4291
  </xsl:if>
4098
- <!-- and ancestor::*[local-name() = 'thead'] -->
4099
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4100
4292
 
4101
4293
 
4102
4294
 
4295
+ <!-- bsi -->
4103
4296
 
4104
4297
 
4105
- <xsl:if test="ancestor::*[local-name() = 'tfoot']">
4106
- <xsl:attribute name="border">solid black 0</xsl:attribute>
4107
- </xsl:if>
4108
-
4109
4298
 
4110
4299
 
4111
- <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
4112
4300
  <xsl:if test="ancestor::*[local-name()='preface']">
4113
4301
  <xsl:attribute name="text-align">center</xsl:attribute>
4114
4302
  </xsl:if>
@@ -4117,63 +4305,53 @@
4117
4305
 
4118
4306
 
4119
4307
 
4308
+
4309
+
4120
4310
 
4121
4311
 
4122
4312
 
4123
4313
 
4124
4314
 
4125
- <xsl:if test=".//*[local-name() = 'table']">
4315
+ <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4126
4316
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4127
4317
  </xsl:if>
4128
- <xsl:if test="@colspan">
4129
- <xsl:attribute name="number-columns-spanned">
4130
- <xsl:value-of select="@colspan"/>
4131
- </xsl:attribute>
4132
- </xsl:if>
4133
- <xsl:if test="@rowspan">
4134
- <xsl:attribute name="number-rows-spanned">
4135
- <xsl:value-of select="@rowspan"/>
4136
- </xsl:attribute>
4137
- </xsl:if>
4138
- <xsl:call-template name="display-align"/>
4318
+
4319
+ <xsl:call-template name="setTableCellAttributes"/>
4320
+
4139
4321
  <fo:block>
4140
-
4322
+
4323
+
4324
+
4141
4325
  <xsl:apply-templates/>
4142
4326
  </fo:block>
4143
4327
  </fo:table-cell>
4144
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
4145
-
4328
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
4329
+
4330
+ <fo:block xsl:use-attribute-sets="table-note-style">
4331
+
4332
+
4333
+
4334
+
4146
4335
 
4147
- <fo:block font-size="10pt" margin-bottom="12pt">
4336
+ <!-- Table's note name (NOTE, for example) -->
4337
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4148
4338
 
4149
4339
 
4150
4340
 
4151
4341
 
4152
- <xsl:attribute name="font-size">8pt</xsl:attribute>
4153
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4154
4342
 
4155
4343
 
4156
4344
 
4157
-
4158
-
4159
- <!-- Table's note name (NOTE, for example) -->
4160
-
4161
- <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
4162
-
4345
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4163
4346
 
4164
-
4165
-
4166
-
4167
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4168
-
4169
- </fo:inline>
4170
-
4171
-
4172
-
4173
- <xsl:apply-templates mode="process"/>
4174
- </fo:block>
4347
+ </fo:inline>
4348
+
4349
+
4350
+
4351
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4352
+ </fo:block>
4175
4353
 
4176
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
4354
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
4177
4355
  <xsl:apply-templates/>
4178
4356
  </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
4179
4357
 
@@ -4251,8 +4429,7 @@
4251
4429
  <xsl:copy-of select="$footnote_inline"/>
4252
4430
  <fo:footnote-body>
4253
4431
 
4254
- <fo:block-container text-indent="0" start-indent="0">
4255
-
4432
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
4256
4433
 
4257
4434
  <fo:block xsl:use-attribute-sets="fn-body-style">
4258
4435
 
@@ -4271,7 +4448,7 @@
4271
4448
  <xsl:copy-of select="$footnote_inline"/>
4272
4449
  </xsl:otherwise>
4273
4450
  </xsl:choose>
4274
- </xsl:template><xsl:template name="fn_display">
4451
+ </xsl:template><xsl:template name="table_fn_display">
4275
4452
  <xsl:variable name="references">
4276
4453
 
4277
4454
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
@@ -4282,39 +4459,26 @@
4282
4459
  <xsl:for-each select="xalan:nodeset($references)//fn">
4283
4460
  <xsl:variable name="reference" select="@reference"/>
4284
4461
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4285
- <fo:block margin-bottom="12pt">
4462
+ <fo:block xsl:use-attribute-sets="table-fn-style">
4286
4463
 
4287
4464
 
4288
4465
 
4289
-
4290
-
4291
- <xsl:attribute name="font-size">8pt</xsl:attribute>
4292
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4293
- <xsl:attribute name="text-indent">-6mm</xsl:attribute>
4294
- <xsl:attribute name="margin-left">6mm</xsl:attribute>
4295
-
4296
-
4297
-
4298
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
4466
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4299
4467
 
4300
4468
 
4301
4469
 
4302
4470
 
4303
- <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4304
- <xsl:attribute name="font-size">70%</xsl:attribute>
4305
4471
 
4472
+ <xsl:value-of select="@reference"/>
4306
4473
 
4307
4474
 
4308
4475
 
4309
4476
 
4310
- <xsl:value-of select="@reference"/>
4311
4477
 
4312
4478
 
4313
4479
 
4314
4480
  </fo:inline>
4315
- <fo:inline>
4316
-
4317
- <!-- <xsl:apply-templates /> -->
4481
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4318
4482
  <xsl:copy-of select="./node()"/>
4319
4483
  </fo:inline>
4320
4484
  </fo:block>
@@ -4326,15 +4490,7 @@
4326
4490
 
4327
4491
  <xsl:apply-templates/>
4328
4492
  </fn>
4329
- </xsl:template><xsl:template name="fn_name_display">
4330
- <!-- <xsl:variable name="references">
4331
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
4332
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
4333
- <xsl:apply-templates />
4334
- </fn>
4335
- </xsl:for-each>
4336
- </xsl:variable>
4337
- $references=<xsl:copy-of select="$references"/> -->
4493
+ </xsl:template><xsl:template name="table_name_fn_display">
4338
4494
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
4339
4495
  <xsl:variable name="reference" select="@reference"/>
4340
4496
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -4343,9 +4499,7 @@
4343
4499
  </fo:block>
4344
4500
  </xsl:for-each>
4345
4501
  </xsl:template><xsl:template name="fn_display_figure">
4346
- <xsl:variable name="key_iso">
4347
- true <!-- and (not(@class) or @class !='pseudocode') -->
4348
- </xsl:variable>
4502
+
4349
4503
  <xsl:variable name="references">
4350
4504
  <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
4351
4505
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -4353,50 +4507,52 @@
4353
4507
  </fn>
4354
4508
  </xsl:for-each>
4355
4509
  </xsl:variable>
4510
+
4511
+ <xsl:if test="xalan:nodeset($references)//fn">
4356
4512
 
4357
- <!-- current hierarchy is 'figure' element -->
4358
- <xsl:variable name="following_dl_colwidths">
4359
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
4360
- <xsl:variable name="html-table">
4361
- <xsl:variable name="doc_ns">
4513
+ <xsl:variable name="key_iso">
4514
+ true
4515
+ </xsl:variable>
4516
+
4517
+ <!-- current hierarchy is 'figure' element -->
4518
+ <xsl:variable name="following_dl_colwidths">
4519
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
4520
+ <xsl:variable name="html-table">
4521
+ <xsl:variable name="doc_ns">
4522
+
4523
+ </xsl:variable>
4524
+ <xsl:variable name="ns">
4525
+ <xsl:choose>
4526
+ <xsl:when test="normalize-space($doc_ns) != ''">
4527
+ <xsl:value-of select="normalize-space($doc_ns)"/>
4528
+ </xsl:when>
4529
+ <xsl:otherwise>
4530
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
4531
+ </xsl:otherwise>
4532
+ </xsl:choose>
4533
+ </xsl:variable>
4362
4534
 
4363
- </xsl:variable>
4364
- <xsl:variable name="ns">
4365
- <xsl:choose>
4366
- <xsl:when test="normalize-space($doc_ns) != ''">
4367
- <xsl:value-of select="normalize-space($doc_ns)"/>
4368
- </xsl:when>
4369
- <xsl:otherwise>
4370
- <xsl:value-of select="substring-before(name(/*), '-')"/>
4371
- </xsl:otherwise>
4372
- </xsl:choose>
4373
- </xsl:variable>
4374
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
4375
- <!-- <xsl:element name="{$ns}:table"> -->
4376
4535
  <xsl:for-each select="*[local-name() = 'dl'][1]">
4377
4536
  <tbody>
4378
4537
  <xsl:apply-templates mode="dl"/>
4379
4538
  </tbody>
4380
4539
  </xsl:for-each>
4381
- <!-- </xsl:element> -->
4382
- </xsl:variable>
4383
-
4384
- <xsl:call-template name="calculate-column-widths">
4385
- <xsl:with-param name="cols-count" select="2"/>
4386
- <xsl:with-param name="table" select="$html-table"/>
4387
- </xsl:call-template>
4388
-
4389
- </xsl:if>
4390
- </xsl:variable>
4391
-
4392
-
4393
- <xsl:variable name="maxlength_dt">
4394
- <xsl:for-each select="*[local-name() = 'dl'][1]">
4395
- <xsl:call-template name="getMaxLength_dt"/>
4396
- </xsl:for-each>
4397
- </xsl:variable>
4398
-
4399
- <xsl:if test="xalan:nodeset($references)//fn">
4540
+ </xsl:variable>
4541
+
4542
+ <xsl:call-template name="calculate-column-widths">
4543
+ <xsl:with-param name="cols-count" select="2"/>
4544
+ <xsl:with-param name="table" select="$html-table"/>
4545
+ </xsl:call-template>
4546
+
4547
+ </xsl:if>
4548
+ </xsl:variable>
4549
+
4550
+ <xsl:variable name="maxlength_dt">
4551
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
4552
+ <xsl:call-template name="getMaxLength_dt"/>
4553
+ </xsl:for-each>
4554
+ </xsl:variable>
4555
+
4400
4556
  <fo:block>
4401
4557
  <fo:table width="95%" table-layout="fixed">
4402
4558
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -4424,28 +4580,17 @@
4424
4580
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4425
4581
  <fo:table-row>
4426
4582
  <fo:table-cell>
4427
- <fo:block>
4428
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
4429
-
4430
- <!-- <xsl:attribute name="font-family">Times New Roman</xsl:attribute> -->
4431
- <xsl:attribute name="baseline-shift">65%</xsl:attribute>
4432
-
4583
+ <fo:block>
4584
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
4433
4585
  <xsl:value-of select="@reference"/>
4434
4586
  </fo:inline>
4435
4587
  </fo:block>
4436
4588
  </fo:table-cell>
4437
4589
  <fo:table-cell>
4438
- <fo:block text-align="justify" margin-bottom="12pt">
4439
-
4440
- <xsl:attribute name="margin-top">5pt</xsl:attribute>
4441
-
4590
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
4442
4591
  <xsl:if test="normalize-space($key_iso) = 'true'">
4443
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
4592
+
4444
4593
  </xsl:if>
4445
-
4446
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
4447
-
4448
- <!-- <xsl:apply-templates /> -->
4449
4594
  <xsl:copy-of select="./node()"/>
4450
4595
  </fo:block>
4451
4596
  </fo:table-cell>
@@ -4458,24 +4603,17 @@
4458
4603
  </xsl:if>
4459
4604
 
4460
4605
  </xsl:template><xsl:template match="*[local-name()='fn']">
4461
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
4462
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
4606
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
4607
+
4463
4608
 
4464
4609
 
4465
4610
 
4466
4611
  <xsl:if test="ancestor::*[local-name()='table']">
4467
4612
  <xsl:attribute name="font-weight">normal</xsl:attribute>
4468
- <!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
4469
4613
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
4470
4614
  </xsl:if>
4471
4615
 
4472
4616
 
4473
-
4474
-
4475
-
4476
-
4477
-
4478
-
4479
4617
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4480
4618
 
4481
4619
 
@@ -4495,10 +4633,10 @@
4495
4633
  <xsl:variable name="isDeleted" select="@deleted"/>
4496
4634
  <fo:block-container>
4497
4635
 
4498
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
4499
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
4500
- </xsl:if>
4501
-
4636
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
4637
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
4638
+ </xsl:if>
4639
+
4502
4640
 
4503
4641
  <xsl:if test="parent::*[local-name() = 'note']">
4504
4642
  <xsl:attribute name="margin-left">
@@ -4515,11 +4653,11 @@
4515
4653
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4516
4654
  </xsl:call-template>
4517
4655
 
4518
- <fo:block-container>
4519
-
4520
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
4521
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
4656
+ <fo:block-container margin-left="0mm">
4657
+
4522
4658
 
4659
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
4660
+
4523
4661
 
4524
4662
  <xsl:variable name="parent" select="local-name(..)"/>
4525
4663
 
@@ -4532,30 +4670,26 @@
4532
4670
  <xsl:choose>
4533
4671
  <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
4534
4672
 
4535
- <fo:block text-align="left">
4536
-
4537
- <xsl:attribute name="margin-bottom">15pt</xsl:attribute>
4538
-
4539
-
4540
- <xsl:variable name="title-where">
4673
+ <fo:block text-align="left">
4541
4674
 
4675
+ <xsl:attribute name="margin-bottom">15pt</xsl:attribute>
4542
4676
 
4543
- <xsl:call-template name="getTitle">
4544
- <xsl:with-param name="name" select="'title-where'"/>
4677
+
4678
+ <xsl:variable name="title-where">
4679
+ <xsl:call-template name="getLocalizedString">
4680
+ <xsl:with-param name="key">where</xsl:with-param>
4545
4681
  </xsl:call-template>
4682
+ </xsl:variable>
4683
+ <xsl:value-of select="$title-where"/>
4684
+ </fo:block>
4685
+ <fo:block>
4546
4686
 
4547
- </xsl:variable>
4548
- <xsl:value-of select="$title-where"/>
4549
- </fo:block>
4550
- <fo:block>
4551
-
4552
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
4553
-
4554
- <xsl:text> </xsl:text>
4555
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4556
- </fo:block>
4557
-
4558
-
4687
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
4688
+
4689
+ <xsl:text> </xsl:text>
4690
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4691
+ </fo:block>
4692
+
4559
4693
  </xsl:when>
4560
4694
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4561
4695
  <fo:block margin-bottom="12pt" text-align="left">
@@ -4566,12 +4700,9 @@
4566
4700
 
4567
4701
 
4568
4702
  <xsl:variable name="title-where">
4569
-
4570
-
4571
- <xsl:call-template name="getTitle">
4572
- <xsl:with-param name="name" select="'title-where'"/>
4573
- </xsl:call-template>
4574
-
4703
+ <xsl:call-template name="getLocalizedString">
4704
+ <xsl:with-param name="key">where</xsl:with-param>
4705
+ </xsl:call-template>
4575
4706
  </xsl:variable>
4576
4707
  <xsl:value-of select="$title-where"/>
4577
4708
  </fo:block>
@@ -4586,12 +4717,9 @@
4586
4717
 
4587
4718
 
4588
4719
  <xsl:variable name="title-key">
4589
-
4590
-
4591
- <xsl:call-template name="getTitle">
4592
- <xsl:with-param name="name" select="'title-key'"/>
4593
- </xsl:call-template>
4594
-
4720
+ <xsl:call-template name="getLocalizedString">
4721
+ <xsl:with-param name="key">key</xsl:with-param>
4722
+ </xsl:call-template>
4595
4723
  </xsl:variable>
4596
4724
  <xsl:value-of select="$title-key"/>
4597
4725
  </fo:block>
@@ -4613,9 +4741,7 @@
4613
4741
  <fo:table width="95%" table-layout="fixed">
4614
4742
 
4615
4743
  <xsl:choose>
4616
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
4617
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
4618
- </xsl:when>
4744
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
4619
4745
  <xsl:when test="normalize-space($key_iso) = 'true'">
4620
4746
  <xsl:attribute name="font-size">10pt</xsl:attribute>
4621
4747
 
@@ -4638,12 +4764,9 @@
4638
4764
  </xsl:otherwise>
4639
4765
  </xsl:choose>
4640
4766
  </xsl:variable>
4641
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
4642
- <!-- <xsl:element name="{$ns}:table"> -->
4643
- <tbody>
4644
- <xsl:apply-templates mode="dl"/>
4645
- </tbody>
4646
- <!-- </xsl:element> -->
4767
+ <tbody>
4768
+ <xsl:apply-templates mode="dl"/>
4769
+ </tbody>
4647
4770
  </xsl:variable>
4648
4771
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
4649
4772
  <xsl:variable name="colwidths">
@@ -4723,8 +4846,6 @@
4723
4846
  </xsl:for-each>
4724
4847
  </xsl:otherwise>
4725
4848
  </xsl:choose>
4726
- <!-- <fo:table-column column-width="15%"/>
4727
- <fo:table-column column-width="85%"/> -->
4728
4849
  </xsl:otherwise>
4729
4850
  </xsl:choose>
4730
4851
  </xsl:template><xsl:template name="getMaxLength_dt">
@@ -4739,12 +4860,6 @@
4739
4860
  </xsl:for-each>
4740
4861
  </xsl:variable>
4741
4862
  <xsl:variable name="maxLength">
4742
- <!-- <xsl:for-each select="*[local-name()='dt']">
4743
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
4744
- <xsl:if test="position() = 1">
4745
- <xsl:value-of select="string-length(normalize-space(.))"/>
4746
- </xsl:if>
4747
- </xsl:for-each> -->
4748
4863
  <xsl:for-each select="xalan:nodeset($lengths)/length">
4749
4864
  <xsl:sort select="." data-type="number" order="descending"/>
4750
4865
  <xsl:if test="position() = 1">
@@ -4770,12 +4885,12 @@
4770
4885
  <xsl:if test="normalize-space($key_iso) = 'true'">
4771
4886
  <xsl:attribute name="margin-top">0</xsl:attribute>
4772
4887
  </xsl:if>
4773
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4888
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4774
4889
  </fo:block>
4775
4890
  </fo:table-cell>
4776
4891
  <fo:table-cell>
4777
4892
  <fo:block>
4778
- <xsl:apply-templates/>
4893
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4779
4894
  </fo:block>
4780
4895
  </fo:table-cell>
4781
4896
  </fo:table-row>
@@ -4786,84 +4901,49 @@
4786
4901
  </td>
4787
4902
  <td>
4788
4903
 
4789
-
4790
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4791
-
4904
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4905
+ <xsl:with-param name="process">true</xsl:with-param>
4906
+ </xsl:apply-templates>
4907
+
4792
4908
  </td>
4793
4909
  </tr>
4794
4910
 
4795
4911
  </xsl:template><xsl:template match="*[local-name()='dt']">
4796
4912
  <xsl:param name="key_iso"/>
4797
4913
 
4798
- <fo:table-row>
4799
-
4800
-
4914
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
4801
4915
  <fo:table-cell>
4802
4916
 
4803
- <fo:block margin-top="6pt">
4917
+ <fo:block xsl:use-attribute-sets="dt-style">
4804
4918
  <xsl:copy-of select="@id"/>
4805
4919
 
4806
-
4807
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
4808
-
4809
4920
  <xsl:if test="normalize-space($key_iso) = 'true'">
4810
4921
  <xsl:attribute name="margin-top">0</xsl:attribute>
4811
-
4812
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
4813
-
4814
4922
  </xsl:if>
4815
4923
 
4816
4924
 
4817
4925
 
4818
-
4819
-
4820
-
4821
-
4822
4926
  <xsl:apply-templates/>
4823
- <!-- <xsl:if test="$namespace = 'gb'">
4824
- <xsl:if test="ancestor::*[local-name()='formula']">
4825
- <xsl:text>—</xsl:text>
4826
- </xsl:if>
4827
- </xsl:if> -->
4828
4927
  </fo:block>
4829
4928
  </fo:table-cell>
4830
4929
  <fo:table-cell>
4831
4930
  <fo:block>
4832
4931
 
4833
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
4834
- <xsl:if test="local-name(*[1]) != 'stem'">
4835
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4836
- </xsl:if>
4837
- </xsl:if> -->
4838
-
4839
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4840
-
4932
+
4933
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4934
+ <xsl:with-param name="process">true</xsl:with-param>
4935
+ </xsl:apply-templates>
4841
4936
  </fo:block>
4842
4937
  </fo:table-cell>
4843
4938
  </fo:table-row>
4844
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
4845
- <xsl:if test="local-name(*[1]) = 'stem'">
4846
- <fo:table-row>
4847
- <fo:table-cell>
4848
- <fo:block margin-top="6pt">
4849
- <xsl:if test="normalize-space($key_iso) = 'true'">
4850
- <xsl:attribute name="margin-top">0</xsl:attribute>
4851
- </xsl:if>
4852
- <xsl:text>&#xA0;</xsl:text>
4853
- </fo:block>
4854
- </fo:table-cell>
4855
- <fo:table-cell>
4856
- <fo:block>
4857
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4858
- </fo:block>
4859
- </fo:table-cell>
4860
- </fo:table-row>
4861
- </xsl:if>
4862
- </xsl:if> -->
4863
4939
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
4864
4940
  <xsl:apply-templates/>
4865
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
4866
- <xsl:apply-templates/>
4941
+ </xsl:template><xsl:template match="*[local-name()='dd']">
4942
+ <xsl:param name="process">false</xsl:param>
4943
+ <xsl:if test="$process = 'true'">
4944
+ <xsl:apply-templates select="@language"/>
4945
+ <xsl:apply-templates/>
4946
+ </xsl:if>
4867
4947
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4868
4948
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4869
4949
  </xsl:template><xsl:template match="*[local-name()='em']">
@@ -4887,6 +4967,7 @@
4887
4967
  </fo:inline>
4888
4968
  </xsl:template><xsl:template match="*[local-name()='tt']">
4889
4969
  <fo:inline xsl:use-attribute-sets="tt-style">
4970
+
4890
4971
  <xsl:variable name="_font-size">
4891
4972
 
4892
4973
 
@@ -4923,7 +5004,22 @@
4923
5004
  <xsl:apply-templates/>
4924
5005
  </fo:inline>
4925
5006
  </xsl:template><xsl:template match="*[local-name()='add']">
5007
+ <xsl:param name="skip">true</xsl:param>
4926
5008
  <xsl:choose>
5009
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
5010
+ <xsl:choose>
5011
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
5012
+ <xsl:otherwise>
5013
+ <fo:inline>
5014
+ <xsl:call-template name="insertTag">
5015
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
5016
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
5017
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
5018
+ </xsl:call-template>
5019
+ </fo:inline>
5020
+ </xsl:otherwise>
5021
+ </xsl:choose>
5022
+ </xsl:when>
4927
5023
  <xsl:when test="@amendment">
4928
5024
  <fo:inline>
4929
5025
  <xsl:call-template name="insertTag">
@@ -4958,7 +5054,6 @@
4958
5054
  </fo:inline>
4959
5055
  </xsl:otherwise>
4960
5056
  </xsl:choose>
4961
-
4962
5057
  </xsl:template><xsl:template name="insertTag">
4963
5058
  <xsl:param name="type"/>
4964
5059
  <xsl:param name="kind"/>
@@ -4966,22 +5061,20 @@
4966
5061
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
4967
5062
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
4968
5063
  <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
4969
- <!-- <xsl:attribute name="width">7mm</xsl:attribute>
4970
- <xsl:attribute name="content-height">100%</xsl:attribute> -->
4971
5064
  <xsl:attribute name="height">5mm</xsl:attribute>
4972
5065
  <xsl:attribute name="content-width">100%</xsl:attribute>
4973
5066
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4974
5067
  <xsl:attribute name="scaling">uniform</xsl:attribute>
4975
5068
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4976
5069
  <g>
4977
- <xsl:if test="$type = 'closing'">
5070
+ <xsl:if test="$type = 'closing' or $type = 'end'">
4978
5071
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
4979
5072
  </xsl:if>
4980
5073
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
4981
5074
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
4982
5075
  </g>
4983
5076
  <text font-family="Arial" x="15" y="57" font-size="40pt">
4984
- <xsl:if test="$type = 'closing'">
5077
+ <xsl:if test="$type = 'closing' or $type = 'end'">
4985
5078
  <xsl:attribute name="x">25</xsl:attribute>
4986
5079
  </xsl:if>
4987
5080
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -5025,7 +5118,11 @@
5025
5118
  <xsl:with-param name="text" select="substring($text,2)"/>
5026
5119
  </xsl:call-template>
5027
5120
  </xsl:if>
5028
- </xsl:template><xsl:template name="tokenize">
5121
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
5122
+ <fo:block break-after="page"/>
5123
+ <fo:block> </fo:block>
5124
+ <fo:block break-after="page"/>
5125
+ </xsl:template><xsl:template name="tokenize">
5029
5126
  <xsl:param name="text"/>
5030
5127
  <xsl:param name="separator" select="' '"/>
5031
5128
  <xsl:choose>
@@ -5185,14 +5282,6 @@
5185
5282
 
5186
5283
  <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
5187
5284
 
5188
- <!-- <xsl:choose>
5189
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
5190
-
5191
- </xsl:when>
5192
- <xsl:otherwise>
5193
- <xsl:copy-of select="current()"/>
5194
- </xsl:otherwise>
5195
- </xsl:choose> -->
5196
5285
  </xsl:variable>
5197
5286
  <xsl:copy-of select="$simple-table"/>
5198
5287
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
@@ -5311,8 +5400,6 @@
5311
5400
  <xsl:choose>
5312
5401
  <xsl:when test="contains($str2, ' ')">
5313
5402
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
5314
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
5315
- <xsl:value-of select="substring($substr, 2)"/> -->
5316
5403
  <xsl:call-template name="capitalize">
5317
5404
  <xsl:with-param name="str" select="$substr"/>
5318
5405
  </xsl:call-template>
@@ -5322,8 +5409,6 @@
5322
5409
  </xsl:call-template>
5323
5410
  </xsl:when>
5324
5411
  <xsl:otherwise>
5325
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
5326
- <xsl:value-of select="substring($str2, 2)"/> -->
5327
5412
  <xsl:call-template name="capitalize">
5328
5413
  <xsl:with-param name="str" select="$str2"/>
5329
5414
  </xsl:call-template>
@@ -5351,6 +5436,7 @@
5351
5436
  <xsl:apply-templates select="." mode="mathml"/>
5352
5437
  </xsl:variable>
5353
5438
  <fo:instream-foreign-object fox:alt-text="Math">
5439
+
5354
5440
 
5355
5441
 
5356
5442
  <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
@@ -5382,7 +5468,7 @@
5382
5468
  </xsl:attribute>
5383
5469
 
5384
5470
 
5385
- <!-- <xsl:copy-of select="."/> -->
5471
+
5386
5472
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
5387
5473
  </fo:instream-foreign-object>
5388
5474
  </fo:inline>
@@ -5439,12 +5525,16 @@
5439
5525
  </xsl:variable>
5440
5526
  <fo:inline xsl:use-attribute-sets="link-style">
5441
5527
 
5528
+
5529
+
5530
+
5442
5531
  <xsl:if test="ancestor::*[local-name()='feedback-statement']">
5443
5532
  <xsl:attribute name="color">blue</xsl:attribute>
5444
5533
  </xsl:if>
5445
5534
 
5446
5535
 
5447
5536
 
5537
+
5448
5538
  <xsl:choose>
5449
5539
  <xsl:when test="$target_text = ''">
5450
5540
  <xsl:apply-templates/>
@@ -5468,19 +5558,19 @@
5468
5558
  </fo:inline>
5469
5559
  </xsl:template><xsl:template match="*[local-name()='appendix']">
5470
5560
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
5471
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
5561
+ <xsl:apply-templates select="*[local-name()='title']"/>
5472
5562
  </fo:block>
5473
- <xsl:apply-templates/>
5474
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
5563
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
5564
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
5475
5565
  <xsl:variable name="level">
5476
5566
  <xsl:call-template name="getLevel"/>
5477
5567
  </xsl:variable>
5478
5568
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
5479
5569
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
5480
5570
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
5481
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5571
+ <xsl:apply-templates select="*[local-name()='name']"/>
5482
5572
  </fo:block>
5483
- <xsl:apply-templates/>
5573
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
5484
5574
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
5485
5575
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
5486
5576
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -5502,7 +5592,6 @@
5502
5592
  </fo:inline>
5503
5593
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
5504
5594
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5505
-
5506
5595
  <xsl:apply-templates/>
5507
5596
  </fo:basic-link>
5508
5597
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -5530,49 +5619,64 @@
5530
5619
  <fo:inline>
5531
5620
  <xsl:apply-templates/>
5532
5621
  </fo:inline>
5533
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
5622
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand -->
5534
5623
  <xsl:if test="normalize-space() != ''">
5535
5624
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
5536
5625
  </xsl:if>
5537
5626
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
5538
5627
 
5539
5628
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5629
+
5630
+
5540
5631
 
5541
5632
 
5542
5633
 
5543
5634
 
5544
5635
 
5636
+
5637
+
5638
+
5639
+
5545
5640
  <fo:block-container margin-left="0mm">
5641
+
5546
5642
 
5547
5643
 
5548
5644
 
5645
+
5549
5646
 
5550
-
5551
-
5552
-
5553
-
5554
- <fo:block>
5555
-
5556
-
5557
-
5558
-
5559
-
5647
+ <fo:block>
5648
+
5649
+
5560
5650
 
5561
- <fo:inline xsl:use-attribute-sets="note-name-style">
5562
5651
 
5563
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5564
- </fo:inline>
5565
- <xsl:apply-templates/>
5566
- </fo:block>
5567
-
5568
-
5652
+
5653
+
5654
+
5655
+ <fo:inline xsl:use-attribute-sets="note-name-style">
5656
+
5657
+
5658
+
5659
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
5660
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
5661
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
5662
+ <xsl:with-param name="skip">false</xsl:with-param>
5663
+ </xsl:apply-templates>
5664
+ </xsl:if>
5665
+
5666
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5667
+
5668
+ </fo:inline>
5669
+
5670
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5671
+ </fo:block>
5672
+
5569
5673
  </fo:block-container>
5570
5674
  </fo:block-container>
5571
5675
 
5572
5676
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
5573
5677
  <xsl:variable name="num"><xsl:number/></xsl:variable>
5574
5678
  <xsl:choose>
5575
- <xsl:when test="$num = 1">
5679
+ <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
5576
5680
  <fo:inline xsl:use-attribute-sets="note-p-style">
5577
5681
  <xsl:apply-templates/>
5578
5682
  </fo:inline>
@@ -5587,12 +5691,16 @@
5587
5691
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
5588
5692
 
5589
5693
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5694
+
5695
+
5696
+
5697
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5590
5698
 
5591
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5592
5699
  </fo:inline>
5593
- <xsl:apply-templates/>
5700
+
5701
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5594
5702
  </fo:block>
5595
- </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
5703
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
5596
5704
  <xsl:param name="sfx"/>
5597
5705
  <xsl:variable name="suffix">
5598
5706
  <xsl:choose>
@@ -5609,7 +5717,7 @@
5609
5717
  <xsl:apply-templates/>
5610
5718
  <xsl:value-of select="$suffix"/>
5611
5719
  </xsl:if>
5612
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
5720
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']">
5613
5721
  <xsl:param name="sfx"/>
5614
5722
  <xsl:variable name="suffix">
5615
5723
  <xsl:choose>
@@ -5636,25 +5744,23 @@
5636
5744
  <xsl:apply-templates/>
5637
5745
  </fo:block>
5638
5746
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5639
- <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5640
5747
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5641
5748
 
5642
5749
 
5750
+
5751
+
5643
5752
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5644
5753
 
5645
5754
  </xsl:if>
5646
- <xsl:apply-templates/>
5755
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5647
5756
  </fo:block>
5648
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5757
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
5649
5758
  <xsl:if test="normalize-space() != ''">
5650
5759
  <xsl:variable name="level">
5651
5760
  <xsl:call-template name="getLevelTermName"/>
5652
5761
  </xsl:variable>
5653
5762
  <fo:inline role="H{$level}">
5654
5763
  <xsl:apply-templates/>
5655
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5656
- <xsl:text>.</xsl:text>
5657
- </xsl:if> -->
5658
5764
  </fo:inline>
5659
5765
  </xsl:if>
5660
5766
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
@@ -5667,9 +5773,10 @@
5667
5773
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
5668
5774
  </xsl:call-template>
5669
5775
 
5670
- <fo:block>
5671
-
5672
- <xsl:apply-templates/>
5776
+
5777
+
5778
+ <fo:block xsl:use-attribute-sets="figure-style">
5779
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5673
5780
  </fo:block>
5674
5781
  <xsl:call-template name="fn_display_figure"/>
5675
5782
  <xsl:for-each select="*[local-name() = 'note']">
@@ -5677,14 +5784,15 @@
5677
5784
  </xsl:for-each>
5678
5785
 
5679
5786
 
5680
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5787
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
5788
+
5681
5789
 
5682
5790
  </fo:block-container>
5683
5791
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
5684
5792
  <fo:block id="{@id}">
5685
- <xsl:apply-templates/>
5793
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5686
5794
  </fo:block>
5687
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5795
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5688
5796
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
5689
5797
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
5690
5798
  <xsl:apply-templates/>
@@ -5791,9 +5899,7 @@
5791
5899
  <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
5792
5900
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
5793
5901
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
5794
- <!-- width=<xsl:value-of select="$width"/> -->
5795
5902
  <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
5796
- <!-- height=<xsl:value-of select="$height"/> -->
5797
5903
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
5798
5904
  <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
5799
5905
  <xsl:call-template name="svg_cross">
@@ -6063,7 +6169,7 @@
6063
6169
  </fo:basic-link>
6064
6170
  </fo:block>
6065
6171
  </fo:block-container>
6066
- </xsl:template><xsl:template match="*[local-name() = 'emf']"/><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">
6172
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><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">
6067
6173
  <xsl:apply-templates mode="contents"/>
6068
6174
  <xsl:text> </xsl:text>
6069
6175
  </xsl:template><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'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
@@ -6075,11 +6181,72 @@
6075
6181
  <xsl:value-of select="."/>
6076
6182
  </xsl:template><xsl:template match="node()" mode="contents">
6077
6183
  <xsl:apply-templates mode="contents"/>
6184
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
6185
+ <xsl:variable name="level">
6186
+ <xsl:call-template name="getLevel">
6187
+ <xsl:with-param name="depth" select="@depth"/>
6188
+ </xsl:call-template>
6189
+ </xsl:variable>
6190
+
6191
+ <xsl:variable name="section">
6192
+ <xsl:choose>
6193
+ <xsl:when test="@type = 'section-title'"/>
6194
+ <xsl:otherwise>
6195
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
6196
+ </xsl:otherwise>
6197
+ </xsl:choose>
6198
+ </xsl:variable>
6199
+
6200
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
6201
+
6202
+ <xsl:variable name="display">
6203
+ <xsl:choose>
6204
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
6205
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
6206
+ <xsl:otherwise>false</xsl:otherwise>
6207
+ </xsl:choose>
6208
+ </xsl:variable>
6209
+
6210
+ <xsl:variable name="skip">false</xsl:variable>
6211
+
6212
+ <xsl:if test="$skip = 'false'">
6213
+
6214
+ <xsl:variable name="title">
6215
+ <xsl:choose>
6216
+ <xsl:when test="*[local-name() = 'tab']">
6217
+ <xsl:choose>
6218
+ <xsl:when test="@type = 'section-title'">
6219
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
6220
+ <xsl:text>: </xsl:text>
6221
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
6222
+ </xsl:when>
6223
+ <xsl:otherwise>
6224
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
6225
+ </xsl:otherwise>
6226
+ </xsl:choose>
6227
+ </xsl:when>
6228
+ <xsl:otherwise>
6229
+ <xsl:copy-of select="node()"/>
6230
+ </xsl:otherwise>
6231
+ </xsl:choose>
6232
+ </xsl:variable>
6233
+
6234
+ <xsl:variable name="root">
6235
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
6236
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
6237
+ </xsl:variable>
6238
+
6239
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
6240
+ <title>
6241
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
6242
+ </title>
6243
+ </item>
6244
+ </xsl:if>
6078
6245
  </xsl:template><xsl:template match="node()" mode="bookmarks">
6079
6246
  <xsl:apply-templates mode="bookmarks"/>
6080
6247
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
6081
6248
  <xsl:apply-templates select="."/>
6082
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
6249
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
6083
6250
  <xsl:apply-templates mode="bookmarks"/>
6084
6251
  </xsl:template><xsl:template name="addBookmarks">
6085
6252
  <xsl:param name="contents"/>
@@ -6169,8 +6336,6 @@
6169
6336
 
6170
6337
 
6171
6338
 
6172
-
6173
-
6174
6339
  </fo:bookmark-tree>
6175
6340
  </xsl:if>
6176
6341
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -6241,7 +6406,7 @@
6241
6406
  <xsl:apply-templates mode="bookmark"/>
6242
6407
  </xsl:otherwise>
6243
6408
  </xsl:choose>
6244
- </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
6409
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
6245
6410
  <xsl:if test="normalize-space() != ''">
6246
6411
  <fo:block xsl:use-attribute-sets="figure-name-style">
6247
6412
 
@@ -6250,16 +6415,13 @@
6250
6415
  </fo:block>
6251
6416
  </xsl:if>
6252
6417
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
6253
- <xsl:apply-templates mode="contents_item"/>
6418
+ <xsl:param name="mode">bookmarks</xsl:param>
6419
+ <xsl:apply-templates mode="contents_item">
6420
+ <xsl:with-param name="mode" select="$mode"/>
6421
+ </xsl:apply-templates>
6254
6422
  <!-- <xsl:text> </xsl:text> -->
6255
6423
  </xsl:template><xsl:template name="getSection">
6256
6424
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
6257
- <!--
6258
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
6259
- <xsl:value-of select="."/>
6260
- </xsl:for-each>
6261
- -->
6262
-
6263
6425
  </xsl:template><xsl:template name="getName">
6264
6426
  <xsl:choose>
6265
6427
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -6323,9 +6485,26 @@
6323
6485
  <xsl:copy-of select="."/>
6324
6486
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
6325
6487
  <xsl:text> </xsl:text>
6488
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
6489
+ <xsl:param name="mode">bookmarks</xsl:param>
6490
+ <xsl:apply-templates mode="contents_item">
6491
+ <xsl:with-param name="mode" select="$mode"/>
6492
+ </xsl:apply-templates>
6493
+ </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item">
6494
+ <xsl:param name="mode">bookmarks</xsl:param>
6495
+ <xsl:choose>
6496
+ <xsl:when test="starts-with(text(), $ace_tag)">
6497
+ <xsl:if test="$mode = 'contents'">
6498
+ <xsl:copy>
6499
+ <xsl:apply-templates mode="contents_item"/>
6500
+ </xsl:copy>
6501
+ </xsl:if>
6502
+ </xsl:when>
6503
+ <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
6504
+ </xsl:choose>
6326
6505
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6327
6506
 
6328
- <fo:block-container margin-left="0mm">
6507
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6329
6508
  <xsl:copy-of select="@id"/>
6330
6509
 
6331
6510
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -6362,6 +6541,7 @@
6362
6541
 
6363
6542
 
6364
6543
  </xsl:variable>
6544
+
6365
6545
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6366
6546
  <xsl:if test="$font-size != ''">
6367
6547
  <xsl:attribute name="font-size">
@@ -6378,11 +6558,11 @@
6378
6558
 
6379
6559
 
6380
6560
 
6381
- <xsl:apply-templates/>
6561
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6382
6562
  </fo:block>
6383
6563
 
6384
6564
 
6385
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6565
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
6386
6566
 
6387
6567
 
6388
6568
 
@@ -6396,7 +6576,7 @@
6396
6576
  <xsl:call-template name="add-zero-spaces-java">
6397
6577
  <xsl:with-param name="text" select="$text"/>
6398
6578
  </xsl:call-template>
6399
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
6579
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
6400
6580
  <xsl:if test="normalize-space() != ''">
6401
6581
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
6402
6582
  <xsl:apply-templates/>
@@ -6404,10 +6584,10 @@
6404
6584
  </xsl:if>
6405
6585
  </xsl:template><xsl:template match="*[local-name() = 'permission']">
6406
6586
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
6407
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6408
- <xsl:apply-templates/>
6587
+ <xsl:apply-templates select="*[local-name()='name']"/>
6588
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6409
6589
  </fo:block>
6410
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
6590
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
6411
6591
  <xsl:if test="normalize-space() != ''">
6412
6592
  <fo:block xsl:use-attribute-sets="permission-name-style">
6413
6593
  <xsl:apply-templates/>
@@ -6420,13 +6600,13 @@
6420
6600
  </fo:block>
6421
6601
  </xsl:template><xsl:template match="*[local-name() = 'requirement']">
6422
6602
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
6423
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6424
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
6425
- <xsl:apply-templates select="@obligation" mode="presentation"/>
6426
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
6427
- <xsl:apply-templates/>
6603
+ <xsl:apply-templates select="*[local-name()='name']"/>
6604
+ <xsl:apply-templates select="*[local-name()='label']"/>
6605
+ <xsl:apply-templates select="@obligation"/>
6606
+ <xsl:apply-templates select="*[local-name()='subject']"/>
6607
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/>
6428
6608
  </fo:block>
6429
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
6609
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
6430
6610
  <xsl:if test="normalize-space() != ''">
6431
6611
  <fo:block xsl:use-attribute-sets="requirement-name-style">
6432
6612
 
@@ -6434,20 +6614,24 @@
6434
6614
 
6435
6615
  </fo:block>
6436
6616
  </xsl:if>
6437
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
6617
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']">
6438
6618
  <fo:block xsl:use-attribute-sets="requirement-label-style">
6439
6619
  <xsl:apply-templates/>
6440
6620
  </fo:block>
6441
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
6621
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation">
6442
6622
  <fo:block>
6443
6623
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
6444
6624
  </fo:block>
6625
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2">
6626
+ <fo:block xsl:use-attribute-sets="subject-style">
6627
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6628
+ </fo:block>
6445
6629
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
6446
6630
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
6447
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6448
- <xsl:apply-templates/>
6631
+ <xsl:apply-templates select="*[local-name()='name']"/>
6632
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6449
6633
  </fo:block>
6450
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
6634
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
6451
6635
  <xsl:if test="normalize-space() != ''">
6452
6636
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
6453
6637
  <xsl:apply-templates/>
@@ -6458,10 +6642,6 @@
6458
6642
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
6459
6643
  <xsl:apply-templates/>
6460
6644
  </fo:block>
6461
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6462
- <fo:block xsl:use-attribute-sets="subject-style">
6463
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6464
- </fo:block>
6465
6645
  </xsl:template><xsl:template match="*[local-name() = 'subject']">
6466
6646
  <fo:block xsl:use-attribute-sets="subject-style">
6467
6647
  <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
@@ -6505,8 +6685,6 @@
6505
6685
  </xsl:variable>
6506
6686
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
6507
6687
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
6508
- <!-- <fo:table-column column-width="35mm"/>
6509
- <fo:table-column column-width="115mm"/> -->
6510
6688
  <fo:table-column column-width="30%"/>
6511
6689
  <fo:table-column column-width="70%"/>
6512
6690
  </xsl:if>
@@ -6516,7 +6694,7 @@
6516
6694
  <xsl:if test=".//*[local-name() = 'fn']">
6517
6695
  <xsl:for-each select="*[local-name() = 'tbody']">
6518
6696
  <fo:block font-size="90%" border-bottom="1pt solid black">
6519
- <xsl:call-template name="fn_display"/>
6697
+ <xsl:call-template name="table_fn_display"/>
6520
6698
  </fo:block>
6521
6699
  </xsl:for-each>
6522
6700
  </xsl:if>
@@ -6533,7 +6711,6 @@
6533
6711
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
6534
6712
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
6535
6713
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
6536
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
6537
6714
  <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
6538
6715
  </xsl:if>
6539
6716
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -6546,34 +6723,11 @@
6546
6723
  </fo:table-row>
6547
6724
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
6548
6725
  <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
6549
- <xsl:attribute name="text-align">
6550
- <xsl:choose>
6551
- <xsl:when test="@align">
6552
- <xsl:value-of select="@align"/>
6553
- </xsl:when>
6554
- <xsl:otherwise>left</xsl:otherwise>
6555
- </xsl:choose>
6556
- </xsl:attribute>
6557
- <xsl:if test="@colspan">
6558
- <xsl:attribute name="number-columns-spanned">
6559
- <xsl:value-of select="@colspan"/>
6560
- </xsl:attribute>
6561
- </xsl:if>
6562
- <xsl:if test="@rowspan">
6563
- <xsl:attribute name="number-rows-spanned">
6564
- <xsl:value-of select="@rowspan"/>
6565
- </xsl:attribute>
6566
- </xsl:if>
6567
- <xsl:call-template name="display-align"/>
6726
+ <xsl:call-template name="setTextAlignment">
6727
+ <xsl:with-param name="default">left</xsl:with-param>
6728
+ </xsl:call-template>
6568
6729
 
6569
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
6570
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
6571
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
6572
- </xsl:if>
6573
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
6574
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
6575
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
6576
- </xsl:if> -->
6730
+ <xsl:call-template name="setTableCellAttributes"/>
6577
6731
 
6578
6732
  <fo:block>
6579
6733
  <xsl:apply-templates/>
@@ -6585,37 +6739,15 @@
6585
6739
  <xsl:attribute name="padding">0mm</xsl:attribute>
6586
6740
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
6587
6741
  </xsl:if>
6588
- <xsl:attribute name="text-align">
6589
- <xsl:choose>
6590
- <xsl:when test="@align">
6591
- <xsl:value-of select="@align"/>
6592
- </xsl:when>
6593
- <xsl:otherwise>left</xsl:otherwise>
6594
- </xsl:choose>
6595
- </xsl:attribute>
6596
- <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
6597
- <xsl:attribute name="font-weight">bold</xsl:attribute>
6598
- </xsl:if>
6599
- <xsl:if test="@colspan">
6600
- <xsl:attribute name="number-columns-spanned">
6601
- <xsl:value-of select="@colspan"/>
6602
- </xsl:attribute>
6603
- </xsl:if>
6604
- <xsl:if test="@rowspan">
6605
- <xsl:attribute name="number-rows-spanned">
6606
- <xsl:value-of select="@rowspan"/>
6607
- </xsl:attribute>
6742
+ <xsl:call-template name="setTextAlignment">
6743
+ <xsl:with-param name="default">left</xsl:with-param>
6744
+ </xsl:call-template>
6745
+
6746
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
6747
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6608
6748
  </xsl:if>
6609
- <xsl:call-template name="display-align"/>
6610
6749
 
6611
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
6612
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
6613
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
6614
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
6615
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
6616
- </xsl:if>
6617
- </xsl:if> -->
6618
- <!-- 2nd line and below -->
6750
+ <xsl:call-template name="setTableCellAttributes"/>
6619
6751
 
6620
6752
  <fo:block>
6621
6753
  <xsl:apply-templates/>
@@ -6627,15 +6759,15 @@
6627
6759
  <xsl:apply-templates/>
6628
6760
  </fo:block>
6629
6761
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
6630
- <fo:block> <!-- margin-bottom="10pt" -->
6762
+ <fo:block>
6631
6763
  <xsl:apply-templates/>
6632
6764
  </fo:block>
6633
6765
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
6634
6766
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
6635
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6636
- <xsl:apply-templates/>
6767
+ <xsl:apply-templates select="*[local-name()='name']"/>
6768
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6637
6769
  </fo:block>
6638
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
6770
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
6639
6771
  <xsl:if test="normalize-space() != ''">
6640
6772
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
6641
6773
  <xsl:apply-templates/>
@@ -6659,42 +6791,52 @@
6659
6791
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
6660
6792
 
6661
6793
 
6662
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6663
-
6664
- <xsl:variable name="element">
6665
-
6666
- inline
6667
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
6794
+ <xsl:variable name="fo_element">
6795
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
6796
+
6797
+ <xsl:choose>
6798
+ <!-- if example contains only one (except 'name') element (paragraph for example), then display it on the same line as EXAMPLE title -->
6799
+ <xsl:when test="count(*[not(local-name() = 'name')]) = 1">inline</xsl:when>
6800
+ <xsl:otherwise>block</xsl:otherwise>
6801
+ </xsl:choose>
6802
+
6668
6803
  </xsl:variable>
6669
6804
 
6805
+ <!-- display 'EXAMPLE' -->
6806
+ <xsl:apply-templates select="*[local-name()='name']">
6807
+ <xsl:with-param name="fo_element" select="$fo_element"/>
6808
+ </xsl:apply-templates>
6809
+
6670
6810
  <xsl:choose>
6671
- <xsl:when test="contains(normalize-space($element), 'block')">
6672
- <fo:block xsl:use-attribute-sets="example-body-style">
6673
- <xsl:apply-templates/>
6674
- </fo:block>
6811
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
6812
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
6813
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6814
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
6815
+ <xsl:with-param name="fo_element" select="$fo_element"/>
6816
+ </xsl:apply-templates>
6817
+ </fo:block-container>
6818
+ </fo:block-container>
6675
6819
  </xsl:when>
6676
6820
  <xsl:otherwise>
6677
6821
  <fo:inline>
6678
- <xsl:apply-templates/>
6822
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
6823
+ <xsl:with-param name="fo_element" select="$fo_element"/>
6824
+ </xsl:apply-templates>
6679
6825
  </fo:inline>
6680
6826
  </xsl:otherwise>
6681
6827
  </xsl:choose>
6682
6828
 
6683
6829
  </fo:block>
6684
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
6685
-
6686
- <xsl:variable name="element">
6687
-
6688
- inline
6689
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
6690
- </xsl:variable>
6830
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
6831
+ <xsl:param name="fo_element">block</xsl:param>
6832
+
6691
6833
  <xsl:choose>
6692
6834
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
6693
6835
  <fo:inline>
6694
6836
  <xsl:apply-templates/>
6695
6837
  </fo:inline>
6696
6838
  </xsl:when>
6697
- <xsl:when test="contains(normalize-space($element), 'block')">
6839
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
6698
6840
  <fo:block xsl:use-attribute-sets="example-name-style">
6699
6841
  <xsl:apply-templates/>
6700
6842
  </fo:block>
@@ -6707,14 +6849,15 @@
6707
6849
  </xsl:choose>
6708
6850
 
6709
6851
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
6852
+ <xsl:param name="fo_element">block</xsl:param>
6853
+
6710
6854
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6711
6855
  <xsl:variable name="element">
6712
- block
6713
-
6714
6856
 
6857
+ <xsl:value-of select="$fo_element"/>
6715
6858
  </xsl:variable>
6716
6859
  <xsl:choose>
6717
- <xsl:when test="normalize-space($element) = 'block'">
6860
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
6718
6861
  <fo:block xsl:use-attribute-sets="example-p-style">
6719
6862
 
6720
6863
  <xsl:apply-templates/>
@@ -6729,6 +6872,8 @@
6729
6872
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
6730
6873
  <fo:block xsl:use-attribute-sets="termsource-style">
6731
6874
 
6875
+
6876
+
6732
6877
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
6733
6878
  <xsl:variable name="termsource_text">
6734
6879
  <xsl:apply-templates/>
@@ -6766,9 +6911,7 @@
6766
6911
  <xsl:value-of select="."/>
6767
6912
  </xsl:if>
6768
6913
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
6769
- <fo:inline>
6770
-
6771
-
6914
+ <fo:inline xsl:use-attribute-sets="termsource-text-style">
6772
6915
  <xsl:value-of select="."/>
6773
6916
  </fo:inline>
6774
6917
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
@@ -6782,12 +6925,9 @@
6782
6925
  </fo:basic-link>
6783
6926
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
6784
6927
  <xsl:variable name="title-modified">
6785
-
6786
-
6787
- <xsl:call-template name="getTitle">
6788
- <xsl:with-param name="name" select="'title-modified'"/>
6789
- </xsl:call-template>
6790
-
6928
+ <xsl:call-template name="getLocalizedString">
6929
+ <xsl:with-param name="key">modified</xsl:with-param>
6930
+ </xsl:call-template>
6791
6931
  </xsl:variable>
6792
6932
 
6793
6933
  <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
@@ -6814,7 +6954,6 @@
6814
6954
  <fo:block-container margin-left="0mm">
6815
6955
 
6816
6956
  <fo:block xsl:use-attribute-sets="quote-style">
6817
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
6818
6957
 
6819
6958
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6820
6959
  </fo:block>
@@ -6857,15 +6996,13 @@
6857
6996
  </xsl:variable>
6858
6997
 
6859
6998
  <xsl:choose>
6860
- <xsl:when test="normalize-space($bibitemid) != ''">
6999
+ <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
6861
7000
  <fo:inline xsl:use-attribute-sets="eref-style">
6862
7001
  <xsl:if test="@type = 'footnote'">
6863
-
6864
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6865
- <xsl:attribute name="font-size">80%</xsl:attribute>
6866
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
6867
- <xsl:attribute name="vertical-align">super</xsl:attribute>
6868
-
7002
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7003
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
7004
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
7005
+ <xsl:attribute name="font-size">80%</xsl:attribute>
6869
7006
 
6870
7007
  </xsl:if>
6871
7008
 
@@ -6882,7 +7019,6 @@
6882
7019
 
6883
7020
 
6884
7021
 
6885
-
6886
7022
  </xsl:if>
6887
7023
 
6888
7024
 
@@ -6942,8 +7078,6 @@
6942
7078
  </xsl:choose>
6943
7079
  </xsl:variable>
6944
7080
 
6945
- <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6946
-
6947
7081
  <xsl:choose>
6948
7082
  <xsl:when test="$lang = 'zh'">
6949
7083
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -6978,12 +7112,9 @@
6978
7112
  </fo:block>
6979
7113
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
6980
7114
  <xsl:variable name="title-deprecated">
6981
-
6982
- <xsl:call-template name="getLocalizedString">
6983
- <xsl:with-param name="key">deprecated</xsl:with-param>
6984
- </xsl:call-template>
6985
-
6986
-
7115
+ <xsl:call-template name="getLocalizedString">
7116
+ <xsl:with-param name="key">deprecated</xsl:with-param>
7117
+ </xsl:call-template>
6987
7118
  </xsl:variable>
6988
7119
  <fo:block xsl:use-attribute-sets="deprecates-style">
6989
7120
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -6992,6 +7123,8 @@
6992
7123
  <xsl:if test="*[local-name() = 'strong']">
6993
7124
  <xsl:attribute name="font-weight">normal</xsl:attribute>
6994
7125
  </xsl:if>
7126
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
7127
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
6995
7128
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
6996
7129
  <fo:block xsl:use-attribute-sets="definition-style">
6997
7130
  <xsl:apply-templates/>
@@ -7000,7 +7133,6 @@
7000
7133
  <xsl:apply-templates/>
7001
7134
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
7002
7135
  <fo:inline> <xsl:apply-templates/></fo:inline>
7003
- <!-- <fo:block>&#xA0;</fo:block> -->
7004
7136
  <fo:block/>
7005
7137
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
7006
7138
 
@@ -7036,11 +7168,6 @@
7036
7168
  <xsl:apply-templates/>
7037
7169
  </fo:block>
7038
7170
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
7039
- <fo:block id="{@id}">
7040
- <xsl:apply-templates/>
7041
- </fo:block>
7042
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
7043
-
7044
7171
  <fo:block id="{@id}">
7045
7172
  <xsl:apply-templates/>
7046
7173
  </fo:block>
@@ -7057,6 +7184,53 @@
7057
7184
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
7058
7185
  <!-- 0xA0 to space replacement -->
7059
7186
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
7187
+ </xsl:template><xsl:variable name="ul_labels_">
7188
+
7189
+
7190
+
7191
+
7192
+
7193
+ <label level="1" font-size="10pt">•</label>
7194
+ <label level="2" font-size="10pt">—</label><!-- em dash -->
7195
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
7196
+
7197
+
7198
+
7199
+
7200
+
7201
+
7202
+
7203
+
7204
+
7205
+
7206
+
7207
+
7208
+
7209
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
7210
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
7211
+ <xsl:variable name="list_level">
7212
+ <xsl:choose>
7213
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
7214
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
7215
+ </xsl:choose>
7216
+ </xsl:variable>
7217
+ <xsl:choose>
7218
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
7219
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
7220
+ </xsl:when>
7221
+ <xsl:when test="$list_level mod 3 = 0">
7222
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
7223
+ </xsl:when>
7224
+ <xsl:when test="$list_level mod 2 = 0">
7225
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
7226
+ </xsl:when>
7227
+ <xsl:otherwise>
7228
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
7229
+ </xsl:otherwise>
7230
+ </xsl:choose>
7231
+ </xsl:template><xsl:template match="label" mode="ul_labels">
7232
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
7233
+ <xsl:value-of select="."/>
7060
7234
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
7061
7235
  <xsl:choose>
7062
7236
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -7263,20 +7437,107 @@
7263
7437
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
7264
7438
  <fo:block><xsl:apply-templates/></fo:block>
7265
7439
  </fo:table-cell>
7266
- </xsl:template><xsl:template name="processBibitem">
7440
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/><xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
7441
+
7442
+
7443
+
7444
+ <fo:block id="{@id}">
7445
+ <xsl:apply-templates/>
7446
+ </fo:block>
7447
+ </xsl:template><xsl:template match="*[local-name() = 'references']">
7448
+ <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
7449
+
7450
+ <fo:block break-after="page"/>
7451
+
7452
+ </xsl:if>
7453
+
7454
+ <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
7455
+ <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'">
7456
+ <fo:block break-after="page"/>
7457
+ </xsl:if>
7458
+ </xsl:if> -->
7459
+
7460
+ <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
7461
+ <xsl:apply-templates/>
7462
+ </fo:block>
7267
7463
 
7268
7464
 
7269
7465
 
7270
-
7271
7466
 
7467
+ <!-- horizontal line -->
7468
+ <fo:block-container text-align="center" margin-top="10mm">
7469
+ <fo:block>_____________</fo:block>
7470
+ </fo:block-container>
7272
7471
 
7273
-
7472
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']">
7473
+ <xsl:call-template name="bibitem"/>
7474
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
7274
7475
 
7476
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
7477
+ <xsl:call-template name="processBibitem"/>
7478
+ </fo:block>
7479
+
7480
+
7481
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
7482
+
7483
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
7484
+ $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
7485
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
7486
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
7487
+ <fo:list-item>
7488
+ <fo:list-item-label end-indent="label-end()">
7489
+ <fo:block>
7490
+ <fo:inline>
7491
+
7492
+ <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
7493
+ <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
7494
+ <xsl:number format="[1]"/>
7495
+ </xsl:if>
7496
+
7497
+ </fo:inline>
7498
+ </fo:block>
7499
+ </fo:list-item-label>
7500
+ <fo:list-item-body start-indent="body-start()">
7501
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
7502
+ <xsl:call-template name="processBibitem"/>
7503
+ </fo:block>
7504
+ </fo:list-item-body>
7505
+ </fo:list-item>
7506
+ </fo:list-block>
7507
+
7275
7508
 
7509
+ </xsl:template><xsl:template name="processBibitem">
7276
7510
 
7277
7511
 
7512
+ <!-- start bibitem processing -->
7513
+ <xsl:if test=".//*[local-name() = 'fn']">
7514
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
7515
+ </xsl:if>
7516
+ <xsl:variable name="docidentifier">
7517
+ <xsl:choose>
7518
+ <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
7519
+ <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
7520
+ </xsl:choose>
7521
+ </xsl:variable>
7522
+ <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
7523
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
7524
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
7525
+ <xsl:choose>
7526
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
7527
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
7528
+ </xsl:when>
7529
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
7530
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
7531
+ </xsl:when>
7532
+ <xsl:otherwise>
7533
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
7534
+ </xsl:otherwise>
7535
+ </xsl:choose>
7536
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
7537
+ <!-- end bibitem processing -->
7538
+
7278
7539
  </xsl:template><xsl:template name="processBibitemDocId">
7279
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
7540
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
7280
7541
  <xsl:choose>
7281
7542
  <xsl:when test="normalize-space($_doc_ident) != ''">
7282
7543
  <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -7290,7 +7551,7 @@
7290
7551
  <xsl:if test="$type != ''">
7291
7552
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
7292
7553
  </xsl:if> -->
7293
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
7554
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
7294
7555
  </xsl:otherwise>
7295
7556
  </xsl:choose>
7296
7557
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -7331,6 +7592,48 @@
7331
7592
  <xsl:value-of select="substring(.,1,1)"/>
7332
7593
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
7333
7594
  <fo:inline><xsl:apply-templates/></fo:inline>
7595
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
7596
+ <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
7597
+ <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
7598
+ <xsl:apply-templates/>
7599
+ </fo:inline>
7600
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
7601
+ <fo:footnote>
7602
+ <xsl:variable name="number">
7603
+
7604
+ <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
7605
+
7606
+ </xsl:variable>
7607
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
7608
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
7609
+ <xsl:value-of select="$number"/>
7610
+
7611
+ </fo:basic-link>
7612
+ </fo:inline>
7613
+ <fo:footnote-body>
7614
+ <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
7615
+ <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7616
+ <xsl:value-of select="$number"/>
7617
+
7618
+ </fo:inline>
7619
+ <xsl:apply-templates/>
7620
+ </fo:block>
7621
+ </fo:footnote-body>
7622
+ </fo:footnote>
7623
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
7624
+ <xsl:text> edition </xsl:text>
7625
+ <xsl:value-of select="."/>
7626
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
7627
+ <xsl:text> (</xsl:text>
7628
+ <fo:inline xsl:use-attribute-sets="link-style">
7629
+ <fo:basic-link external-destination="." fox:alt-text=".">
7630
+ <xsl:value-of select="."/>
7631
+ </fo:basic-link>
7632
+ </fo:inline>
7633
+ <xsl:text>)</xsl:text>
7634
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']">
7635
+
7636
+ <xsl:apply-templates/>
7334
7637
  </xsl:template><xsl:template match="*[local-name() = 'form']">
7335
7638
  <fo:block>
7336
7639
  <xsl:apply-templates/>
@@ -7396,27 +7699,14 @@
7396
7699
  <fo:block> </fo:block>
7397
7700
  </fo:block-container>
7398
7701
  </xsl:template><xsl:variable name="toc_level">
7702
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
7703
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
7704
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
7399
7705
  <xsl:choose>
7400
- <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
7706
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
7707
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
7401
7708
  <xsl:otherwise><!-- default value -->
7402
-
7403
-
7404
-
7405
-
7406
-
7407
7709
  3
7408
-
7409
-
7410
-
7411
-
7412
-
7413
-
7414
-
7415
-
7416
-
7417
-
7418
-
7419
-
7420
7710
  </xsl:otherwise>
7421
7711
  </xsl:choose>
7422
7712
  </xsl:variable><xsl:template match="*[local-name() = 'toc']">
@@ -7499,7 +7789,7 @@
7499
7789
  </td>
7500
7790
  </xsl:for-each>
7501
7791
  <td>333</td> <!-- page number, just for fill -->
7502
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7792
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7503
7793
  <fo:inline padding-right="5mm"> </fo:inline>
7504
7794
  <fo:inline><xsl:apply-templates/></fo:inline>
7505
7795
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -7510,6 +7800,62 @@
7510
7800
  </svg>
7511
7801
  </fo:instream-foreign-object>
7512
7802
  </fo:inline>
7803
+ </xsl:template><xsl:template match="@language">
7804
+ <xsl:copy-of select="."/>
7805
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
7806
+ <xsl:call-template name="title"/>
7807
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']">
7808
+
7809
+
7810
+
7811
+
7812
+
7813
+ <!-- text in the box -->
7814
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
7815
+
7816
+
7817
+
7818
+
7819
+
7820
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style">
7821
+
7822
+
7823
+ <fo:block text-align="justify">
7824
+ <fo:inline>
7825
+ <xsl:call-template name="displayAdmonitionName"/>
7826
+ <xsl:text> – </xsl:text>
7827
+ </fo:inline>
7828
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7829
+ </fo:block>
7830
+
7831
+ </fo:block-container>
7832
+
7833
+ </fo:block-container>
7834
+
7835
+ </xsl:template><xsl:template name="displayAdmonitionName">
7836
+
7837
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7838
+ <xsl:if test="not(*[local-name() = 'name'])">
7839
+ <xsl:apply-templates select="@type"/>
7840
+ </xsl:if>
7841
+
7842
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
7843
+ <xsl:apply-templates/>
7844
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
7845
+ <xsl:variable name="admonition_type_">
7846
+ <xsl:call-template name="getLocalizedString">
7847
+ <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
7848
+ </xsl:call-template>
7849
+ </xsl:variable>
7850
+ <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
7851
+ <xsl:value-of select="$admonition_type"/>
7852
+ <xsl:if test="$admonition_type = ''">
7853
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
7854
+ </xsl:if>
7855
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
7856
+ <!-- processing for admonition/p found in the template for 'p' -->
7857
+ <xsl:call-template name="paragraph"/>
7858
+
7513
7859
  </xsl:template><xsl:template name="convertDate">
7514
7860
  <xsl:param name="date"/>
7515
7861
  <xsl:param name="format" select="'short'"/>
@@ -7517,83 +7863,80 @@
7517
7863
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
7518
7864
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
7519
7865
  <xsl:variable name="monthStr">
7520
- <xsl:choose>
7521
- <xsl:when test="$month = '01'">January</xsl:when>
7522
- <xsl:when test="$month = '02'">February</xsl:when>
7523
- <xsl:when test="$month = '03'">March</xsl:when>
7524
- <xsl:when test="$month = '04'">April</xsl:when>
7525
- <xsl:when test="$month = '05'">May</xsl:when>
7526
- <xsl:when test="$month = '06'">June</xsl:when>
7527
- <xsl:when test="$month = '07'">July</xsl:when>
7528
- <xsl:when test="$month = '08'">August</xsl:when>
7529
- <xsl:when test="$month = '09'">September</xsl:when>
7530
- <xsl:when test="$month = '10'">October</xsl:when>
7531
- <xsl:when test="$month = '11'">November</xsl:when>
7532
- <xsl:when test="$month = '12'">December</xsl:when>
7533
- </xsl:choose>
7866
+ <xsl:call-template name="getMonthByNum">
7867
+ <xsl:with-param name="num" select="$month"/>
7868
+ <xsl:with-param name="lowercase" select="'true'"/>
7869
+ </xsl:call-template>
7870
+ </xsl:variable>
7871
+ <xsl:variable name="monthStr_localized">
7872
+ <xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if>
7534
7873
  </xsl:variable>
7535
7874
  <xsl:variable name="result">
7536
7875
  <xsl:choose>
7537
- <xsl:when test="$format = 'ddMMyyyy'">
7876
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
7538
7877
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7539
7878
  <xsl:text> </xsl:text>
7540
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
7879
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
7541
7880
  </xsl:when>
7542
7881
  <xsl:when test="$format = 'ddMM'">
7543
7882
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7544
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
7883
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/>
7545
7884
  </xsl:when>
7546
7885
  <xsl:when test="$format = 'short' or $day = ''">
7547
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7886
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
7548
7887
  </xsl:when>
7549
7888
  <xsl:otherwise>
7550
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
7889
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
7551
7890
  </xsl:otherwise>
7552
7891
  </xsl:choose>
7553
7892
  </xsl:variable>
7554
7893
  <xsl:value-of select="$result"/>
7555
- </xsl:template><xsl:template name="convertDateLocalized">
7556
- <xsl:param name="date"/>
7557
- <xsl:param name="format" select="'short'"/>
7558
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
7559
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
7560
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
7561
- <xsl:variable name="monthStr">
7562
- <xsl:choose>
7563
- <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>
7564
- <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>
7565
- <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>
7566
- <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>
7567
- <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>
7568
- <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>
7569
- <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>
7570
- <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>
7571
- <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>
7572
- <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>
7573
- <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>
7574
- <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>
7575
- </xsl:choose>
7576
- </xsl:variable>
7577
- <xsl:variable name="result">
7894
+ </xsl:template><xsl:template name="getMonthByNum">
7895
+ <xsl:param name="num"/>
7896
+ <xsl:param name="lang">en</xsl:param>
7897
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
7898
+ <xsl:variable name="monthStr_">
7578
7899
  <xsl:choose>
7579
- <xsl:when test="$format = 'ddMMyyyy'">
7580
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7581
- <xsl:text> </xsl:text>
7582
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
7583
- </xsl:when>
7584
- <xsl:when test="$format = 'ddMM'">
7585
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7586
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
7587
- </xsl:when>
7588
- <xsl:when test="$format = 'short' or $day = ''">
7589
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7900
+ <xsl:when test="$lang = 'fr'">
7901
+ <xsl:choose>
7902
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
7903
+ <xsl:when test="$num = '02'">Février</xsl:when>
7904
+ <xsl:when test="$num = '03'">Mars</xsl:when>
7905
+ <xsl:when test="$num = '04'">Avril</xsl:when>
7906
+ <xsl:when test="$num = '05'">Mai</xsl:when>
7907
+ <xsl:when test="$num = '06'">Juin</xsl:when>
7908
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
7909
+ <xsl:when test="$num = '08'">Août</xsl:when>
7910
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
7911
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
7912
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
7913
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
7914
+ </xsl:choose>
7590
7915
  </xsl:when>
7591
7916
  <xsl:otherwise>
7592
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
7917
+ <xsl:choose>
7918
+ <xsl:when test="$num = '01'">January</xsl:when>
7919
+ <xsl:when test="$num = '02'">February</xsl:when>
7920
+ <xsl:when test="$num = '03'">March</xsl:when>
7921
+ <xsl:when test="$num = '04'">April</xsl:when>
7922
+ <xsl:when test="$num = '05'">May</xsl:when>
7923
+ <xsl:when test="$num = '06'">June</xsl:when>
7924
+ <xsl:when test="$num = '07'">July</xsl:when>
7925
+ <xsl:when test="$num = '08'">August</xsl:when>
7926
+ <xsl:when test="$num = '09'">September</xsl:when>
7927
+ <xsl:when test="$num = '10'">October</xsl:when>
7928
+ <xsl:when test="$num = '11'">November</xsl:when>
7929
+ <xsl:when test="$num = '12'">December</xsl:when>
7930
+ </xsl:choose>
7593
7931
  </xsl:otherwise>
7594
7932
  </xsl:choose>
7595
7933
  </xsl:variable>
7596
- <xsl:value-of select="$result"/>
7934
+ <xsl:choose>
7935
+ <xsl:when test="normalize-space($lowercase) = 'true'">
7936
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
7937
+ </xsl:when>
7938
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7939
+ </xsl:choose>
7597
7940
  </xsl:template><xsl:template name="insertKeywords">
7598
7941
  <xsl:param name="sorting" select="'true'"/>
7599
7942
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -7642,13 +7985,8 @@
7642
7985
  <xsl:variable name="title">
7643
7986
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
7644
7987
 
7645
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
7646
-
7647
-
7648
-
7649
-
7650
-
7651
-
7988
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
7989
+
7652
7990
  </xsl:for-each>
7653
7991
  </xsl:variable>
7654
7992
  <xsl:choose>
@@ -7663,21 +8001,18 @@
7663
8001
  <dc:creator>
7664
8002
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
7665
8003
 
7666
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
7667
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
7668
- <xsl:if test="position() != last()">; </xsl:if>
7669
- </xsl:for-each>
7670
-
7671
-
7672
-
8004
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
8005
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
8006
+ <xsl:if test="position() != last()">; </xsl:if>
8007
+ </xsl:for-each>
8008
+
7673
8009
  </xsl:for-each>
7674
8010
  </dc:creator>
7675
8011
  <dc:description>
7676
8012
  <xsl:variable name="abstract">
7677
8013
 
7678
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
7679
-
7680
-
8014
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
8015
+
7681
8016
  </xsl:variable>
7682
8017
  <xsl:value-of select="normalize-space($abstract)"/>
7683
8018
  </dc:description>
@@ -7697,7 +8032,6 @@
7697
8032
  <xsl:value-of select="../@id"/>
7698
8033
  </xsl:when>
7699
8034
  <xsl:otherwise>
7700
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
7701
8035
  <xsl:value-of select="concat(generate-id(..), '_', text())"/>
7702
8036
  </xsl:otherwise>
7703
8037
  </xsl:choose>
@@ -7723,9 +8057,6 @@
7723
8057
  <xsl:when test="ancestor::*[local-name() = 'preface']">
7724
8058
  <xsl:value-of select="$level_total - 2"/>
7725
8059
  </xsl:when>
7726
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
7727
- <xsl:value-of select="$level_total - 1"/>
7728
- </xsl:when> -->
7729
8060
  <xsl:when test="ancestor::*[local-name() = 'sections']">
7730
8061
  <xsl:value-of select="$level_total - 1"/>
7731
8062
  </xsl:when>
@@ -7867,9 +8198,15 @@
7867
8198
  </xsl:template><xsl:template name="getLocalizedString">
7868
8199
  <xsl:param name="key"/>
7869
8200
  <xsl:param name="formatted">false</xsl:param>
8201
+ <xsl:param name="lang"/>
7870
8202
 
7871
8203
  <xsl:variable name="curr_lang">
7872
- <xsl:call-template name="getLang"/>
8204
+ <xsl:choose>
8205
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
8206
+ <xsl:otherwise>
8207
+ <xsl:call-template name="getLang"/>
8208
+ </xsl:otherwise>
8209
+ </xsl:choose>
7873
8210
  </xsl:variable>
7874
8211
 
7875
8212
  <xsl:variable name="data_value">
@@ -7909,7 +8246,6 @@
7909
8246
  <xsl:value-of select="$key_"/>
7910
8247
  </xsl:otherwise>
7911
8248
  </xsl:choose>
7912
-
7913
8249
  </xsl:template><xsl:template name="setTrackChangesStyles">
7914
8250
  <xsl:param name="isAdded"/>
7915
8251
  <xsl:param name="isDeleted"/>
@@ -7932,7 +8268,6 @@
7932
8268
  <xsl:if test="local-name() = 'table'">
7933
8269
  <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
7934
8270
  </xsl:if>
7935
- <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
7936
8271
  <xsl:attribute name="padding">2mm</xsl:attribute>
7937
8272
  </xsl:if>
7938
8273
  </xsl:otherwise>
@@ -7952,15 +8287,18 @@
7952
8287
  </xsl:choose>
7953
8288
  </xsl:template><xsl:template name="setTextAlignment">
7954
8289
  <xsl:param name="default">left</xsl:param>
8290
+ <xsl:variable name="align" select="normalize-space(@align)"/>
7955
8291
  <xsl:attribute name="text-align">
7956
8292
  <xsl:choose>
7957
- <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
8293
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
8294
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
8295
+ <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
7958
8296
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
7959
8297
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
7960
8298
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7961
8299
  </xsl:choose>
7962
8300
  </xsl:attribute>
7963
- <xsl:if test="@align = 'indent'">
8301
+ <xsl:if test="$align = 'indent'">
7964
8302
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
7965
8303
  </xsl:if>
7966
8304
  </xsl:template><xsl:template name="number-to-words">
@@ -8059,6 +8397,25 @@
8059
8397
  </xsl:otherwise>
8060
8398
  </xsl:choose>
8061
8399
  </xsl:if>
8400
+ </xsl:template><xsl:template name="number-to-ordinal">
8401
+ <xsl:param name="number"/>
8402
+ <xsl:param name="curr_lang"/>
8403
+ <xsl:choose>
8404
+ <xsl:when test="$curr_lang = 'fr'">
8405
+ <xsl:choose>
8406
+ <xsl:when test="$number = '1'">re</xsl:when>
8407
+ <xsl:otherwise>e</xsl:otherwise>
8408
+ </xsl:choose>
8409
+ </xsl:when>
8410
+ <xsl:otherwise>
8411
+ <xsl:choose>
8412
+ <xsl:when test="$number = 1">st</xsl:when>
8413
+ <xsl:when test="$number = 2">nd</xsl:when>
8414
+ <xsl:when test="$number = 3">rd</xsl:when>
8415
+ <xsl:otherwise>th</xsl:otherwise>
8416
+ </xsl:choose>
8417
+ </xsl:otherwise>
8418
+ </xsl:choose>
8062
8419
  </xsl:template><xsl:template name="setAltText">
8063
8420
  <xsl:param name="value"/>
8064
8421
  <xsl:attribute name="fox:alt-text">