metanorma-iec 1.2.7 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +29 -8
  3. data/README.adoc +3 -4
  4. data/lib/asciidoctor/iec/basicdoc.rng +50 -3
  5. data/lib/asciidoctor/iec/converter.rb +22 -1
  6. data/lib/asciidoctor/iec/front.rb +18 -7
  7. data/lib/asciidoctor/iec/iec.rng +81 -1
  8. data/lib/asciidoctor/iec/iec_intro_en.xml +110 -56
  9. data/lib/asciidoctor/iec/iec_intro_fr.xml +78 -22
  10. data/lib/asciidoctor/iec/isodoc.rng +61 -3
  11. data/lib/asciidoctor/iec/isostandard.rng +27 -10
  12. data/lib/isodoc/iec/base_convert.rb +2 -2
  13. data/lib/isodoc/iec/html/htmlstyle.css +5 -5
  14. data/lib/isodoc/iec/html/htmlstyle.scss +4 -4
  15. data/lib/isodoc/iec/html/isodoc.css +79 -79
  16. data/lib/isodoc/iec/html/isodoc.scss +79 -79
  17. data/lib/isodoc/iec/html/wordstyle.css +120 -120
  18. data/lib/isodoc/iec/html/wordstyle.scss +120 -120
  19. data/lib/isodoc/iec/html_convert.rb +8 -0
  20. data/lib/isodoc/iec/i18n-en.yaml +17 -0
  21. data/lib/isodoc/iec/i18n-fr.yaml +18 -0
  22. data/lib/isodoc/iec/iec.international-standard.xsl +817 -382
  23. data/lib/isodoc/iec/metadata.rb +33 -0
  24. data/lib/isodoc/iec/presentation_xml_convert.rb +12 -0
  25. data/lib/isodoc/iec/word_convert.rb +10 -0
  26. data/lib/metanorma/iec/processor.rb +11 -8
  27. data/lib/metanorma/iec/version.rb +1 -1
  28. data/metanorma-iec.gemspec +1 -2
  29. data/spec/asciidoctor-iec/base_spec.rb +429 -8
  30. data/spec/asciidoctor-iec/blocks_spec.rb +25 -21
  31. data/spec/asciidoctor-iec/cleanup_spec.rb +99 -98
  32. data/spec/asciidoctor-iec/iev_spec.rb +15 -6
  33. data/spec/asciidoctor-iec/inline_spec.rb +11 -7
  34. data/spec/asciidoctor-iec/lists_spec.rb +13 -9
  35. data/spec/asciidoctor-iec/section_spec.rb +9 -5
  36. data/spec/asciidoctor-iec/validate_spec.rb +15 -0
  37. data/spec/isodoc/i18n_spec.rb +30 -0
  38. data/spec/isodoc/iso_spec.rb +2 -2
  39. data/spec/isodoc/metadata_spec.rb +23 -1
  40. data/spec/isodoc/ref_spec.rb +2 -2
  41. data/spec/metanorma/processor_spec.rb +1 -1
  42. data/spec/spec_helper.rb +20 -31
  43. metadata +4 -18
@@ -16,6 +16,8 @@ module IsoDoc
16
16
  bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
17
17
  headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
18
18
  monospacefont: ('"Courier New",monospace'),
19
+ monospacefontsize: "1.0em",
20
+ footnotefontsize: "0.9em",
19
21
  }
20
22
  end
21
23
 
@@ -36,6 +38,12 @@ module IsoDoc
36
38
  docxml
37
39
  end
38
40
 
41
+ def authority_cleanup(docxml)
42
+ auth = docxml.at("//div[@id = 'boilerplate-feedback' or @class = 'boilerplate-feedback']")
43
+ auth&.remove
44
+ super
45
+ end
46
+
39
47
  include BaseConvert
40
48
  include Init
41
49
  end
@@ -5,6 +5,7 @@ IEC: INTERNATIONAL ELECTROTECHNICAL COMMISSION
5
5
  formula: Equation
6
6
  inequality: Inequality
7
7
  section_iev: Section
8
+ price-code: Price Code
8
9
  term_def_boilerplate: |
9
10
  <p>ISO and IEC maintain terminological databases for use in
10
11
  standardization at the following addresses:</p>
@@ -16,3 +17,19 @@ term_def_boilerplate: |
16
17
  <li> <p>ISO Online browsing platform: available at
17
18
  <link target="http://www.iso.org/obp"/></p> </li>
18
19
  </ul>
20
+ doctype_dict:
21
+ international-standard: International Standard
22
+ technical-specification: Technical Specification
23
+ technical-report: Technical Report
24
+ publicly-available-specification: Publicly Available Specification
25
+ international-workshop-agreement: International Workshop Agreement
26
+ guide: Guide
27
+ interpretation-sheet: Interpretation Sheet
28
+ function_dict:
29
+ emc: Basic EMC Publication
30
+ safety: Basic Safety Publication
31
+ environment: Basic Environment Publication
32
+ quality-assurance: Basic Quality Assurance Publication
33
+ horizontal_dict:
34
+ "true": Horizontal Standard
35
+ "false":
@@ -5,6 +5,7 @@ formula: Equation
5
5
  inequality: Inégalité
6
6
  IEC: COMMISSION ELECTROTECHNIQUE INTERNATIONALE
7
7
  section_iev: Section
8
+ price-code: Code prix
8
9
  term_def_boilerplate: |
9
10
  <p>L'ISO et l'IEC tiennent à jour des bases de données terminologiques
10
11
  destinées à être utilisées en normalisation, consultables aux adresses
@@ -16,3 +17,20 @@ term_def_boilerplate: |
16
17
  <li> <p>ISO Online browsing platform: disponible à l'adresse
17
18
  <link target="http://www.iso.org/obp"/></p> </li>
18
19
  </ul>
20
+ doctype_dict:
21
+ international-standard: Norme international
22
+ technical-specification: Spécification technique
23
+ technical-report: Rapport technique
24
+ publicly-available-specification: Spécification disponible publiquement
25
+ international-workshop-agreement: Accord internationale d’atelier
26
+ guide: Guide
27
+ interpretation-sheet: Feuille d’interprétation
28
+ function_dict:
29
+ emc: Publication fondamentale en CEM
30
+ safety: Publication fondamentale de sécurité
31
+ environment: Publication fondamentale sur l’environnement
32
+ quality-assurance: Publication fondamentale sur l’assurance de la qualité
33
+ horizontal_dict:
34
+ "true": Norme horizontale
35
+ "false":
36
+
@@ -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(translate(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype,'-',' ')))"/>
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
 
@@ -136,7 +155,7 @@
136
155
  <xsl:call-template name="namespaceCheck"/>
137
156
  <!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
138
157
  <!-- https://xmlgraphics.apache.org/fop/knownissues.html -->
139
- <fo:root font-family="Arial, Times New Roman, STIX Two Math, HanSans" font-size="10pt" xml:lang="{$lang}">
158
+ <fo:root font-family="Arial, Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
140
159
  <fo:layout-master-set>
141
160
  <!-- cover pages -->
142
161
  <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -146,6 +165,13 @@
146
165
  <fo:region-start region-name="left-region" extent="18mm"/>
147
166
  <fo:region-end region-name="right-region" extent="20.5mm"/>
148
167
  </fo:simple-page-master>
168
+ <fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}" page-height="{$pageHeight}">
169
+ <fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="25mm" margin-right="25mm" column-count="2" column-gap="5mm"/>
170
+ <fo:region-before region-name="header" extent="17.5mm"/>
171
+ <fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
172
+ <fo:region-start region-name="left-region" extent="25mm"/>
173
+ <fo:region-end region-name="right-region" extent="25mm"/>
174
+ </fo:simple-page-master>
149
175
 
150
176
  <fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}" page-height="{$pageHeight}">
151
177
  <fo:region-body margin-top="17.5mm" margin-bottom="29mm" margin-left="18mm" margin-right="19mm"/>
@@ -203,7 +229,7 @@
203
229
  <fo:static-content flow-name="left-region">
204
230
  <fo:block-container reference-orientation="90">
205
231
  <fo:block font-size="7pt" margin-left="0.5mm" margin-top="5mm">
206
- <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']"/>
207
233
  </fo:block>
208
234
  </fo:block-container>
209
235
  </fo:static-content>
@@ -218,226 +244,240 @@
218
244
  </fo:page-sequence>
219
245
 
220
246
  <!-- 2nd Cover Page -->
221
- <fo:page-sequence master-reference="cover" force-page-count="no-force">
247
+ <fo:page-sequence master-reference="cover_2nd" force-page-count="no-force" font-size="8pt">
222
248
  <fo:flow flow-name="xsl-region-body">
223
- <fo:block-container margin-left="7mm" margin-right="4.5mm" border="0.5pt solid black" margin-top="7mm">
224
- <fo:block-container margin-left="2.5mm" margin-right="2.5mm" margin-top="1mm" margin-bottom="1mm">
225
- <fo:block-container margin-left="0mm" margin-right="0mm">
226
- <fo:table table-layout="fixed" width="100%">
227
- <fo:table-column column-width="20mm"/>
228
- <fo:table-column column-width="130mm"/>
229
- <fo:table-body>
230
- <fo:table-row>
231
- <fo:table-cell>
232
- <fo:block>
233
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="17.8mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
234
- </fo:block>
235
- </fo:table-cell>
236
- <fo:table-cell font-size="10pt" font-weight="bold" display-align="after">
237
- <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
238
- <fo:block margin-bottom="10pt">
239
- <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
240
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-year']"/>
241
- </fo:block>
242
- </fo:table-cell>
243
- </fo:table-row>
244
- </fo:table-body>
245
- </fo:table>
246
- <fo:block font-size="8pt">
247
- <fo:block margin-bottom="8pt" text-align="justify">
248
- <!-- Example: All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
249
- or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
250
- either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
251
- copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
252
- your local IEC member National Committee for further information. -->
253
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-message']"/>
254
- </fo:block>
255
- <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
256
- ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
257
- 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
258
- questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
259
- les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.</fo:block>
260
-
261
- <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())"/>
249
+ <fo:block span="all">
250
+ <fo:block-container border="0.5pt solid black" margin-top="7mm">
251
+ <fo:block-container margin-left="2.5mm" margin-right="2.5mm" margin-top="1mm" margin-bottom="1mm">
252
+ <fo:block-container margin-left="0mm" margin-right="0mm">
262
253
  <fo:table table-layout="fixed" width="100%">
263
- <fo:table-column column-width="59mm"/>
264
- <fo:table-column column-width="90mm"/>
254
+ <fo:table-column column-width="20mm"/>
255
+ <fo:table-column column-width="130mm"/>
265
256
  <fo:table-body>
266
257
  <fo:table-row>
267
258
  <fo:table-cell>
268
259
  <fo:block>
269
- <!-- Example: IEC Central Office
270
- 3, rue de Varembé
271
- CH-1211 Geneva 20
272
- Switzerland -->
273
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-name']" mode="coverpage"/>
274
- <xsl:choose>
275
- <xsl:when test="$telpos != 0">
276
- <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"/>
277
- </xsl:when>
278
- <xsl:otherwise>
279
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
280
- </xsl:otherwise>
281
- </xsl:choose>
260
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="17.8mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
282
261
  </fo:block>
283
262
  </fo:table-cell>
284
- <fo:table-cell>
285
- <fo:block>
286
- <!-- Example: Tel.: +41 22 919 02 11
287
- Fax: +41 22 919 0
288
- info@iec.ch
289
- www.iec.ch -->
290
- <xsl:choose>
291
- <xsl:when test="$telpos != 0">
292
- <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"/>
293
- </xsl:when>
294
- <xsl:otherwise> </xsl:otherwise>
295
- </xsl:choose>
263
+ <fo:table-cell font-size="10pt" font-weight="bold" display-align="after">
264
+ <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
265
+ <fo:block margin-bottom="10pt">
266
+ <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
267
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-year')]"/>
296
268
  </fo:block>
297
269
  </fo:table-cell>
298
270
  </fo:table-row>
299
271
  </fo:table-body>
300
272
  </fo:table>
301
-
302
- </fo:block>
273
+ <fo:block>
274
+ <fo:block margin-bottom="8pt" text-align="justify">
275
+ <!-- Example: All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
276
+ or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
277
+ either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
278
+ copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
279
+ your local IEC member National Committee for further information. -->
280
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-message')]"/>
281
+ </fo:block>
282
+ <!-- Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
283
+ ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
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
285
+ questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
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>
290
+
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())"/>
292
+ <fo:table table-layout="fixed" width="100%">
293
+ <fo:table-column column-width="59mm"/>
294
+ <fo:table-column column-width="90mm"/>
295
+ <fo:table-body>
296
+ <fo:table-row>
297
+ <fo:table-cell>
298
+ <fo:block>
299
+ <!-- Example: IEC Central Office
300
+ 3, rue de Varembé
301
+ CH-1211 Geneva 20
302
+ Switzerland -->
303
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-name')]" mode="coverpage"/>
304
+ <xsl:choose>
305
+ <xsl:when test="$telpos != 0">
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"/>
307
+ </xsl:when>
308
+ <xsl:otherwise>
309
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
310
+ </xsl:otherwise>
311
+ </xsl:choose>
312
+ </fo:block>
313
+ </fo:table-cell>
314
+ <fo:table-cell>
315
+ <fo:block>
316
+ <!-- Example: Tel.: +41 22 919 02 11
317
+ Fax: +41 22 919 0
318
+ info@iec.ch
319
+ www.iec.ch -->
320
+ <xsl:choose>
321
+ <xsl:when test="$telpos != 0">
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"/>
323
+ </xsl:when>
324
+ <xsl:otherwise> </xsl:otherwise>
325
+ </xsl:choose>
326
+ </fo:block>
327
+ </fo:table-cell>
328
+ </fo:table-row>
329
+ </fo:table-body>
330
+ </fo:table>
331
+
332
+ </fo:block>
333
+ </fo:block-container>
303
334
  </fo:block-container>
304
335
  </fo:block-container>
305
- </fo:block-container>
336
+ </fo:block>
306
337
 
307
- <fo:block-container margin-left="7mm" margin-right="4.5mm" margin-top="6pt">
308
- <fo:block-container font-size="8pt" text-align="justify" margin-left="0mm" margin-right="0mm">
309
-
310
- <fo:block font-weight="bold">About the IEC</fo:block>
311
- <fo:block margin-bottom="6pt">The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
312
- International Standards for all electrical, electronic and related technologies.</fo:block>
313
-
314
- <fo:block font-weight="bold">About IEC publications</fo:block>
315
- <fo:block margin-bottom="6pt">The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the
316
- latest edition, a corrigenda or an amendment might have been published.</fo:block>
317
-
318
- <fo:table table-layout="fixed" width="100%" margin-bottom="12pt">
319
- <fo:table-column column-width="82mm"/>
320
- <fo:table-column column-width="78mm"/>
321
- <fo:table-body>
322
- <fo:table-row border-bottom="0.5pt solid black">
323
- <fo:table-cell padding-right="5mm">
324
- <fo:block font-weight="bold">IEC Catalogue - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
325
- <fo:block margin-bottom="6pt">
326
- <xsl:text>The stand-alone application for consulting the entire
327
- bibliographical information on IEC International Standards,
328
- Technical Specifications, Technical Reports and other
329
- documents. Available for PC, Mac OS, Android Tablets and
330
- iPad.</xsl:text>
331
- </fo:block>
332
- <fo:block font-weight="bold">IEC publications search - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
333
- <fo:block margin-bottom="6pt">
334
- <xsl:text>The advanced search enables to find IEC publications by a
335
- variety of criteria (reference number, text, technical
336
- committee,…). It also gives information on projects, replaced
337
- and withdrawn publications.</xsl:text>
338
- </fo:block>
339
- <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
340
- <fo:block margin-bottom="6pt">
341
- <xsl:text>Stay up to date on all new IEC publications. Just Published
342
- details all new publications released. Available online and
343
- also once a month by email.</xsl:text>
344
- </fo:block>
345
- </fo:table-cell>
346
- <fo:table-cell>
347
- <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
348
- <fo:block margin-bottom="6pt">
349
- <xsl:text>The world's leading online dictionary of electronic and
350
- electrical terms containing more than 30 000 terms and
351
- definitions in English and French, with equivalent terms in 14
352
- additional languages. Also known as the International
353
- Electrotechnical Vocabulary (IEV) online.</xsl:text>
354
- </fo:block>
355
- <fo:block font-weight="bold">IEC Glossary - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
356
- <fo:block margin-bottom="6pt">
357
- <xsl:text>More than 55 000 electrotechnical terminology entries in
358
- English and French extracted from the Terms and Definitions
359
- clause of IEC publications issued since 2002. Some entries
360
- have been collected from earlier publications of IEC TC 37,
361
- 77, 86 and CISPR.</xsl:text>
362
- </fo:block>
363
- <fo:block font-weight="bold">IEC Customer Service Centre - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
364
- <fo:block margin-bottom="6pt">
365
- <xsl:text>If you wish to give us your feedback on this publication or
366
- need further assistance, please contact the Customer Service
367
- Centre: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
368
- </fo:block>
369
- </fo:table-cell>
370
- </fo:table-row>
371
- </fo:table-body>
372
- </fo:table>
373
- <fo:block font-weight="bold">A propos de l'IEC</fo:block>
374
- <fo:block margin-bottom="6pt">La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
375
- Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.</fo:block>
338
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:feedback-statement"/>
339
+ <fo:block span="all" border-bottom="0.5pt solid black"/>
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>
344
+ <!-- <fo:block span="all">
345
+ <fo:block-container margin-top="6pt">
346
+ <fo:block-container text-align="justify" margin-left="0mm" margin-right="0mm">
347
+
348
+ <fo:block font-weight="bold">About the IEC</fo:block>
349
+ <fo:block margin-bottom="6pt">The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
350
+ International Standards for all electrical, electronic and related technologies.</fo:block>
376
351
 
377
- <fo:block font-weight="bold">A propos des publications IEC</fo:block>
378
- <fo:block margin-bottom="6pt">Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
379
- plus récente, un corrigendum ou amendement peut avoir été publié.</fo:block>
352
+ <fo:block font-weight="bold">About IEC publications</fo:block>
353
+ <fo:block margin-bottom="6pt">The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the
354
+ latest edition, a corrigenda or an amendment might have been published.</fo:block>
355
+
356
+ <fo:table table-layout="fixed" width="100%" margin-bottom="12pt">
357
+ <fo:table-column column-width="82mm"/>
358
+ <fo:table-column column-width="78mm"/>
359
+ <fo:table-body>
360
+ <fo:table-row border-bottom="0.5pt solid black">
361
+ <fo:table-cell padding-right="5mm">
362
+ <fo:block font-weight="bold">IEC Catalogue - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
363
+ <fo:block margin-bottom="6pt">
364
+ <xsl:text>The stand-alone application for consulting the entire
365
+ bibliographical information on IEC International Standards,
366
+ Technical Specifications, Technical Reports and other
367
+ documents. Available for PC, Mac OS, Android Tablets and
368
+ iPad.</xsl:text>
369
+ </fo:block>
370
+ <fo:block font-weight="bold">IEC publications search - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
371
+ <fo:block margin-bottom="6pt">
372
+ <xsl:text>The advanced search enables to find IEC publications by a
373
+ variety of criteria (reference number, text, technical
374
+ committee,…). It also gives information on projects, replaced
375
+ and withdrawn publications.</xsl:text>
376
+ </fo:block>
377
+ <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
378
+ <fo:block margin-bottom="6pt">
379
+ <xsl:text>Stay up to date on all new IEC publications. Just Published
380
+ details all new publications released. Available online and
381
+ also once a month by email.</xsl:text>
382
+ </fo:block>
383
+ </fo:table-cell>
384
+ <fo:table-cell>
385
+ <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
386
+ <fo:block margin-bottom="6pt">
387
+ <xsl:text>The world's leading online dictionary of electronic and
388
+ electrical terms containing more than 30 000 terms and
389
+ definitions in English and French, with equivalent terms in 14
390
+ additional languages. Also known as the International
391
+ Electrotechnical Vocabulary (IEV) online.</xsl:text>
392
+ </fo:block>
393
+ <fo:block font-weight="bold">IEC Glossary - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
394
+ <fo:block margin-bottom="6pt">
395
+ <xsl:text>More than 55 000 electrotechnical terminology entries in
396
+ English and French extracted from the Terms and Definitions
397
+ clause of IEC publications issued since 2002. Some entries
398
+ have been collected from earlier publications of IEC TC 37,
399
+ 77, 86 and CISPR.</xsl:text>
400
+ </fo:block>
401
+ <fo:block font-weight="bold">IEC Customer Service Centre - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
402
+ <fo:block margin-bottom="6pt">
403
+ <xsl:text>If you wish to give us your feedback on this publication or
404
+ need further assistance, please contact the Customer Service
405
+ Centre: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
406
+ </fo:block>
407
+ </fo:table-cell>
408
+ </fo:table-row>
409
+ </fo:table-body>
410
+ </fo:table>
411
+
412
+ <fo:block font-weight="bold">A propos de l'IEC</fo:block>
413
+ <fo:block margin-bottom="6pt">La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
414
+ Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.</fo:block>
415
+
416
+ <fo:block font-weight="bold">A propos des publications IEC</fo:block>
417
+ <fo:block margin-bottom="6pt">Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
418
+ plus récente, un corrigendum ou amendement peut avoir été publié.</fo:block>
380
419
 
381
- <fo:table table-layout="fixed" width="100%">
382
- <fo:table-column column-width="82mm"/>
383
- <fo:table-column column-width="78mm"/>
384
- <fo:table-body>
385
- <fo:table-row>
386
- <fo:table-cell padding-right="5mm">
387
- <fo:block font-weight="bold">Catalogue IEC - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
388
- <fo:block margin-bottom="6pt">
389
- <xsl:text>Application autonome pour consulter tous les renseignements
390
- bibliographiques sur les Normes internationales,
391
- Spécifications techniques, Rapports techniques et autres
392
- documents de l'IEC. Disponible pour PC, Mac OS, tablettes
393
- Android et iPad.</xsl:text>
394
- </fo:block>
395
- <fo:block font-weight="bold">Recherche de publications IEC - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
396
- <fo:block margin-bottom="6pt">
397
- <xsl:text>La recherche avancée permet de trouver des publications IEC
398
- en utilisant différents critères (numéro de référence, texte,
399
- comité d’études,…). Elle donne aussi des informations sur les
400
- projets et les publications remplacées ou retirées.</xsl:text>
401
- </fo:block>
402
- <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
403
- <fo:block margin-bottom="6pt">
404
- <xsl:text>Restez informé sur les nouvelles publications IEC. Just
405
- Published détaille les nouvelles publications parues.
406
- Disponible en ligne et aussi une fois par mois par email.</xsl:text>
407
- </fo:block>
408
- </fo:table-cell>
409
- <fo:table-cell>
410
- <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
411
- <fo:block margin-bottom="6pt">
412
- <xsl:text>Le premier dictionnaire en ligne de termes électroniques et
413
- électriques. Il contient plus de 30 000 termes et définitions en
414
- anglais et en français, ainsi que les termes équivalents dans
415
- 14 langues additionnelles. Egalement appelé Vocabulaire
416
- Electrotechnique International (IEV) en ligne.</xsl:text>
417
- </fo:block>
418
- <fo:block font-weight="bold">Glossaire IEC - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
419
- <fo:block margin-bottom="6pt">
420
- <xsl:text>Plus de 55 000 entrées terminologiques électrotechniques, en
421
- anglais et en français, extraites des articles Termes et
422
- Définitions des publications IEC parues depuis 2002. Plus
423
- certaines entrées antérieures extraites des publications des
424
- CE 37, 77, 86 et CISPR de l'IEC.</xsl:text>
425
- </fo:block>
426
- <fo:block font-weight="bold">Service Clients - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
427
- <fo:block margin-bottom="6pt">
428
- <xsl:text>Si vous désirez nous donner des commentaires sur cette
429
- publication ou si vous avez des questions contactez-nous: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
430
- </fo:block>
431
- </fo:table-cell>
432
- </fo:table-row>
433
- </fo:table-body>
434
- </fo:table>
420
+ <fo:table table-layout="fixed" width="100%">
421
+ <fo:table-column column-width="82mm"/>
422
+ <fo:table-column column-width="78mm"/>
423
+ <fo:table-body>
424
+ <fo:table-row>
425
+ <fo:table-cell padding-right="5mm">
426
+ <fo:block font-weight="bold">Catalogue IEC - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
427
+ <fo:block margin-bottom="6pt">
428
+ <xsl:text>Application autonome pour consulter tous les renseignements
429
+ bibliographiques sur les Normes internationales,
430
+ Spécifications techniques, Rapports techniques et autres
431
+ documents de l'IEC. Disponible pour PC, Mac OS, tablettes
432
+ Android et iPad.</xsl:text>
433
+ </fo:block>
434
+ <fo:block font-weight="bold">Recherche de publications IEC - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
435
+ <fo:block margin-bottom="6pt">
436
+ <xsl:text>La recherche avancée permet de trouver des publications IEC
437
+ en utilisant différents critères (numéro de référence, texte,
438
+ comité d’études,…). Elle donne aussi des informations sur les
439
+ projets et les publications remplacées ou retirées.</xsl:text>
440
+ </fo:block>
441
+ <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
442
+ <fo:block margin-bottom="6pt">
443
+ <xsl:text>Restez informé sur les nouvelles publications IEC. Just
444
+ Published détaille les nouvelles publications parues.
445
+ Disponible en ligne et aussi une fois par mois par email.</xsl:text>
446
+ </fo:block>
447
+ </fo:table-cell>
448
+ <fo:table-cell>
449
+ <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
450
+ <fo:block margin-bottom="6pt">
451
+ <xsl:text>Le premier dictionnaire en ligne de termes électroniques et
452
+ électriques. Il contient plus de 30 000 termes et définitions en
453
+ anglais et en français, ainsi que les termes équivalents dans
454
+ 14 langues additionnelles. Egalement appelé Vocabulaire
455
+ Electrotechnique International (IEV) en ligne.</xsl:text>
456
+ </fo:block>
457
+ <fo:block font-weight="bold">Glossaire IEC - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
458
+ <fo:block margin-bottom="6pt">
459
+ <xsl:text>Plus de 55 000 entrées terminologiques électrotechniques, en
460
+ anglais et en français, extraites des articles Termes et
461
+ Définitions des publications IEC parues depuis 2002. Plus
462
+ certaines entrées antérieures extraites des publications des
463
+ CE 37, 77, 86 et CISPR de l'IEC.</xsl:text>
464
+ </fo:block>
465
+ <fo:block font-weight="bold">Service Clients - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
466
+ <fo:block margin-bottom="6pt">
467
+ <xsl:text>Si vous désirez nous donner des commentaires sur cette
468
+ publication ou si vous avez des questions contactez-nous: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
469
+ </fo:block>
470
+ </fo:table-cell>
471
+ </fo:table-row>
472
+ </fo:table-body>
473
+ </fo:table>
474
+ </fo:block-container>
435
475
  </fo:block-container>
436
- </fo:block-container>
476
+ </fo:block> -->
437
477
  </fo:flow>
438
478
  </fo:page-sequence>
439
479
  </xsl:if>
440
-
480
+ <xsl:variable name="lang_second" select="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']"/>
441
481
  <!-- For 'Published' documents insert 3rd Cover Page
442
482
  OR insert first Covert Page for FDIS -->
443
483
  <xsl:if test="$stage &gt;= 60 or $stage-abbreviation = 'FDIS'">
@@ -449,15 +489,18 @@
449
489
  <fo:block font-size="9pt" color="{$color_blue}" line-height="150%">
450
490
  <fo:block-container width="40mm">
451
491
  <fo:block>
452
- <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]"/>
453
495
  </fo:block>
454
496
  </fo:block-container>
455
497
  </fo:block>
456
- <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]">
457
499
  <fo:block font-size="9pt" line-height="150%" margin-top="8pt">
458
500
  <fo:block-container width="40mm">
459
501
  <fo:block>
460
- <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]"/>
461
504
  </fo:block>
462
505
  </fo:block-container>
463
506
  </fo:block>
@@ -471,18 +514,35 @@
471
514
  <fo:table-row border-bottom="0.5pt solid {$color_gray}" height="16mm">
472
515
  <fo:table-cell font-size="8pt" text-align="right" display-align="center">
473
516
  <fo:block>
474
- <fo:block color="{$color_blue}" margin-bottom="3pt">PRICE CODE</fo:block>
475
- <fo:block>CODE PRIX</fo:block>
517
+ <fo:block color="{$color_blue}" margin-bottom="3pt">
518
+ <!-- PRICE CODE -->
519
+ <xsl:variable name="price_code">
520
+ <!-- <xsl:call-template name="getLocalizedString">
521
+ <xsl:with-param name="key">price-code</xsl:with-param>
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]"/>
524
+ </xsl:variable>
525
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($price_code))"/>
526
+ </fo:block>
527
+ <!-- <xsl:if test="$lang != 'fr'">
528
+ <fo:block>CODE PRIX</fo:block>
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>
476
536
  </fo:block>
477
537
  </fo:table-cell>
478
538
  <fo:table-cell font-size="25pt" font-weight="bold" color="{$color_gray}" text-align="right" display-align="center">
479
- <fo:block padding-top="1mm">XC</fo:block>
539
+ <fo:block padding-top="1mm"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:price-code"/></fo:block>
480
540
  </fo:table-cell>
481
541
  </fo:table-row>
482
542
  </fo:table-body>
483
543
  </fo:table>
484
544
  <fo:block font-size="8pt" text-align-last="justify">
485
- <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">
486
546
  <xsl:if test="position() = 1">ICS </xsl:if>
487
547
  <xsl:value-of select="iec:code"/>
488
548
  <xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if>
@@ -490,15 +550,17 @@
490
550
  <xsl:text> </xsl:text>
491
551
  <fo:inline keep-together.within-line="always"><fo:leader leader-pattern="space"/>
492
552
  <xsl:text> </xsl:text>
493
- <!-- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:isbn"/> -->
494
- <xsl:text>Example: ISBN 978-2-8322-1532-6</xsl:text>
553
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']">
554
+ <!-- <xsl:text>Example: ISBN 978-2-8322-1532-6</xsl:text> -->
555
+ <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']"/>
556
+ </xsl:if>
495
557
  </fo:inline>
496
558
  </fo:block>
497
559
  <fo:block-container margin-left="1.5mm">
498
560
  <fo:block-container margin-left="0mm">
499
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">
500
562
  <fo:block>Warning! Make sure that you obtained this publication from an authorized distributor.</fo:block>
501
- <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']">
502
564
  <fo:block margin-top="3pt">Attention! Veuillez vous assurer que vous avez obtenu cette publication via un distributeur agréé.</fo:block>
503
565
  </xsl:if>
504
566
  </fo:block-container>
@@ -506,7 +568,7 @@
506
568
  </fo:block-container>
507
569
  <fo:block font-size="6pt" margin-top="6mm" margin-left="1mm">
508
570
  <fo:block>® Registered trademark of the International Electrotechnical Commission</fo:block>
509
- <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']">
510
572
  <fo:block margin-left="2mm">Marque déposée de la Commission Electrotechnique Internationale</fo:block>
511
573
  </xsl:if>
512
574
  </fo:block>
@@ -525,7 +587,9 @@
525
587
  <fo:inline font-weight="bold">
526
588
  <xsl:call-template name="addLetterSpacing">
527
589
  <xsl:with-param name="text">
528
- <xsl:text>Copyright © 2019 International Electrotechnical Commission, IEC</xsl:text>
590
+ <xsl:for-each select="(//iec:iec-standard)[1]/iec:bibdata/iec:copyright">
591
+ <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"/>
592
+ </xsl:for-each>
529
593
  </xsl:with-param>
530
594
  </xsl:call-template>
531
595
  </fo:inline>
@@ -582,7 +646,7 @@
582
646
  </fo:block>
583
647
  <fo:block font-size="9pt" font-weight="bold">
584
648
  <xsl:call-template name="addLetterSpacing">
585
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number"/></xsl:with-param>
649
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number"/></xsl:with-param>
586
650
  </xsl:call-template>
587
651
  </fo:block>
588
652
  </fo:table-cell>
@@ -596,7 +660,7 @@
596
660
  </fo:block>
597
661
  <fo:block font-size="9pt" font-weight="bold">
598
662
  <xsl:call-template name="addLetterSpacing">
599
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:date[@type ='circulated']/iec:on"/></xsl:with-param>
663
+ <xsl:with-param name="text"><xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:date[@type ='circulated']/iec:on"/></xsl:with-param>
600
664
  </xsl:call-template>
601
665
  </fo:block>
602
666
  </fo:table-cell>
@@ -622,7 +686,7 @@
622
686
  </fo:block>
623
687
  <fo:block font-size="9pt" font-weight="bold">
624
688
  <xsl:variable name="supersedes_documents">
625
- <xsl:for-each select="/iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber">
689
+ <xsl:for-each select="//iec:iec-standard/iec:bibdata/iec:relation[@type='supersedes']/iec:bibitem/iec:docnumber">
626
690
  <xsl:value-of select="."/>
627
691
  <xsl:if test="position() != last()">,</xsl:if>
628
692
  </xsl:for-each>
@@ -648,19 +712,19 @@
648
712
  <fo:table-row height="4mm">
649
713
  <fo:table-cell number-columns-spanned="2" border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
650
714
  <fo:block>
651
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
715
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee">
652
716
  <fo:block font-size="6.5pt">
653
- <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>
717
+ <fo:inline font-size="8pt">IEC SC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee/@number"/> : </fo:inline>
654
718
  <xsl:call-template name="addLetterSpacingSmallCaps">
655
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
719
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:subcommittee"/>
656
720
  </xsl:call-template>
657
721
  </fo:block>
658
722
  </xsl:if>
659
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
723
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee">
660
724
  <fo:block font-size="6.5pt">
661
- <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>
725
+ <fo:inline font-size="8pt">IEC TC <xsl:value-of select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee/@number"/> : </fo:inline>
662
726
  <xsl:call-template name="addLetterSpacingSmallCaps">
663
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
727
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:technical-committee"/>
664
728
  </xsl:call-template>
665
729
  </fo:block>
666
730
  </xsl:if>
@@ -676,7 +740,7 @@
676
740
  </fo:block>
677
741
  <fo:block font-size="9pt">
678
742
  <xsl:call-template name="addLetterSpacing">
679
- <xsl:with-param name="text" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:secretariat"/>
743
+ <xsl:with-param name="text" select="//iec:iec-standard/iec:bibdata/iec:ext/iec:editorialgroup/iec:secretariat"/>
680
744
  </xsl:call-template>
681
745
  </fo:block>
682
746
  </fo:table-cell>
@@ -746,13 +810,28 @@
746
810
  <xsl:with-param name="text" select="'Functions concerned:'"/>
747
811
  </xsl:call-template>
748
812
  </fo:block>
813
+ <!-- function: { emc | safety | environment | quality-assurance } -->
749
814
  <fo:block font-size="6.5pt">
750
- <xsl:call-template name="insertCheckBoxOff"/>
815
+ <xsl:choose>
816
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'emc'">
817
+ <xsl:call-template name="insertCheckBoxOn"/>
818
+ </xsl:when>
819
+ <xsl:otherwise>
820
+ <xsl:call-template name="insertCheckBoxOff"/>
821
+ </xsl:otherwise>
822
+ </xsl:choose>
751
823
  <xsl:call-template name="addLetterSpacingSmallCaps">
752
824
  <xsl:with-param name="text" select="'EMC'"/>
753
825
  </xsl:call-template>
754
826
  <fo:inline padding-right="33mm"> </fo:inline>
755
- <xsl:call-template name="insertCheckBoxOff"/>
827
+ <xsl:choose>
828
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'environment'">
829
+ <xsl:call-template name="insertCheckBoxOn"/>
830
+ </xsl:when>
831
+ <xsl:otherwise>
832
+ <xsl:call-template name="insertCheckBoxOff"/>
833
+ </xsl:otherwise>
834
+ </xsl:choose>
756
835
  <xsl:call-template name="addLetterSpacingSmallCaps">
757
836
  <xsl:with-param name="text" select="'Environment'"/>
758
837
  </xsl:call-template>
@@ -761,12 +840,26 @@
761
840
  <fo:table-cell padding="1.5mm" padding-bottom="0mm">
762
841
  <fo:block font-size="6.5pt" margin-bottom="6pt"> </fo:block>
763
842
  <fo:block font-size="6.5pt">
764
- <xsl:call-template name="insertCheckBoxOff"/>
843
+ <xsl:choose>
844
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'quality-assurance'">
845
+ <xsl:call-template name="insertCheckBoxOn"/>
846
+ </xsl:when>
847
+ <xsl:otherwise>
848
+ <xsl:call-template name="insertCheckBoxOff"/>
849
+ </xsl:otherwise>
850
+ </xsl:choose>
765
851
  <xsl:call-template name="addLetterSpacingSmallCaps">
766
852
  <xsl:with-param name="text" select="'Quality assurance'"/>
767
853
  </xsl:call-template>
768
854
  <fo:inline padding-right="13mm"> </fo:inline>
769
- <xsl:call-template name="insertCheckBoxOn"/>
855
+ <xsl:choose>
856
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'safety'">
857
+ <xsl:call-template name="insertCheckBoxOn"/>
858
+ </xsl:when>
859
+ <xsl:otherwise>
860
+ <xsl:call-template name="insertCheckBoxOff"/>
861
+ </xsl:otherwise>
862
+ </xsl:choose>
770
863
  <xsl:call-template name="addLetterSpacingSmallCaps">
771
864
  <xsl:with-param name="text" select="'Safety'"/>
772
865
  </xsl:call-template>
@@ -780,7 +873,14 @@
780
873
  <fo:table-row>
781
874
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
782
875
  <fo:block font-size="6.5pt" margin-bottom="12pt">
783
- <xsl:call-template name="insertCheckBoxOn"/>
876
+ <xsl:choose>
877
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:cen-processing = 'true'">
878
+ <xsl:call-template name="insertCheckBoxOn"/>
879
+ </xsl:when>
880
+ <xsl:otherwise>
881
+ <xsl:call-template name="insertCheckBoxOff"/>
882
+ </xsl:otherwise>
883
+ </xsl:choose>
784
884
  <xsl:call-template name="addLetterSpacingSmallCaps">
785
885
  <xsl:with-param name="text" select="'Submitted for CENELEC parallel voting'"/>
786
886
  </xsl:call-template>
@@ -811,7 +911,14 @@
811
911
  </fo:table-cell>
812
912
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
813
913
  <fo:block font-size="6.5pt" margin-bottom="6pt">
814
- <xsl:call-template name="insertCheckBoxOff"/>
914
+ <xsl:choose>
915
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:cen-processing = 'true'">
916
+ <xsl:call-template name="insertCheckBoxOff"/>
917
+ </xsl:when>
918
+ <xsl:otherwise>
919
+ <xsl:call-template name="insertCheckBoxOn"/>
920
+ </xsl:otherwise>
921
+ </xsl:choose>
815
922
  <xsl:call-template name="addLetterSpacingSmallCaps">
816
923
  <xsl:with-param name="text" select="'Not submitted for CENELEC parallel voting'"/>
817
924
  </xsl:call-template>
@@ -864,7 +971,7 @@
864
971
  </fo:block>
865
972
  <fo:block font-size="9pt" font-weight="bold">
866
973
  <xsl:call-template name="addLetterSpacing">
867
- <xsl:with-param name="text"><xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'main']"/></xsl:with-param>
974
+ <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>
868
975
  </xsl:call-template>
869
976
  </fo:block>
870
977
  </fo:block-container>
@@ -916,8 +1023,56 @@
916
1023
  </fo:page-sequence>
917
1024
  </xsl:if>
918
1025
 
1026
+ <xsl:if test="$debug = 'true'">
1027
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1028
+ DEBUG
1029
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
1030
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1031
+ </xsl:if>
1032
+
1033
+ <xsl:for-each select="//iec:iec-standard">
1034
+ <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
1035
+ <xsl:variable name="current_document">
1036
+ <xsl:copy-of select="."/>
1037
+ </xsl:variable>
1038
+ <xsl:for-each select="xalan:nodeset($current_document)">
1039
+
1040
+ <xsl:variable name="docid">
1041
+ <xsl:call-template name="getDocumentId"/>
1042
+ </xsl:variable>
1043
+
1044
+
1045
+ <fo:page-sequence master-reference="document" format="1" force-page-count="no-force"> <!-- initial-page-number="2" -->
1046
+ <xsl:variable name="num"><xsl:number count="iec:iec-standard" level="any"/></xsl:variable>
1047
+ <xsl:if test="$num = '1'">
1048
+ <xsl:attribute name="initial-page-number">2</xsl:attribute>
1049
+ </xsl:if>
1050
+
1051
+ <xsl:call-template name="insertHeaderFooter"/>
1052
+ <fo:flow flow-name="xsl-region-body">
1053
+
1054
+ <xsl:call-template name="insertTOCpages">
1055
+ <xsl:with-param name="contents" select="xalan:nodeset($contents)/doc[@id = $docid]"/>
1056
+ </xsl:call-template>
1057
+
1058
+ <xsl:call-template name="insertPrefacepages">
1059
+ <xsl:with-param name="lang" select="$lang"/>
1060
+ </xsl:call-template>
1061
+
1062
+
1063
+ </fo:flow>
1064
+ </fo:page-sequence>
1065
+
1066
+ <xsl:call-template name="insertBodypages">
1067
+ <xsl:with-param name="lang" select="$lang"/>
1068
+ </xsl:call-template>
1069
+
1070
+ </xsl:for-each>
1071
+ </xsl:for-each>
1072
+
1073
+
919
1074
 
920
- <fo:page-sequence master-reference="document" format="1" initial-page-number="2" force-page-count="no-force">
1075
+ <!-- <fo:page-sequence master-reference="document" format="1" initial-page-number="2" force-page-count="no-force">
921
1076
  <xsl:call-template name="insertHeaderFooter"/>
922
1077
  <fo:flow flow-name="xsl-region-body">
923
1078
 
@@ -925,13 +1080,7 @@
925
1080
  <xsl:call-template name="getDocumentId"/>
926
1081
  </xsl:variable>
927
1082
 
928
- <xsl:if test="$debug = 'true'">
929
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
930
- DEBUG
931
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
932
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
933
- </xsl:if>
934
-
1083
+
935
1084
  <xsl:call-template name="insertTOCpages">
936
1085
  <xsl:with-param name="contents" select="xalan:nodeset($contents)/doc[@id = $docid]"/>
937
1086
  </xsl:call-template>
@@ -943,11 +1092,11 @@
943
1092
 
944
1093
 
945
1094
  <xsl:call-template name="insertBodypages"/>
946
-
1095
+ -->
947
1096
 
948
1097
 
949
1098
  <!-- Test=<xsl:copy-of select="$additionalDocs"/> Test -->
950
- <xsl:for-each select="xalan:nodeset($additionalXMLsArray)/*">
1099
+ <!-- <xsl:for-each select="xalan:nodeset($additionalXMLsArray)/*">
951
1100
 
952
1101
  <xsl:for-each select="document(.)">
953
1102
  <xsl:variable name="lang">
@@ -988,7 +1137,7 @@
988
1137
 
989
1138
  </xsl:for-each>
990
1139
  </xsl:for-each>
991
- </xsl:for-each>
1140
+ </xsl:for-each> -->
992
1141
 
993
1142
 
994
1143
 
@@ -1007,6 +1156,7 @@
1007
1156
  <fo:block font-size="11pt" color="{$color_blue}" margin-bottom="12pt" line-height="150%">
1008
1157
  <fo:block-container width="42mm">
1009
1158
  <fo:block>
1159
+ <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))"/>
1010
1160
  <xsl:value-of select="$publisher"/>
1011
1161
  </fo:block>
1012
1162
  </fo:block-container>
@@ -1022,14 +1172,14 @@
1022
1172
  Fax: + 41 22 919 03 00
1023
1173
  info@iec.ch
1024
1174
  www.iec.ch -->
1025
- <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())"/>
1175
+ <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())"/>
1026
1176
  <xsl:choose>
1027
1177
  <xsl:when test="$telpos != 0">
1028
- <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"/>
1029
- <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"/>
1178
+ <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"/>
1179
+ <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"/>
1030
1180
  </xsl:when>
1031
1181
  <xsl:otherwise>
1032
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
1182
+ <xsl:apply-templates select="(//iec:iec-standard)[1]/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
1033
1183
  </xsl:otherwise>
1034
1184
  </xsl:choose>
1035
1185
  </fo:block>
@@ -1042,10 +1192,20 @@
1042
1192
  </xsl:template>
1043
1193
 
1044
1194
  <xsl:template name="insertCoverPart1">
1195
+ <xsl:variable name="lang_second">
1196
+ <xsl:choose>
1197
+ <xsl:when test="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']">
1198
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:bibdata/iec:language[@current = 'true']"/>
1199
+ </xsl:when>
1200
+ <xsl:otherwise>
1201
+ <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:title[@language and @language != $lang]/@language"/>
1202
+ </xsl:otherwise>
1203
+ </xsl:choose>
1204
+ </xsl:variable>
1045
1205
  <fo:block text-align-last="justify">
1046
1206
  <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"/>
1047
1207
  <fo:inline font-size="8pt" padding-left="0.5mm" color="rgb(88, 88, 90)">®</fo:inline>
1048
- <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>
1208
+ <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>
1049
1209
  </fo:block>
1050
1210
  <fo:block font-size="10.5pt" text-align="right" margin-top="0.5mm">
1051
1211
  <xsl:variable name="title-edition">
@@ -1055,12 +1215,13 @@
1055
1215
  </xsl:variable>
1056
1216
  <xsl:value-of select="$title-edition"/>
1057
1217
  <fo:inline>
1058
- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:edition"/>
1059
- <xsl:if test="not(contains(/iec:iec-standard/iec:bibdata/iec:edition, '.'))">.0</xsl:if>
1218
+ <xsl:variable name="edition" select="//iec:iec-standard/iec:bibdata/iec:edition"/>
1219
+ <xsl:value-of select="$edition"/>
1220
+ <xsl:if test="not(contains($edition, '.'))">.0</xsl:if>
1060
1221
  </fo:inline>
1061
1222
  <fo:inline padding-left="4mm">
1062
1223
  <!-- Example 2014-05 -->
1063
- <xsl:value-of select="substring(/iec:iec-standard/iec:bibdata/iec:version/iec:revision-date, 1, 7)"/>
1224
+ <xsl:value-of select="substring(//iec:iec-standard/iec:bibdata/iec:version/iec:revision-date, 1, 7)"/>
1064
1225
  </fo:inline>
1065
1226
  <fo:block> </fo:block>
1066
1227
  </fo:block>
@@ -1076,6 +1237,7 @@
1076
1237
  <xsl:text>PRE-RELEASE VERSION (FDIS)</xsl:text>
1077
1238
  </xsl:when>
1078
1239
  <xsl:when test="$stage &gt;= 60">
1240
+ <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]))"/>
1079
1241
  <xsl:value-of select="$doctype_uppercased"/>
1080
1242
  </xsl:when>
1081
1243
  <xsl:otherwise>
@@ -1083,17 +1245,18 @@
1083
1245
  <xsl:text> (</xsl:text><xsl:value-of select="$stage-abbreviation"/><xsl:text>)</xsl:text>
1084
1246
  </xsl:otherwise>
1085
1247
  </xsl:choose>
1086
-
1087
1248
  </fo:block>
1088
1249
  </fo:block-container>
1089
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
1250
+
1251
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second]">
1090
1252
  <fo:block-container height="26mm" margin-top="10pt" display-align="after">
1091
1253
  <xsl:if test="$stage &gt;= 60">
1092
1254
  <xsl:attribute name="width">100mm</xsl:attribute>
1093
1255
  </xsl:if>
1094
1256
  <fo:block color="{$color_gray}">
1095
1257
  <xsl:if test="$stage &gt;= 60">
1096
- <xsl:text>NORME INTERNATIONALE</xsl:text>
1258
+ <!-- <xsl:text>NORME INTERNATIONALE</xsl:text> -->
1259
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = $lang_second]))"/>
1097
1260
  </xsl:if>
1098
1261
  </fo:block>
1099
1262
  </fo:block-container>
@@ -1104,21 +1267,39 @@
1104
1267
  <fo:block-container margin-left="0mm">
1105
1268
  <fo:block-container height="6mm">
1106
1269
  <fo:block text-align="right" margin-top="-4.5mm" margin-right="-1mm">
1107
- <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"/>
1270
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:ext/iec:accessibility-color-inside = 'true'">
1271
+ <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"/>
1272
+ </xsl:if>
1108
1273
  </fo:block>
1109
1274
  </fo:block-container>
1110
1275
  <fo:block-container border-bottom="0.5pt solid {$color_gray}" margin-top="4mm" margin-bottom="16pt" height="14mm" display-align="center">
1111
1276
  <fo:block font-size="10pt" color="{$color_blue}" margin-bottom="4pt">
1112
- Example: BASIC EMC PUBLICATION
1277
+ <xsl:choose>
1278
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1279
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang]))"/>
1280
+ </xsl:when>
1281
+ <xsl:otherwise><!-- horizontal is false -->
1282
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang]))"/>
1283
+ </xsl:otherwise>
1284
+ </xsl:choose>
1285
+ <!-- Example: BASIC EMC PUBLICATION -->
1113
1286
  <!-- HORIZONTAL STANDARD -->
1114
1287
  <!-- Basic EMC Publication
1115
1288
  Basic Safety Publication
1116
1289
  Basic Environment Publication
1117
1290
  Basic Quality Assurance Publication -->
1118
1291
  </fo:block>
1119
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
1292
+ <xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second]">
1120
1293
  <fo:block font-size="10pt" margin-bottom="10pt">
1121
- Example: PUBLICATION FONDAMENTALE EN CEM
1294
+ <xsl:choose>
1295
+ <xsl:when test="//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1296
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang_second]))"/>
1297
+ </xsl:when>
1298
+ <xsl:otherwise><!-- horizontal is false -->
1299
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang_second]))"/>
1300
+ </xsl:otherwise>
1301
+ </xsl:choose>
1302
+ <!-- Example: PUBLICATION FONDAMENTALE EN CEM -->
1122
1303
  <!-- NORME HORIZONTALE -->
1123
1304
  </fo:block>
1124
1305
  </xsl:if>
@@ -1132,42 +1313,62 @@
1132
1313
  Electromagnetic compatibility (EMC) –
1133
1314
  Part 4-5: Testing and measurement techniques – Surge immunity test
1134
1315
  -->
1316
+ <xsl:variable name="title-intro" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']"/>
1135
1317
  <xsl:value-of select="$title-intro"/>
1318
+ <xsl:variable name="title-main" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']"/>
1136
1319
  <xsl:if test="$title-main != ''">
1137
1320
  <xsl:text> — </xsl:text>
1138
1321
  <xsl:value-of select="$title-main"/>
1139
1322
  </xsl:if>
1140
- <xsl:variable name="part-en" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'title-part']"/>
1141
- <xsl:if test="$part-en != ''">
1323
+ <xsl:variable name="title-part" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-part']"/>
1324
+ <xsl:if test="$title-part != ''">
1142
1325
  <xsl:text> — </xsl:text>
1143
1326
  <xsl:value-of select="$linebreak"/>
1144
1327
  <xsl:if test="$part != ''">
1145
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1328
+ <xsl:variable name="localized_part" select="(//iec:iec-standard)[1]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang]"/>
1329
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($localized_part),'#',$part)"/> -->
1330
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1146
1331
  <!-- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
1147
1332
  <xsl:text>: </xsl:text> -->
1148
1333
  </xsl:if>
1149
- <xsl:value-of select="$part-en"/>
1334
+ <xsl:value-of select="$title-part"/>
1150
1335
  </xsl:if>
1151
1336
  </fo:block>
1152
1337
  <fo:block font-size="12pt" font-weight="bold">
1153
1338
  <!-- Example: Compatibilité électromagnétique (CEM) –
1154
1339
  Partie 4-5: Techniques d'essai et de mesure – Essai d'immunité aux ondes de
1155
1340
  choc -->
1156
- <xsl:value-of select="$title-intro-fr"/>
1157
- <xsl:if test="$title-main-fr != ''">
1341
+ <xsl:variable name="title-intro-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-intro']"/>
1342
+ <xsl:value-of select="$title-intro-second"/>
1343
+ <xsl:variable name="title-main-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-main']"/>
1344
+ <xsl:if test="$title-main-second != ''">
1158
1345
  <xsl:text> — </xsl:text>
1159
- <xsl:value-of select="$title-main-fr"/>
1346
+ <xsl:value-of select="$title-main-second"/>
1160
1347
  </xsl:if>
1161
- <xsl:variable name="part-fr" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr' and @type = 'title-part']"/>
1162
- <xsl:if test="$part-fr != ''">
1348
+ <xsl:variable name="part-second" select="//iec:iec-standard/iec:bibdata/iec:title[@language = $lang_second and @type = 'title-part']"/>
1349
+ <xsl:if test="$part-second != ''">
1163
1350
  <xsl:text> — </xsl:text>
1164
1351
  <xsl:value-of select="$linebreak"/>
1165
1352
  <xsl:if test="$part != ''">
1166
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1353
+
1354
+ <xsl:choose>
1355
+ <xsl:when test="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]">
1356
+ <xsl:variable name="localized_part">
1357
+ <xsl:value-of select="(//iec:iec-standard)[2]/iec:localized-strings/iec:localized-string[@key='locality.part' and @language=$lang_second]"/>
1358
+ </xsl:variable>
1359
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1360
+ </xsl:when>
1361
+ <xsl:otherwise>
1362
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang_second]),'#',$part)"/>
1363
+ </xsl:otherwise>
1364
+ </xsl:choose>
1365
+
1366
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($localized_part),'#',$part)"/> -->
1367
+
1167
1368
  <!-- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
1168
1369
  <xsl:text>: </xsl:text> -->
1169
1370
  </xsl:if>
1170
- <xsl:value-of select="$part-fr"/>
1371
+ <xsl:value-of select="$part-second"/>
1171
1372
  </xsl:if>
1172
1373
  </fo:block>
1173
1374
  </fo:block-container>
@@ -1289,7 +1490,8 @@
1289
1490
  <xsl:param name="lang" select="$lang"/>
1290
1491
  <fo:block break-after="page"/>
1291
1492
  <fo:block-container font-size="12pt" text-align="center" margin-bottom="18pt">
1292
- <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>
1493
+ <!-- <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> -->
1494
+ <fo:block><xsl:value-of select="/iec:iec-standard/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/></fo:block>
1293
1495
  <fo:block>___________</fo:block>
1294
1496
  <fo:block> </fo:block>
1295
1497
  <fo:block font-weight="bold">
@@ -1304,7 +1506,9 @@
1304
1506
  <fo:block>
1305
1507
  <xsl:if test="$part != ''">
1306
1508
  <!-- Example: Part 1: Riz -->
1307
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/>
1509
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1510
+ <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1511
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1308
1512
  </xsl:if>
1309
1513
  <xsl:value-of select="$title-part"/>
1310
1514
  </fo:block>
@@ -1344,7 +1548,9 @@
1344
1548
  <fo:block>
1345
1549
  <xsl:if test="$part != ''">
1346
1550
  <!-- Example: Part 1: Rice -->
1347
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/>
1551
+ <!-- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang = $lang]),'#',$part)"/> -->
1552
+ <xsl:variable name="localized_part" select="//iec:iec-standard/iec:localized-strings/iec:localized-string[@key='locality.part' and @language = $lang]"/>
1553
+ <xsl:value-of select="concat($localized_part ,' ',$part, ': ')"/>
1348
1554
  </xsl:if>
1349
1555
  <xsl:value-of select="$title-part"/>
1350
1556
  </fo:block>
@@ -1367,6 +1573,35 @@
1367
1573
  <xsl:apply-templates/>
1368
1574
  </xsl:template>
1369
1575
 
1576
+
1577
+ <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1578
+ <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1579
+ </xsl:template>
1580
+
1581
+ <xsl:template match="iec:feedback-statement//iec:clause/iec:p" priority="2">
1582
+ <fo:block margin-bottom="6pt"><xsl:apply-templates/></fo:block>
1583
+ </xsl:template>
1584
+
1585
+ <xsl:template match="iec:feedback-statement/iec:clause[not(iec:clause)]" priority="2">
1586
+ <fo:block span="all" text-align="justify">
1587
+ <xsl:if test="not(preceding-sibling::iec:clause)">
1588
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1589
+ </xsl:if>
1590
+ <xsl:apply-templates/>
1591
+ </fo:block>
1592
+ </xsl:template>
1593
+
1594
+ <xsl:template match="iec:feedback-statement/iec:clause[iec:clause]" priority="2">
1595
+ <fo:block text-align="justify">
1596
+ <xsl:apply-templates/>
1597
+ </fo:block>
1598
+ </xsl:template>
1599
+ <xsl:template match="iec:feedback-statement/iec:clause/iec:clause" priority="3">
1600
+ <fo:block text-align="justify">
1601
+ <xsl:apply-templates/>
1602
+ </fo:block>
1603
+ </xsl:template>
1604
+
1370
1605
  <!-- ============================= -->
1371
1606
  <!-- CONTENTS -->
1372
1607
  <!-- ============================= -->
@@ -1721,9 +1956,9 @@
1721
1956
  <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" -->
1722
1957
  <xsl:value-of select="$number + count(//iec:bibitem/iec:note)"/><!-- <xsl:text>)</xsl:text> -->
1723
1958
  </fo:inline>
1724
- <xsl:for-each select="iec:p">
1725
- <xsl:apply-templates/>
1726
- </xsl:for-each>
1959
+ <!-- <xsl:for-each select="iec:p"> -->
1960
+ <xsl:apply-templates/>
1961
+ <!-- </xsl:for-each> -->
1727
1962
  </fo:block>
1728
1963
  </fo:footnote-body>
1729
1964
  </fo:footnote>
@@ -1819,10 +2054,10 @@
1819
2054
  <xsl:otherwise> <!-- for ordered lists -->
1820
2055
  <xsl:choose>
1821
2056
  <xsl:when test="../@type = 'arabic'">
1822
- <xsl:number format="a)"/>
2057
+ <xsl:number format="a)" lang="en"/>
1823
2058
  </xsl:when>
1824
2059
  <xsl:when test="../@type = 'alphabet'">
1825
- <xsl:number format="a)"/>
2060
+ <xsl:number format="a)" lang="en"/>
1826
2061
  </xsl:when>
1827
2062
  <xsl:otherwise>
1828
2063
  <xsl:number format="1)"/>
@@ -2190,15 +2425,24 @@
2190
2425
 
2191
2426
  <xsl:text>Part #: </xsl:text>
2192
2427
 
2428
+
2193
2429
  </title-part>
2194
2430
  <title-part lang="fr">
2195
2431
 
2196
2432
 
2197
2433
  <xsl:text>Partie #: </xsl:text>
2198
2434
 
2435
+
2199
2436
  </title-part>
2200
2437
  <title-part lang="zh">第 # 部分:</title-part>
2201
2438
 
2439
+ <title-subpart lang="en">
2440
+
2441
+ </title-subpart>
2442
+ <title-subpart lang="fr">
2443
+
2444
+ </title-subpart>
2445
+
2202
2446
  <title-modified lang="en">modified</title-modified>
2203
2447
  <title-modified lang="fr">modifiée</title-modified>
2204
2448
 
@@ -2499,6 +2743,7 @@
2499
2743
 
2500
2744
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2501
2745
 
2746
+
2502
2747
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2503
2748
 
2504
2749
 
@@ -2536,6 +2781,7 @@
2536
2781
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2537
2782
 
2538
2783
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2784
+
2539
2785
 
2540
2786
 
2541
2787
 
@@ -2662,7 +2908,9 @@
2662
2908
 
2663
2909
 
2664
2910
 
2665
-
2911
+ <!-- <xsl:if test="$namespace = 'bipm'">
2912
+ <fo:block>&#xA0;</fo:block>
2913
+ </xsl:if> -->
2666
2914
 
2667
2915
  <!-- $namespace = 'iso' or -->
2668
2916
 
@@ -2696,10 +2944,12 @@
2696
2944
 
2697
2945
 
2698
2946
  <xsl:variable name="colwidths">
2699
- <xsl:call-template name="calculate-column-widths">
2700
- <xsl:with-param name="cols-count" select="$cols-count"/>
2701
- <xsl:with-param name="table" select="$simple-table"/>
2702
- </xsl:call-template>
2947
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2948
+ <xsl:call-template name="calculate-column-widths">
2949
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2950
+ <xsl:with-param name="table" select="$simple-table"/>
2951
+ </xsl:call-template>
2952
+ </xsl:if>
2703
2953
  </xsl:variable>
2704
2954
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2705
2955
 
@@ -2744,7 +2994,12 @@
2744
2994
 
2745
2995
  <xsl:variable name="table_attributes">
2746
2996
  <attribute name="table-layout">fixed</attribute>
2747
- <attribute name="width">100%</attribute>
2997
+ <attribute name="width">
2998
+ <xsl:choose>
2999
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
3000
+ <xsl:otherwise>100%</xsl:otherwise>
3001
+ </xsl:choose>
3002
+ </attribute>
2748
3003
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2749
3004
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2750
3005
 
@@ -2775,16 +3030,25 @@
2775
3030
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2776
3031
  </xsl:if>
2777
3032
 
2778
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2779
- <xsl:choose>
2780
- <xsl:when test=". = 1 or . = 0">
2781
- <fo:table-column column-width="proportional-column-width(2)"/>
2782
- </xsl:when>
2783
- <xsl:otherwise>
2784
- <fo:table-column column-width="proportional-column-width({.})"/>
2785
- </xsl:otherwise>
2786
- </xsl:choose>
2787
- </xsl:for-each>
3033
+ <xsl:choose>
3034
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3035
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3036
+ <fo:table-column column-width="{@width}"/>
3037
+ </xsl:for-each>
3038
+ </xsl:when>
3039
+ <xsl:otherwise>
3040
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3041
+ <xsl:choose>
3042
+ <xsl:when test=". = 1 or . = 0">
3043
+ <fo:table-column column-width="proportional-column-width(2)"/>
3044
+ </xsl:when>
3045
+ <xsl:otherwise>
3046
+ <fo:table-column column-width="proportional-column-width({.})"/>
3047
+ </xsl:otherwise>
3048
+ </xsl:choose>
3049
+ </xsl:for-each>
3050
+ </xsl:otherwise>
3051
+ </xsl:choose>
2788
3052
 
2789
3053
  <xsl:choose>
2790
3054
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2797,10 +3061,12 @@
2797
3061
 
2798
3062
  </fo:table>
2799
3063
 
3064
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2800
3065
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2801
3066
  <xsl:call-template name="insertTableFooterInSeparateTable">
2802
3067
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2803
3068
  <xsl:with-param name="colwidths" select="$colwidths"/>
3069
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2804
3070
  </xsl:call-template>
2805
3071
  </xsl:for-each>
2806
3072
 
@@ -2833,6 +3099,7 @@
2833
3099
  <xsl:if test="normalize-space() != ''">
2834
3100
  <fo:block xsl:use-attribute-sets="table-name-style">
2835
3101
 
3102
+
2836
3103
  <xsl:apply-templates/>
2837
3104
  </fo:block>
2838
3105
  </xsl:if>
@@ -3065,12 +3332,22 @@
3065
3332
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3066
3333
  <xsl:param name="table_attributes"/>
3067
3334
  <xsl:param name="colwidths"/>
3335
+ <xsl:param name="colgroup"/>
3068
3336
 
3069
3337
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3070
3338
 
3071
3339
  <xsl:if test="$isNoteOrFnExist = 'true'">
3072
3340
 
3073
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3341
+ <xsl:variable name="cols-count">
3342
+ <xsl:choose>
3343
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3344
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3345
+ </xsl:when>
3346
+ <xsl:otherwise>
3347
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3348
+ </xsl:otherwise>
3349
+ </xsl:choose>
3350
+ </xsl:variable>
3074
3351
 
3075
3352
  <fo:table keep-with-previous="always">
3076
3353
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3088,16 +3365,25 @@
3088
3365
  </xsl:choose>
3089
3366
  </xsl:for-each>
3090
3367
 
3091
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3092
- <xsl:choose>
3093
- <xsl:when test=". = 1 or . = 0">
3094
- <fo:table-column column-width="proportional-column-width(2)"/>
3095
- </xsl:when>
3096
- <xsl:otherwise>
3097
- <fo:table-column column-width="proportional-column-width({.})"/>
3098
- </xsl:otherwise>
3099
- </xsl:choose>
3100
- </xsl:for-each>
3368
+ <xsl:choose>
3369
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3370
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3371
+ <fo:table-column column-width="{@width}"/>
3372
+ </xsl:for-each>
3373
+ </xsl:when>
3374
+ <xsl:otherwise>
3375
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3376
+ <xsl:choose>
3377
+ <xsl:when test=". = 1 or . = 0">
3378
+ <fo:table-column column-width="proportional-column-width(2)"/>
3379
+ </xsl:when>
3380
+ <xsl:otherwise>
3381
+ <fo:table-column column-width="proportional-column-width({.})"/>
3382
+ </xsl:otherwise>
3383
+ </xsl:choose>
3384
+ </xsl:for-each>
3385
+ </xsl:otherwise>
3386
+ </xsl:choose>
3101
3387
 
3102
3388
  <fo:table-body>
3103
3389
  <fo:table-row>
@@ -3216,6 +3502,7 @@
3216
3502
 
3217
3503
 
3218
3504
 
3505
+
3219
3506
  <!-- <xsl:if test="$namespace = 'bipm'">
3220
3507
  <xsl:attribute name="height">8mm</xsl:attribute>
3221
3508
  </xsl:if> -->
@@ -3320,7 +3607,8 @@
3320
3607
  </xsl:attribute>
3321
3608
  </xsl:if>
3322
3609
  <xsl:call-template name="display-align"/>
3323
- <fo:block>
3610
+ <fo:block>
3611
+
3324
3612
  <xsl:apply-templates/>
3325
3613
  </fo:block>
3326
3614
  </fo:table-cell>
@@ -3556,7 +3844,13 @@
3556
3844
  <xsl:apply-templates/>
3557
3845
  </fo:inline>
3558
3846
  </xsl:template><xsl:template match="*[local-name()='dl']">
3559
- <fo:block-container margin-left="0mm">
3847
+ <fo:block-container>
3848
+
3849
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3850
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3851
+ </xsl:if>
3852
+
3853
+
3560
3854
  <xsl:if test="parent::*[local-name() = 'note']">
3561
3855
  <xsl:attribute name="margin-left">
3562
3856
  <xsl:choose>
@@ -3566,8 +3860,12 @@
3566
3860
  </xsl:attribute>
3567
3861
 
3568
3862
  </xsl:if>
3569
- <fo:block-container margin-left="0mm">
3570
-
3863
+ <fo:block-container>
3864
+
3865
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3866
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3867
+
3868
+
3571
3869
  <xsl:variable name="parent" select="local-name(..)"/>
3572
3870
 
3573
3871
  <xsl:variable name="key_iso">
@@ -3585,9 +3883,12 @@
3585
3883
 
3586
3884
 
3587
3885
  <xsl:variable name="title-where">
3588
- <xsl:call-template name="getTitle">
3589
- <xsl:with-param name="name" select="'title-where'"/>
3590
- </xsl:call-template>
3886
+
3887
+
3888
+ <xsl:call-template name="getTitle">
3889
+ <xsl:with-param name="name" select="'title-where'"/>
3890
+ </xsl:call-template>
3891
+
3591
3892
  </xsl:variable>
3592
3893
  <xsl:value-of select="$title-where"/>
3593
3894
  </fo:block>
@@ -3610,9 +3911,12 @@
3610
3911
 
3611
3912
 
3612
3913
  <xsl:variable name="title-where">
3613
- <xsl:call-template name="getTitle">
3614
- <xsl:with-param name="name" select="'title-where'"/>
3615
- </xsl:call-template>
3914
+
3915
+
3916
+ <xsl:call-template name="getTitle">
3917
+ <xsl:with-param name="name" select="'title-where'"/>
3918
+ </xsl:call-template>
3919
+
3616
3920
  </xsl:variable>
3617
3921
  <xsl:value-of select="$title-where"/>
3618
3922
  </fo:block>
@@ -3626,9 +3930,12 @@
3626
3930
 
3627
3931
 
3628
3932
  <xsl:variable name="title-key">
3629
- <xsl:call-template name="getTitle">
3630
- <xsl:with-param name="name" select="'title-key'"/>
3631
- </xsl:call-template>
3933
+
3934
+
3935
+ <xsl:call-template name="getTitle">
3936
+ <xsl:with-param name="name" select="'title-key'"/>
3937
+ </xsl:call-template>
3938
+
3632
3939
  </xsl:variable>
3633
3940
  <xsl:value-of select="$title-key"/>
3634
3941
  </fo:block>
@@ -3756,12 +4063,32 @@
3756
4063
  </xsl:otherwise>
3757
4064
  </xsl:choose>
3758
4065
  </xsl:template><xsl:template name="getMaxLength_dt">
3759
- <xsl:for-each select="*[local-name()='dt']">
3760
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3761
- <xsl:if test="position() = 1">
3762
- <xsl:value-of select="string-length(normalize-space(.))"/>
3763
- </xsl:if>
3764
- </xsl:for-each>
4066
+ <xsl:variable name="lengths">
4067
+ <xsl:for-each select="*[local-name()='dt']">
4068
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
4069
+ <xsl:variable name="attributes">
4070
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
4071
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
4072
+ </xsl:variable>
4073
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
4074
+ </xsl:for-each>
4075
+ </xsl:variable>
4076
+ <xsl:variable name="maxLength">
4077
+ <!-- <xsl:for-each select="*[local-name()='dt']">
4078
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
4079
+ <xsl:if test="position() = 1">
4080
+ <xsl:value-of select="string-length(normalize-space(.))"/>
4081
+ </xsl:if>
4082
+ </xsl:for-each> -->
4083
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
4084
+ <xsl:sort select="." data-type="number" order="descending"/>
4085
+ <xsl:if test="position() = 1">
4086
+ <xsl:value-of select="."/>
4087
+ </xsl:if>
4088
+ </xsl:for-each>
4089
+ </xsl:variable>
4090
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
4091
+ <xsl:value-of select="$maxLength"/>
3765
4092
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3766
4093
  <xsl:param name="key_iso"/>
3767
4094
 
@@ -3877,6 +4204,7 @@
3877
4204
  </fo:inline>
3878
4205
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3879
4206
  <fo:inline font-weight="bold">
4207
+
3880
4208
  <xsl:apply-templates/>
3881
4209
  </fo:inline>
3882
4210
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3916,6 +4244,10 @@
3916
4244
  </xsl:if>
3917
4245
  <xsl:apply-templates/>
3918
4246
  </fo:inline>
4247
+ </xsl:template><xsl:template match="*[local-name()='underline']">
4248
+ <fo:inline text-decoration="underline">
4249
+ <xsl:apply-templates/>
4250
+ </fo:inline>
3919
4251
  </xsl:template><xsl:template match="*[local-name()='del']">
3920
4252
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3921
4253
  <xsl:apply-templates/>
@@ -4205,7 +4537,18 @@
4205
4537
  <xsl:with-param name="previousRow" select="$newRow"/>
4206
4538
  </xsl:apply-templates>
4207
4539
  </xsl:template><xsl:template name="getLang">
4208
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4540
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4541
+ <xsl:variable name="language">
4542
+ <xsl:choose>
4543
+ <xsl:when test="$language_current != ''">
4544
+ <xsl:value-of select="$language_current"/>
4545
+ </xsl:when>
4546
+ <xsl:otherwise>
4547
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4548
+ </xsl:otherwise>
4549
+ </xsl:choose>
4550
+ </xsl:variable>
4551
+
4209
4552
  <xsl:choose>
4210
4553
  <xsl:when test="$language = 'English'">en</xsl:when>
4211
4554
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4240,6 +4583,7 @@
4240
4583
  <xsl:value-of select="substring($str, 2)"/>
4241
4584
  </xsl:template><xsl:template match="mathml:math">
4242
4585
  <fo:inline font-family="STIX Two Math"> <!-- -->
4586
+
4243
4587
  <xsl:variable name="mathml">
4244
4588
  <xsl:apply-templates select="." mode="mathml"/>
4245
4589
  </xsl:variable>
@@ -4269,6 +4613,11 @@
4269
4613
  </xsl:choose>
4270
4614
  </xsl:variable>
4271
4615
  <fo:inline xsl:use-attribute-sets="link-style">
4616
+
4617
+ <xsl:if test="ancestor::*[local-name()='feedback-statement']">
4618
+ <xsl:attribute name="color">blue</xsl:attribute>
4619
+ </xsl:if>
4620
+
4272
4621
  <xsl:choose>
4273
4622
  <xsl:when test="$target = ''">
4274
4623
  <xsl:apply-templates/>
@@ -4322,10 +4671,14 @@
4322
4671
  </fo:inline>
4323
4672
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4324
4673
  <xsl:variable name="title-modified">
4325
- <xsl:call-template name="getTitle">
4326
- <xsl:with-param name="name" select="'title-modified'"/>
4327
- </xsl:call-template>
4674
+
4675
+
4676
+ <xsl:call-template name="getTitle">
4677
+ <xsl:with-param name="name" select="'title-modified'"/>
4678
+ </xsl:call-template>
4679
+
4328
4680
  </xsl:variable>
4681
+
4329
4682
  <xsl:choose>
4330
4683
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4331
4684
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4478,7 +4831,8 @@
4478
4831
  </fo:inline>
4479
4832
  </xsl:if>
4480
4833
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4481
- <fo:block-container id="{@id}">
4834
+ <fo:block-container id="{@id}">
4835
+
4482
4836
  <fo:block>
4483
4837
  <xsl:apply-templates/>
4484
4838
  </fo:block>
@@ -4529,7 +4883,7 @@
4529
4883
  <xsl:apply-templates mode="bookmarks"/>
4530
4884
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4531
4885
  <xsl:apply-templates select="."/>
4532
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4886
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4533
4887
  <xsl:apply-templates mode="bookmarks"/>
4534
4888
  </xsl:template><xsl:template name="addBookmarks">
4535
4889
  <xsl:param name="contents"/>
@@ -4545,6 +4899,8 @@
4545
4899
  <xsl:variable name="bookmark-title_">
4546
4900
  <xsl:call-template name="getLangVersion">
4547
4901
  <xsl:with-param name="lang" select="@lang"/>
4902
+ <xsl:with-param name="doctype" select="@doctype"/>
4903
+ <xsl:with-param name="title" select="@title-part"/>
4548
4904
  </xsl:call-template>
4549
4905
  </xsl:variable>
4550
4906
  <xsl:choose>
@@ -4562,13 +4918,34 @@
4562
4918
  </xsl:choose>
4563
4919
  </fo:bookmark-title>
4564
4920
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4921
+
4922
+ <xsl:call-template name="insertFigureBookmarks">
4923
+ <xsl:with-param name="contents" select="contents"/>
4924
+ </xsl:call-template>
4925
+
4926
+ <xsl:call-template name="insertTableBookmarks">
4927
+ <xsl:with-param name="contents" select="contents"/>
4928
+ <xsl:with-param name="lang" select="@lang"/>
4929
+ </xsl:call-template>
4930
+
4565
4931
  </fo:bookmark>
4566
4932
 
4567
4933
  </xsl:for-each>
4568
4934
  </xsl:when>
4569
4935
  <xsl:otherwise>
4570
4936
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4937
+
4571
4938
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4939
+
4940
+ <xsl:call-template name="insertFigureBookmarks">
4941
+ <xsl:with-param name="contents" select="contents"/>
4942
+ </xsl:call-template>
4943
+
4944
+ <xsl:call-template name="insertTableBookmarks">
4945
+ <xsl:with-param name="contents" select="contents"/>
4946
+ <xsl:with-param name="lang" select="@lang"/>
4947
+ </xsl:call-template>
4948
+
4572
4949
  </xsl:for-each>
4573
4950
  </xsl:otherwise>
4574
4951
  </xsl:choose>
@@ -4580,42 +4957,51 @@
4580
4957
 
4581
4958
 
4582
4959
 
4583
- <xsl:if test="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4584
- <fo:bookmark internal-destination="{//*[local-name() = 'figure'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4585
- <fo:bookmark-title>Figures</fo:bookmark-title>
4586
- <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4587
- <fo:bookmark internal-destination="{@id}">
4588
- <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']/text()" mode="bookmarks"/></fo:bookmark-title>
4589
- </fo:bookmark>
4590
- </xsl:for-each>
4591
- </fo:bookmark>
4592
- </xsl:if>
4593
-
4594
4960
 
4595
-
4596
- <xsl:if test="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4597
- <fo:bookmark internal-destination="{//*[local-name() = 'table'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4598
- <fo:bookmark-title>
4599
- <xsl:choose>
4600
- <xsl:when test="@lang = 'fr'">Tableaux</xsl:when>
4601
- <xsl:otherwise>Tables</xsl:otherwise>
4602
- </xsl:choose>
4603
- </fo:bookmark-title>
4604
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4605
- <fo:bookmark internal-destination="{@id}">
4606
- <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']//text()" mode="bookmarks"/></fo:bookmark-title>
4607
- </fo:bookmark>
4608
- </xsl:for-each>
4609
- </fo:bookmark>
4610
- </xsl:if>
4611
4961
 
4612
4962
 
4613
4963
 
4614
4964
 
4615
4965
  </fo:bookmark-tree>
4616
4966
  </xsl:if>
4967
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4968
+ <xsl:param name="contents"/>
4969
+ <xsl:if test="xalan:nodeset($contents)/figure">
4970
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4971
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4972
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4973
+ <fo:bookmark internal-destination="{@id}">
4974
+ <fo:bookmark-title>
4975
+ <xsl:value-of select="normalize-space(title)"/>
4976
+ </fo:bookmark-title>
4977
+ </fo:bookmark>
4978
+ </xsl:for-each>
4979
+ </fo:bookmark>
4980
+ </xsl:if>
4981
+ </xsl:template><xsl:template name="insertTableBookmarks">
4982
+ <xsl:param name="contents"/>
4983
+ <xsl:param name="lang"/>
4984
+ <xsl:if test="xalan:nodeset($contents)/table">
4985
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4986
+ <fo:bookmark-title>
4987
+ <xsl:choose>
4988
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4989
+ <xsl:otherwise>Tables</xsl:otherwise>
4990
+ </xsl:choose>
4991
+ </fo:bookmark-title>
4992
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4993
+ <fo:bookmark internal-destination="{@id}">
4994
+ <fo:bookmark-title>
4995
+ <xsl:value-of select="normalize-space(title)"/>
4996
+ </fo:bookmark-title>
4997
+ </fo:bookmark>
4998
+ </xsl:for-each>
4999
+ </fo:bookmark>
5000
+ </xsl:if>
4617
5001
  </xsl:template><xsl:template name="getLangVersion">
4618
5002
  <xsl:param name="lang"/>
5003
+ <xsl:param name="doctype" select="''"/>
5004
+ <xsl:param name="title" select="''"/>
4619
5005
  <xsl:choose>
4620
5006
  <xsl:when test="$lang = 'en'">
4621
5007
  English
@@ -5079,9 +5465,14 @@
5079
5465
 
5080
5466
  <fo:inline>
5081
5467
 
5082
- <xsl:call-template name="getTitle">
5083
- <xsl:with-param name="name" select="'title-source'"/>
5084
- </xsl:call-template>
5468
+
5469
+
5470
+
5471
+ <xsl:call-template name="getTitle">
5472
+ <xsl:with-param name="name" select="'title-source'"/>
5473
+ </xsl:call-template>
5474
+
5475
+
5085
5476
  <xsl:text>: </xsl:text>
5086
5477
  </fo:inline>
5087
5478
 
@@ -5106,7 +5497,8 @@
5106
5497
  <fo:block-container margin-left="0mm">
5107
5498
 
5108
5499
  <fo:block xsl:use-attribute-sets="quote-style">
5109
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5500
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5501
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5110
5502
  </fo:block>
5111
5503
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5112
5504
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5232,9 +5624,12 @@
5232
5624
  </fo:block>
5233
5625
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5234
5626
  <xsl:variable name="title-deprecated">
5235
- <xsl:call-template name="getTitle">
5236
- <xsl:with-param name="name" select="'title-deprecated'"/>
5237
- </xsl:call-template>
5627
+
5628
+
5629
+ <xsl:call-template name="getTitle">
5630
+ <xsl:with-param name="name" select="'title-deprecated'"/>
5631
+ </xsl:call-template>
5632
+
5238
5633
  </xsl:variable>
5239
5634
  <fo:block xsl:use-attribute-sets="deprecates-style">
5240
5635
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5283,7 +5678,7 @@
5283
5678
  <fo:block id="{@id}">
5284
5679
  <xsl:apply-templates/>
5285
5680
  </fo:block>
5286
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5681
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5287
5682
 
5288
5683
  <fo:block id="{@id}">
5289
5684
  <xsl:apply-templates/>
@@ -5340,7 +5735,8 @@
5340
5735
  <fo:table-column column-width="107mm"/>
5341
5736
  <fo:table-column column-width="15mm"/>
5342
5737
  <fo:table-body>
5343
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5738
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5739
+
5344
5740
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5345
5741
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5346
5742
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5358,6 +5754,10 @@
5358
5754
  <fo:block><xsl:apply-templates/></fo:block>
5359
5755
  </fo:table-cell>
5360
5756
  </xsl:template><xsl:template name="processBibitem">
5757
+
5758
+
5759
+ <!-- end BIPM bibitem processing-->
5760
+
5361
5761
 
5362
5762
 
5363
5763
 
@@ -5416,6 +5816,8 @@
5416
5816
  <xsl:value-of select="translate(.,'. ','')"/>
5417
5817
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5418
5818
  <xsl:value-of select="substring(.,1,1)"/>
5819
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5820
+ <fo:inline><xsl:apply-templates/></fo:inline>
5419
5821
  </xsl:template><xsl:template name="convertDate">
5420
5822
  <xsl:param name="date"/>
5421
5823
  <xsl:param name="format" select="'short'"/>
@@ -5595,13 +5997,22 @@
5595
5997
  </xsl:template><xsl:template name="split">
5596
5998
  <xsl:param name="pText" select="."/>
5597
5999
  <xsl:param name="sep" select="','"/>
6000
+ <xsl:param name="normalize-space" select="'true'"/>
5598
6001
  <xsl:if test="string-length($pText) &gt;0">
5599
6002
  <item>
5600
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
6003
+ <xsl:choose>
6004
+ <xsl:when test="$normalize-space = 'true'">
6005
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
6006
+ </xsl:when>
6007
+ <xsl:otherwise>
6008
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
6009
+ </xsl:otherwise>
6010
+ </xsl:choose>
5601
6011
  </item>
5602
6012
  <xsl:call-template name="split">
5603
6013
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5604
6014
  <xsl:with-param name="sep" select="$sep"/>
6015
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5605
6016
  </xsl:call-template>
5606
6017
  </xsl:if>
5607
6018
  </xsl:template><xsl:template name="getDocumentId">
@@ -5667,4 +6078,28 @@
5667
6078
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5668
6079
  </xsl:call-template>
5669
6080
  </xsl:if>
6081
+ </xsl:template><xsl:template name="repeat">
6082
+ <xsl:param name="char" select="'*'"/>
6083
+ <xsl:param name="count"/>
6084
+ <xsl:if test="$count &gt; 0">
6085
+ <xsl:value-of select="$char"/>
6086
+ <xsl:call-template name="repeat">
6087
+ <xsl:with-param name="char" select="$char"/>
6088
+ <xsl:with-param name="count" select="$count - 1"/>
6089
+ </xsl:call-template>
6090
+ </xsl:if>
6091
+ </xsl:template><xsl:template name="getLocalizedString">
6092
+ <xsl:param name="key"/>
6093
+
6094
+ <xsl:variable name="curr_lang">
6095
+ <xsl:call-template name="getLang"/>
6096
+ </xsl:variable>
6097
+
6098
+ <xsl:choose>
6099
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6100
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6101
+ </xsl:when>
6102
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6103
+ </xsl:choose>
6104
+
5670
6105
  </xsl:template></xsl:stylesheet>