metanorma-iec 1.2.10 → 1.2.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,6 +55,13 @@
55
55
  <param name="pattern">\i\c*|\c+#\c+</param>
56
56
  </data>
57
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
58
65
  <optional>
59
66
  <attribute name="type">
60
67
  <ref name="ReferenceFormat"/>
@@ -246,6 +253,9 @@
246
253
  <data type="boolean"/>
247
254
  </attribute>
248
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
249
259
  <optional>
250
260
  <ref name="colgroup"/>
251
261
  </optional>
@@ -779,6 +789,9 @@
779
789
  <attribute name="width"/>
780
790
  </element>
781
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
782
795
  <define name="TextElement" combine="choice">
783
796
  <ref name="concept"/>
784
797
  </define>
@@ -799,6 +812,8 @@
799
812
  <ref name="requirement"/>
800
813
  <ref name="recommendation"/>
801
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
802
817
  </choice>
803
818
  </define>
804
819
  <define name="bibliography">
@@ -829,6 +844,9 @@
829
844
  <data type="boolean"/>
830
845
  </attribute>
831
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
832
850
  <optional>
833
851
  <attribute name="obligation">
834
852
  <choice>
@@ -884,9 +902,11 @@
884
902
  <element name="code">
885
903
  <text/>
886
904
  </element>
887
- <element name="text">
888
- <text/>
889
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
890
910
  </element>
891
911
  </define>
892
912
  <define name="standard-document">
@@ -899,6 +919,9 @@
899
919
  </choice>
900
920
  </attribute>
901
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
902
925
  <optional>
903
926
  <ref name="boilerplate"/>
904
927
  </optional>
@@ -909,11 +932,21 @@
909
932
  <zeroOrMore>
910
933
  <ref name="annex"/>
911
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
912
938
  <zeroOrMore>
913
- <ref name="references"/>
939
+ <ref name="indexsect"/>
914
940
  </zeroOrMore>
915
941
  </element>
916
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
917
950
  <define name="preface">
918
951
  <element name="preface">
919
952
  <oneOrMore>
@@ -937,6 +970,11 @@
937
970
  <ref name="Content-Section"/>
938
971
  </element>
939
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
940
978
  <define name="boilerplate">
941
979
  <element name="boilerplate">
942
980
  <optional>
@@ -1056,6 +1094,9 @@
1056
1094
  </choice>
1057
1095
  </attribute>
1058
1096
  </optional>
1097
+ <optional>
1098
+ <attribute name="number"/>
1099
+ </optional>
1059
1100
  <optional>
1060
1101
  <attribute name="type"/>
1061
1102
  </optional>
@@ -1109,6 +1150,9 @@
1109
1150
  <optional>
1110
1151
  <attribute name="type"/>
1111
1152
  </optional>
1153
+ <optional>
1154
+ <attribute name="number"/>
1155
+ </optional>
1112
1156
  <optional>
1113
1157
  <ref name="section-title"/>
1114
1158
  </optional>
@@ -1211,6 +1255,9 @@
1211
1255
  <optional>
1212
1256
  <attribute name="type"/>
1213
1257
  </optional>
1258
+ <optional>
1259
+ <attribute name="number"/>
1260
+ </optional>
1214
1261
  <optional>
1215
1262
  <attribute name="obligation">
1216
1263
  <choice>
@@ -1539,6 +1586,7 @@
1539
1586
  <value>add</value>
1540
1587
  <value>modify</value>
1541
1588
  <value>delete</value>
1589
+ <value>replace</value>
1542
1590
  </choice>
1543
1591
  </attribute>
1544
1592
  <optional>
@@ -1569,6 +1617,11 @@
1569
1617
  </optional>
1570
1618
  <optional>
1571
1619
  <element name="newcontent">
1620
+ <optional>
1621
+ <attribute name="id">
1622
+ <data type="ID"/>
1623
+ </attribute>
1624
+ </optional>
1572
1625
  <zeroOrMore>
1573
1626
  <ref name="BasicBlock"/>
1574
1627
  </zeroOrMore>
@@ -1602,4 +1655,65 @@
1602
1655
  <text/>
1603
1656
  </element>
1604
1657
  </define>
1658
+ <define name="imagemap">
1659
+ <element name="imagemap">
1660
+ <ref name="figure"/>
1661
+ <zeroOrMore>
1662
+ <element name="area">
1663
+ <attribute name="type">
1664
+ <choice>
1665
+ <value>rect</value>
1666
+ <value>circle</value>
1667
+ <value>ellipse</value>
1668
+ <value>poly</value>
1669
+ </choice>
1670
+ </attribute>
1671
+ <choice>
1672
+ <ref name="xref"/>
1673
+ <ref name="hyperlink"/>
1674
+ <ref name="eref"/>
1675
+ </choice>
1676
+ <oneOrMore>
1677
+ <element name="coords">
1678
+ <attribute name="x">
1679
+ <data type="float"/>
1680
+ </attribute>
1681
+ <attribute name="y">
1682
+ <data type="float"/>
1683
+ </attribute>
1684
+ </element>
1685
+ </oneOrMore>
1686
+ <optional>
1687
+ <element name="radius">
1688
+ <attribute name="x">
1689
+ <data type="float"/>
1690
+ </attribute>
1691
+ <optional>
1692
+ <attribute name="y">
1693
+ <data type="float"/>
1694
+ </attribute>
1695
+ </optional>
1696
+ </element>
1697
+ </optional>
1698
+ </element>
1699
+ </zeroOrMore>
1700
+ </element>
1701
+ </define>
1702
+ <define name="svgmap">
1703
+ <element name="svgmap">
1704
+ <ref name="figure"/>
1705
+ <zeroOrMore>
1706
+ <element name="target">
1707
+ <attribute name="href">
1708
+ <data type="anyURI"/>
1709
+ </attribute>
1710
+ <choice>
1711
+ <ref name="xref"/>
1712
+ <ref name="hyperlink"/>
1713
+ <ref name="eref"/>
1714
+ </choice>
1715
+ </element>
1716
+ </zeroOrMore>
1717
+ </element>
1718
+ </define>
1605
1719
  </grammar>
@@ -140,22 +140,28 @@
140
140
  </choice>
141
141
  </attribute>
142
142
  </optional>
143
+ <optional>
144
+ <attribute name="type"/>
145
+ </optional>
143
146
  <optional>
144
147
  <ref name="section-title"/>
145
148
  </optional>
146
- <choice>
147
- <group>
148
- <oneOrMore>
149
- <ref name="BasicBlock"/>
150
- </oneOrMore>
151
- <zeroOrMore>
152
- <ref name="note"/>
153
- </zeroOrMore>
154
- </group>
149
+ <group>
150
+ <choice>
151
+ <group>
152
+ <oneOrMore>
153
+ <ref name="BasicBlock"/>
154
+ </oneOrMore>
155
+ <zeroOrMore>
156
+ <ref name="note"/>
157
+ </zeroOrMore>
158
+ </group>
159
+ <ref name="amend"/>
160
+ </choice>
155
161
  <oneOrMore>
156
162
  <ref name="clause-subsection"/>
157
163
  </oneOrMore>
158
- </choice>
164
+ </group>
159
165
  </define>
160
166
  <define name="term">
161
167
  <element name="term">
@@ -422,6 +428,9 @@
422
428
  <zeroOrMore>
423
429
  <ref name="termdocsource"/>
424
430
  </zeroOrMore>
431
+ <optional>
432
+ <ref name="misccontainer"/>
433
+ </optional>
425
434
  <optional>
426
435
  <ref name="boilerplate"/>
427
436
  </optional>
@@ -433,6 +442,9 @@
433
442
  <ref name="annex"/>
434
443
  </zeroOrMore>
435
444
  <ref name="bibliography"/>
445
+ <zeroOrMore>
446
+ <ref name="indexsect"/>
447
+ </zeroOrMore>
436
448
  </element>
437
449
  </define>
438
450
  <define name="horizontal">
@@ -13,7 +13,7 @@ module IsoDoc
13
13
  b = isoxml.at(ns("//boilerplate/legal-statement"))
14
14
  page_break(out)
15
15
  iec_orgname(out)
16
- middle_title(out)
16
+ middle_title(isoxml, out)
17
17
  out.div **attr_code(id: f ? f["id"] : "") do |s|
18
18
  s.h1(**{ class: "ForewordTitle" }) { |h1| h1 << @i18n.foreword }
19
19
  @meta.get[:doctype] == "Amendment" or
@@ -30,7 +30,7 @@ module IsoDoc
30
30
  out.p(**{ class: "zzSTDTitle1" }) { |p| p << "&nbsp;" }
31
31
  end
32
32
 
33
- def middle_title(out)
33
+ def middle_title(_isoxml, out)
34
34
  title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
35
35
  @meta.get[:doctitleintro] and
36
36
  title1 = "#{@meta.get[:doctitleintro]} &mdash; #{title1}"
@@ -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",
@@ -17,31 +17,23 @@
17
17
 
18
18
 
19
19
 
20
- <xsl:variable name="debug">true</xsl:variable>
20
+ <xsl:variable name="debug">false</xsl:variable>
21
21
  <xsl:variable name="pageWidth" select="'210mm'"/>
22
22
  <xsl:variable name="pageHeight" select="'297mm'"/>
23
23
 
24
- <xsl:variable name="copyrightText" select="concat('© ', /iec:iec-standard/iec:bibdata/iec:copyright/iec:owner/iec:organization/iec:abbreviation, ':', iec:iec-standard/iec:bibdata/iec:copyright/iec:from)"/>
24
+ <xsl:variable name="copyrightText" select="concat('© ', //iec:iec-standard/iec:bibdata/iec:copyright/iec:owner/iec:organization/iec:abbreviation, ':', //iec:iec-standard/iec:bibdata/iec:copyright/iec:from)"/>
25
25
  <!-- <xsl:variable name="lang-1st-letter" select="concat('(', translate(substring(iec:iec-standard/iec:bibdata/iec:language,1,1),$lower, $upper), ')')"/> -->
26
26
  <xsl:variable name="lang-1st-letter" select="''"/>
27
- <xsl:variable name="ISOname" select="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type='iso']"/>
27
+ <xsl:variable name="ISOname" select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='iso' or @type='ISO']"/>
28
28
 
29
- <xsl:variable name="title-intro" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'title-intro']"/>
30
- <xsl:variable name="title-intro-fr" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr' and @type = 'title-intro']"/>
31
- <xsl:variable name="title-main" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'title-main']"/>
32
- <xsl:variable name="title-main-fr" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr' and @type = 'title-main']"/>
33
- <xsl:variable name="part" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number/@part"/>
29
+ <xsl:variable name="part" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number/@part"/>
34
30
 
35
- <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = $lang]))"/>
36
-
37
-
38
-
39
- <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))"/>
31
+ <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = $lang]))"/>
40
32
 
41
- <xsl:variable name="stage" select="number(/iec:iec-standard/iec:bibdata/iec:status/iec:stage)"/>
42
- <xsl:variable name="substage" select="number(/iec:iec-standard/iec:bibdata/iec:status/iec:substage)"/>
43
- <xsl:variable name="stagename" select="normalize-space(/iec:iec-standard/iec:bibdata/iec:ext/iec:stagename)"/>
44
- <xsl:variable name="abbreviation" select="normalize-space(/iec:iec-standard/iec:bibdata/iec:status/iec:stage/@abbreviation)"/>
33
+ <xsl:variable name="stage" select="number(//iec:iec-standard/iec:bibdata/iec:status/iec:stage)"/>
34
+ <xsl:variable name="substage" select="number(//iec:iec-standard/iec:bibdata/iec:status/iec:substage)"/>
35
+ <xsl:variable name="stagename" select="normalize-space(//iec:iec-standard/iec:bibdata/iec:ext/iec:stagename)"/>
36
+ <xsl:variable name="abbreviation" select="normalize-space(//iec:iec-standard/iec:bibdata/iec:status/iec:stage/@abbreviation)"/>
45
37
 
46
38
  <xsl:variable name="stage-abbreviation">
47
39
  <xsl:choose>
@@ -87,7 +79,24 @@
87
79
  <item id="term-script" display="false">3.2</item>
88
80
  -->
89
81
  <xsl:variable name="contents">
90
- <xsl:variable name="docid">
82
+
83
+ <xsl:for-each select="//iec:iec-standard">
84
+ <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
85
+ <xsl:variable name="current_document">
86
+ <xsl:copy-of select="."/>
87
+ </xsl:variable>
88
+ <xsl:for-each select="xalan:nodeset($current_document)">
89
+ <xsl:variable name="docid">
90
+ <xsl:call-template name="getDocumentId"/>
91
+ </xsl:variable>
92
+ <doc id="{$docid}" lang="{$lang}">
93
+ <xsl:call-template name="generateContents"/>
94
+ </doc>
95
+ </xsl:for-each>
96
+ </xsl:for-each>
97
+
98
+
99
+ <!-- <xsl:variable name="docid">
91
100
  <xsl:call-template name="getDocumentId"/>
92
101
  </xsl:variable>
93
102
  <doc id="{$docid}" lang="{$lang}">
@@ -113,7 +122,7 @@
113
122
  </doc>
114
123
  </xsl:for-each>
115
124
  </xsl:for-each>
116
- </xsl:for-each>
125
+ </xsl:for-each> -->
117
126
 
118
127
 
119
128
  </xsl:variable>
@@ -122,6 +131,16 @@
122
131
  <contents>
123
132
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
124
133
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
134
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
135
+ <figure id="{@id}">
136
+ <title><xsl:value-of select="*[local-name() = 'name']/text()"/></title>
137
+ </figure>
138
+ </xsl:for-each>
139
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
140
+ <table id="{@id}">
141
+ <title><xsl:value-of select="*[local-name() = 'name']/text()"/></title>
142
+ </table>
143
+ </xsl:for-each>
125
144
  </contents>
126
145
  </xsl:template>
127
146
 
@@ -210,7 +229,7 @@
210
229
  <fo:static-content flow-name="left-region">
211
230
  <fo:block-container reference-orientation="90">
212
231
  <fo:block font-size="7pt" margin-left="0.5mm" margin-top="5mm">
213
- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type = 'iso-with-lang']"/>
232
+ <xsl:value-of select="(//iec:iec-standard)[1]/iec:bibdata/iec:docidentifier[@type = 'iso-with-lang']"/>
214
233
  </fo:block>
215
234
  </fo:block-container>
216
235
  </fo:static-content>
@@ -245,7 +264,7 @@
245
264
  <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
246
265
  <fo:block margin-bottom="10pt">
247
266
  <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
248
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-year']"/>
267
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-year')]"/>
249
268
  </fo:block>
250
269
  </fo:table-cell>
251
270
  </fo:table-row>
@@ -258,15 +277,18 @@
258
277
  either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
259
278
  copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
260
279
  your local IEC member National Committee for further information. -->
261
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-message']"/>
280
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-message')]"/>
262
281
  </fo:block>
263
- <fo:block margin-bottom="8pt" text-align="justify">Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
282
+ <!-- Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
264
283
  ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
265
284
  et les microfilms, sans l'accord écrit de l'IEC ou du Comité national de l'IEC du pays du demandeur. Si vous avez des
266
285
  questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
267
- les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.</fo:block>
286
+ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence. -->
287
+ <fo:block margin-bottom="8pt" text-align="justify">
288
+ <xsl:apply-templates select="(//iec:iec-standard)[2]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-message')]"/>
289
+ </fo:block>
268
290
 
269
- <xsl:variable name="telpos" select="count(/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
291
+ <xsl:variable name="telpos" select="count((//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
270
292
  <fo:table table-layout="fixed" width="100%">
271
293
  <fo:table-column column-width="59mm"/>
272
294
  <fo:table-column column-width="90mm"/>
@@ -278,13 +300,13 @@
278
300
  3, rue de Varembé
279
301
  CH-1211 Geneva 20
280
302
  Switzerland -->
281
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-name']" mode="coverpage"/>
303
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-name')]" mode="coverpage"/>
282
304
  <xsl:choose>
283
305
  <xsl:when test="$telpos != 0">
284
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &lt; $telpos]" mode="coverpage"/>
306
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/node()[position() &lt; $telpos]" mode="coverpage"/>
285
307
  </xsl:when>
286
308
  <xsl:otherwise>
287
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
309
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
288
310
  </xsl:otherwise>
289
311
  </xsl:choose>
290
312
  </fo:block>
@@ -297,7 +319,7 @@
297
319
  www.iec.ch -->
298
320
  <xsl:choose>
299
321
  <xsl:when test="$telpos != 0">
300
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &gt; $telpos]" mode="coverpage"/>
322
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/node()[position() &gt; $telpos]" mode="coverpage"/>
301
323
  </xsl:when>
302
324
  <xsl:otherwise> </xsl:otherwise>
303
325
  </xsl:choose>
@@ -313,9 +335,12 @@
313
335
  </fo:block-container>
314
336
  </fo:block>
315
337
 
316
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:feedback-statement"/>
338
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement"/> <!-- //iec:clause[not(@id) or @id != 'boilerplate-cenelec-attention'] -->
317
339
  <fo:block span="all" border-bottom="0.5pt solid black"/>
318
-
340
+ <xsl:if test="(//iec:iec-standard)[2]/iec:boilerplate/iec:feedback-statement">
341
+ <xsl:apply-templates select="(//iec:iec-standard)[2]/iec:boilerplate/iec:feedback-statement"/>
342
+ <fo:block span="all"/>
343
+ </xsl:if>
319
344
  <!-- <fo:block span="all">
320
345
  <fo:block-container margin-top="6pt">
321
346
  <fo:block-container text-align="justify" margin-left="0mm" margin-right="0mm">
@@ -452,7 +477,7 @@
452
477
  </fo:flow>
453
478
  </fo:page-sequence>
454
479
  </xsl:if>
455
-
480
+ <xsl:variable name="lang_second" select="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']"/>
456
481
  <!-- For 'Published' documents insert 3rd Cover Page
457
482
  OR insert first Covert Page for FDIS -->
458
483
  <xsl:if test="$stage &gt;= 60 or $stage-abbreviation = 'FDIS'">
@@ -464,15 +489,18 @@
464
489
  <fo:block font-size="9pt" color="{$color_blue}" line-height="150%">
465
490
  <fo:block-container width="40mm">
466
491
  <fo:block>
467
- <xsl:value-of select="$publisher"/>
492
+ <!-- <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))"/> -->
493
+ <!-- <xsl:value-of select="$publisher"/> -->
494
+ <xsl:value-of select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/>
468
495
  </fo:block>
469
496
  </fo:block-container>
470
497
  </fo:block>
471
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
498
+ <xsl:if test="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang_second]">
472
499
  <fo:block font-size="9pt" line-height="150%" margin-top="8pt">
473
500
  <fo:block-container width="40mm">
474
501
  <fo:block>
475
- <xsl:value-of select="'COMMISSION ELECTROTECHNIQUE INTERNATIONALE'"/>
502
+ <!-- <xsl:value-of select="'COMMISSION ELECTROTECHNIQUE INTERNATIONALE'"/> -->
503
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang_second]"/>
476
504
  </fo:block>
477
505
  </fo:block-container>
478
506
  </fo:block>
@@ -489,25 +517,32 @@
489
517
  <fo:block color="{$color_blue}" margin-bottom="3pt">
490
518
  <!-- PRICE CODE -->
491
519
  <xsl:variable name="price_code">
492
- <xsl:call-template name="getLocalizedString">
520
+ <!-- <xsl:call-template name="getLocalizedString">
493
521
  <xsl:with-param name="key">price-code</xsl:with-param>
494
- </xsl:call-template>
522
+ </xsl:call-template> -->
523
+ <xsl:value-of select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='price-code' and @language=$lang]"/>
495
524
  </xsl:variable>
496
525
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
497
526
  </fo:block>
498
- <xsl:if test="$lang != 'fr'">
527
+ <!-- <xsl:if test="$lang != 'fr'">
499
528
  <fo:block>CODE PRIX</fo:block>
500
- </xsl:if>
529
+ </xsl:if> -->
530
+ <fo:block>
531
+ <xsl:variable name="price_code">
532
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='price-code' and @language=$lang_second]"/>
533
+ </xsl:variable>
534
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
535
+ </fo:block>
501
536
  </fo:block>
502
537
  </fo:table-cell>
503
538
  <fo:table-cell font-size="25pt" font-weight="bold" color="{$color_gray}" text-align="right" display-align="center">
504
- <fo:block padding-top="1mm"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:ext/iec:price-code"/></fo:block>
539
+ <fo:block padding-top="1mm"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:price-code"/></fo:block>
505
540
  </fo:table-cell>
506
541
  </fo:table-row>
507
542
  </fo:table-body>
508
543
  </fo:table>
509
544
  <fo:block font-size="8pt" text-align-last="justify">
510
- <xsl:for-each select="/iec:iec-standard/iec:bibdata/iec:ext/iec:ics">
545
+ <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:ext/iec:ics">
511
546
  <xsl:if test="position() = 1">ICS </xsl:if>
512
547
  <xsl:value-of select="iec:code"/>
513
548
  <xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if>
@@ -515,9 +550,9 @@
515
550
  <xsl:text> </xsl:text>
516
551
  <fo:inline keep-together.within-line="always"><fo:leader leader-pattern="space"/>
517
552
  <xsl:text> </xsl:text>
518
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']">
553
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']">
519
554
  <!-- <xsl:text>Example: ISBN 978-2-8322-1532-6</xsl:text> -->
520
- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']"/>
555
+ <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']"/>
521
556
  </xsl:if>
522
557
  </fo:inline>
523
558
  </fo:block>
@@ -525,7 +560,7 @@
525
560
  <fo:block-container margin-left="0mm">
526
561
  <fo:block-container border="0.5pt solid black" font-size="10pt" margin-top="8mm" font-weight="bold" padding-left="1.5mm" padding-top="0.5mm" width="102%" height="11mm" display-align="center">
527
562
  <fo:block>Warning! Make sure that you obtained this publication from an authorized distributor.</fo:block>
528
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
563
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
529
564
  <fo:block margin-top="3pt">Attention! Veuillez vous assurer que vous avez obtenu cette publication via un distributeur agréé.</fo:block>
530
565
  </xsl:if>
531
566
  </fo:block-container>
@@ -533,7 +568,7 @@
533
568
  </fo:block-container>
534
569
  <fo:block font-size="6pt" margin-top="6mm" margin-left="1mm">
535
570
  <fo:block>® Registered trademark of the International Electrotechnical Commission</fo:block>
536
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
571
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
537
572
  <fo:block margin-left="2mm">Marque déposée de la Commission Electrotechnique Internationale</fo:block>
538
573
  </xsl:if>
539
574
  </fo:block>
@@ -549,10 +584,15 @@
549
584
  <fo:static-content flow-name="footer-FDIS">
550
585
  <fo:block-container background-color="rgb(236, 232, 232)" padding="2mm" border="1.5pt solid white">
551
586
  <fo:block font-size="8pt" margin-bottom="6pt">
552
- <fo:inline font-weight="bold">
587
+
588
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[not(@id)]"/>
589
+
590
+ <!-- <fo:inline font-weight="bold">
553
591
  <xsl:call-template name="addLetterSpacing">
554
592
  <xsl:with-param name="text">
555
- <xsl:text>Copyright © 2019 International Electrotechnical Commission, IEC</xsl:text>
593
+ <xsl:for-each select="(//iec:iec-standard)[1]/iec:bibdata/iec:copyright">
594
+ <xsl:text>Copyright © </xsl:text><xsl:value-of select="iec:from"/><xsl:text> </xsl:text><xsl:value-of select="iec:owner/iec:organization/iec:name"/><xsl:text>, </xsl:text><xsl:value-of select="iec:owner/iec:organization/iec:abbreviation"/>
595
+ </xsl:for-each>
556
596
  </xsl:with-param>
557
597
  </xsl:call-template>
558
598
  </fo:inline>
@@ -562,7 +602,7 @@
562
602
  <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>
563
603
  </xsl:with-param>
564
604
  </xsl:call-template>
565
- </fo:inline>
605
+ </fo:inline> -->
566
606
  </fo:block>
567
607
  </fo:block-container>
568
608
  </fo:static-content>
@@ -574,7 +614,8 @@
574
614
  <fo:inline font-size="8pt" padding-left="0.5mm" color="{$color_blue}">®</fo:inline>
575
615
  </xsl:if>
576
616
  <fo:inline keep-together.within-line="always" font-size="18pt" font-weight="bold" baseline-shift="10mm"><fo:leader leader-pattern="space"/>
577
- <xsl:text>Ex: 34D/1511/FDIS</xsl:text>
617
+ <!-- Ex: 34D/1511/FDIS -->
618
+ <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='iso-tc']"/>
578
619
  <xsl:text> </xsl:text>
579
620
  </fo:inline>
580
621
  </fo:block>
@@ -609,7 +650,7 @@
609
650
  </fo:block>
610
651
  <fo:block font-size="9pt" font-weight="bold">
611
652
  <xsl:call-template name="addLetterSpacing">
612
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number"/></xsl:with-param>
653
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number"/></xsl:with-param>
613
654
  </xsl:call-template>
614
655
  </fo:block>
615
656
  </fo:table-cell>
@@ -623,7 +664,7 @@
623
664
  </fo:block>
624
665
  <fo:block font-size="9pt" font-weight="bold">
625
666
  <xsl:call-template name="addLetterSpacing">
626
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:date[@type ='circulated']/iec:on"/></xsl:with-param>
667
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type ='circulated']/iec:on"/></xsl:with-param>
627
668
  </xsl:call-template>
628
669
  </fo:block>
629
670
  </fo:table-cell>
@@ -635,7 +676,8 @@
635
676
  </fo:block>
636
677
  <fo:block font-size="9pt" font-weight="bold">
637
678
  <xsl:call-template name="addLetterSpacing">
638
- <xsl:with-param name="text">2019-12-06</xsl:with-param>
679
+ <!-- 2019-12-06 -->
680
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type='vote-ended']/iec:on"/></xsl:with-param>
639
681
  </xsl:call-template>
640
682
  </fo:block>
641
683
  </fo:table-cell>
@@ -649,7 +691,8 @@
649
691
  </fo:block>
650
692
  <fo:block font-size="9pt" font-weight="bold">
651
693
  <xsl:variable name="supersedes_documents">
652
- <xsl:for-each select="/iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber">
694
+ <!-- <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber"> -->
695
+ <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='obsoletes']/iec:bibitem/iec:docidentifier">
653
696
  <xsl:value-of select="."/>
654
697
  <xsl:if test="position() != last()">,</xsl:if>
655
698
  </xsl:for-each>
@@ -675,22 +718,26 @@
675
718
  <fo:table-row height="4mm">
676
719
  <fo:table-cell number-columns-spanned="2" border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
677
720
  <fo:block>
678
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
679
- <fo:block font-size="6.5pt">
680
- <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>
681
- <xsl:call-template name="addLetterSpacingSmallCaps">
682
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
683
- </xsl:call-template>
684
- </fo:block>
685
- </xsl:if>
686
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
687
- <fo:block font-size="6.5pt">
688
- <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>
689
- <xsl:call-template name="addLetterSpacingSmallCaps">
690
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
691
- </xsl:call-template>
692
- </fo:block>
693
- </xsl:if>
721
+ <!-- If //bibdata/ext/editorialgroup/subcommittee exists, use "IEC SC" + //bibdata/ext/editorialgroup/subcommittee/@number + //bibdata/ext/editorialgroup/subcommittee,
722
+ else use "IEC TC" + //bibdata/ext/editorialgroup/technical-committee/@number + //bibdata/ext/editorialgroup/technical-committee -->
723
+ <xsl:choose>
724
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
725
+ <fo:block font-size="6.5pt">
726
+ <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>
727
+ <xsl:call-template name="addLetterSpacingSmallCaps">
728
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
729
+ </xsl:call-template>
730
+ </fo:block>
731
+ </xsl:when>
732
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
733
+ <fo:block font-size="6.5pt">
734
+ <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>
735
+ <xsl:call-template name="addLetterSpacingSmallCaps">
736
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
737
+ </xsl:call-template>
738
+ </fo:block>
739
+ </xsl:when>
740
+ </xsl:choose>
694
741
  </fo:block>
695
742
  </fo:table-cell>
696
743
  </fo:table-row>
@@ -703,7 +750,7 @@
703
750
  </fo:block>
704
751
  <fo:block font-size="9pt">
705
752
  <xsl:call-template name="addLetterSpacing">
706
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:secretariat"/>
753
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:secretariat"/>
707
754
  </xsl:call-template>
708
755
  </fo:block>
709
756
  </fo:table-cell>
@@ -714,8 +761,9 @@
714
761
  </xsl:call-template>
715
762
  </fo:block>
716
763
  <fo:block font-size="9pt">
764
+ <!-- Example: Ms Shanti Conn -->
717
765
  <xsl:call-template name="addLetterSpacing">
718
- <xsl:with-param name="text" select="'Ms Shanti Conn'"/>
766
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:secretary"/>
719
767
  </xsl:call-template>
720
768
  </fo:block>
721
769
  </fo:table-cell>
@@ -730,6 +778,11 @@
730
778
  <xsl:with-param name="text" select="'Of interest to the following committees:'"/>
731
779
  </xsl:call-template>
732
780
  </fo:block>
781
+ <fo:block font-size="9pt">
782
+ <xsl:call-template name="addLetterSpacing">
783
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:interest-to-committees"/>
784
+ </xsl:call-template>
785
+ </fo:block>
733
786
  </fo:table-cell>
734
787
  <xsl:if test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'CDV' or $stage-abbreviation = 'CD'">
735
788
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
@@ -745,9 +798,15 @@
745
798
  </xsl:call-template>
746
799
  </xsl:if>
747
800
  </fo:block>
748
-
749
801
  <fo:block>
750
- <xsl:call-template name="insertCheckBoxOff"/>
802
+ <xsl:choose>
803
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
804
+ <xsl:call-template name="insertCheckBoxOn"/>
805
+ </xsl:when>
806
+ <xsl:otherwise>
807
+ <xsl:call-template name="insertCheckBoxOff"/>
808
+ </xsl:otherwise>
809
+ </xsl:choose>
751
810
  </fo:block>
752
811
 
753
812
  <xsl:if test="$stage-abbreviation = 'CDV' or $stage-abbreviation = 'CD'">
@@ -776,7 +835,7 @@
776
835
  <!-- function: { emc | safety | environment | quality-assurance } -->
777
836
  <fo:block font-size="6.5pt">
778
837
  <xsl:choose>
779
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'emc'">
838
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'emc'">
780
839
  <xsl:call-template name="insertCheckBoxOn"/>
781
840
  </xsl:when>
782
841
  <xsl:otherwise>
@@ -788,7 +847,7 @@
788
847
  </xsl:call-template>
789
848
  <fo:inline padding-right="33mm"> </fo:inline>
790
849
  <xsl:choose>
791
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'environment'">
850
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'environment'">
792
851
  <xsl:call-template name="insertCheckBoxOn"/>
793
852
  </xsl:when>
794
853
  <xsl:otherwise>
@@ -804,7 +863,7 @@
804
863
  <fo:block font-size="6.5pt" margin-bottom="6pt"> </fo:block>
805
864
  <fo:block font-size="6.5pt">
806
865
  <xsl:choose>
807
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'quality-assurance'">
866
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'quality-assurance'">
808
867
  <xsl:call-template name="insertCheckBoxOn"/>
809
868
  </xsl:when>
810
869
  <xsl:otherwise>
@@ -816,7 +875,7 @@
816
875
  </xsl:call-template>
817
876
  <fo:inline padding-right="13mm"> </fo:inline>
818
877
  <xsl:choose>
819
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'safety'">
878
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'safety'">
820
879
  <xsl:call-template name="insertCheckBoxOn"/>
821
880
  </xsl:when>
822
881
  <xsl:otherwise>
@@ -836,18 +895,22 @@
836
895
  <fo:table-row>
837
896
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
838
897
  <fo:block font-size="6.5pt" margin-bottom="12pt">
839
- <xsl:call-template name="insertCheckBoxOn"/>
898
+ <xsl:choose>
899
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:cen-processing = 'true'">
900
+ <xsl:call-template name="insertCheckBoxOn"/>
901
+ </xsl:when>
902
+ <xsl:otherwise>
903
+ <xsl:call-template name="insertCheckBoxOff"/>
904
+ </xsl:otherwise>
905
+ </xsl:choose>
840
906
  <xsl:call-template name="addLetterSpacingSmallCaps">
841
907
  <xsl:with-param name="text" select="'Submitted for CENELEC parallel voting'"/>
842
908
  </xsl:call-template>
843
909
  </fo:block>
844
- <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
845
- <xsl:call-template name="addLetterSpacing">
846
- <xsl:with-param name="text" select="'Attention IEC-CENELEC parallel voting'"/>
847
- </xsl:call-template>
848
- </fo:block>
849
910
 
850
- <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
911
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']"/>
912
+
913
+ <!-- <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
851
914
  <xsl:if test="$stage-abbreviation = 'FDIS'">
852
915
  <xsl:call-template name="addLetterSpacing">
853
916
  <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.'"/>
@@ -863,11 +926,19 @@
863
926
  <xsl:call-template name="addLetterSpacing">
864
927
  <xsl:with-param name="text" select="'The CENELEC members are invited to vote through the CENELEC online voting system.'"/>
865
928
  </xsl:call-template>
866
- </fo:block>
929
+ </fo:block> -->
930
+
867
931
  </fo:table-cell>
868
932
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
869
933
  <fo:block font-size="6.5pt" margin-bottom="6pt">
870
- <xsl:call-template name="insertCheckBoxOff"/>
934
+ <xsl:choose>
935
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:cen-processing = 'true'">
936
+ <xsl:call-template name="insertCheckBoxOff"/>
937
+ </xsl:when>
938
+ <xsl:otherwise>
939
+ <xsl:call-template name="insertCheckBoxOn"/>
940
+ </xsl:otherwise>
941
+ </xsl:choose>
871
942
  <xsl:call-template name="addLetterSpacingSmallCaps">
872
943
  <xsl:with-param name="text" select="'Not submitted for CENELEC parallel voting'"/>
873
944
  </xsl:call-template>
@@ -881,7 +952,10 @@
881
952
  </fo:block-container>
882
953
 
883
954
  <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">
884
- <xsl:if test="$stage-abbreviation = 'FDIS'">
955
+ <fo:block>
956
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:license-statement" mode="cover-page-internal"/>
957
+ </fo:block>
958
+ <!-- <xsl:if test="$stage-abbreviation = 'FDIS'">
885
959
  <fo:block margin-bottom="6pt">
886
960
  <xsl:call-template name="addLetterSpacing">
887
961
  <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>
@@ -898,7 +972,17 @@
898
972
  </xsl:call-template>
899
973
  </fo:block>
900
974
  </xsl:if>
901
- <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'">
975
+ <xsl:if test="$stage-abbreviation = 'NWIP' or
976
+ $stage-abbreviation = 'PWI' or
977
+ $stage-abbreviation = 'NP' or
978
+ $stage-abbreviation = 'AWI' or
979
+ $stage-abbreviation = 'WD' or
980
+ $stage-abbreviation = 'CD' or
981
+ $stage-abbreviation = 'CDV' or
982
+ $stage-abbreviation = 'CD-TSTR' or
983
+ $stage-abbreviation = 'DTS' or
984
+ $stage-abbreviation = 'DTR' or
985
+ $stage-abbreviation = 'DPAS'">
902
986
  <fo:block margin-bottom="6pt">
903
987
  <xsl:call-template name="addLetterSpacing">
904
988
  <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>
@@ -909,7 +993,7 @@
909
993
  <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>
910
994
  </xsl:call-template>
911
995
  </fo:block>
912
- </xsl:if>
996
+ </xsl:if> -->
913
997
  </fo:block-container>
914
998
 
915
999
  <fo:block-container background-color="rgb(219, 229, 241)" margin-top="4mm" padding="2mm" padding-top="1mm" border="1.5pt solid white">
@@ -920,7 +1004,7 @@
920
1004
  </fo:block>
921
1005
  <fo:block font-size="9pt" font-weight="bold">
922
1006
  <xsl:call-template name="addLetterSpacing">
923
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'main']"/></xsl:with-param>
1007
+ <xsl:with-param name="text"><xsl:value-of select="(//iec:iec-standard)[1]/iec:bibdata/iec:title[@language = $lang and @type = 'main']"/></xsl:with-param>
924
1008
  </xsl:call-template>
925
1009
  </fo:block>
926
1010
  </fo:block-container>
@@ -933,24 +1017,24 @@
933
1017
  <xsl:text>PROPOSED STABILITY DATE: </xsl:text>
934
1018
  </xsl:with-param>
935
1019
  </xsl:call-template>
936
- <fo:inline font-size="9pt">2023</fo:inline>
1020
+ <!-- 2023 -->
1021
+ <fo:inline font-size="9pt"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type='unchanged']/iec:on"/></fo:inline>
937
1022
  </fo:block>
938
1023
  </fo:block-container>
939
1024
  </xsl:if>
940
1025
 
941
- <fo:block-container border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
1026
+ <fo:block-container border="1.5 solid" border-color="rgb(221, 213, 213)" padding="1mm" margin-top="3mm">
942
1027
  <fo:block font-size="6.5pt" margin-bottom="6pt">
943
1028
  <xsl:call-template name="addLetterSpacingSmallCaps">
944
1029
  <xsl:with-param name="text">Note from TC/SC officers:</xsl:with-param>
945
1030
  </xsl:call-template>
946
1031
  </fo:block>
947
- <!-- <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> -->
1032
+ <!-- Example: This FDIS is the result of the discussion between the IEC SC21A experts WG 3 during the meeting held in -->
1033
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:bibdata/iec:ext/iec:tc-sc-officers-note"/>
948
1034
  </fo:block-container>
949
1035
 
950
-
951
-
952
- <xsl:if test="$stage-abbreviation = 'FDIS'">
953
- <fo:block-container font-size="9pt" border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
1036
+ <!-- <xsl:if test="$stage-abbreviation = 'FDIS'">
1037
+ <fo:block-container font-size="9pt" border="1.5 solid" border-color="rgb(221, 213, 213)" height="13mm" padding="1mm" margin-top="3mm">
954
1038
  <fo:block margin-bottom="6pt">
955
1039
  <xsl:call-template name="addLetterSpacing">
956
1040
  <xsl:with-param name="text">
@@ -966,14 +1050,62 @@
966
1050
  </xsl:call-template>
967
1051
  </fo:block>
968
1052
  </fo:block-container>
969
- </xsl:if>
1053
+ </xsl:if> -->
970
1054
 
971
1055
  </fo:flow>
972
1056
  </fo:page-sequence>
973
1057
  </xsl:if>
974
1058
 
1059
+ <xsl:if test="$debug = 'true'">
1060
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1061
+ DEBUG
1062
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
1063
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1064
+ </xsl:if>
975
1065
 
976
- <fo:page-sequence master-reference="document" format="1" initial-page-number="2" force-page-count="no-force">
1066
+ <xsl:for-each select="//iec:iec-standard">
1067
+ <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
1068
+ <xsl:variable name="current_document">
1069
+ <xsl:copy-of select="."/>
1070
+ </xsl:variable>
1071
+ <xsl:for-each select="xalan:nodeset($current_document)">
1072
+
1073
+ <xsl:variable name="docid">
1074
+ <xsl:call-template name="getDocumentId"/>
1075
+ </xsl:variable>
1076
+
1077
+
1078
+ <fo:page-sequence master-reference="document" format="1" force-page-count="no-force"> <!-- initial-page-number="2" -->
1079
+ <xsl:variable name="num"><xsl:number count="iec:iec-standard" level="any"/></xsl:variable>
1080
+ <xsl:if test="$num = '1'">
1081
+ <xsl:attribute name="initial-page-number">2</xsl:attribute>
1082
+ </xsl:if>
1083
+
1084
+ <xsl:call-template name="insertHeaderFooter"/>
1085
+ <fo:flow flow-name="xsl-region-body">
1086
+
1087
+ <xsl:call-template name="insertTOCpages">
1088
+ <xsl:with-param name="contents" select="xalan:nodeset($contents)/doc[@id = $docid]"/>
1089
+ </xsl:call-template>
1090
+
1091
+ <xsl:call-template name="insertPrefacepages">
1092
+ <xsl:with-param name="lang" select="$lang"/>
1093
+ </xsl:call-template>
1094
+
1095
+
1096
+ </fo:flow>
1097
+ </fo:page-sequence>
1098
+
1099
+ <xsl:call-template name="insertBodypages">
1100
+ <xsl:with-param name="lang" select="$lang"/>
1101
+ </xsl:call-template>
1102
+
1103
+ </xsl:for-each>
1104
+ </xsl:for-each>
1105
+
1106
+
1107
+
1108
+ <!-- <fo:page-sequence master-reference="document" format="1" initial-page-number="2" force-page-count="no-force">
977
1109
  <xsl:call-template name="insertHeaderFooter"/>
978
1110
  <fo:flow flow-name="xsl-region-body">
979
1111
 
@@ -981,13 +1113,7 @@
981
1113
  <xsl:call-template name="getDocumentId"/>
982
1114
  </xsl:variable>
983
1115
 
984
- <xsl:if test="$debug = 'true'">
985
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
986
- DEBUG
987
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
988
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
989
- </xsl:if>
990
-
1116
+
991
1117
  <xsl:call-template name="insertTOCpages">
992
1118
  <xsl:with-param name="contents" select="xalan:nodeset($contents)/doc[@id = $docid]"/>
993
1119
  </xsl:call-template>
@@ -999,11 +1125,11 @@
999
1125
 
1000
1126
 
1001
1127
  <xsl:call-template name="insertBodypages"/>
1002
-
1128
+ -->
1003
1129
 
1004
1130
 
1005
1131
  <!-- Test=<xsl:copy-of select="$additionalDocs"/> Test -->
1006
- <xsl:for-each select="xalan:nodeset($additionalXMLsArray)/*">
1132
+ <!-- <xsl:for-each select="xalan:nodeset($additionalXMLsArray)/*">
1007
1133
 
1008
1134
  <xsl:for-each select="document(.)">
1009
1135
  <xsl:variable name="lang">
@@ -1044,7 +1170,7 @@
1044
1170
 
1045
1171
  </xsl:for-each>
1046
1172
  </xsl:for-each>
1047
- </xsl:for-each>
1173
+ </xsl:for-each> -->
1048
1174
 
1049
1175
 
1050
1176
 
@@ -1063,6 +1189,7 @@
1063
1189
  <fo:block font-size="11pt" color="{$color_blue}" margin-bottom="12pt" line-height="150%">
1064
1190
  <fo:block-container width="42mm">
1065
1191
  <fo:block>
1192
+ <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))"/>
1066
1193
  <xsl:value-of select="$publisher"/>
1067
1194
  </fo:block>
1068
1195
  </fo:block-container>
@@ -1078,14 +1205,14 @@
1078
1205
  Fax: + 41 22 919 03 00
1079
1206
  info@iec.ch
1080
1207
  www.iec.ch -->
1081
- <xsl:variable name="telpos" select="count(/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
1208
+ <xsl:variable name="telpos" select="count((//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
1082
1209
  <xsl:choose>
1083
1210
  <xsl:when test="$telpos != 0">
1084
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &lt;= $telpos]" mode="coverpage"/>
1085
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &gt;= $telpos]" mode="coverpage"/>
1211
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/node()[position() &lt;= $telpos]" mode="coverpage"/>
1212
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]/node()[position() &gt;= $telpos]" mode="coverpage"/>
1086
1213
  </xsl:when>
1087
1214
  <xsl:otherwise>
1088
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
1215
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
1089
1216
  </xsl:otherwise>
1090
1217
  </xsl:choose>
1091
1218
  </fo:block>
@@ -1097,11 +1224,25 @@
1097
1224
  </fo:root>
1098
1225
  </xsl:template>
1099
1226
 
1227
+ <xsl:template match="iec:tc-sc-officers-note/iec:p">
1228
+ <fo:block><xsl:apply-templates/></fo:block>
1229
+ </xsl:template>
1230
+
1100
1231
  <xsl:template name="insertCoverPart1">
1232
+ <xsl:variable name="lang_second">
1233
+ <xsl:choose>
1234
+ <xsl:when test="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']">
1235
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']"/>
1236
+ </xsl:when>
1237
+ <xsl:otherwise>
1238
+ <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:title[@language and @language != $lang]/@language"/>
1239
+ </xsl:otherwise>
1240
+ </xsl:choose>
1241
+ </xsl:variable>
1101
1242
  <fo:block text-align-last="justify">
1102
1243
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-IEC))}" width="18mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo IEC"/>
1103
1244
  <fo:inline font-size="8pt" padding-left="0.5mm" color="rgb(88, 88, 90)">®</fo:inline>
1104
- <fo:inline keep-together.within-line="always" font-size="25pt" font-weight="bold" color="{$color_gray}" border-bottom="0.5pt solid {$color_gray}" padding-bottom="3.5mm" baseline-shift="5.5mm"><fo:leader leader-pattern="space"/><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type = 'iso']"/></fo:inline>
1245
+ <fo:inline keep-together.within-line="always" font-size="25pt" font-weight="bold" color="{$color_gray}" border-bottom="0.5pt solid {$color_gray}" padding-bottom="3.5mm" baseline-shift="5.5mm"><fo:leader leader-pattern="space"/><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type = 'iso' or @type = 'ISO']"/></fo:inline>
1105
1246
  </fo:block>
1106
1247
  <fo:block font-size="10.5pt" text-align="right" margin-top="0.5mm">
1107
1248
  <xsl:variable name="title-edition">
@@ -1111,12 +1252,13 @@
1111
1252
  </xsl:variable>
1112
1253
  <xsl:value-of select="$title-edition"/>
1113
1254
  <fo:inline>
1114
- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:edition"/>
1115
- <xsl:if test="not(contains(/iec:iec-standard/iec:bibdata/iec:edition, '.'))">.0</xsl:if>
1255
+ <xsl:variable name="edition" select="//iec:iec-standard/iec:bibdata/iec:edition"/>
1256
+ <xsl:value-of select="$edition"/>
1257
+ <xsl:if test="not(contains($edition, '.'))">.0</xsl:if>
1116
1258
  </fo:inline>
1117
1259
  <fo:inline padding-left="4mm">
1118
1260
  <!-- Example 2014-05 -->
1119
- <xsl:value-of select="substring(/iec:iec-standard/iec:bibdata/iec:version/iec:revision-date, 1, 7)"/>
1261
+ <xsl:value-of select="substring(//iec:iec-standard/iec:bibdata/iec:version/iec:revision-date, 1, 7)"/>
1120
1262
  </fo:inline>
1121
1263
  <fo:block> </fo:block>
1122
1264
  </fo:block>
@@ -1132,6 +1274,7 @@
1132
1274
  <xsl:text>PRE-RELEASE VERSION (FDIS)</xsl:text>
1133
1275
  </xsl:when>
1134
1276
  <xsl:when test="$stage &gt;= 60">
1277
+ <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new((//iec:iec-standard)[1]/iec:bibdata/iec:ext/iec:doctype[@language = $lang]))"/>
1135
1278
  <xsl:value-of select="$doctype_uppercased"/>
1136
1279
  </xsl:when>
1137
1280
  <xsl:otherwise>
@@ -1139,10 +1282,10 @@
1139
1282
  <xsl:text> (</xsl:text><xsl:value-of select="$stage-abbreviation"/><xsl:text>)</xsl:text>
1140
1283
  </xsl:otherwise>
1141
1284
  </xsl:choose>
1142
-
1143
1285
  </fo:block>
1144
1286
  </fo:block-container>
1145
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr'] and $lang != 'fr'">
1287
+
1288
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second]">
1146
1289
  <fo:block-container height="26mm" margin-top="10pt" display-align="after">
1147
1290
  <xsl:if test="$stage &gt;= 60">
1148
1291
  <xsl:attribute name="width">100mm</xsl:attribute>
@@ -1150,7 +1293,7 @@
1150
1293
  <fo:block color="{$color_gray}">
1151
1294
  <xsl:if test="$stage &gt;= 60">
1152
1295
  <!-- <xsl:text>NORME INTERNATIONALE</xsl:text> -->
1153
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = 'fr']))"/>
1296
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = $lang_second]))"/>
1154
1297
  </xsl:if>
1155
1298
  </fo:block>
1156
1299
  </fo:block-container>
@@ -1161,7 +1304,7 @@
1161
1304
  <fo:block-container margin-left="0mm">
1162
1305
  <fo:block-container height="6mm">
1163
1306
  <fo:block text-align="right" margin-top="-4.5mm" margin-right="-1mm">
1164
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:ext/iec:accessibility-color-inside = 'true'">
1307
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:accessibility-color-inside = 'true'">
1165
1308
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Colour-Inside))}" width="19mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo IEC"/>
1166
1309
  </xsl:if>
1167
1310
  </fo:block>
@@ -1169,11 +1312,11 @@
1169
1312
  <fo:block-container border-bottom="0.5pt solid {$color_gray}" margin-top="4mm" margin-bottom="16pt" height="14mm" display-align="center">
1170
1313
  <fo:block font-size="10pt" color="{$color_blue}" margin-bottom="4pt">
1171
1314
  <xsl:choose>
1172
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1173
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang]))"/>
1315
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1316
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang]))"/>
1174
1317
  </xsl:when>
1175
1318
  <xsl:otherwise><!-- horizontal is false -->
1176
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang]))"/>
1319
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang]))"/>
1177
1320
  </xsl:otherwise>
1178
1321
  </xsl:choose>
1179
1322
  <!-- Example: BASIC EMC PUBLICATION -->
@@ -1183,14 +1326,14 @@
1183
1326
  Basic Environment Publication
1184
1327
  Basic Quality Assurance Publication -->
1185
1328
  </fo:block>
1186
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr'] and $lang != 'fr'">
1329
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second]">
1187
1330
  <fo:block font-size="10pt" margin-bottom="10pt">
1188
1331
  <xsl:choose>
1189
- <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1190
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = 'fr']))"/>
1332
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1333
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang_second]))"/>
1191
1334
  </xsl:when>
1192
1335
  <xsl:otherwise><!-- horizontal is false -->
1193
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = 'fr']))"/>
1336
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang_second]))"/>
1194
1337
  </xsl:otherwise>
1195
1338
  </xsl:choose>
1196
1339
  <!-- Example: PUBLICATION FONDAMENTALE EN CEM -->
@@ -1207,42 +1350,62 @@
1207
1350
  Electromagnetic compatibility (EMC) –
1208
1351
  Part 4-5: Testing and measurement techniques – Surge immunity test
1209
1352
  -->
1353
+ <xsl:variable name="title-intro" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']"/>
1210
1354
  <xsl:value-of select="$title-intro"/>
1355
+ <xsl:variable name="title-main" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']"/>
1211
1356
  <xsl:if test="$title-main != ''">
1212
1357
  <xsl:text> — </xsl:text>
1213
1358
  <xsl:value-of select="$title-main"/>
1214
1359
  </xsl:if>
1215
- <xsl:variable name="part-en" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'title-part']"/>
1216
- <xsl:if test="$part-en != ''">
1360
+ <xsl:variable name="title-part" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-part']"/>
1361
+ <xsl:if test="$title-part != ''">
1217
1362
  <xsl:text> — </xsl:text>
1218
1363
  <xsl:value-of select="$linebreak"/>
1219
1364
  <xsl:if test="$part != ''">
1220
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1365
+ <xsl:variable name="localized_part" select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang]"/>
1366
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($localized_part),'#',$part)"/> -->
1367
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1221
1368
  <!-- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
1222
1369
  <xsl:text>: </xsl:text> -->
1223
1370
  </xsl:if>
1224
- <xsl:value-of select="$part-en"/>
1371
+ <xsl:value-of select="$title-part"/>
1225
1372
  </xsl:if>
1226
1373
  </fo:block>
1227
1374
  <fo:block font-size="12pt" font-weight="bold">
1228
1375
  <!-- Example: Compatibilité électromagnétique (CEM) –
1229
1376
  Partie 4-5: Techniques d'essai et de mesure – Essai d'immunité aux ondes de
1230
1377
  choc -->
1231
- <xsl:value-of select="$title-intro-fr"/>
1232
- <xsl:if test="$title-main-fr != ''">
1378
+ <xsl:variable name="title-intro-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-intro']"/>
1379
+ <xsl:value-of select="$title-intro-second"/>
1380
+ <xsl:variable name="title-main-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-main']"/>
1381
+ <xsl:if test="$title-main-second != ''">
1233
1382
  <xsl:text> — </xsl:text>
1234
- <xsl:value-of select="$title-main-fr"/>
1383
+ <xsl:value-of select="$title-main-second"/>
1235
1384
  </xsl:if>
1236
- <xsl:variable name="part-fr" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr' and @type = 'title-part']"/>
1237
- <xsl:if test="$part-fr != ''">
1385
+ <xsl:variable name="part-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-part']"/>
1386
+ <xsl:if test="$part-second != ''">
1238
1387
  <xsl:text> — </xsl:text>
1239
1388
  <xsl:value-of select="$linebreak"/>
1240
1389
  <xsl:if test="$part != ''">
1241
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1390
+
1391
+ <xsl:choose>
1392
+ <xsl:when test="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]">
1393
+ <xsl:variable name="localized_part">
1394
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]"/>
1395
+ </xsl:variable>
1396
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1397
+ </xsl:when>
1398
+ <xsl:otherwise>
1399
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang_second]),'#',$part)"/>
1400
+ </xsl:otherwise>
1401
+ </xsl:choose>
1402
+
1403
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($localized_part),'#',$part)"/> -->
1404
+
1242
1405
  <!-- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
1243
1406
  <xsl:text>: </xsl:text> -->
1244
1407
  </xsl:if>
1245
- <xsl:value-of select="$part-fr"/>
1408
+ <xsl:value-of select="$part-second"/>
1246
1409
  </xsl:if>
1247
1410
  </fo:block>
1248
1411
  </fo:block-container>
@@ -1364,7 +1527,8 @@
1364
1527
  <xsl:param name="lang" select="$lang"/>
1365
1528
  <fo:block break-after="page"/>
1366
1529
  <fo:block-container font-size="12pt" text-align="center" margin-bottom="18pt">
1367
- <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>
1530
+ <!-- <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> -->
1531
+ <fo:block><xsl:value-of select="/iec:iec-standard/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/></fo:block>
1368
1532
  <fo:block>___________</fo:block>
1369
1533
  <fo:block> </fo:block>
1370
1534
  <fo:block font-weight="bold">
@@ -1379,7 +1543,9 @@
1379
1543
  <fo:block>
1380
1544
  <xsl:if test="$part != ''">
1381
1545
  <!-- Example: Part 1: Riz -->
1382
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/>
1546
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1547
+ <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1548
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1383
1549
  </xsl:if>
1384
1550
  <xsl:value-of select="$title-part"/>
1385
1551
  </fo:block>
@@ -1419,7 +1585,9 @@
1419
1585
  <fo:block>
1420
1586
  <xsl:if test="$part != ''">
1421
1587
  <!-- Example: Part 1: Rice -->
1422
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/>
1588
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1589
+ <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1590
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1423
1591
  </xsl:if>
1424
1592
  <xsl:value-of select="$title-part"/>
1425
1593
  </fo:block>
@@ -1443,6 +1611,39 @@
1443
1611
  </xsl:template>
1444
1612
 
1445
1613
 
1614
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']" priority="3">
1615
+ <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
1616
+ <xsl:apply-templates/>
1617
+ </fo:block>
1618
+ </xsl:template>
1619
+
1620
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:title" priority="3">
1621
+ <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
1622
+ <xsl:apply-templates/>
1623
+ </fo:block>
1624
+ </xsl:template>
1625
+
1626
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:p" priority="3">
1627
+ <fo:block font-size="8pt" margin-bottom="10pt" text-align="justify">
1628
+ <xsl:apply-templates/>
1629
+ </fo:block>
1630
+ </xsl:template>
1631
+
1632
+ <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//text()" priority="3">
1633
+ <!-- Example: Attention IEC-CENELEC parallel voting -->
1634
+ <xsl:if test="normalize-space() ! = ''">
1635
+ <xsl:call-template name="addLetterSpacing">
1636
+ <xsl:with-param name="text" select="."/>
1637
+ </xsl:call-template>
1638
+ </xsl:if>
1639
+ </xsl:template>
1640
+
1641
+ <xsl:template match="iec:boilerplate/iec:feedback-statement">
1642
+ <fo:block margin-top="6pt" font-size="1pt" span="all">
1643
+ </fo:block>
1644
+ <xsl:apply-templates select="*[not(@id) or @id != 'boilerplate-cenelec-attention']"/>
1645
+ </xsl:template>
1646
+
1446
1647
  <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1447
1648
  <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1448
1649
  </xsl:template>
@@ -1453,9 +1654,9 @@
1453
1654
 
1454
1655
  <xsl:template match="iec:feedback-statement/iec:clause[not(iec:clause)]" priority="2">
1455
1656
  <fo:block span="all" text-align="justify">
1456
- <xsl:if test="not(preceding-sibling::iec:clause)">
1657
+ <!-- <xsl:if test="not(preceding-sibling::iec:clause)">
1457
1658
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1458
- </xsl:if>
1659
+ </xsl:if> -->
1459
1660
  <xsl:apply-templates/>
1460
1661
  </fo:block>
1461
1662
  </xsl:template>
@@ -1562,6 +1763,23 @@
1562
1763
  </fo:block>
1563
1764
  </xsl:template>
1564
1765
 
1766
+ <xsl:template match="iec:license-statement//iec:title" mode="cover-page-internal">
1767
+ <fo:block text-align="center" font-weight="bold">
1768
+ <xsl:apply-templates/>
1769
+ </fo:block>
1770
+ </xsl:template>
1771
+ <xsl:template match="iec:license-statement//iec:p" mode="cover-page-internal">
1772
+ <fo:block margin-bottom="6pt">
1773
+ <xsl:apply-templates mode="cover-page-internal"/>
1774
+ </fo:block>
1775
+ </xsl:template>
1776
+ <xsl:template match="iec:license-statement//iec:p//text()" mode="cover-page-internal">
1777
+ <xsl:call-template name="addLetterSpacing">
1778
+ <xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param>
1779
+ </xsl:call-template>
1780
+ </xsl:template>
1781
+
1782
+
1565
1783
  <!-- <fo:block margin-bottom="12pt">© ISO 2019, Published in Switzerland.</fo:block>
1566
1784
  <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>
1567
1785
  <fo:block font-size="10pt" text-indent="7.1mm">
@@ -1597,6 +1815,15 @@
1597
1815
  <xsl:apply-templates/>
1598
1816
  </fo:block>
1599
1817
  </xsl:template>
1818
+
1819
+ <!-- copyright text in footer internal footer -->
1820
+ <xsl:template match="iec:copyright-statement//iec:p[not(@id)]//text()">
1821
+ <xsl:if test="normalize-space() ! = ''">
1822
+ <xsl:call-template name="addLetterSpacing">
1823
+ <xsl:with-param name="text" select="normalize-space(.)"/>
1824
+ </xsl:call-template>
1825
+ </xsl:if>
1826
+ </xsl:template>
1600
1827
 
1601
1828
 
1602
1829
  <xsl:template match="iec:iec-standard/iec:preface/iec:foreword" priority="3">
@@ -1825,9 +2052,9 @@
1825
2052
  <fo:inline id="{$lang}_footnote_{@reference}" keep-with-next.within-line="always" baseline-shift="15%" padding-right="3mm"> <!-- padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
1826
2053
  <xsl:value-of select="$number + count(//iec:bibitem/iec:note)"/><!-- <xsl:text>)</xsl:text> -->
1827
2054
  </fo:inline>
1828
- <xsl:for-each select="iec:p">
1829
- <xsl:apply-templates/>
1830
- </xsl:for-each>
2055
+ <!-- <xsl:for-each select="iec:p"> -->
2056
+ <xsl:apply-templates/>
2057
+ <!-- </xsl:for-each> -->
1831
2058
  </fo:block>
1832
2059
  </fo:footnote-body>
1833
2060
  </fo:footnote>
@@ -1923,13 +2150,22 @@
1923
2150
  <xsl:otherwise> <!-- for ordered lists -->
1924
2151
  <xsl:choose>
1925
2152
  <xsl:when test="../@type = 'arabic'">
1926
- <xsl:number format="a)" lang="en"/>
2153
+ <xsl:number format="1)"/>
1927
2154
  </xsl:when>
1928
2155
  <xsl:when test="../@type = 'alphabet'">
1929
2156
  <xsl:number format="a)" lang="en"/>
1930
2157
  </xsl:when>
2158
+ <xsl:when test="../@type = 'alphabet_upper'">
2159
+ <xsl:number format="A." lang="en"/>
2160
+ </xsl:when>
2161
+ <xsl:when test="../@type = 'roman'">
2162
+ <xsl:number format="i)" lang="en"/>
2163
+ </xsl:when>
2164
+ <xsl:when test="../@type = 'roman_upper'">
2165
+ <xsl:number format="I." lang="en"/>
2166
+ </xsl:when>
1931
2167
  <xsl:otherwise>
1932
- <xsl:number format="1)"/>
2168
+ <xsl:number format="a)" lang="en"/>
1933
2169
  </xsl:otherwise>
1934
2170
  </xsl:choose>
1935
2171
  </xsl:otherwise>
@@ -2612,10 +2848,12 @@
2612
2848
 
2613
2849
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2614
2850
 
2851
+
2615
2852
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2616
2853
 
2617
2854
 
2618
2855
 
2856
+
2619
2857
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2620
2858
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2621
2859
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
@@ -2766,198 +3004,237 @@
2766
3004
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2767
3005
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2768
3006
  <xsl:call-template name="add-zero-spaces-java"/>
2769
- </xsl:template><xsl:template match="*[local-name()='table']">
3007
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2770
3008
 
2771
- <xsl:variable name="simple-table">
2772
- <xsl:call-template name="getSimpleTable"/>
2773
- </xsl:variable>
3009
+ <xsl:variable name="table">
2774
3010
 
2775
-
2776
-
2777
-
2778
-
2779
- <!-- <xsl:if test="$namespace = 'bipm'">
2780
- <fo:block>&#xA0;</fo:block>
2781
- </xsl:if> -->
2782
-
2783
- <!-- $namespace = 'iso' or -->
2784
-
2785
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2786
-
2787
-
2788
-
2789
- <xsl:call-template name="fn_name_display"/>
3011
+ <xsl:variable name="simple-table">
3012
+ <xsl:call-template name="getSimpleTable"/>
3013
+ </xsl:variable>
2790
3014
 
2791
3015
 
2792
-
2793
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2794
-
2795
- <!-- <xsl:variable name="cols-count">
2796
- <xsl:choose>
2797
- <xsl:when test="*[local-name()='thead']">
2798
- <xsl:call-template name="calculate-columns-numbers">
2799
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2800
- </xsl:call-template>
2801
- </xsl:when>
2802
- <xsl:otherwise>
2803
- <xsl:call-template name="calculate-columns-numbers">
2804
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2805
- </xsl:call-template>
2806
- </xsl:otherwise>
2807
- </xsl:choose>
2808
- </xsl:variable> -->
2809
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2810
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2811
-
2812
-
2813
-
2814
- <xsl:variable name="colwidths">
2815
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2816
- <xsl:call-template name="calculate-column-widths">
2817
- <xsl:with-param name="cols-count" select="$cols-count"/>
2818
- <xsl:with-param name="table" select="$simple-table"/>
2819
- </xsl:call-template>
2820
- </xsl:if>
2821
- </xsl:variable>
2822
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2823
-
2824
- <!-- <xsl:variable name="colwidths2">
2825
- <xsl:call-template name="calculate-column-widths">
2826
- <xsl:with-param name="cols-count" select="$cols-count"/>
2827
- </xsl:call-template>
2828
- </xsl:variable> -->
2829
-
2830
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2831
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2832
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2833
-
2834
- <xsl:variable name="margin-left">
2835
- <xsl:choose>
2836
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2837
- <xsl:otherwise>0</xsl:otherwise>
2838
- </xsl:choose>
2839
- </xsl:variable>
2840
-
2841
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2842
3016
 
2843
3017
 
2844
3018
 
2845
- <xsl:attribute name="font-size">8pt</xsl:attribute>
2846
- <xsl:attribute name="space-after">12pt</xsl:attribute>
2847
- <xsl:if test="ancestor::*[local-name() = 'preface']">
2848
- <xsl:attribute name="space-after">16pt</xsl:attribute>
2849
- </xsl:if>
2850
-
2851
-
2852
-
3019
+ <!-- <xsl:if test="$namespace = 'bipm'">
3020
+ <fo:block>&#xA0;</fo:block>
3021
+ </xsl:if> -->
2853
3022
 
3023
+ <!-- $namespace = 'iso' or -->
2854
3024
 
2855
-
3025
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2856
3026
 
3027
+
2857
3028
 
3029
+ <xsl:call-template name="fn_name_display"/>
2858
3030
 
3031
+
2859
3032
 
3033
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2860
3034
 
3035
+ <!-- <xsl:variable name="cols-count">
3036
+ <xsl:choose>
3037
+ <xsl:when test="*[local-name()='thead']">
3038
+ <xsl:call-template name="calculate-columns-numbers">
3039
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
3040
+ </xsl:call-template>
3041
+ </xsl:when>
3042
+ <xsl:otherwise>
3043
+ <xsl:call-template name="calculate-columns-numbers">
3044
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
3045
+ </xsl:call-template>
3046
+ </xsl:otherwise>
3047
+ </xsl:choose>
3048
+ </xsl:variable> -->
3049
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
3050
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
3051
+
3052
+
3053
+
3054
+ <xsl:variable name="colwidths">
3055
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3056
+ <xsl:call-template name="calculate-column-widths">
3057
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3058
+ <xsl:with-param name="table" select="$simple-table"/>
3059
+ </xsl:call-template>
3060
+ </xsl:if>
3061
+ </xsl:variable>
3062
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2861
3063
 
3064
+ <!-- <xsl:variable name="colwidths2">
3065
+ <xsl:call-template name="calculate-column-widths">
3066
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3067
+ </xsl:call-template>
3068
+ </xsl:variable> -->
3069
+
3070
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
3071
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
3072
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
3073
+
3074
+ <xsl:variable name="margin-left">
3075
+ <xsl:choose>
3076
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3077
+ <xsl:otherwise>0</xsl:otherwise>
3078
+ </xsl:choose>
3079
+ </xsl:variable>
2862
3080
 
2863
- <xsl:variable name="table_attributes">
2864
- <attribute name="table-layout">fixed</attribute>
2865
- <attribute name="width">100%</attribute>
2866
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2867
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3081
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2868
3082
 
2869
3083
 
2870
- <attribute name="border">0.5pt solid black</attribute>
2871
3084
 
3085
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3086
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3087
+ <xsl:if test="ancestor::*[local-name() = 'preface']">
3088
+ <xsl:attribute name="space-after">16pt</xsl:attribute>
3089
+ </xsl:if>
3090
+
3091
+
3092
+
2872
3093
 
2873
3094
 
2874
-
2875
-
2876
-
3095
+
2877
3096
 
2878
-
2879
3097
 
2880
- </xsl:variable>
2881
-
2882
-
2883
- <fo:table id="{@id}" table-omit-footer-at-break="true">
2884
3098
 
2885
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2886
- <xsl:attribute name="{@name}">
2887
- <xsl:value-of select="."/>
2888
- </xsl:attribute>
2889
- </xsl:for-each>
2890
3099
 
2891
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2892
- <xsl:if test="$isNoteOrFnExist = 'true'">
2893
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2894
- </xsl:if>
2895
3100
 
2896
- <xsl:choose>
2897
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2898
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2899
- <fo:table-column column-width="{@width}"/>
2900
- </xsl:for-each>
2901
- </xsl:when>
2902
- <xsl:otherwise>
2903
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2904
- <xsl:choose>
2905
- <xsl:when test=". = 1 or . = 0">
2906
- <fo:table-column column-width="proportional-column-width(2)"/>
2907
- </xsl:when>
2908
- <xsl:otherwise>
2909
- <fo:table-column column-width="proportional-column-width({.})"/>
2910
- </xsl:otherwise>
2911
- </xsl:choose>
2912
- </xsl:for-each>
2913
- </xsl:otherwise>
2914
- </xsl:choose>
2915
3101
 
2916
- <xsl:choose>
2917
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2918
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2919
- </xsl:when>
2920
- <xsl:otherwise>
2921
- <xsl:apply-templates/>
2922
- </xsl:otherwise>
2923
- </xsl:choose>
3102
+ <xsl:variable name="table_width">
3103
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3104
+ 100%
3105
+
3106
+
3107
+ </xsl:variable>
3108
+
3109
+ <xsl:variable name="table_attributes">
3110
+ <attribute name="table-layout">fixed</attribute>
3111
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
3112
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3113
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3114
+
3115
+
3116
+ <attribute name="border">0.5pt solid black</attribute>
3117
+
3118
+
3119
+
3120
+
3121
+
3122
+
3123
+
3124
+
3125
+
3126
+ </xsl:variable>
2924
3127
 
2925
- </fo:table>
2926
-
2927
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2928
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2929
- <xsl:call-template name="insertTableFooterInSeparateTable">
2930
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
2931
- <xsl:with-param name="colwidths" select="$colwidths"/>
2932
- <xsl:with-param name="colgroup" select="$colgroup"/>
2933
- </xsl:call-template>
2934
- </xsl:for-each>
2935
-
2936
- <!-- insert footer as table -->
2937
- <!-- <fo:table>
2938
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2939
- <xsl:attribute name="{@name}">
2940
- <xsl:value-of select="."/>
2941
- </xsl:attribute>
2942
- </xsl:for-each>
2943
3128
 
2944
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3129
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
3130
+
3131
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3132
+ <xsl:attribute name="{@name}">
3133
+ <xsl:value-of select="."/>
3134
+ </xsl:attribute>
3135
+ </xsl:for-each>
3136
+
3137
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3138
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3139
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3140
+ </xsl:if>
3141
+
2945
3142
  <xsl:choose>
2946
- <xsl:when test=". = 1 or . = 0">
2947
- <fo:table-column column-width="proportional-column-width(2)"/>
3143
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3144
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3145
+ <fo:table-column column-width="{@width}"/>
3146
+ </xsl:for-each>
2948
3147
  </xsl:when>
2949
3148
  <xsl:otherwise>
2950
- <fo:table-column column-width="proportional-column-width({.})"/>
3149
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3150
+ <xsl:choose>
3151
+ <xsl:when test=". = 1 or . = 0">
3152
+ <fo:table-column column-width="proportional-column-width(2)"/>
3153
+ </xsl:when>
3154
+ <xsl:otherwise>
3155
+ <fo:table-column column-width="proportional-column-width({.})"/>
3156
+ </xsl:otherwise>
3157
+ </xsl:choose>
3158
+ </xsl:for-each>
2951
3159
  </xsl:otherwise>
2952
3160
  </xsl:choose>
3161
+
3162
+ <xsl:choose>
3163
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3164
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3165
+ </xsl:when>
3166
+ <xsl:otherwise>
3167
+ <xsl:apply-templates/>
3168
+ </xsl:otherwise>
3169
+ </xsl:choose>
3170
+
3171
+ </fo:table>
3172
+
3173
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3174
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3175
+ <xsl:call-template name="insertTableFooterInSeparateTable">
3176
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
3177
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3178
+ <xsl:with-param name="colgroup" select="$colgroup"/>
3179
+ </xsl:call-template>
2953
3180
  </xsl:for-each>
2954
- </fo:table>-->
2955
-
2956
-
2957
-
2958
-
2959
-
2960
- </fo:block-container>
3181
+
3182
+ <!-- insert footer as table -->
3183
+ <!-- <fo:table>
3184
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3185
+ <xsl:attribute name="{@name}">
3186
+ <xsl:value-of select="."/>
3187
+ </xsl:attribute>
3188
+ </xsl:for-each>
3189
+
3190
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3191
+ <xsl:choose>
3192
+ <xsl:when test=". = 1 or . = 0">
3193
+ <fo:table-column column-width="proportional-column-width(2)"/>
3194
+ </xsl:when>
3195
+ <xsl:otherwise>
3196
+ <fo:table-column column-width="proportional-column-width({.})"/>
3197
+ </xsl:otherwise>
3198
+ </xsl:choose>
3199
+ </xsl:for-each>
3200
+ </fo:table>-->
3201
+
3202
+
3203
+
3204
+
3205
+
3206
+ </fo:block-container>
3207
+ </xsl:variable>
3208
+
3209
+
3210
+
3211
+ <xsl:choose>
3212
+ <xsl:when test="@width">
3213
+
3214
+ <!-- centered table when table name is centered (see table-name-style) -->
3215
+
3216
+ <fo:table table-layout="fixed" width="100%">
3217
+ <fo:table-column column-width="proportional-column-width(1)"/>
3218
+ <fo:table-column column-width="{@width}"/>
3219
+ <fo:table-column column-width="proportional-column-width(1)"/>
3220
+ <fo:table-body>
3221
+ <fo:table-row>
3222
+ <fo:table-cell column-number="2">
3223
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
3224
+ </fo:table-cell>
3225
+ </fo:table-row>
3226
+ </fo:table-body>
3227
+ </fo:table>
3228
+
3229
+
3230
+
3231
+
3232
+ </xsl:when>
3233
+ <xsl:otherwise>
3234
+ <xsl:copy-of select="$table"/>
3235
+ </xsl:otherwise>
3236
+ </xsl:choose>
3237
+
2961
3238
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2962
3239
  <xsl:if test="normalize-space() != ''">
2963
3240
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -3709,7 +3986,9 @@
3709
3986
  </xsl:template><xsl:template match="*[local-name()='dl']">
3710
3987
  <fo:block-container>
3711
3988
 
3712
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3989
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3990
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3991
+ </xsl:if>
3713
3992
 
3714
3993
 
3715
3994
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -3724,6 +4003,7 @@
3724
4003
  <fo:block-container>
3725
4004
 
3726
4005
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4006
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3727
4007
 
3728
4008
 
3729
4009
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -3856,7 +4136,7 @@
3856
4136
  <xsl:with-param name="table" select="$html-table"/>
3857
4137
  </xsl:call-template>
3858
4138
  </xsl:variable>
3859
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
4139
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3860
4140
  <xsl:variable name="maxlength_dt">
3861
4141
  <xsl:call-template name="getMaxLength_dt"/>
3862
4142
  </xsl:variable>
@@ -3885,13 +4165,22 @@
3885
4165
  </xsl:when>
3886
4166
  <xsl:otherwise>
3887
4167
  <xsl:choose>
4168
+ <!-- to set width check most wide chars like `W` -->
3888
4169
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3889
- <fo:table-column column-width="5%"/>
3890
- <fo:table-column column-width="95%"/>
4170
+ <fo:table-column column-width="7%"/>
4171
+ <fo:table-column column-width="93%"/>
3891
4172
  </xsl:when>
3892
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3893
- <fo:table-column column-width="10%"/>
3894
- <fo:table-column column-width="90%"/>
4173
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
4174
+ <fo:table-column column-width="15%"/>
4175
+ <fo:table-column column-width="85%"/>
4176
+ </xsl:when>
4177
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
4178
+ <fo:table-column column-width="20%"/>
4179
+ <fo:table-column column-width="80%"/>
4180
+ </xsl:when>
4181
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
4182
+ <fo:table-column column-width="25%"/>
4183
+ <fo:table-column column-width="75%"/>
3895
4184
  </xsl:when>
3896
4185
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3897
4186
  <fo:table-column column-width="60%"/>
@@ -3923,12 +4212,32 @@
3923
4212
  </xsl:otherwise>
3924
4213
  </xsl:choose>
3925
4214
  </xsl:template><xsl:template name="getMaxLength_dt">
3926
- <xsl:for-each select="*[local-name()='dt']">
3927
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3928
- <xsl:if test="position() = 1">
3929
- <xsl:value-of select="string-length(normalize-space(.))"/>
3930
- </xsl:if>
3931
- </xsl:for-each>
4215
+ <xsl:variable name="lengths">
4216
+ <xsl:for-each select="*[local-name()='dt']">
4217
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
4218
+ <xsl:variable name="attributes">
4219
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
4220
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
4221
+ </xsl:variable>
4222
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
4223
+ </xsl:for-each>
4224
+ </xsl:variable>
4225
+ <xsl:variable name="maxLength">
4226
+ <!-- <xsl:for-each select="*[local-name()='dt']">
4227
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
4228
+ <xsl:if test="position() = 1">
4229
+ <xsl:value-of select="string-length(normalize-space(.))"/>
4230
+ </xsl:if>
4231
+ </xsl:for-each> -->
4232
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
4233
+ <xsl:sort select="." data-type="number" order="descending"/>
4234
+ <xsl:if test="position() = 1">
4235
+ <xsl:value-of select="."/>
4236
+ </xsl:if>
4237
+ </xsl:for-each>
4238
+ </xsl:variable>
4239
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
4240
+ <xsl:value-of select="$maxLength"/>
3932
4241
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3933
4242
  <xsl:param name="key_iso"/>
3934
4243
 
@@ -4071,6 +4380,7 @@
4071
4380
 
4072
4381
 
4073
4382
 
4383
+
4074
4384
 
4075
4385
  </xsl:variable>
4076
4386
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4084,6 +4394,10 @@
4084
4394
  </xsl:if>
4085
4395
  <xsl:apply-templates/>
4086
4396
  </fo:inline>
4397
+ </xsl:template><xsl:template match="*[local-name()='underline']">
4398
+ <fo:inline text-decoration="underline">
4399
+ <xsl:apply-templates/>
4400
+ </fo:inline>
4087
4401
  </xsl:template><xsl:template match="*[local-name()='del']">
4088
4402
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
4089
4403
  <xsl:apply-templates/>
@@ -4177,6 +4491,10 @@
4177
4491
  <xsl:param name="text" select="."/>
4178
4492
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4179
4493
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4494
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4495
+ <xsl:param name="text" select="."/>
4496
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4497
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4180
4498
  </xsl:template><xsl:template name="add-zero-spaces">
4181
4499
  <xsl:param name="text" select="."/>
4182
4500
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4437,6 +4755,11 @@
4437
4755
  <!-- replace start and end spaces to non-break space -->
4438
4756
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4439
4757
  </xsl:copy>
4758
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4759
+ <xsl:copy>
4760
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4761
+ </xsl:copy>
4762
+ <mathml:mspace width="0.5ex"/>
4440
4763
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4441
4764
  <xsl:variable name="target">
4442
4765
  <xsl:choose>
@@ -4462,7 +4785,10 @@
4462
4785
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4463
4786
  <xsl:choose>
4464
4787
  <xsl:when test="normalize-space(.) = ''">
4465
- <xsl:value-of select="$target"/>
4788
+ <!-- <xsl:value-of select="$target"/> -->
4789
+ <xsl:call-template name="add-zero-spaces-link-java">
4790
+ <xsl:with-param name="text" select="$target"/>
4791
+ </xsl:call-template>
4466
4792
  </xsl:when>
4467
4793
  <xsl:otherwise>
4468
4794
  <xsl:apply-templates/>
@@ -4666,7 +4992,7 @@
4666
4992
  </xsl:if> -->
4667
4993
  </fo:inline>
4668
4994
  </xsl:if>
4669
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
4995
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4670
4996
  <fo:block-container id="{@id}">
4671
4997
 
4672
4998
  <fo:block>
@@ -4735,6 +5061,8 @@
4735
5061
  <xsl:variable name="bookmark-title_">
4736
5062
  <xsl:call-template name="getLangVersion">
4737
5063
  <xsl:with-param name="lang" select="@lang"/>
5064
+ <xsl:with-param name="doctype" select="@doctype"/>
5065
+ <xsl:with-param name="title" select="@title-part"/>
4738
5066
  </xsl:call-template>
4739
5067
  </xsl:variable>
4740
5068
  <xsl:choose>
@@ -4752,13 +5080,34 @@
4752
5080
  </xsl:choose>
4753
5081
  </fo:bookmark-title>
4754
5082
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
5083
+
5084
+ <xsl:call-template name="insertFigureBookmarks">
5085
+ <xsl:with-param name="contents" select="contents"/>
5086
+ </xsl:call-template>
5087
+
5088
+ <xsl:call-template name="insertTableBookmarks">
5089
+ <xsl:with-param name="contents" select="contents"/>
5090
+ <xsl:with-param name="lang" select="@lang"/>
5091
+ </xsl:call-template>
5092
+
4755
5093
  </fo:bookmark>
4756
5094
 
4757
5095
  </xsl:for-each>
4758
5096
  </xsl:when>
4759
5097
  <xsl:otherwise>
4760
5098
  <xsl:for-each select="xalan:nodeset($contents)/doc">
5099
+
4761
5100
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
5101
+
5102
+ <xsl:call-template name="insertFigureBookmarks">
5103
+ <xsl:with-param name="contents" select="contents"/>
5104
+ </xsl:call-template>
5105
+
5106
+ <xsl:call-template name="insertTableBookmarks">
5107
+ <xsl:with-param name="contents" select="contents"/>
5108
+ <xsl:with-param name="lang" select="@lang"/>
5109
+ </xsl:call-template>
5110
+
4762
5111
  </xsl:for-each>
4763
5112
  </xsl:otherwise>
4764
5113
  </xsl:choose>
@@ -4770,42 +5119,51 @@
4770
5119
 
4771
5120
 
4772
5121
 
4773
- <xsl:if test="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4774
- <fo:bookmark internal-destination="{//*[local-name() = 'figure'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4775
- <fo:bookmark-title>Figures</fo:bookmark-title>
4776
- <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4777
- <fo:bookmark internal-destination="{@id}">
4778
- <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']/text()" mode="bookmarks"/></fo:bookmark-title>
4779
- </fo:bookmark>
4780
- </xsl:for-each>
4781
- </fo:bookmark>
4782
- </xsl:if>
4783
-
4784
5122
 
4785
-
4786
- <xsl:if test="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4787
- <fo:bookmark internal-destination="{//*[local-name() = 'table'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4788
- <fo:bookmark-title>
4789
- <xsl:choose>
4790
- <xsl:when test="@lang = 'fr'">Tableaux</xsl:when>
4791
- <xsl:otherwise>Tables</xsl:otherwise>
4792
- </xsl:choose>
4793
- </fo:bookmark-title>
4794
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4795
- <fo:bookmark internal-destination="{@id}">
4796
- <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']//text()" mode="bookmarks"/></fo:bookmark-title>
4797
- </fo:bookmark>
4798
- </xsl:for-each>
4799
- </fo:bookmark>
4800
- </xsl:if>
4801
5123
 
4802
5124
 
4803
5125
 
4804
5126
 
4805
5127
  </fo:bookmark-tree>
4806
5128
  </xsl:if>
5129
+ </xsl:template><xsl:template name="insertFigureBookmarks">
5130
+ <xsl:param name="contents"/>
5131
+ <xsl:if test="xalan:nodeset($contents)/figure">
5132
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
5133
+ <fo:bookmark-title>Figures</fo:bookmark-title>
5134
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
5135
+ <fo:bookmark internal-destination="{@id}">
5136
+ <fo:bookmark-title>
5137
+ <xsl:value-of select="normalize-space(title)"/>
5138
+ </fo:bookmark-title>
5139
+ </fo:bookmark>
5140
+ </xsl:for-each>
5141
+ </fo:bookmark>
5142
+ </xsl:if>
5143
+ </xsl:template><xsl:template name="insertTableBookmarks">
5144
+ <xsl:param name="contents"/>
5145
+ <xsl:param name="lang"/>
5146
+ <xsl:if test="xalan:nodeset($contents)/table">
5147
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
5148
+ <fo:bookmark-title>
5149
+ <xsl:choose>
5150
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
5151
+ <xsl:otherwise>Tables</xsl:otherwise>
5152
+ </xsl:choose>
5153
+ </fo:bookmark-title>
5154
+ <xsl:for-each select="xalan:nodeset($contents)/table">
5155
+ <fo:bookmark internal-destination="{@id}">
5156
+ <fo:bookmark-title>
5157
+ <xsl:value-of select="normalize-space(title)"/>
5158
+ </fo:bookmark-title>
5159
+ </fo:bookmark>
5160
+ </xsl:for-each>
5161
+ </fo:bookmark>
5162
+ </xsl:if>
4807
5163
  </xsl:template><xsl:template name="getLangVersion">
4808
5164
  <xsl:param name="lang"/>
5165
+ <xsl:param name="doctype" select="''"/>
5166
+ <xsl:param name="title" select="''"/>
4809
5167
  <xsl:choose>
4810
5168
  <xsl:when test="$lang = 'en'">
4811
5169
  English
@@ -4841,6 +5199,12 @@
4841
5199
  <!-- <xsl:text> </xsl:text> -->
4842
5200
  </xsl:template><xsl:template name="getSection">
4843
5201
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5202
+ <!--
5203
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
5204
+ <xsl:value-of select="."/>
5205
+ </xsl:for-each>
5206
+ -->
5207
+
4844
5208
  </xsl:template><xsl:template name="getName">
4845
5209
  <xsl:choose>
4846
5210
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4893,6 +5257,12 @@
4893
5257
  <xsl:copy>
4894
5258
  <xsl:apply-templates mode="contents_item"/>
4895
5259
  </xsl:copy>
5260
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
5261
+ <xsl:copy>
5262
+ <xsl:apply-templates mode="contents_item"/>
5263
+ </xsl:copy>
5264
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
5265
+ <xsl:copy-of select="."/>
4896
5266
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4897
5267
  <xsl:text> </xsl:text>
4898
5268
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4918,6 +5288,7 @@
4918
5288
 
4919
5289
 
4920
5290
 
5291
+
4921
5292
 
4922
5293
 
4923
5294
 
@@ -5298,10 +5669,13 @@
5298
5669
  </xsl:if>
5299
5670
  </xsl:if>
5300
5671
 
5672
+
5301
5673
  <fo:block-container margin-left="0mm">
5302
5674
 
5303
5675
  <fo:block xsl:use-attribute-sets="quote-style">
5304
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5676
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5677
+
5678
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5305
5679
  </fo:block>
5306
5680
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5307
5681
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5454,6 +5828,7 @@
5454
5828
 
5455
5829
 
5456
5830
 
5831
+
5457
5832
 
5458
5833
 
5459
5834
 
@@ -5465,7 +5840,7 @@
5465
5840
 
5466
5841
 
5467
5842
 
5468
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
5843
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
5469
5844
  <fo:block break-after="page"/>
5470
5845
  <fo:block>
5471
5846
  <xsl:call-template name="setId"/>
@@ -5473,7 +5848,8 @@
5473
5848
  </fo:block>
5474
5849
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
5475
5850
  <fo:block>
5476
- <xsl:call-template name="setId"/>
5851
+ <xsl:call-template name="setId"/>
5852
+
5477
5853
 
5478
5854
  <xsl:apply-templates/>
5479
5855
  </fo:block>
@@ -5619,6 +5995,8 @@
5619
5995
  <xsl:value-of select="translate(.,'. ','')"/>
5620
5996
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5621
5997
  <xsl:value-of select="substring(.,1,1)"/>
5998
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5999
+ <fo:inline><xsl:apply-templates/></fo:inline>
5622
6000
  </xsl:template><xsl:template name="convertDate">
5623
6001
  <xsl:param name="date"/>
5624
6002
  <xsl:param name="format" select="'short'"/>
@@ -5643,6 +6021,57 @@
5643
6021
  </xsl:variable>
5644
6022
  <xsl:variable name="result">
5645
6023
  <xsl:choose>
6024
+ <xsl:when test="$format = 'ddMMyyyy'">
6025
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6026
+ <xsl:text> </xsl:text>
6027
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6028
+ </xsl:when>
6029
+ <xsl:when test="$format = 'ddMM'">
6030
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6031
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6032
+ </xsl:when>
6033
+ <xsl:when test="$format = 'short' or $day = ''">
6034
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
6035
+ </xsl:when>
6036
+ <xsl:otherwise>
6037
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
6038
+ </xsl:otherwise>
6039
+ </xsl:choose>
6040
+ </xsl:variable>
6041
+ <xsl:value-of select="$result"/>
6042
+ </xsl:template><xsl:template name="convertDateLocalized">
6043
+ <xsl:param name="date"/>
6044
+ <xsl:param name="format" select="'short'"/>
6045
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
6046
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
6047
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
6048
+ <xsl:variable name="monthStr">
6049
+ <xsl:choose>
6050
+ <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>
6051
+ <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>
6052
+ <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>
6053
+ <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>
6054
+ <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>
6055
+ <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>
6056
+ <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>
6057
+ <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>
6058
+ <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>
6059
+ <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>
6060
+ <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>
6061
+ <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>
6062
+ </xsl:choose>
6063
+ </xsl:variable>
6064
+ <xsl:variable name="result">
6065
+ <xsl:choose>
6066
+ <xsl:when test="$format = 'ddMMyyyy'">
6067
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6068
+ <xsl:text> </xsl:text>
6069
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
6070
+ </xsl:when>
6071
+ <xsl:when test="$format = 'ddMM'">
6072
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
6073
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
6074
+ </xsl:when>
5646
6075
  <xsl:when test="$format = 'short' or $day = ''">
5647
6076
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5648
6077
  </xsl:when>
@@ -5658,7 +6087,7 @@
5658
6087
  <xsl:param name="charDelim" select="', '"/>
5659
6088
  <xsl:choose>
5660
6089
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
5661
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6090
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5662
6091
  <xsl:sort data-type="text" order="ascending"/>
5663
6092
  <xsl:call-template name="insertKeyword">
5664
6093
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -5667,7 +6096,7 @@
5667
6096
  </xsl:for-each>
5668
6097
  </xsl:when>
5669
6098
  <xsl:otherwise>
5670
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6099
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5671
6100
  <xsl:call-template name="insertKeyword">
5672
6101
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
5673
6102
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -5684,6 +6113,9 @@
5684
6113
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
5685
6114
  </xsl:choose>
5686
6115
  </xsl:template><xsl:template name="addPDFUAmeta">
6116
+ <xsl:variable name="lang">
6117
+ <xsl:call-template name="getLang"/>
6118
+ </xsl:variable>
5687
6119
  <fo:declarations>
5688
6120
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5689
6121
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -5696,13 +6128,16 @@
5696
6128
  <!-- Dublin Core properties go here -->
5697
6129
  <dc:title>
5698
6130
  <xsl:variable name="title">
5699
-
5700
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
5701
-
5702
-
5703
-
5704
-
5705
-
6131
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6132
+
6133
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
6134
+
6135
+
6136
+
6137
+
6138
+
6139
+
6140
+ </xsl:for-each>
5706
6141
  </xsl:variable>
5707
6142
  <xsl:choose>
5708
6143
  <xsl:when test="normalize-space($title) != ''">
@@ -5714,17 +6149,21 @@
5714
6149
  </xsl:choose>
5715
6150
  </dc:title>
5716
6151
  <dc:creator>
5717
-
5718
-
5719
-
5720
- </dc:creator>
5721
- <dc:description>
5722
- <xsl:variable name="abstract">
6152
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5723
6153
 
6154
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6155
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6156
+ <xsl:if test="position() != last()">; </xsl:if>
6157
+ </xsl:for-each>
5724
6158
 
5725
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract'][@language = 'en']//text()"/>
5726
6159
 
5727
6160
 
6161
+ </xsl:for-each>
6162
+ </dc:creator>
6163
+ <dc:description>
6164
+ <xsl:variable name="abstract">
6165
+
6166
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5728
6167
 
5729
6168
 
5730
6169
  </xsl:variable>
@@ -5837,6 +6276,7 @@
5837
6276
 
5838
6277
 
5839
6278
 
6279
+
5840
6280
  </xsl:variable>
5841
6281
  <xsl:if test="$documentNS != $XSLNS">
5842
6282
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5896,6 +6336,11 @@
5896
6336
  <xsl:call-template name="getLang"/>
5897
6337
  </xsl:variable>
5898
6338
 
5899
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6339
+ <xsl:choose>
6340
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6341
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6342
+ </xsl:when>
6343
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6344
+ </xsl:choose>
5900
6345
 
5901
6346
  </xsl:template></xsl:stylesheet>