metanorma-iec 1.2.11 → 1.2.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  <nav>
4
4
 
5
- <h1 id="content">Contents</h1>
5
+ <h1 id="content">{{ labels["table_of_contents"] }}</h1>
6
6
  <div id="toc"></div>
7
7
 
8
8
  </nav>
@@ -1,3 +1,3 @@
1
- <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">Contents</span></p>
1
+ <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">{{ labels["table_of_contents"] }}</span></p>
2
2
 
3
3
  WORDTOC
@@ -13,8 +13,8 @@ module IsoDoc
13
13
 
14
14
  def default_fonts(options)
15
15
  {
16
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
17
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
16
+ bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Arial",sans-serif'),
17
+ headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Arial",sans-serif'),
18
18
  monospacefont: ('"Courier New",monospace'),
19
19
  monospacefontsize: "1.0em",
20
20
  footnotefontsize: "0.9em",
@@ -3,6 +3,7 @@
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
7
8
 
8
9
 
@@ -215,7 +216,9 @@
215
216
  </fo:simple-page-master>
216
217
  </fo:layout-master-set>
217
218
 
218
- <xsl:call-template name="addPDFUAmeta"/>
219
+ <fo:declarations>
220
+ <xsl:call-template name="addPDFUAmeta"/>
221
+ </fo:declarations>
219
222
 
220
223
  <xsl:call-template name="addBookmarks">
221
224
  <xsl:with-param name="contents" select="$contents"/>
@@ -335,7 +338,7 @@
335
338
  </fo:block-container>
336
339
  </fo:block>
337
340
 
338
- <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement"/>
341
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement"/> <!-- //iec:clause[not(@id) or @id != 'boilerplate-cenelec-attention'] -->
339
342
  <fo:block span="all" border-bottom="0.5pt solid black"/>
340
343
  <xsl:if test="(//iec:iec-standard)[2]/iec:boilerplate/iec:feedback-statement">
341
344
  <xsl:apply-templates select="(//iec:iec-standard)[2]/iec:boilerplate/iec:feedback-statement"/>
@@ -584,7 +587,10 @@
584
587
  <fo:static-content flow-name="footer-FDIS">
585
588
  <fo:block-container background-color="rgb(236, 232, 232)" padding="2mm" border="1.5pt solid white">
586
589
  <fo:block font-size="8pt" margin-bottom="6pt">
587
- <fo:inline font-weight="bold">
590
+
591
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[not(@id)]"/>
592
+
593
+ <!-- <fo:inline font-weight="bold">
588
594
  <xsl:call-template name="addLetterSpacing">
589
595
  <xsl:with-param name="text">
590
596
  <xsl:for-each select="(//iec:iec-standard)[1]/iec:bibdata/iec:copyright">
@@ -599,7 +605,7 @@
599
605
  <xsl:text>. All rights reserved. It is permitted to download this electronic file, to make a copy and to print out the content for the sole purpose of preparing National Committee positions. You may not copy or "mirror" the file or printed version of the document, or any part of it, for any other purpose without permission in writing from IEC.</xsl:text>
600
606
  </xsl:with-param>
601
607
  </xsl:call-template>
602
- </fo:inline>
608
+ </fo:inline> -->
603
609
  </fo:block>
604
610
  </fo:block-container>
605
611
  </fo:static-content>
@@ -611,7 +617,8 @@
611
617
  <fo:inline font-size="8pt" padding-left="0.5mm" color="{$color_blue}">®</fo:inline>
612
618
  </xsl:if>
613
619
  <fo:inline keep-together.within-line="always" font-size="18pt" font-weight="bold" baseline-shift="10mm"><fo:leader leader-pattern="space"/>
614
- <xsl:text>Ex: 34D/1511/FDIS</xsl:text>
620
+ <!-- Ex: 34D/1511/FDIS -->
621
+ <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='iso-tc']"/>
615
622
  <xsl:text> </xsl:text>
616
623
  </fo:inline>
617
624
  </fo:block>
@@ -672,7 +679,8 @@
672
679
  </fo:block>
673
680
  <fo:block font-size="9pt" font-weight="bold">
674
681
  <xsl:call-template name="addLetterSpacing">
675
- <xsl:with-param name="text">2019-12-06</xsl:with-param>
682
+ <!-- 2019-12-06 -->
683
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type='vote-ended']/iec:on"/></xsl:with-param>
676
684
  </xsl:call-template>
677
685
  </fo:block>
678
686
  </fo:table-cell>
@@ -686,7 +694,8 @@
686
694
  </fo:block>
687
695
  <fo:block font-size="9pt" font-weight="bold">
688
696
  <xsl:variable name="supersedes_documents">
689
- <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber">
697
+ <!-- <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber"> -->
698
+ <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='obsoletes']/iec:bibitem/iec:docidentifier">
690
699
  <xsl:value-of select="."/>
691
700
  <xsl:if test="position() != last()">,</xsl:if>
692
701
  </xsl:for-each>
@@ -712,22 +721,26 @@
712
721
  <fo:table-row height="4mm">
713
722
  <fo:table-cell number-columns-spanned="2" border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
714
723
  <fo:block>
715
- <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
716
- <fo:block font-size="6.5pt">
717
- <fo:inline font-size="8pt">IEC SC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee/@number"/> : </fo:inline>
718
- <xsl:call-template name="addLetterSpacingSmallCaps">
719
- <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
720
- </xsl:call-template>
721
- </fo:block>
722
- </xsl:if>
723
- <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
724
- <fo:block font-size="6.5pt">
725
- <fo:inline font-size="8pt">IEC TC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee/@number"/> : </fo:inline>
726
- <xsl:call-template name="addLetterSpacingSmallCaps">
727
- <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
728
- </xsl:call-template>
729
- </fo:block>
730
- </xsl:if>
724
+ <!-- If //bibdata/ext/editorialgroup/subcommittee exists, use "IEC SC" + //bibdata/ext/editorialgroup/subcommittee/@number + //bibdata/ext/editorialgroup/subcommittee,
725
+ else use "IEC TC" + //bibdata/ext/editorialgroup/technical-committee/@number + //bibdata/ext/editorialgroup/technical-committee -->
726
+ <xsl:choose>
727
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
728
+ <fo:block font-size="6.5pt">
729
+ <fo:inline font-size="8pt">IEC SC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee/@number"/> : </fo:inline>
730
+ <xsl:call-template name="addLetterSpacingSmallCaps">
731
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
732
+ </xsl:call-template>
733
+ </fo:block>
734
+ </xsl:when>
735
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
736
+ <fo:block font-size="6.5pt">
737
+ <fo:inline font-size="8pt">IEC TC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee/@number"/> : </fo:inline>
738
+ <xsl:call-template name="addLetterSpacingSmallCaps">
739
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
740
+ </xsl:call-template>
741
+ </fo:block>
742
+ </xsl:when>
743
+ </xsl:choose>
731
744
  </fo:block>
732
745
  </fo:table-cell>
733
746
  </fo:table-row>
@@ -751,8 +764,9 @@
751
764
  </xsl:call-template>
752
765
  </fo:block>
753
766
  <fo:block font-size="9pt">
767
+ <!-- Example: Ms Shanti Conn -->
754
768
  <xsl:call-template name="addLetterSpacing">
755
- <xsl:with-param name="text" select="'Ms Shanti Conn'"/>
769
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:secretary"/>
756
770
  </xsl:call-template>
757
771
  </fo:block>
758
772
  </fo:table-cell>
@@ -767,6 +781,11 @@
767
781
  <xsl:with-param name="text" select="'Of interest to the following committees:'"/>
768
782
  </xsl:call-template>
769
783
  </fo:block>
784
+ <fo:block font-size="9pt">
785
+ <xsl:call-template name="addLetterSpacing">
786
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:interest-to-committees"/>
787
+ </xsl:call-template>
788
+ </fo:block>
770
789
  </fo:table-cell>
771
790
  <xsl:if test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'CDV' or $stage-abbreviation = 'CD'">
772
791
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
@@ -782,9 +801,15 @@
782
801
  </xsl:call-template>
783
802
  </xsl:if>
784
803
  </fo:block>
785
-
786
804
  <fo:block>
787
- <xsl:call-template name="insertCheckBoxOff"/>
805
+ <xsl:choose>
806
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
807
+ <xsl:call-template name="insertCheckBoxOn"/>
808
+ </xsl:when>
809
+ <xsl:otherwise>
810
+ <xsl:call-template name="insertCheckBoxOff"/>
811
+ </xsl:otherwise>
812
+ </xsl:choose>
788
813
  </fo:block>
789
814
 
790
815
  <xsl:if test="$stage-abbreviation = 'CDV' or $stage-abbreviation = 'CD'">
@@ -885,13 +910,10 @@
885
910
  <xsl:with-param name="text" select="'Submitted for CENELEC parallel voting'"/>
886
911
  </xsl:call-template>
887
912
  </fo:block>
888
- <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
889
- <xsl:call-template name="addLetterSpacing">
890
- <xsl:with-param name="text" select="'Attention IEC-CENELEC parallel voting'"/>
891
- </xsl:call-template>
892
- </fo:block>
893
913
 
894
- <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
914
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']"/>
915
+
916
+ <!-- <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
895
917
  <xsl:if test="$stage-abbreviation = 'FDIS'">
896
918
  <xsl:call-template name="addLetterSpacing">
897
919
  <xsl:with-param name="text" select="'The attention of IEC National Committees, members of CENELEC, is drawn to the fact that this Final Draft International Standard (FDIS) is submitted for parallel voting.'"/>
@@ -907,7 +929,8 @@
907
929
  <xsl:call-template name="addLetterSpacing">
908
930
  <xsl:with-param name="text" select="'The CENELEC members are invited to vote through the CENELEC online voting system.'"/>
909
931
  </xsl:call-template>
910
- </fo:block>
932
+ </fo:block> -->
933
+
911
934
  </fo:table-cell>
912
935
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
913
936
  <fo:block font-size="6.5pt" margin-bottom="6pt">
@@ -932,7 +955,10 @@
932
955
  </fo:block-container>
933
956
 
934
957
  <fo:block-container font-size="8pt" background-color="rgb(236, 232, 232)" margin-top="5mm" padding="2mm" text-align="justify" border="1.5pt solid white">
935
- <xsl:if test="$stage-abbreviation = 'FDIS'">
958
+ <fo:block>
959
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:license-statement" mode="cover-page-internal"/>
960
+ </fo:block>
961
+ <!-- <xsl:if test="$stage-abbreviation = 'FDIS'">
936
962
  <fo:block margin-bottom="6pt">
937
963
  <xsl:call-template name="addLetterSpacing">
938
964
  <xsl:with-param name="text">This document is a draft distributed for approval. It may not be referred to as an International Standard until published as such.</xsl:with-param>
@@ -949,7 +975,17 @@
949
975
  </xsl:call-template>
950
976
  </fo:block>
951
977
  </xsl:if>
952
- <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'CDV' or $stage-abbreviation = 'CD-TSTR' or $stage-abbreviation = 'DTS' or $stage-abbreviation = 'DTR' or $stage-abbreviation = 'DPAS'">
978
+ <xsl:if test="$stage-abbreviation = 'NWIP' or
979
+ $stage-abbreviation = 'PWI' or
980
+ $stage-abbreviation = 'NP' or
981
+ $stage-abbreviation = 'AWI' or
982
+ $stage-abbreviation = 'WD' or
983
+ $stage-abbreviation = 'CD' or
984
+ $stage-abbreviation = 'CDV' or
985
+ $stage-abbreviation = 'CD-TSTR' or
986
+ $stage-abbreviation = 'DTS' or
987
+ $stage-abbreviation = 'DTR' or
988
+ $stage-abbreviation = 'DPAS'">
953
989
  <fo:block margin-bottom="6pt">
954
990
  <xsl:call-template name="addLetterSpacing">
955
991
  <xsl:with-param name="text">This document is still under study and subject to change. It should not be used for reference purposes.</xsl:with-param>
@@ -960,7 +996,7 @@
960
996
  <xsl:with-param name="text">Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</xsl:with-param>
961
997
  </xsl:call-template>
962
998
  </fo:block>
963
- </xsl:if>
999
+ </xsl:if> -->
964
1000
  </fo:block-container>
965
1001
 
966
1002
  <fo:block-container background-color="rgb(219, 229, 241)" margin-top="4mm" padding="2mm" padding-top="1mm" border="1.5pt solid white">
@@ -984,24 +1020,24 @@
984
1020
  <xsl:text>PROPOSED STABILITY DATE: </xsl:text>
985
1021
  </xsl:with-param>
986
1022
  </xsl:call-template>
987
- <fo:inline font-size="9pt">2023</fo:inline>
1023
+ <!-- 2023 -->
1024
+ <fo:inline font-size="9pt"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type='unchanged']/iec:on"/></fo:inline>
988
1025
  </fo:block>
989
1026
  </fo:block-container>
990
1027
  </xsl:if>
991
1028
 
992
- <fo:block-container border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
1029
+ <fo:block-container border="1.5 solid" border-color="rgb(221, 213, 213)" padding="1mm" margin-top="3mm">
993
1030
  <fo:block font-size="6.5pt" margin-bottom="6pt">
994
1031
  <xsl:call-template name="addLetterSpacingSmallCaps">
995
1032
  <xsl:with-param name="text">Note from TC/SC officers:</xsl:with-param>
996
1033
  </xsl:call-template>
997
1034
  </fo:block>
998
- <!-- <fo:block font-size="9pt">This FDIS is the result of the discussion between the IEC SC21A experts WG 3 during the meeting held in</fo:block> -->
1035
+ <!-- Example: This FDIS is the result of the discussion between the IEC SC21A experts WG 3 during the meeting held in -->
1036
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:bibdata/iec:ext/iec:tc-sc-officers-note"/>
999
1037
  </fo:block-container>
1000
1038
 
1001
-
1002
-
1003
- <xsl:if test="$stage-abbreviation = 'FDIS'">
1004
- <fo:block-container font-size="9pt" border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
1039
+ <!-- <xsl:if test="$stage-abbreviation = 'FDIS'">
1040
+ <fo:block-container font-size="9pt" border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
1005
1041
  <fo:block margin-bottom="6pt">
1006
1042
  <xsl:call-template name="addLetterSpacing">
1007
1043
  <xsl:with-param name="text">
@@ -1017,7 +1053,7 @@
1017
1053
  </xsl:call-template>
1018
1054
  </fo:block>
1019
1055
  </fo:block-container>
1020
- </xsl:if>
1056
+ </xsl:if> -->
1021
1057
 
1022
1058
  </fo:flow>
1023
1059
  </fo:page-sequence>
@@ -1191,6 +1227,10 @@
1191
1227
  </fo:root>
1192
1228
  </xsl:template>
1193
1229
 
1230
+ <xsl:template match="iec:tc-sc-officers-note/iec:p">
1231
+ <fo:block><xsl:apply-templates/></fo:block>
1232
+ </xsl:template>
1233
+
1194
1234
  <xsl:template name="insertCoverPart1">
1195
1235
  <xsl:variable name="lang_second">
1196
1236
  <xsl:choose>
@@ -1574,6 +1614,39 @@
1574
1614
  </xsl:template>
1575
1615
 
1576
1616
 
1617
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']" priority="3">
1618
+ <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
1619
+ <xsl:apply-templates/>
1620
+ </fo:block>
1621
+ </xsl:template>
1622
+
1623
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:title" priority="3">
1624
+ <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
1625
+ <xsl:apply-templates/>
1626
+ </fo:block>
1627
+ </xsl:template>
1628
+
1629
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:p" priority="3">
1630
+ <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
1631
+ <xsl:apply-templates/>
1632
+ </fo:block>
1633
+ </xsl:template>
1634
+
1635
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//text()" priority="3">
1636
+ <!-- Example: Attention IEC-CENELEC parallel voting -->
1637
+ <xsl:if test="normalize-space() ! = ''">
1638
+ <xsl:call-template name="addLetterSpacing">
1639
+ <xsl:with-param name="text" select="."/>
1640
+ </xsl:call-template>
1641
+ </xsl:if>
1642
+ </xsl:template>
1643
+
1644
+ <xsl:template match="iec:boilerplate/iec:feedback-statement">
1645
+ <fo:block margin-top="6pt" font-size="1pt" span="all">
1646
+ </fo:block>
1647
+ <xsl:apply-templates select="*[not(@id) or @id != 'boilerplate-cenelec-attention']"/>
1648
+ </xsl:template>
1649
+
1577
1650
  <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1578
1651
  <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1579
1652
  </xsl:template>
@@ -1584,9 +1657,9 @@
1584
1657
 
1585
1658
  <xsl:template match="iec:feedback-statement/iec:clause[not(iec:clause)]" priority="2">
1586
1659
  <fo:block span="all" text-align="justify">
1587
- <xsl:if test="not(preceding-sibling::iec:clause)">
1660
+ <!-- <xsl:if test="not(preceding-sibling::iec:clause)">
1588
1661
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1589
- </xsl:if>
1662
+ </xsl:if> -->
1590
1663
  <xsl:apply-templates/>
1591
1664
  </fo:block>
1592
1665
  </xsl:template>
@@ -1693,6 +1766,23 @@
1693
1766
  </fo:block>
1694
1767
  </xsl:template>
1695
1768
 
1769
+ <xsl:template match="iec:license-statement//iec:title" mode="cover-page-internal">
1770
+ <fo:block text-align="center" font-weight="bold">
1771
+ <xsl:apply-templates/>
1772
+ </fo:block>
1773
+ </xsl:template>
1774
+ <xsl:template match="iec:license-statement//iec:p" mode="cover-page-internal">
1775
+ <fo:block margin-bottom="6pt">
1776
+ <xsl:apply-templates mode="cover-page-internal"/>
1777
+ </fo:block>
1778
+ </xsl:template>
1779
+ <xsl:template match="iec:license-statement//iec:p//text()" mode="cover-page-internal">
1780
+ <xsl:call-template name="addLetterSpacing">
1781
+ <xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param>
1782
+ </xsl:call-template>
1783
+ </xsl:template>
1784
+
1785
+
1696
1786
  <!-- <fo:block margin-bottom="12pt">© ISO 2019, Published in Switzerland.</fo:block>
1697
1787
  <fo:block font-size="10pt" margin-bottom="12pt">All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISO’s member body in the country of the requester.</fo:block>
1698
1788
  <fo:block font-size="10pt" text-indent="7.1mm">
@@ -1728,6 +1818,15 @@
1728
1818
  <xsl:apply-templates/>
1729
1819
  </fo:block>
1730
1820
  </xsl:template>
1821
+
1822
+ <!-- copyright text in footer internal footer -->
1823
+ <xsl:template match="iec:copyright-statement//iec:p[not(@id)]//text()">
1824
+ <xsl:if test="normalize-space() ! = ''">
1825
+ <xsl:call-template name="addLetterSpacing">
1826
+ <xsl:with-param name="text" select="normalize-space(.)"/>
1827
+ </xsl:call-template>
1828
+ </xsl:if>
1829
+ </xsl:template>
1731
1830
 
1732
1831
 
1733
1832
  <xsl:template match="iec:iec-standard/iec:preface/iec:foreword" priority="3">
@@ -2054,13 +2153,22 @@
2054
2153
  <xsl:otherwise> <!-- for ordered lists -->
2055
2154
  <xsl:choose>
2056
2155
  <xsl:when test="../@type = 'arabic'">
2057
- <xsl:number format="a)" lang="en"/>
2156
+ <xsl:number format="1)"/>
2058
2157
  </xsl:when>
2059
2158
  <xsl:when test="../@type = 'alphabet'">
2060
2159
  <xsl:number format="a)" lang="en"/>
2061
2160
  </xsl:when>
2161
+ <xsl:when test="../@type = 'alphabet_upper'">
2162
+ <xsl:number format="A." lang="en"/>
2163
+ </xsl:when>
2164
+ <xsl:when test="../@type = 'roman'">
2165
+ <xsl:number format="i)" lang="en"/>
2166
+ </xsl:when>
2167
+ <xsl:when test="../@type = 'roman_upper'">
2168
+ <xsl:number format="I." lang="en"/>
2169
+ </xsl:when>
2062
2170
  <xsl:otherwise>
2063
- <xsl:number format="1)"/>
2171
+ <xsl:number format="a)" lang="en"/>
2064
2172
  </xsl:otherwise>
2065
2173
  </xsl:choose>
2066
2174
  </xsl:otherwise>
@@ -2631,6 +2739,7 @@
2631
2739
 
2632
2740
 
2633
2741
 
2742
+
2634
2743
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
2635
2744
 
2636
2745
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -2748,6 +2857,7 @@
2748
2857
 
2749
2858
 
2750
2859
 
2860
+
2751
2861
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2752
2862
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2753
2863
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
@@ -2898,198 +3008,237 @@
2898
3008
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2899
3009
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2900
3010
  <xsl:call-template name="add-zero-spaces-java"/>
2901
- </xsl:template><xsl:template match="*[local-name()='table']">
3011
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2902
3012
 
2903
- <xsl:variable name="simple-table">
2904
- <xsl:call-template name="getSimpleTable"/>
2905
- </xsl:variable>
3013
+ <xsl:variable name="table">
2906
3014
 
2907
-
2908
-
2909
-
2910
-
2911
- <!-- <xsl:if test="$namespace = 'bipm'">
2912
- <fo:block>&#xA0;</fo:block>
2913
- </xsl:if> -->
2914
-
2915
- <!-- $namespace = 'iso' or -->
2916
-
2917
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2918
-
2919
-
2920
-
2921
- <xsl:call-template name="fn_name_display"/>
3015
+ <xsl:variable name="simple-table">
3016
+ <xsl:call-template name="getSimpleTable"/>
3017
+ </xsl:variable>
2922
3018
 
2923
3019
 
2924
-
2925
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2926
-
2927
- <!-- <xsl:variable name="cols-count">
2928
- <xsl:choose>
2929
- <xsl:when test="*[local-name()='thead']">
2930
- <xsl:call-template name="calculate-columns-numbers">
2931
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2932
- </xsl:call-template>
2933
- </xsl:when>
2934
- <xsl:otherwise>
2935
- <xsl:call-template name="calculate-columns-numbers">
2936
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2937
- </xsl:call-template>
2938
- </xsl:otherwise>
2939
- </xsl:choose>
2940
- </xsl:variable> -->
2941
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2942
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2943
-
2944
-
2945
-
2946
- <xsl:variable name="colwidths">
2947
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2948
- <xsl:call-template name="calculate-column-widths">
2949
- <xsl:with-param name="cols-count" select="$cols-count"/>
2950
- <xsl:with-param name="table" select="$simple-table"/>
2951
- </xsl:call-template>
2952
- </xsl:if>
2953
- </xsl:variable>
2954
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2955
-
2956
- <!-- <xsl:variable name="colwidths2">
2957
- <xsl:call-template name="calculate-column-widths">
2958
- <xsl:with-param name="cols-count" select="$cols-count"/>
2959
- </xsl:call-template>
2960
- </xsl:variable> -->
2961
-
2962
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2963
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2964
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2965
-
2966
- <xsl:variable name="margin-left">
2967
- <xsl:choose>
2968
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2969
- <xsl:otherwise>0</xsl:otherwise>
2970
- </xsl:choose>
2971
- </xsl:variable>
2972
-
2973
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2974
3020
 
2975
3021
 
2976
3022
 
2977
- <xsl:attribute name="font-size">8pt</xsl:attribute>
2978
- <xsl:attribute name="space-after">12pt</xsl:attribute>
2979
- <xsl:if test="ancestor::*[local-name() = 'preface']">
2980
- <xsl:attribute name="space-after">16pt</xsl:attribute>
2981
- </xsl:if>
2982
-
2983
-
2984
-
3023
+ <!-- <xsl:if test="$namespace = 'bipm'">
3024
+ <fo:block>&#xA0;</fo:block>
3025
+ </xsl:if> -->
2985
3026
 
3027
+ <!-- $namespace = 'iso' or -->
2986
3028
 
2987
-
3029
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2988
3030
 
3031
+
2989
3032
 
3033
+ <xsl:call-template name="fn_name_display"/>
2990
3034
 
3035
+
2991
3036
 
3037
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2992
3038
 
3039
+ <!-- <xsl:variable name="cols-count">
3040
+ <xsl:choose>
3041
+ <xsl:when test="*[local-name()='thead']">
3042
+ <xsl:call-template name="calculate-columns-numbers">
3043
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
3044
+ </xsl:call-template>
3045
+ </xsl:when>
3046
+ <xsl:otherwise>
3047
+ <xsl:call-template name="calculate-columns-numbers">
3048
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
3049
+ </xsl:call-template>
3050
+ </xsl:otherwise>
3051
+ </xsl:choose>
3052
+ </xsl:variable> -->
3053
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
3054
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2993
3055
 
2994
3056
 
2995
- <xsl:variable name="table_attributes">
2996
- <attribute name="table-layout">fixed</attribute>
2997
- <attribute name="width">100%</attribute>
2998
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2999
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3057
+
3058
+ <xsl:variable name="colwidths">
3059
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3060
+ <xsl:call-template name="calculate-column-widths">
3061
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3062
+ <xsl:with-param name="table" select="$simple-table"/>
3063
+ </xsl:call-template>
3064
+ </xsl:if>
3065
+ </xsl:variable>
3066
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3067
+
3068
+ <!-- <xsl:variable name="colwidths2">
3069
+ <xsl:call-template name="calculate-column-widths">
3070
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3071
+ </xsl:call-template>
3072
+ </xsl:variable> -->
3073
+
3074
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
3075
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
3076
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
3077
+
3078
+ <xsl:variable name="margin-left">
3079
+ <xsl:choose>
3080
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3081
+ <xsl:otherwise>0</xsl:otherwise>
3082
+ </xsl:choose>
3083
+ </xsl:variable>
3084
+
3085
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
3000
3086
 
3001
3087
 
3002
- <attribute name="border">0.5pt solid black</attribute>
3003
3088
 
3089
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3090
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3091
+ <xsl:if test="ancestor::*[local-name() = 'preface']">
3092
+ <xsl:attribute name="space-after">16pt</xsl:attribute>
3093
+ </xsl:if>
3094
+
3095
+
3096
+
3004
3097
 
3005
3098
 
3006
-
3007
-
3008
-
3099
+
3009
3100
 
3010
-
3011
3101
 
3012
- </xsl:variable>
3013
-
3014
-
3015
- <fo:table id="{@id}" table-omit-footer-at-break="true">
3016
3102
 
3017
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3018
- <xsl:attribute name="{@name}">
3019
- <xsl:value-of select="."/>
3020
- </xsl:attribute>
3021
- </xsl:for-each>
3022
3103
 
3023
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3024
- <xsl:if test="$isNoteOrFnExist = 'true'">
3025
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3026
- </xsl:if>
3027
3104
 
3028
- <xsl:choose>
3029
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3030
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3031
- <fo:table-column column-width="{@width}"/>
3032
- </xsl:for-each>
3033
- </xsl:when>
3034
- <xsl:otherwise>
3035
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3036
- <xsl:choose>
3037
- <xsl:when test=". = 1 or . = 0">
3038
- <fo:table-column column-width="proportional-column-width(2)"/>
3039
- </xsl:when>
3040
- <xsl:otherwise>
3041
- <fo:table-column column-width="proportional-column-width({.})"/>
3042
- </xsl:otherwise>
3043
- </xsl:choose>
3044
- </xsl:for-each>
3045
- </xsl:otherwise>
3046
- </xsl:choose>
3047
3105
 
3048
- <xsl:choose>
3049
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3050
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3051
- </xsl:when>
3052
- <xsl:otherwise>
3053
- <xsl:apply-templates/>
3054
- </xsl:otherwise>
3055
- </xsl:choose>
3106
+ <xsl:variable name="table_width">
3107
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3108
+ 100%
3109
+
3110
+
3111
+ </xsl:variable>
3056
3112
 
3057
- </fo:table>
3058
-
3059
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3060
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3061
- <xsl:call-template name="insertTableFooterInSeparateTable">
3062
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
3063
- <xsl:with-param name="colwidths" select="$colwidths"/>
3064
- <xsl:with-param name="colgroup" select="$colgroup"/>
3065
- </xsl:call-template>
3066
- </xsl:for-each>
3067
-
3068
- <!-- insert footer as table -->
3069
- <!-- <fo:table>
3070
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3071
- <xsl:attribute name="{@name}">
3072
- <xsl:value-of select="."/>
3073
- </xsl:attribute>
3074
- </xsl:for-each>
3113
+ <xsl:variable name="table_attributes">
3114
+ <attribute name="table-layout">fixed</attribute>
3115
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
3116
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3117
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3118
+
3119
+
3120
+ <attribute name="border">0.5pt solid black</attribute>
3121
+
3122
+
3123
+
3124
+
3125
+
3126
+
3127
+
3128
+
3129
+
3130
+ </xsl:variable>
3075
3131
 
3076
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3132
+
3133
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
3134
+
3135
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3136
+ <xsl:attribute name="{@name}">
3137
+ <xsl:value-of select="."/>
3138
+ </xsl:attribute>
3139
+ </xsl:for-each>
3140
+
3141
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3142
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3143
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3144
+ </xsl:if>
3145
+
3077
3146
  <xsl:choose>
3078
- <xsl:when test=". = 1 or . = 0">
3079
- <fo:table-column column-width="proportional-column-width(2)"/>
3147
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3148
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3149
+ <fo:table-column column-width="{@width}"/>
3150
+ </xsl:for-each>
3080
3151
  </xsl:when>
3081
3152
  <xsl:otherwise>
3082
- <fo:table-column column-width="proportional-column-width({.})"/>
3153
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3154
+ <xsl:choose>
3155
+ <xsl:when test=". = 1 or . = 0">
3156
+ <fo:table-column column-width="proportional-column-width(2)"/>
3157
+ </xsl:when>
3158
+ <xsl:otherwise>
3159
+ <fo:table-column column-width="proportional-column-width({.})"/>
3160
+ </xsl:otherwise>
3161
+ </xsl:choose>
3162
+ </xsl:for-each>
3163
+ </xsl:otherwise>
3164
+ </xsl:choose>
3165
+
3166
+ <xsl:choose>
3167
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3168
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3169
+ </xsl:when>
3170
+ <xsl:otherwise>
3171
+ <xsl:apply-templates/>
3083
3172
  </xsl:otherwise>
3084
3173
  </xsl:choose>
3174
+
3175
+ </fo:table>
3176
+
3177
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3178
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3179
+ <xsl:call-template name="insertTableFooterInSeparateTable">
3180
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
3181
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3182
+ <xsl:with-param name="colgroup" select="$colgroup"/>
3183
+ </xsl:call-template>
3085
3184
  </xsl:for-each>
3086
- </fo:table>-->
3087
-
3088
-
3089
-
3090
-
3091
-
3092
- </fo:block-container>
3185
+
3186
+ <!-- insert footer as table -->
3187
+ <!-- <fo:table>
3188
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3189
+ <xsl:attribute name="{@name}">
3190
+ <xsl:value-of select="."/>
3191
+ </xsl:attribute>
3192
+ </xsl:for-each>
3193
+
3194
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3195
+ <xsl:choose>
3196
+ <xsl:when test=". = 1 or . = 0">
3197
+ <fo:table-column column-width="proportional-column-width(2)"/>
3198
+ </xsl:when>
3199
+ <xsl:otherwise>
3200
+ <fo:table-column column-width="proportional-column-width({.})"/>
3201
+ </xsl:otherwise>
3202
+ </xsl:choose>
3203
+ </xsl:for-each>
3204
+ </fo:table>-->
3205
+
3206
+
3207
+
3208
+
3209
+
3210
+ </fo:block-container>
3211
+ </xsl:variable>
3212
+
3213
+
3214
+
3215
+ <xsl:choose>
3216
+ <xsl:when test="@width">
3217
+
3218
+ <!-- centered table when table name is centered (see table-name-style) -->
3219
+
3220
+ <fo:table table-layout="fixed" width="100%">
3221
+ <fo:table-column column-width="proportional-column-width(1)"/>
3222
+ <fo:table-column column-width="{@width}"/>
3223
+ <fo:table-column column-width="proportional-column-width(1)"/>
3224
+ <fo:table-body>
3225
+ <fo:table-row>
3226
+ <fo:table-cell column-number="2">
3227
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
3228
+ </fo:table-cell>
3229
+ </fo:table-row>
3230
+ </fo:table-body>
3231
+ </fo:table>
3232
+
3233
+
3234
+
3235
+
3236
+ </xsl:when>
3237
+ <xsl:otherwise>
3238
+ <xsl:copy-of select="$table"/>
3239
+ </xsl:otherwise>
3240
+ </xsl:choose>
3241
+
3093
3242
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3094
3243
  <xsl:if test="normalize-space() != ''">
3095
3244
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -3217,7 +3366,15 @@
3217
3366
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
3218
3367
  <xsl:value-of select="@target"/>
3219
3368
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
3220
- <xsl:variable name="math_text" select="normalize-space(.)"/>
3369
+ <xsl:variable name="mathml">
3370
+ <xsl:for-each select="*">
3371
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
3372
+ <xsl:copy-of select="."/>
3373
+ </xsl:if>
3374
+ </xsl:for-each>
3375
+ </xsl:variable>
3376
+
3377
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
3221
3378
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3222
3379
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3223
3380
  <xsl:param name="cols-count"/>
@@ -3991,7 +4148,7 @@
3991
4148
  <xsl:with-param name="table" select="$html-table"/>
3992
4149
  </xsl:call-template>
3993
4150
  </xsl:variable>
3994
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
4151
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3995
4152
  <xsl:variable name="maxlength_dt">
3996
4153
  <xsl:call-template name="getMaxLength_dt"/>
3997
4154
  </xsl:variable>
@@ -4020,13 +4177,22 @@
4020
4177
  </xsl:when>
4021
4178
  <xsl:otherwise>
4022
4179
  <xsl:choose>
4180
+ <!-- to set width check most wide chars like `W` -->
4023
4181
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
4024
- <fo:table-column column-width="5%"/>
4025
- <fo:table-column column-width="95%"/>
4182
+ <fo:table-column column-width="7%"/>
4183
+ <fo:table-column column-width="93%"/>
4184
+ </xsl:when>
4185
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
4186
+ <fo:table-column column-width="15%"/>
4187
+ <fo:table-column column-width="85%"/>
4026
4188
  </xsl:when>
4027
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
4028
- <fo:table-column column-width="10%"/>
4029
- <fo:table-column column-width="90%"/>
4189
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
4190
+ <fo:table-column column-width="20%"/>
4191
+ <fo:table-column column-width="80%"/>
4192
+ </xsl:when>
4193
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
4194
+ <fo:table-column column-width="25%"/>
4195
+ <fo:table-column column-width="75%"/>
4030
4196
  </xsl:when>
4031
4197
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
4032
4198
  <fo:table-column column-width="60%"/>
@@ -4226,6 +4392,7 @@
4226
4392
 
4227
4393
 
4228
4394
 
4395
+
4229
4396
 
4230
4397
  </xsl:variable>
4231
4398
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4239,10 +4406,18 @@
4239
4406
  </xsl:if>
4240
4407
  <xsl:apply-templates/>
4241
4408
  </fo:inline>
4409
+ </xsl:template><xsl:template match="*[local-name()='underline']">
4410
+ <fo:inline text-decoration="underline">
4411
+ <xsl:apply-templates/>
4412
+ </fo:inline>
4242
4413
  </xsl:template><xsl:template match="*[local-name()='del']">
4243
4414
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
4244
4415
  <xsl:apply-templates/>
4245
4416
  </fo:inline>
4417
+ </xsl:template><xsl:template match="*[local-name()='hi']">
4418
+ <fo:inline background-color="yellow">
4419
+ <xsl:apply-templates/>
4420
+ </fo:inline>
4246
4421
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
4247
4422
  <xsl:variable name="text" select="normalize-space(.)"/>
4248
4423
  <fo:inline font-size="75%">
@@ -4332,6 +4507,10 @@
4332
4507
  <xsl:param name="text" select="."/>
4333
4508
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4334
4509
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4510
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4511
+ <xsl:param name="text" select="."/>
4512
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4513
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4335
4514
  </xsl:template><xsl:template name="add-zero-spaces">
4336
4515
  <xsl:param name="text" select="."/>
4337
4516
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4579,6 +4758,7 @@
4579
4758
  <xsl:apply-templates select="." mode="mathml"/>
4580
4759
  </xsl:variable>
4581
4760
  <fo:instream-foreign-object fox:alt-text="Math">
4761
+
4582
4762
  <!-- <xsl:copy-of select="."/> -->
4583
4763
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4584
4764
  </fo:instream-foreign-object>
@@ -4592,7 +4772,12 @@
4592
4772
  <!-- replace start and end spaces to non-break space -->
4593
4773
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4594
4774
  </xsl:copy>
4595
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4775
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4776
+ <xsl:copy>
4777
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4778
+ </xsl:copy>
4779
+ <mathml:mspace width="0.5ex"/>
4780
+ </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4596
4781
  <xsl:variable name="target">
4597
4782
  <xsl:choose>
4598
4783
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -4617,7 +4802,10 @@
4617
4802
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4618
4803
  <xsl:choose>
4619
4804
  <xsl:when test="normalize-space(.) = ''">
4620
- <xsl:value-of select="$target"/>
4805
+ <!-- <xsl:value-of select="$target"/> -->
4806
+ <xsl:call-template name="add-zero-spaces-link-java">
4807
+ <xsl:with-param name="text" select="$target"/>
4808
+ </xsl:call-template>
4621
4809
  </xsl:when>
4622
4810
  <xsl:otherwise>
4623
4811
  <xsl:apply-templates/>
@@ -4627,8 +4815,6 @@
4627
4815
  </xsl:otherwise>
4628
4816
  </xsl:choose>
4629
4817
  </fo:inline>
4630
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
4631
- <fo:inline id="{@id}"/>
4632
4818
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4633
4819
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4634
4820
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -4821,7 +5007,7 @@
4821
5007
  </xsl:if> -->
4822
5008
  </fo:inline>
4823
5009
  </xsl:if>
4824
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
5010
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4825
5011
  <fo:block-container id="{@id}">
4826
5012
 
4827
5013
  <fo:block>
@@ -4837,6 +5023,7 @@
4837
5023
  <fo:block id="{@id}">
4838
5024
  <xsl:apply-templates/>
4839
5025
  </fo:block>
5026
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4840
5027
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4841
5028
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4842
5029
  <xsl:apply-templates/>
@@ -5028,6 +5215,12 @@
5028
5215
  <!-- <xsl:text> </xsl:text> -->
5029
5216
  </xsl:template><xsl:template name="getSection">
5030
5217
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5218
+ <!--
5219
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
5220
+ <xsl:value-of select="."/>
5221
+ </xsl:for-each>
5222
+ -->
5223
+
5031
5224
  </xsl:template><xsl:template name="getName">
5032
5225
  <xsl:choose>
5033
5226
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -5080,6 +5273,12 @@
5080
5273
  <xsl:copy>
5081
5274
  <xsl:apply-templates mode="contents_item"/>
5082
5275
  </xsl:copy>
5276
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
5277
+ <xsl:copy>
5278
+ <xsl:apply-templates mode="contents_item"/>
5279
+ </xsl:copy>
5280
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
5281
+ <xsl:copy-of select="."/>
5083
5282
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
5084
5283
  <xsl:text> </xsl:text>
5085
5284
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -5105,6 +5304,7 @@
5105
5304
 
5106
5305
 
5107
5306
 
5307
+
5108
5308
 
5109
5309
 
5110
5310
 
@@ -5407,10 +5607,11 @@
5407
5607
  </xsl:choose>
5408
5608
 
5409
5609
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5410
-
5610
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5411
5611
  <xsl:variable name="element">
5412
5612
  block
5413
5613
 
5614
+
5414
5615
  </xsl:variable>
5415
5616
  <xsl:choose>
5416
5617
  <xsl:when test="normalize-space($element) = 'block'">
@@ -5485,11 +5686,13 @@
5485
5686
  </xsl:if>
5486
5687
  </xsl:if>
5487
5688
 
5689
+
5488
5690
  <fo:block-container margin-left="0mm">
5489
5691
 
5490
5692
  <fo:block xsl:use-attribute-sets="quote-style">
5491
5693
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5492
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5694
+
5695
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5493
5696
  </fo:block>
5494
5697
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5495
5698
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5512,29 +5715,47 @@
5512
5715
  <xsl:text>— </xsl:text>
5513
5716
  <xsl:apply-templates/>
5514
5717
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
5515
- <fo:inline xsl:use-attribute-sets="eref-style">
5516
- <xsl:if test="@type = 'footnote'">
5517
-
5518
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5519
- <xsl:attribute name="font-size">80%</xsl:attribute>
5520
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5521
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5522
-
5523
-
5524
- </xsl:if>
5525
-
5526
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5527
-
5528
- <xsl:if test="@type = 'inline'">
5529
-
5530
-
5531
-
5532
- </xsl:if>
5533
-
5534
-
5535
- <xsl:apply-templates/>
5536
- </fo:basic-link>
5537
- </fo:inline>
5718
+
5719
+ <xsl:variable name="bibitemid">
5720
+ <xsl:choose>
5721
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
5722
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
5723
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
5724
+ </xsl:choose>
5725
+ </xsl:variable>
5726
+
5727
+ <xsl:choose>
5728
+ <xsl:when test="normalize-space($bibitemid) != ''">
5729
+ <fo:inline xsl:use-attribute-sets="eref-style">
5730
+ <xsl:if test="@type = 'footnote'">
5731
+
5732
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5733
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5734
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5735
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5736
+
5737
+
5738
+ </xsl:if>
5739
+
5740
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5741
+ <xsl:if test="normalize-space(@citeas) = ''">
5742
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5743
+ </xsl:if>
5744
+ <xsl:if test="@type = 'inline'">
5745
+
5746
+
5747
+
5748
+ </xsl:if>
5749
+
5750
+ <xsl:apply-templates/>
5751
+ </fo:basic-link>
5752
+
5753
+ </fo:inline>
5754
+ </xsl:when>
5755
+ <xsl:otherwise>
5756
+ <fo:inline><xsl:apply-templates/></fo:inline>
5757
+ </xsl:otherwise>
5758
+ </xsl:choose>
5538
5759
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
5539
5760
  <!-- zero-space char -->
5540
5761
  <xsl:variable name="depth">
@@ -5642,6 +5863,7 @@
5642
5863
 
5643
5864
 
5644
5865
 
5866
+
5645
5867
 
5646
5868
 
5647
5869
 
@@ -5653,7 +5875,7 @@
5653
5875
 
5654
5876
 
5655
5877
 
5656
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
5878
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
5657
5879
  <fo:block break-after="page"/>
5658
5880
  <fo:block>
5659
5881
  <xsl:call-template name="setId"/>
@@ -5661,7 +5883,8 @@
5661
5883
  </fo:block>
5662
5884
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
5663
5885
  <fo:block>
5664
- <xsl:call-template name="setId"/>
5886
+ <xsl:call-template name="setId"/>
5887
+
5665
5888
 
5666
5889
  <xsl:apply-templates/>
5667
5890
  </fo:block>
@@ -5712,6 +5935,153 @@
5712
5935
  </fo:block>
5713
5936
  </xsl:otherwise>
5714
5937
  </xsl:choose>
5938
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
5939
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5940
+ <bookmark><xsl:value-of select="@id"/></bookmark>
5941
+ </xsl:for-each>
5942
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
5943
+ <xsl:copy>
5944
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
5945
+ </xsl:copy>
5946
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
5947
+ <xsl:variable name="id">
5948
+ <xsl:call-template name="generateIndexXrefId"/>
5949
+ </xsl:variable>
5950
+ <xsl:copy> <!-- add id to xref -->
5951
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
5952
+ <xsl:attribute name="id">
5953
+ <xsl:value-of select="$id"/>
5954
+ </xsl:attribute>
5955
+ <xsl:apply-templates mode="index_add_id"/>
5956
+ </xsl:copy>
5957
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5958
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5959
+ <xsl:if test="@to">
5960
+ <xsl:value-of select="$dash"/>
5961
+ <xsl:copy>
5962
+ <xsl:copy-of select="@*"/>
5963
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
5964
+ <xsl:attribute name="id">
5965
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
5966
+ </xsl:attribute>
5967
+ <xsl:apply-templates mode="index_add_id"/>
5968
+ </xsl:copy>
5969
+ </xsl:if>
5970
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
5971
+ <xsl:copy>
5972
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
5973
+ </xsl:copy>
5974
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
5975
+ <xsl:copy>
5976
+ <xsl:apply-templates select="@*" mode="index_update"/>
5977
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
5978
+ </xsl:copy>
5979
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
5980
+ <xsl:param name="element"/>
5981
+ <xsl:param name="remove" select="'false'"/>
5982
+ <xsl:param name="target"/>
5983
+ <!-- <node></node> -->
5984
+ <xsl:choose>
5985
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
5986
+ <!-- skip text (i.e. remove it) and process next element -->
5987
+ <!-- [removed_<xsl:value-of select="."/>] -->
5988
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5989
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
5990
+ </xsl:apply-templates>
5991
+ </xsl:when>
5992
+ <xsl:when test="self::text()">
5993
+ <xsl:value-of select="."/>
5994
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5995
+ </xsl:when>
5996
+ <xsl:when test="self::* and local-name(.) = 'xref'">
5997
+ <xsl:variable name="id" select="@id"/>
5998
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
5999
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
6000
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
6001
+
6002
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
6003
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
6004
+
6005
+ <xsl:choose>
6006
+ <!-- 2nd pass -->
6007
+ <!-- if page is equal to page for next and page is not the end of range -->
6008
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
6009
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
6010
+ <!-- [removed_xref] -->
6011
+
6012
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
6013
+ <xsl:with-param name="remove">true</xsl:with-param>
6014
+ <xsl:with-param name="target">
6015
+ <xsl:choose>
6016
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
6017
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
6018
+ </xsl:choose>
6019
+ </xsl:with-param>
6020
+ </xsl:apply-templates>
6021
+ </xsl:when>
6022
+
6023
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
6024
+ <!-- remove xref -->
6025
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
6026
+ <xsl:with-param name="remove">true</xsl:with-param>
6027
+ </xsl:apply-templates>
6028
+ </xsl:when>
6029
+
6030
+ <xsl:otherwise>
6031
+ <xsl:apply-templates select="." mode="xref_copy">
6032
+ <xsl:with-param name="target" select="$target"/>
6033
+ </xsl:apply-templates>
6034
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
6035
+ </xsl:otherwise>
6036
+ </xsl:choose>
6037
+ </xsl:when>
6038
+ <xsl:when test="self::* and local-name(.) = 'ul'">
6039
+ <!-- ul -->
6040
+ <xsl:apply-templates select="." mode="index_update"/>
6041
+ </xsl:when>
6042
+ <xsl:otherwise>
6043
+ <xsl:apply-templates select="." mode="xref_copy">
6044
+ <xsl:with-param name="target" select="$target"/>
6045
+ </xsl:apply-templates>
6046
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
6047
+ </xsl:otherwise>
6048
+ </xsl:choose>
6049
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
6050
+ <xsl:param name="target"/>
6051
+ <xsl:copy>
6052
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
6053
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
6054
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
6055
+ </xsl:if>
6056
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
6057
+ </xsl:copy>
6058
+ </xsl:template><xsl:template name="generateIndexXrefId">
6059
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6060
+
6061
+ <xsl:variable name="docid">
6062
+ <xsl:call-template name="getDocumentId"/>
6063
+ </xsl:variable>
6064
+ <xsl:variable name="item_number">
6065
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
6066
+ </xsl:variable>
6067
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
6068
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
6069
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
6070
+ <xsl:apply-templates/>
6071
+ <fo:block>
6072
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
6073
+ <fo:block> </fo:block>
6074
+ </xsl:if>
6075
+ </fo:block>
6076
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
6077
+ <xsl:apply-templates/>
6078
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6079
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6080
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6081
+ <xsl:apply-templates/>
6082
+ </fo:block>
6083
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
6084
+ <fo:inline id="{@id}"/>
5715
6085
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
5716
6086
  <!-- <row>
5717
6087
  <date>05-07-2013</date>
@@ -5807,6 +6177,8 @@
5807
6177
  <xsl:value-of select="translate(.,'. ','')"/>
5808
6178
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5809
6179
  <xsl:value-of select="substring(.,1,1)"/>
6180
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
6181
+ <fo:inline><xsl:apply-templates/></fo:inline>
5810
6182
  </xsl:template><xsl:template name="convertDate">
5811
6183
  <xsl:param name="date"/>
5812
6184
  <xsl:param name="format" select="'short'"/>
@@ -5831,6 +6203,57 @@
5831
6203
  </xsl:variable>
5832
6204
  <xsl:variable name="result">
5833
6205
  <xsl:choose>
6206
+ <xsl:when test="$format = 'ddMMyyyy'">
6207
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6208
+ <xsl:text> </xsl:text>
6209
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6210
+ </xsl:when>
6211
+ <xsl:when test="$format = 'ddMM'">
6212
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6213
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6214
+ </xsl:when>
6215
+ <xsl:when test="$format = 'short' or $day = ''">
6216
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
6217
+ </xsl:when>
6218
+ <xsl:otherwise>
6219
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
6220
+ </xsl:otherwise>
6221
+ </xsl:choose>
6222
+ </xsl:variable>
6223
+ <xsl:value-of select="$result"/>
6224
+ </xsl:template><xsl:template name="convertDateLocalized">
6225
+ <xsl:param name="date"/>
6226
+ <xsl:param name="format" select="'short'"/>
6227
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
6228
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
6229
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
6230
+ <xsl:variable name="monthStr">
6231
+ <xsl:choose>
6232
+ <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>
6233
+ <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>
6234
+ <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>
6235
+ <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>
6236
+ <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>
6237
+ <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>
6238
+ <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>
6239
+ <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>
6240
+ <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>
6241
+ <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>
6242
+ <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>
6243
+ <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>
6244
+ </xsl:choose>
6245
+ </xsl:variable>
6246
+ <xsl:variable name="result">
6247
+ <xsl:choose>
6248
+ <xsl:when test="$format = 'ddMMyyyy'">
6249
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6250
+ <xsl:text> </xsl:text>
6251
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6252
+ </xsl:when>
6253
+ <xsl:when test="$format = 'ddMM'">
6254
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6255
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6256
+ </xsl:when>
5834
6257
  <xsl:when test="$format = 'short' or $day = ''">
5835
6258
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5836
6259
  </xsl:when>
@@ -5846,7 +6269,7 @@
5846
6269
  <xsl:param name="charDelim" select="', '"/>
5847
6270
  <xsl:choose>
5848
6271
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
5849
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6272
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5850
6273
  <xsl:sort data-type="text" order="ascending"/>
5851
6274
  <xsl:call-template name="insertKeyword">
5852
6275
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -5855,7 +6278,7 @@
5855
6278
  </xsl:for-each>
5856
6279
  </xsl:when>
5857
6280
  <xsl:otherwise>
5858
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6281
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5859
6282
  <xsl:call-template name="insertKeyword">
5860
6283
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
5861
6284
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -5872,63 +6295,71 @@
5872
6295
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
5873
6296
  </xsl:choose>
5874
6297
  </xsl:template><xsl:template name="addPDFUAmeta">
5875
- <fo:declarations>
5876
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5877
- <pdf:dictionary type="normal" key="ViewerPreferences">
5878
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5879
- </pdf:dictionary>
5880
- </pdf:catalog>
5881
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
5882
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5883
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5884
- <!-- Dublin Core properties go here -->
5885
- <dc:title>
5886
- <xsl:variable name="title">
6298
+ <xsl:variable name="lang">
6299
+ <xsl:call-template name="getLang"/>
6300
+ </xsl:variable>
6301
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
6302
+ <pdf:dictionary type="normal" key="ViewerPreferences">
6303
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
6304
+ </pdf:dictionary>
6305
+ </pdf:catalog>
6306
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
6307
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
6308
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
6309
+ <!-- Dublin Core properties go here -->
6310
+ <dc:title>
6311
+ <xsl:variable name="title">
6312
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6313
+
6314
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
5887
6315
 
5888
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
5889
6316
 
5890
6317
 
5891
6318
 
5892
6319
 
5893
6320
 
5894
- </xsl:variable>
5895
- <xsl:choose>
5896
- <xsl:when test="normalize-space($title) != ''">
5897
- <xsl:value-of select="$title"/>
5898
- </xsl:when>
5899
- <xsl:otherwise>
5900
- <xsl:text> </xsl:text>
5901
- </xsl:otherwise>
5902
- </xsl:choose>
5903
- </dc:title>
5904
- <dc:creator>
6321
+ </xsl:for-each>
6322
+ </xsl:variable>
6323
+ <xsl:choose>
6324
+ <xsl:when test="normalize-space($title) != ''">
6325
+ <xsl:value-of select="$title"/>
6326
+ </xsl:when>
6327
+ <xsl:otherwise>
6328
+ <xsl:text> </xsl:text>
6329
+ </xsl:otherwise>
6330
+ </xsl:choose>
6331
+ </dc:title>
6332
+ <dc:creator>
6333
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5905
6334
 
6335
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6336
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6337
+ <xsl:if test="position() != last()">; </xsl:if>
6338
+ </xsl:for-each>
5906
6339
 
5907
6340
 
5908
- </dc:creator>
5909
- <dc:description>
5910
- <xsl:variable name="abstract">
5911
-
5912
-
5913
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract'][@language = 'en']//text()"/>
5914
-
5915
-
5916
-
5917
-
5918
- </xsl:variable>
5919
- <xsl:value-of select="normalize-space($abstract)"/>
5920
- </dc:description>
5921
- <pdf:Keywords>
5922
- <xsl:call-template name="insertKeywords"/>
5923
- </pdf:Keywords>
5924
- </rdf:Description>
5925
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5926
- <!-- XMP properties go here -->
5927
- <xmp:CreatorTool/>
5928
- </rdf:Description>
5929
- </rdf:RDF>
5930
- </x:xmpmeta>
5931
- </fo:declarations>
6341
+
6342
+ </xsl:for-each>
6343
+ </dc:creator>
6344
+ <dc:description>
6345
+ <xsl:variable name="abstract">
6346
+
6347
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
6348
+
6349
+
6350
+ </xsl:variable>
6351
+ <xsl:value-of select="normalize-space($abstract)"/>
6352
+ </dc:description>
6353
+ <pdf:Keywords>
6354
+ <xsl:call-template name="insertKeywords"/>
6355
+ </pdf:Keywords>
6356
+ </rdf:Description>
6357
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
6358
+ <!-- XMP properties go here -->
6359
+ <xmp:CreatorTool/>
6360
+ </rdf:Description>
6361
+ </rdf:RDF>
6362
+ </x:xmpmeta>
5932
6363
  </xsl:template><xsl:template name="getId">
5933
6364
  <xsl:choose>
5934
6365
  <xsl:when test="../@id">
@@ -6025,6 +6456,7 @@
6025
6456
 
6026
6457
 
6027
6458
 
6459
+
6028
6460
  </xsl:variable>
6029
6461
  <xsl:if test="$documentNS != $XSLNS">
6030
6462
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -6084,6 +6516,11 @@
6084
6516
  <xsl:call-template name="getLang"/>
6085
6517
  </xsl:variable>
6086
6518
 
6087
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6519
+ <xsl:choose>
6520
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6521
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6522
+ </xsl:when>
6523
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6524
+ </xsl:choose>
6088
6525
 
6089
6526
  </xsl:template></xsl:stylesheet>