metanorma-iec 1.2.4 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +62 -0
  3. data/README.adoc +3 -4
  4. data/lib/asciidoctor/iec/basicdoc.rng +4 -11
  5. data/lib/asciidoctor/iec/converter.rb +6 -1
  6. data/lib/asciidoctor/iec/front.rb +11 -3
  7. data/lib/asciidoctor/iec/iec.rng +43 -1
  8. data/lib/asciidoctor/iec/iec_intro_en.xml +82 -53
  9. data/lib/asciidoctor/iec/iec_intro_fr.xml +44 -20
  10. data/lib/asciidoctor/iec/isodoc.rng +27 -50
  11. data/lib/asciidoctor/iec/isostandard.rng +16 -1
  12. data/lib/isodoc/iec/html/htmlstyle.css +10 -6
  13. data/lib/isodoc/iec/html/htmlstyle.scss +4 -4
  14. data/lib/isodoc/iec/html/isodoc.css +79 -79
  15. data/lib/isodoc/iec/html/isodoc.scss +79 -79
  16. data/lib/isodoc/iec/html/wordstyle.css +120 -120
  17. data/lib/isodoc/iec/html/wordstyle.scss +120 -120
  18. data/lib/isodoc/iec/html_convert.rb +8 -0
  19. data/lib/isodoc/iec/i18n-en.yaml +16 -0
  20. data/lib/isodoc/iec/i18n-fr.yaml +17 -0
  21. data/lib/isodoc/iec/iec.international-standard.xsl +926 -330
  22. data/lib/isodoc/iec/metadata.rb +33 -0
  23. data/lib/isodoc/iec/presentation_xml_convert.rb +12 -0
  24. data/lib/isodoc/iec/word_convert.rb +10 -0
  25. data/lib/metanorma/iec/fonts_manifest.yaml +5 -0
  26. data/lib/metanorma/iec/processor.rb +0 -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 +22 -5
  30. data/spec/asciidoctor-iec/blocks_spec.rb +1 -1
  31. data/spec/asciidoctor-iec/cleanup_spec.rb +0 -84
  32. data/spec/asciidoctor-iec/iev_spec.rb +6 -3
  33. data/spec/asciidoctor-iec/lists_spec.rb +6 -6
  34. data/spec/asciidoctor-iec/validate_spec.rb +36 -1
  35. data/spec/assets/xref_error.adoc +7 -0
  36. data/spec/isodoc/blocks_spec.rb +1 -1
  37. data/spec/isodoc/i18n_spec.rb +39 -9
  38. data/spec/isodoc/iev_spec.rb +13 -13
  39. data/spec/isodoc/inline_spec.rb +1 -1
  40. data/spec/isodoc/iso_spec.rb +2 -2
  41. data/spec/isodoc/metadata_spec.rb +59 -24
  42. data/spec/isodoc/ref_spec.rb +5 -5
  43. data/spec/isodoc/section_spec.rb +2 -2
  44. data/spec/isodoc/terms_spec.rb +1 -1
  45. data/spec/spec_helper.rb +9 -2
  46. metadata +7 -21
  47. data/.github/workflows/macos.yml +0 -38
  48. data/.github/workflows/ubuntu.yml +0 -56
  49. data/.github/workflows/windows.yml +0 -40
@@ -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
@@ -16,3 +16,19 @@ term_def_boilerplate: |
16
16
  <li> <p>ISO Online browsing platform: available at
17
17
  <link target="http://www.iso.org/obp"/></p> </li>
18
18
  </ul>
19
+ doctype_dict:
20
+ international-standard: International Standard
21
+ technical-specification: Technical Specification
22
+ technical-report: Technical Report
23
+ publicly-available-specification: Publicly Available Specification
24
+ international-workshop-agreement: International Workshop Agreement
25
+ guide: Guide
26
+ interpretation-sheet: Interpretation Sheet
27
+ function_dict:
28
+ emc: Basic EMC Publication
29
+ safety: Basic Safety Publication
30
+ environment: Basic Environment Publication
31
+ quality-assurance: Basic Quality Assurance Publication
32
+ horizontal_dict:
33
+ "true": Horizontal Standard
34
+ "false":
@@ -16,3 +16,20 @@ term_def_boilerplate: |
16
16
  <li> <p>ISO Online browsing platform: disponible à l'adresse
17
17
  <link target="http://www.iso.org/obp"/></p> </li>
18
18
  </ul>
19
+ doctype_dict:
20
+ international-standard: Norme international
21
+ technical-specification: Spécification technique
22
+ technical-report: Rapport technique
23
+ publicly-available-specification: Spécification disponible publiquement
24
+ international-workshop-agreement: Accord internationale d’atelier
25
+ guide: Guide
26
+ interpretation-sheet: Feuille d’interprétation
27
+ function_dict:
28
+ emc: Publication fondamentale en CEM
29
+ safety: Publication fondamentale de sécurité
30
+ environment: Publication fondamentale sur l’environnement
31
+ quality-assurance: Publication fondamentale sur l’assurance de la qualité
32
+ horizontal_dict:
33
+ "true": Norme horizontale
34
+ "false":
35
+
@@ -17,7 +17,7 @@
17
17
 
18
18
 
19
19
 
20
- <xsl:variable name="debug">false</xsl:variable>
20
+ <xsl:variable name="debug">true</xsl:variable>
21
21
  <xsl:variable name="pageWidth" select="'210mm'"/>
22
22
  <xsl:variable name="pageHeight" select="'297mm'"/>
23
23
 
@@ -32,7 +32,7 @@
32
32
  <xsl:variable name="title-main-fr" select="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr' and @type = 'title-main']"/>
33
33
  <xsl:variable name="part" select="/iec:iec-standard/iec:bibdata/iec:ext/iec:structuredidentifier/iec:project-number/@part"/>
34
34
 
35
- <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new(translate(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype,'-',' ')))"/>
35
+ <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = $lang]))"/>
36
36
 
37
37
 
38
38
 
@@ -90,7 +90,7 @@
90
90
  <xsl:variable name="docid">
91
91
  <xsl:call-template name="getDocumentId"/>
92
92
  </xsl:variable>
93
- <doc id="{$docid}">
93
+ <doc id="{$docid}" lang="{$lang}">
94
94
  <xsl:call-template name="generateContents"/>
95
95
  </doc>
96
96
 
@@ -108,7 +108,7 @@
108
108
  <xsl:variable name="docid">
109
109
  <xsl:call-template name="getDocumentId"/>
110
110
  </xsl:variable>
111
- <doc id="{$docid}">
111
+ <doc id="{$docid}" lang="{$lang}">
112
112
  <xsl:call-template name="generateContents"/>
113
113
  </doc>
114
114
  </xsl:for-each>
@@ -136,7 +136,7 @@
136
136
  <xsl:call-template name="namespaceCheck"/>
137
137
  <!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
138
138
  <!-- https://xmlgraphics.apache.org/fop/knownissues.html -->
139
- <fo:root font-family="Arial, Times New Roman, STIX2Math, HanSans" font-size="10pt" xml:lang="{$lang}">
139
+ <fo:root font-family="Arial, Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
140
140
  <fo:layout-master-set>
141
141
  <!-- cover pages -->
142
142
  <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -146,6 +146,13 @@
146
146
  <fo:region-start region-name="left-region" extent="18mm"/>
147
147
  <fo:region-end region-name="right-region" extent="20.5mm"/>
148
148
  </fo:simple-page-master>
149
+ <fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}" page-height="{$pageHeight}">
150
+ <fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="25mm" margin-right="25mm" column-count="2" column-gap="5mm"/>
151
+ <fo:region-before region-name="header" extent="17.5mm"/>
152
+ <fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
153
+ <fo:region-start region-name="left-region" extent="25mm"/>
154
+ <fo:region-end region-name="right-region" extent="25mm"/>
155
+ </fo:simple-page-master>
149
156
 
150
157
  <fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}" page-height="{$pageHeight}">
151
158
  <fo:region-body margin-top="17.5mm" margin-bottom="29mm" margin-left="18mm" margin-right="19mm"/>
@@ -191,6 +198,10 @@
191
198
 
192
199
  <xsl:call-template name="addPDFUAmeta"/>
193
200
 
201
+ <xsl:call-template name="addBookmarks">
202
+ <xsl:with-param name="contents" select="$contents"/>
203
+ </xsl:call-template>
204
+
194
205
  <!-- For 'Published' documents insert two cover pages -->
195
206
  <xsl:if test="$stage &gt;= 60">
196
207
 
@@ -214,222 +225,230 @@
214
225
  </fo:page-sequence>
215
226
 
216
227
  <!-- 2nd Cover Page -->
217
- <fo:page-sequence master-reference="cover" force-page-count="no-force">
228
+ <fo:page-sequence master-reference="cover_2nd" force-page-count="no-force" font-size="8pt">
218
229
  <fo:flow flow-name="xsl-region-body">
219
- <fo:block-container margin-left="7mm" margin-right="4.5mm" border="0.5pt solid black" margin-top="7mm">
220
- <fo:block-container margin-left="2.5mm" margin-right="2.5mm" margin-top="1mm" margin-bottom="1mm">
221
- <fo:block-container margin-left="0mm" margin-right="0mm">
222
- <fo:table table-layout="fixed" width="100%">
223
- <fo:table-column column-width="20mm"/>
224
- <fo:table-column column-width="130mm"/>
225
- <fo:table-body>
226
- <fo:table-row>
227
- <fo:table-cell>
228
- <fo:block>
229
- <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"/>
230
- </fo:block>
231
- </fo:table-cell>
232
- <fo:table-cell font-size="10pt" font-weight="bold" display-align="after">
233
- <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
234
- <fo:block margin-bottom="10pt">
235
- <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
236
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-year']"/>
237
- </fo:block>
238
- </fo:table-cell>
239
- </fo:table-row>
240
- </fo:table-body>
241
- </fo:table>
242
- <fo:block font-size="8pt">
243
- <fo:block margin-bottom="8pt" text-align="justify">
244
- <!-- Example: All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
245
- or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
246
- either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
247
- copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
248
- your local IEC member National Committee for further information. -->
249
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-message']"/>
250
- </fo:block>
251
- <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
252
- ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
253
- 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
254
- questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
255
- les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.</fo:block>
256
-
257
- <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())"/>
230
+ <fo:block span="all">
231
+ <fo:block-container border="0.5pt solid black" margin-top="7mm">
232
+ <fo:block-container margin-left="2.5mm" margin-right="2.5mm" margin-top="1mm" margin-bottom="1mm">
233
+ <fo:block-container margin-left="0mm" margin-right="0mm">
258
234
  <fo:table table-layout="fixed" width="100%">
259
- <fo:table-column column-width="59mm"/>
260
- <fo:table-column column-width="90mm"/>
235
+ <fo:table-column column-width="20mm"/>
236
+ <fo:table-column column-width="130mm"/>
261
237
  <fo:table-body>
262
238
  <fo:table-row>
263
239
  <fo:table-cell>
264
240
  <fo:block>
265
- <!-- Example: IEC Central Office
266
- 3, rue de Varembé
267
- CH-1211 Geneva 20
268
- Switzerland -->
269
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-name']" mode="coverpage"/>
270
- <xsl:choose>
271
- <xsl:when test="$telpos != 0">
272
- <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"/>
273
- </xsl:when>
274
- <xsl:otherwise>
275
- <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
276
- </xsl:otherwise>
277
- </xsl:choose>
241
+ <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"/>
278
242
  </fo:block>
279
243
  </fo:table-cell>
280
- <fo:table-cell>
281
- <fo:block>
282
- <!-- Example: Tel.: +41 22 919 02 11
283
- Fax: +41 22 919 0
284
- info@iec.ch
285
- www.iec.ch -->
286
- <xsl:choose>
287
- <xsl:when test="$telpos != 0">
288
- <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"/>
289
- </xsl:when>
290
- <xsl:otherwise> </xsl:otherwise>
291
- </xsl:choose>
244
+ <fo:table-cell font-size="10pt" font-weight="bold" display-align="after">
245
+ <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
246
+ <fo:block margin-bottom="10pt">
247
+ <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
248
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-year']"/>
292
249
  </fo:block>
293
250
  </fo:table-cell>
294
251
  </fo:table-row>
295
252
  </fo:table-body>
296
253
  </fo:table>
297
-
298
- </fo:block>
254
+ <fo:block>
255
+ <fo:block margin-bottom="8pt" text-align="justify">
256
+ <!-- Example: All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
257
+ or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
258
+ either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
259
+ copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
260
+ your local IEC member National Committee for further information. -->
261
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-message']"/>
262
+ </fo:block>
263
+ <fo:block margin-bottom="8pt" text-align="justify">Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
264
+ ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
265
+ et les microfilms, sans l'accord écrit de l'IEC ou du Comité national de l'IEC du pays du demandeur. Si vous avez des
266
+ questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
267
+ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.</fo:block>
268
+
269
+ <xsl:variable name="telpos" select="count(/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
270
+ <fo:table table-layout="fixed" width="100%">
271
+ <fo:table-column column-width="59mm"/>
272
+ <fo:table-column column-width="90mm"/>
273
+ <fo:table-body>
274
+ <fo:table-row>
275
+ <fo:table-cell>
276
+ <fo:block>
277
+ <!-- Example: IEC Central Office
278
+ 3, rue de Varembé
279
+ CH-1211 Geneva 20
280
+ Switzerland -->
281
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-name']" mode="coverpage"/>
282
+ <xsl:choose>
283
+ <xsl:when test="$telpos != 0">
284
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &lt; $telpos]" mode="coverpage"/>
285
+ </xsl:when>
286
+ <xsl:otherwise>
287
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']" mode="coverpage"/>
288
+ </xsl:otherwise>
289
+ </xsl:choose>
290
+ </fo:block>
291
+ </fo:table-cell>
292
+ <fo:table-cell>
293
+ <fo:block>
294
+ <!-- Example: Tel.: +41 22 919 02 11
295
+ Fax: +41 22 919 0
296
+ info@iec.ch
297
+ www.iec.ch -->
298
+ <xsl:choose>
299
+ <xsl:when test="$telpos != 0">
300
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:copyright-statement/iec:clause/iec:p[@id = 'boilerplate-address']/node()[position() &gt; $telpos]" mode="coverpage"/>
301
+ </xsl:when>
302
+ <xsl:otherwise> </xsl:otherwise>
303
+ </xsl:choose>
304
+ </fo:block>
305
+ </fo:table-cell>
306
+ </fo:table-row>
307
+ </fo:table-body>
308
+ </fo:table>
309
+
310
+ </fo:block>
311
+ </fo:block-container>
299
312
  </fo:block-container>
300
313
  </fo:block-container>
301
- </fo:block-container>
314
+ </fo:block>
302
315
 
303
- <fo:block-container margin-left="7mm" margin-right="4.5mm" margin-top="6pt">
304
- <fo:block-container font-size="8pt" text-align="justify" margin-left="0mm" margin-right="0mm">
305
-
306
- <fo:block font-weight="bold">About the IEC</fo:block>
307
- <fo:block margin-bottom="6pt">The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
308
- International Standards for all electrical, electronic and related technologies.</fo:block>
309
-
310
- <fo:block font-weight="bold">About IEC publications</fo:block>
311
- <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
312
- latest edition, a corrigenda or an amendment might have been published.</fo:block>
313
-
314
- <fo:table table-layout="fixed" width="100%" margin-bottom="12pt">
315
- <fo:table-column column-width="82mm"/>
316
- <fo:table-column column-width="78mm"/>
317
- <fo:table-body>
318
- <fo:table-row border-bottom="0.5pt solid black">
319
- <fo:table-cell padding-right="5mm">
320
- <fo:block font-weight="bold">IEC Catalogue - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
321
- <fo:block margin-bottom="6pt">
322
- <xsl:text>The stand-alone application for consulting the entire
323
- bibliographical information on IEC International Standards,
324
- Technical Specifications, Technical Reports and other
325
- documents. Available for PC, Mac OS, Android Tablets and
326
- iPad.</xsl:text>
327
- </fo:block>
328
- <fo:block font-weight="bold">IEC publications search - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
329
- <fo:block margin-bottom="6pt">
330
- <xsl:text>The advanced search enables to find IEC publications by a
331
- variety of criteria (reference number, text, technical
332
- committee,…). It also gives information on projects, replaced
333
- and withdrawn publications.</xsl:text>
334
- </fo:block>
335
- <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
336
- <fo:block margin-bottom="6pt">
337
- <xsl:text>Stay up to date on all new IEC publications. Just Published
338
- details all new publications released. Available online and
339
- also once a month by email.</xsl:text>
340
- </fo:block>
341
- </fo:table-cell>
342
- <fo:table-cell>
343
- <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
344
- <fo:block margin-bottom="6pt">
345
- <xsl:text>The world's leading online dictionary of electronic and
346
- electrical terms containing more than 30 000 terms and
347
- definitions in English and French, with equivalent terms in 14
348
- additional languages. Also known as the International
349
- Electrotechnical Vocabulary (IEV) online.</xsl:text>
350
- </fo:block>
351
- <fo:block font-weight="bold">IEC Glossary - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
352
- <fo:block margin-bottom="6pt">
353
- <xsl:text>More than 55 000 electrotechnical terminology entries in
354
- English and French extracted from the Terms and Definitions
355
- clause of IEC publications issued since 2002. Some entries
356
- have been collected from earlier publications of IEC TC 37,
357
- 77, 86 and CISPR.</xsl:text>
358
- </fo:block>
359
- <fo:block font-weight="bold">IEC Customer Service Centre - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
360
- <fo:block margin-bottom="6pt">
361
- <xsl:text>If you wish to give us your feedback on this publication or
362
- need further assistance, please contact the Customer Service
363
- Centre: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
364
- </fo:block>
365
- </fo:table-cell>
366
- </fo:table-row>
367
- </fo:table-body>
368
- </fo:table>
369
- <fo:block font-weight="bold">A propos de l'IEC</fo:block>
370
- <fo:block margin-bottom="6pt">La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
371
- Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.</fo:block>
316
+ <xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:feedback-statement"/>
317
+ <fo:block span="all" border-bottom="0.5pt solid black"/>
318
+
319
+ <!-- <fo:block span="all">
320
+ <fo:block-container margin-top="6pt">
321
+ <fo:block-container text-align="justify" margin-left="0mm" margin-right="0mm">
322
+
323
+ <fo:block font-weight="bold">About the IEC</fo:block>
324
+ <fo:block margin-bottom="6pt">The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
325
+ International Standards for all electrical, electronic and related technologies.</fo:block>
372
326
 
373
- <fo:block font-weight="bold">A propos des publications IEC</fo:block>
374
- <fo:block margin-bottom="6pt">Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
375
- plus récente, un corrigendum ou amendement peut avoir été publié.</fo:block>
327
+ <fo:block font-weight="bold">About IEC publications</fo:block>
328
+ <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
329
+ latest edition, a corrigenda or an amendment might have been published.</fo:block>
330
+
331
+ <fo:table table-layout="fixed" width="100%" margin-bottom="12pt">
332
+ <fo:table-column column-width="82mm"/>
333
+ <fo:table-column column-width="78mm"/>
334
+ <fo:table-body>
335
+ <fo:table-row border-bottom="0.5pt solid black">
336
+ <fo:table-cell padding-right="5mm">
337
+ <fo:block font-weight="bold">IEC Catalogue - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
338
+ <fo:block margin-bottom="6pt">
339
+ <xsl:text>The stand-alone application for consulting the entire
340
+ bibliographical information on IEC International Standards,
341
+ Technical Specifications, Technical Reports and other
342
+ documents. Available for PC, Mac OS, Android Tablets and
343
+ iPad.</xsl:text>
344
+ </fo:block>
345
+ <fo:block font-weight="bold">IEC publications search - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
346
+ <fo:block margin-bottom="6pt">
347
+ <xsl:text>The advanced search enables to find IEC publications by a
348
+ variety of criteria (reference number, text, technical
349
+ committee,…). It also gives information on projects, replaced
350
+ and withdrawn publications.</xsl:text>
351
+ </fo:block>
352
+ <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
353
+ <fo:block margin-bottom="6pt">
354
+ <xsl:text>Stay up to date on all new IEC publications. Just Published
355
+ details all new publications released. Available online and
356
+ also once a month by email.</xsl:text>
357
+ </fo:block>
358
+ </fo:table-cell>
359
+ <fo:table-cell>
360
+ <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
361
+ <fo:block margin-bottom="6pt">
362
+ <xsl:text>The world's leading online dictionary of electronic and
363
+ electrical terms containing more than 30 000 terms and
364
+ definitions in English and French, with equivalent terms in 14
365
+ additional languages. Also known as the International
366
+ Electrotechnical Vocabulary (IEV) online.</xsl:text>
367
+ </fo:block>
368
+ <fo:block font-weight="bold">IEC Glossary - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
369
+ <fo:block margin-bottom="6pt">
370
+ <xsl:text>More than 55 000 electrotechnical terminology entries in
371
+ English and French extracted from the Terms and Definitions
372
+ clause of IEC publications issued since 2002. Some entries
373
+ have been collected from earlier publications of IEC TC 37,
374
+ 77, 86 and CISPR.</xsl:text>
375
+ </fo:block>
376
+ <fo:block font-weight="bold">IEC Customer Service Centre - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
377
+ <fo:block margin-bottom="6pt">
378
+ <xsl:text>If you wish to give us your feedback on this publication or
379
+ need further assistance, please contact the Customer Service
380
+ Centre: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
381
+ </fo:block>
382
+ </fo:table-cell>
383
+ </fo:table-row>
384
+ </fo:table-body>
385
+ </fo:table>
386
+
387
+ <fo:block font-weight="bold">A propos de l'IEC</fo:block>
388
+ <fo:block margin-bottom="6pt">La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
389
+ Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.</fo:block>
390
+
391
+ <fo:block font-weight="bold">A propos des publications IEC</fo:block>
392
+ <fo:block margin-bottom="6pt">Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
393
+ plus récente, un corrigendum ou amendement peut avoir été publié.</fo:block>
376
394
 
377
- <fo:table table-layout="fixed" width="100%">
378
- <fo:table-column column-width="82mm"/>
379
- <fo:table-column column-width="78mm"/>
380
- <fo:table-body>
381
- <fo:table-row>
382
- <fo:table-cell padding-right="5mm">
383
- <fo:block font-weight="bold">Catalogue IEC - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
384
- <fo:block margin-bottom="6pt">
385
- <xsl:text>Application autonome pour consulter tous les renseignements
386
- bibliographiques sur les Normes internationales,
387
- Spécifications techniques, Rapports techniques et autres
388
- documents de l'IEC. Disponible pour PC, Mac OS, tablettes
389
- Android et iPad.</xsl:text>
390
- </fo:block>
391
- <fo:block font-weight="bold">Recherche de publications IEC - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
392
- <fo:block margin-bottom="6pt">
393
- <xsl:text>La recherche avancée permet de trouver des publications IEC
394
- en utilisant différents critères (numéro de référence, texte,
395
- comité d’études,…). Elle donne aussi des informations sur les
396
- projets et les publications remplacées ou retirées.</xsl:text>
397
- </fo:block>
398
- <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
399
- <fo:block margin-bottom="6pt">
400
- <xsl:text>Restez informé sur les nouvelles publications IEC. Just
401
- Published détaille les nouvelles publications parues.
402
- Disponible en ligne et aussi une fois par mois par email.</xsl:text>
403
- </fo:block>
404
- </fo:table-cell>
405
- <fo:table-cell>
406
- <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
407
- <fo:block margin-bottom="6pt">
408
- <xsl:text>Le premier dictionnaire en ligne de termes électroniques et
409
- électriques. Il contient plus de 30 000 termes et définitions en
410
- anglais et en français, ainsi que les termes équivalents dans
411
- 14 langues additionnelles. Egalement appelé Vocabulaire
412
- Electrotechnique International (IEV) en ligne.</xsl:text>
413
- </fo:block>
414
- <fo:block font-weight="bold">Glossaire IEC - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
415
- <fo:block margin-bottom="6pt">
416
- <xsl:text>Plus de 55 000 entrées terminologiques électrotechniques, en
417
- anglais et en français, extraites des articles Termes et
418
- Définitions des publications IEC parues depuis 2002. Plus
419
- certaines entrées antérieures extraites des publications des
420
- CE 37, 77, 86 et CISPR de l'IEC.</xsl:text>
421
- </fo:block>
422
- <fo:block font-weight="bold">Service Clients - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
423
- <fo:block margin-bottom="6pt">
424
- <xsl:text>Si vous désirez nous donner des commentaires sur cette
425
- publication ou si vous avez des questions contactez-nous: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
426
- </fo:block>
427
- </fo:table-cell>
428
- </fo:table-row>
429
- </fo:table-body>
430
- </fo:table>
395
+ <fo:table table-layout="fixed" width="100%">
396
+ <fo:table-column column-width="82mm"/>
397
+ <fo:table-column column-width="78mm"/>
398
+ <fo:table-body>
399
+ <fo:table-row>
400
+ <fo:table-cell padding-right="5mm">
401
+ <fo:block font-weight="bold">Catalogue IEC - <fo:inline color="blue">webstore.iec.ch/catalogue</fo:inline></fo:block>
402
+ <fo:block margin-bottom="6pt">
403
+ <xsl:text>Application autonome pour consulter tous les renseignements
404
+ bibliographiques sur les Normes internationales,
405
+ Spécifications techniques, Rapports techniques et autres
406
+ documents de l'IEC. Disponible pour PC, Mac OS, tablettes
407
+ Android et iPad.</xsl:text>
408
+ </fo:block>
409
+ <fo:block font-weight="bold">Recherche de publications IEC - <fo:inline color="blue">www.iec.ch/searchpub</fo:inline></fo:block>
410
+ <fo:block margin-bottom="6pt">
411
+ <xsl:text>La recherche avancée permet de trouver des publications IEC
412
+ en utilisant différents critères (numéro de référence, texte,
413
+ comité d’études,…). Elle donne aussi des informations sur les
414
+ projets et les publications remplacées ou retirées.</xsl:text>
415
+ </fo:block>
416
+ <fo:block font-weight="bold">IEC Just Published - <fo:inline color="blue">webstore.iec.ch/justpublished</fo:inline></fo:block>
417
+ <fo:block margin-bottom="6pt">
418
+ <xsl:text>Restez informé sur les nouvelles publications IEC. Just
419
+ Published détaille les nouvelles publications parues.
420
+ Disponible en ligne et aussi une fois par mois par email.</xsl:text>
421
+ </fo:block>
422
+ </fo:table-cell>
423
+ <fo:table-cell>
424
+ <fo:block font-weight="bold">Electropedia - <fo:inline color="blue">www.electropedia.org</fo:inline></fo:block>
425
+ <fo:block margin-bottom="6pt">
426
+ <xsl:text>Le premier dictionnaire en ligne de termes électroniques et
427
+ électriques. Il contient plus de 30 000 termes et définitions en
428
+ anglais et en français, ainsi que les termes équivalents dans
429
+ 14 langues additionnelles. Egalement appelé Vocabulaire
430
+ Electrotechnique International (IEV) en ligne.</xsl:text>
431
+ </fo:block>
432
+ <fo:block font-weight="bold">Glossaire IEC - <fo:inline color="blue">std.iec.ch/glossary</fo:inline></fo:block>
433
+ <fo:block margin-bottom="6pt">
434
+ <xsl:text>Plus de 55 000 entrées terminologiques électrotechniques, en
435
+ anglais et en français, extraites des articles Termes et
436
+ Définitions des publications IEC parues depuis 2002. Plus
437
+ certaines entrées antérieures extraites des publications des
438
+ CE 37, 77, 86 et CISPR de l'IEC.</xsl:text>
439
+ </fo:block>
440
+ <fo:block font-weight="bold">Service Clients - <fo:inline color="blue">webstore.iec.ch/csc</fo:inline></fo:block>
441
+ <fo:block margin-bottom="6pt">
442
+ <xsl:text>Si vous désirez nous donner des commentaires sur cette
443
+ publication ou si vous avez des questions contactez-nous: </xsl:text><fo:inline color="blue">csc@iec.ch</fo:inline>.
444
+ </fo:block>
445
+ </fo:table-cell>
446
+ </fo:table-row>
447
+ </fo:table-body>
448
+ </fo:table>
449
+ </fo:block-container>
431
450
  </fo:block-container>
432
- </fo:block-container>
451
+ </fo:block> -->
433
452
  </fo:flow>
434
453
  </fo:page-sequence>
435
454
  </xsl:if>
@@ -486,8 +505,10 @@
486
505
  <xsl:text> </xsl:text>
487
506
  <fo:inline keep-together.within-line="always"><fo:leader leader-pattern="space"/>
488
507
  <xsl:text> </xsl:text>
489
- <!-- <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:isbn"/> -->
490
- <xsl:text>Example: ISBN 978-2-8322-1532-6</xsl:text>
508
+ <xsl:if test="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']">
509
+ <!-- <xsl:text>Example: ISBN 978-2-8322-1532-6</xsl:text> -->
510
+ <xsl:value-of select="/iec:iec-standard/iec:bibdata/iec:docidentifier[@type='ISBN']"/>
511
+ </xsl:if>
491
512
  </fo:inline>
492
513
  </fo:block>
493
514
  <fo:block-container margin-left="1.5mm">
@@ -742,13 +763,28 @@
742
763
  <xsl:with-param name="text" select="'Functions concerned:'"/>
743
764
  </xsl:call-template>
744
765
  </fo:block>
766
+ <!-- function: { emc | safety | environment | quality-assurance } -->
745
767
  <fo:block font-size="6.5pt">
746
- <xsl:call-template name="insertCheckBoxOff"/>
768
+ <xsl:choose>
769
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'emc'">
770
+ <xsl:call-template name="insertCheckBoxOn"/>
771
+ </xsl:when>
772
+ <xsl:otherwise>
773
+ <xsl:call-template name="insertCheckBoxOff"/>
774
+ </xsl:otherwise>
775
+ </xsl:choose>
747
776
  <xsl:call-template name="addLetterSpacingSmallCaps">
748
777
  <xsl:with-param name="text" select="'EMC'"/>
749
778
  </xsl:call-template>
750
779
  <fo:inline padding-right="33mm"> </fo:inline>
751
- <xsl:call-template name="insertCheckBoxOff"/>
780
+ <xsl:choose>
781
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'environment'">
782
+ <xsl:call-template name="insertCheckBoxOn"/>
783
+ </xsl:when>
784
+ <xsl:otherwise>
785
+ <xsl:call-template name="insertCheckBoxOff"/>
786
+ </xsl:otherwise>
787
+ </xsl:choose>
752
788
  <xsl:call-template name="addLetterSpacingSmallCaps">
753
789
  <xsl:with-param name="text" select="'Environment'"/>
754
790
  </xsl:call-template>
@@ -757,12 +793,26 @@
757
793
  <fo:table-cell padding="1.5mm" padding-bottom="0mm">
758
794
  <fo:block font-size="6.5pt" margin-bottom="6pt"> </fo:block>
759
795
  <fo:block font-size="6.5pt">
760
- <xsl:call-template name="insertCheckBoxOff"/>
796
+ <xsl:choose>
797
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'quality-assurance'">
798
+ <xsl:call-template name="insertCheckBoxOn"/>
799
+ </xsl:when>
800
+ <xsl:otherwise>
801
+ <xsl:call-template name="insertCheckBoxOff"/>
802
+ </xsl:otherwise>
803
+ </xsl:choose>
761
804
  <xsl:call-template name="addLetterSpacingSmallCaps">
762
805
  <xsl:with-param name="text" select="'Quality assurance'"/>
763
806
  </xsl:call-template>
764
807
  <fo:inline padding-right="13mm"> </fo:inline>
765
- <xsl:call-template name="insertCheckBoxOn"/>
808
+ <xsl:choose>
809
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:function = 'safety'">
810
+ <xsl:call-template name="insertCheckBoxOn"/>
811
+ </xsl:when>
812
+ <xsl:otherwise>
813
+ <xsl:call-template name="insertCheckBoxOff"/>
814
+ </xsl:otherwise>
815
+ </xsl:choose>
766
816
  <xsl:call-template name="addLetterSpacingSmallCaps">
767
817
  <xsl:with-param name="text" select="'Safety'"/>
768
818
  </xsl:call-template>
@@ -1082,14 +1132,15 @@
1082
1132
 
1083
1133
  </fo:block>
1084
1134
  </fo:block-container>
1085
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
1135
+ <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr'] and $lang != 'fr'">
1086
1136
  <fo:block-container height="26mm" margin-top="10pt" display-align="after">
1087
1137
  <xsl:if test="$stage &gt;= 60">
1088
1138
  <xsl:attribute name="width">100mm</xsl:attribute>
1089
1139
  </xsl:if>
1090
1140
  <fo:block color="{$color_gray}">
1091
1141
  <xsl:if test="$stage &gt;= 60">
1092
- <xsl:text>NORME INTERNATIONALE</xsl:text>
1142
+ <!-- <xsl:text>NORME INTERNATIONALE</xsl:text> -->
1143
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:doctype[@language = 'fr']))"/>
1093
1144
  </xsl:if>
1094
1145
  </fo:block>
1095
1146
  </fo:block-container>
@@ -1105,16 +1156,32 @@
1105
1156
  </fo:block-container>
1106
1157
  <fo:block-container border-bottom="0.5pt solid {$color_gray}" margin-top="4mm" margin-bottom="16pt" height="14mm" display-align="center">
1107
1158
  <fo:block font-size="10pt" color="{$color_blue}" margin-bottom="4pt">
1108
- Example: BASIC EMC PUBLICATION
1159
+ <xsl:choose>
1160
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1161
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = $lang]))"/>
1162
+ </xsl:when>
1163
+ <xsl:otherwise><!-- horizontal is false -->
1164
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = $lang]))"/>
1165
+ </xsl:otherwise>
1166
+ </xsl:choose>
1167
+ <!-- Example: BASIC EMC PUBLICATION -->
1109
1168
  <!-- HORIZONTAL STANDARD -->
1110
1169
  <!-- Basic EMC Publication
1111
1170
  Basic Safety Publication
1112
1171
  Basic Environment Publication
1113
1172
  Basic Quality Assurance Publication -->
1114
1173
  </fo:block>
1115
- <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
1174
+ <xsl:if test="/iec:iec-standard/iec:bibdata/iec:title[@language = 'fr'] and $lang != 'fr'">
1116
1175
  <fo:block font-size="10pt" margin-bottom="10pt">
1117
- Example: PUBLICATION FONDAMENTALE EN CEM
1176
+ <xsl:choose>
1177
+ <xsl:when test="/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal = 'true'">
1178
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:horizontal[@language = 'fr']))"/>
1179
+ </xsl:when>
1180
+ <xsl:otherwise><!-- horizontal is false -->
1181
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:ext/iec:function[@language = 'fr']))"/>
1182
+ </xsl:otherwise>
1183
+ </xsl:choose>
1184
+ <!-- Example: PUBLICATION FONDAMENTALE EN CEM -->
1118
1185
  <!-- NORME HORIZONTALE -->
1119
1186
  </fo:block>
1120
1187
  </xsl:if>
@@ -1184,7 +1251,7 @@
1184
1251
  </xsl:call-template>
1185
1252
  </fo:block>
1186
1253
 
1187
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true']
1254
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
1188
1255
  [@level &lt;= 3]
1189
1256
  [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1190
1257
  <fo:block text-align-last="justify">
@@ -1228,9 +1295,9 @@
1228
1295
  </fo:list-item-label>
1229
1296
  <fo:list-item-body start-indent="body-start()">
1230
1297
  <fo:block text-align-last="justify">
1231
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
1298
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1232
1299
  <xsl:variable name="title">
1233
- <xsl:apply-templates/>
1300
+ <xsl:apply-templates select="title"/>
1234
1301
  </xsl:variable>
1235
1302
  <xsl:call-template name="addLetterSpacing">
1236
1303
  <xsl:with-param name="text" select="$title"/>
@@ -1363,6 +1430,35 @@
1363
1430
  <xsl:apply-templates/>
1364
1431
  </xsl:template>
1365
1432
 
1433
+
1434
+ <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1435
+ <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1436
+ </xsl:template>
1437
+
1438
+ <xsl:template match="iec:feedback-statement//iec:clause/iec:p" priority="2">
1439
+ <fo:block margin-bottom="6pt"><xsl:apply-templates/></fo:block>
1440
+ </xsl:template>
1441
+
1442
+ <xsl:template match="iec:feedback-statement/iec:clause[not(iec:clause)]" priority="2">
1443
+ <fo:block span="all" text-align="justify">
1444
+ <xsl:if test="not(preceding-sibling::iec:clause)">
1445
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1446
+ </xsl:if>
1447
+ <xsl:apply-templates/>
1448
+ </fo:block>
1449
+ </xsl:template>
1450
+
1451
+ <xsl:template match="iec:feedback-statement/iec:clause[iec:clause]" priority="2">
1452
+ <fo:block text-align="justify">
1453
+ <xsl:apply-templates/>
1454
+ </fo:block>
1455
+ </xsl:template>
1456
+ <xsl:template match="iec:feedback-statement/iec:clause/iec:clause" priority="3">
1457
+ <fo:block text-align="justify">
1458
+ <xsl:apply-templates/>
1459
+ </fo:block>
1460
+ </xsl:template>
1461
+
1366
1462
  <!-- ============================= -->
1367
1463
  <!-- CONTENTS -->
1368
1464
  <!-- ============================= -->
@@ -1387,39 +1483,48 @@
1387
1483
  </xsl:variable>
1388
1484
 
1389
1485
  <xsl:variable name="display">
1390
- <xsl:choose>
1391
- <xsl:when test="ancestor-or-self::iec:bibitem">false</xsl:when>
1392
- <xsl:when test="ancestor-or-self::iec:term">false</xsl:when>
1486
+ <xsl:choose>
1393
1487
  <xsl:when test="$level &gt; 3">false</xsl:when>
1394
1488
  <xsl:when test="$section = '' and $type = 'clause'">false</xsl:when><!-- don't show clause with number only in title -->
1395
1489
  <xsl:otherwise>true</xsl:otherwise>
1396
1490
  </xsl:choose>
1397
1491
  </xsl:variable>
1398
1492
 
1399
- <xsl:if test="$display = 'true'">
1493
+
1494
+ <xsl:variable name="skip">
1495
+ <xsl:choose>
1496
+ <xsl:when test="ancestor-or-self::iec:bibitem">true</xsl:when>
1497
+ <xsl:when test="ancestor-or-self::iec:term">true</xsl:when>
1498
+ <xsl:otherwise>false</xsl:otherwise>
1499
+ </xsl:choose>
1500
+ </xsl:variable>
1501
+
1502
+ <xsl:if test="$skip = 'false'">
1400
1503
 
1401
1504
  <xsl:variable name="title">
1402
1505
  <xsl:call-template name="getName"/>
1403
1506
  </xsl:variable>
1404
1507
 
1405
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
1508
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
1406
1509
  <xsl:if test="$type ='appendix'">
1407
1510
  <xsl:attribute name="section"/>
1408
1511
  </xsl:if>
1409
- <xsl:choose>
1410
- <xsl:when test="$type = 'foreword' or $type = 'introduction'">
1411
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
1412
- </xsl:when>
1413
- <xsl:when test="$type = 'appendix'">
1414
- <xsl:apply-templates select="iec:title" mode="contents_item"/>
1415
- </xsl:when>
1416
- <xsl:otherwise>
1417
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1418
- </xsl:otherwise>
1419
- </xsl:choose>
1420
-
1512
+ <title>
1513
+ <xsl:choose>
1514
+ <xsl:when test="$type = 'foreword' or $type = 'introduction'">
1515
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
1516
+ </xsl:when>
1517
+ <xsl:when test="$type = 'appendix'">
1518
+ <xsl:apply-templates select="iec:title" mode="contents_item"/>
1519
+ </xsl:when>
1520
+ <xsl:otherwise>
1521
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1522
+ </xsl:otherwise>
1523
+ </xsl:choose>
1524
+ </title>
1525
+ <xsl:apply-templates mode="contents"/>
1421
1526
  </item>
1422
- <xsl:apply-templates mode="contents"/>
1527
+
1423
1528
  </xsl:if>
1424
1529
 
1425
1530
  </xsl:template>
@@ -2136,6 +2241,12 @@
2136
2241
 
2137
2242
  </title-edition>
2138
2243
 
2244
+ <title-edition lang="fr">
2245
+
2246
+ <xsl:text>Édition </xsl:text>
2247
+
2248
+ </title-edition>
2249
+
2139
2250
 
2140
2251
  <title-toc lang="en">
2141
2252
 
@@ -2144,7 +2255,12 @@
2144
2255
 
2145
2256
 
2146
2257
  </title-toc>
2147
- <title-toc lang="fr">Sommaire</title-toc>
2258
+ <title-toc lang="fr">
2259
+
2260
+ <xsl:text>Sommaire</xsl:text>
2261
+
2262
+
2263
+ </title-toc>
2148
2264
 
2149
2265
  <title-toc lang="zh">Contents</title-toc>
2150
2266
 
@@ -2166,15 +2282,24 @@
2166
2282
 
2167
2283
  <xsl:text>Part #: </xsl:text>
2168
2284
 
2285
+
2169
2286
  </title-part>
2170
2287
  <title-part lang="fr">
2171
2288
 
2172
2289
 
2173
2290
  <xsl:text>Partie #: </xsl:text>
2174
2291
 
2292
+
2175
2293
  </title-part>
2176
2294
  <title-part lang="zh">第 # 部分:</title-part>
2177
2295
 
2296
+ <title-subpart lang="en">
2297
+
2298
+ </title-subpart>
2299
+ <title-subpart lang="fr">
2300
+
2301
+ </title-subpart>
2302
+
2178
2303
  <title-modified lang="en">modified</title-modified>
2179
2304
  <title-modified lang="fr">modifiée</title-modified>
2180
2305
 
@@ -2236,10 +2361,19 @@
2236
2361
 
2237
2362
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2238
2363
  <xsl:param name="name"/>
2239
- <xsl:variable name="lang">
2240
- <xsl:call-template name="getLang"/>
2364
+ <xsl:param name="lang"/>
2365
+ <xsl:variable name="lang_">
2366
+ <xsl:choose>
2367
+ <xsl:when test="$lang != ''">
2368
+ <xsl:value-of select="$lang"/>
2369
+ </xsl:when>
2370
+ <xsl:otherwise>
2371
+ <xsl:call-template name="getLang"/>
2372
+ </xsl:otherwise>
2373
+ </xsl:choose>
2241
2374
  </xsl:variable>
2242
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
2375
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
2376
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
2243
2377
  <xsl:choose>
2244
2378
  <xsl:when test="normalize-space($title_) != ''">
2245
2379
  <xsl:value-of select="$title_"/>
@@ -2248,7 +2382,9 @@
2248
2382
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2249
2383
  </xsl:otherwise>
2250
2384
  </xsl:choose>
2251
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
2385
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
2386
+
2387
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
2252
2388
 
2253
2389
 
2254
2390
 
@@ -2377,6 +2513,7 @@
2377
2513
 
2378
2514
 
2379
2515
 
2516
+
2380
2517
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2381
2518
 
2382
2519
 
@@ -2419,6 +2556,7 @@
2419
2556
 
2420
2557
 
2421
2558
 
2559
+
2422
2560
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
2423
2561
 
2424
2562
 
@@ -2499,6 +2637,7 @@
2499
2637
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2500
2638
 
2501
2639
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2640
+
2502
2641
 
2503
2642
 
2504
2643
 
@@ -2625,6 +2764,10 @@
2625
2764
 
2626
2765
 
2627
2766
 
2767
+ <!-- <xsl:if test="$namespace = 'bipm'">
2768
+ <fo:block>&#xA0;</fo:block>
2769
+ </xsl:if> -->
2770
+
2628
2771
  <!-- $namespace = 'iso' or -->
2629
2772
 
2630
2773
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2662,6 +2805,7 @@
2662
2805
  <xsl:with-param name="table" select="$simple-table"/>
2663
2806
  </xsl:call-template>
2664
2807
  </xsl:variable>
2808
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2665
2809
 
2666
2810
  <!-- <xsl:variable name="colwidths2">
2667
2811
  <xsl:call-template name="calculate-column-widths">
@@ -2683,37 +2827,57 @@
2683
2827
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2684
2828
 
2685
2829
 
2830
+
2831
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
2686
2832
  <xsl:attribute name="space-after">12pt</xsl:attribute>
2687
2833
  <xsl:if test="ancestor::*[local-name() = 'preface']">
2688
2834
  <xsl:attribute name="space-after">16pt</xsl:attribute>
2689
2835
  </xsl:if>
2836
+
2837
+
2838
+
2690
2839
 
2691
2840
 
2841
+
2692
2842
 
2693
2843
 
2694
-
2695
2844
 
2696
2845
 
2697
2846
 
2698
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2699
-
2700
-
2701
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
2702
-
2703
-
2704
-
2705
-
2847
+
2848
+
2849
+ <xsl:variable name="table_attributes">
2850
+ <attribute name="table-layout">fixed</attribute>
2851
+ <attribute name="width">100%</attribute>
2852
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2853
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2706
2854
 
2707
2855
 
2856
+ <attribute name="border">0.5pt solid black</attribute>
2708
2857
 
2709
2858
 
2710
2859
 
2860
+
2861
+
2862
+
2711
2863
 
2712
- <!-- <xsl:if test="ancestor::*[local-name()='preface']"> -->
2713
- <xsl:attribute name="font-size">8pt</xsl:attribute>
2864
+
2714
2865
 
2866
+ </xsl:variable>
2867
+
2868
+
2869
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2715
2870
 
2871
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2872
+ <xsl:attribute name="{@name}">
2873
+ <xsl:value-of select="."/>
2874
+ </xsl:attribute>
2875
+ </xsl:for-each>
2716
2876
 
2877
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2878
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2879
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2880
+ </xsl:if>
2717
2881
 
2718
2882
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2719
2883
  <xsl:choose>
@@ -2737,6 +2901,33 @@
2737
2901
 
2738
2902
  </fo:table>
2739
2903
 
2904
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2905
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2906
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2907
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2908
+ </xsl:call-template>
2909
+ </xsl:for-each>
2910
+
2911
+ <!-- insert footer as table -->
2912
+ <!-- <fo:table>
2913
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2914
+ <xsl:attribute name="{@name}">
2915
+ <xsl:value-of select="."/>
2916
+ </xsl:attribute>
2917
+ </xsl:for-each>
2918
+
2919
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2920
+ <xsl:choose>
2921
+ <xsl:when test=". = 1 or . = 0">
2922
+ <fo:table-column column-width="proportional-column-width(2)"/>
2923
+ </xsl:when>
2924
+ <xsl:otherwise>
2925
+ <fo:table-column column-width="proportional-column-width({.})"/>
2926
+ </xsl:otherwise>
2927
+ </xsl:choose>
2928
+ </xsl:for-each>
2929
+ </fo:table>-->
2930
+
2740
2931
 
2741
2932
 
2742
2933
 
@@ -2746,6 +2937,7 @@
2746
2937
  <xsl:if test="normalize-space() != ''">
2747
2938
  <fo:block xsl:use-attribute-sets="table-name-style">
2748
2939
 
2940
+
2749
2941
  <xsl:apply-templates/>
2750
2942
  </fo:block>
2751
2943
  </xsl:if>
@@ -2801,6 +2993,13 @@
2801
2993
  <xsl:for-each select="xalan:nodeset($table)//tr">
2802
2994
  <xsl:variable name="td_text">
2803
2995
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2996
+
2997
+ <!-- <xsl:if test="$namespace = 'bipm'">
2998
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
2999
+ <word><xsl:value-of select="normalize-space(.)"/></word>
3000
+ </xsl:for-each>
3001
+ </xsl:if> -->
3002
+
2804
3003
  </xsl:variable>
2805
3004
  <xsl:variable name="words">
2806
3005
  <xsl:variable name="string_with_added_zerospaces">
@@ -2860,11 +3059,14 @@
2860
3059
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2861
3060
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2862
3061
  <xsl:value-of select="@target"/>
3062
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
3063
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
3064
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2863
3065
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2864
3066
  <xsl:param name="cols-count"/>
2865
3067
  <!-- font-weight="bold" -->
2866
3068
  <fo:table-header>
2867
-
3069
+
2868
3070
  <xsl:apply-templates/>
2869
3071
  </fo:table-header>
2870
3072
  </xsl:template><xsl:template name="table-header-title">
@@ -2889,6 +3091,13 @@
2889
3091
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2890
3092
  <xsl:apply-templates/>
2891
3093
  </xsl:template><xsl:template name="insertTableFooter">
3094
+ <xsl:param name="cols-count"/>
3095
+ <xsl:if test="../*[local-name()='tfoot']">
3096
+ <fo:table-footer>
3097
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3098
+ </fo:table-footer>
3099
+ </xsl:if>
3100
+ </xsl:template><xsl:template name="insertTableFooter2">
2892
3101
  <xsl:param name="cols-count"/>
2893
3102
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2894
3103
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2916,11 +3125,29 @@
2916
3125
  </xsl:if>
2917
3126
 
2918
3127
 
3128
+
3129
+
3130
+
3131
+
2919
3132
  <!-- except gb -->
2920
3133
 
2921
3134
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2922
3135
 
2923
3136
 
3137
+ <!-- show Note under table in preface (ex. abstract) sections -->
3138
+ <!-- empty, because notes show at page side in main sections -->
3139
+ <!-- <xsl:if test="$namespace = 'bipm'">
3140
+ <xsl:choose>
3141
+ <xsl:when test="ancestor::*[local-name()='preface']">
3142
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3143
+ </xsl:when>
3144
+ <xsl:otherwise>
3145
+ <fo:block/>
3146
+ </xsl:otherwise>
3147
+ </xsl:choose>
3148
+ </xsl:if> -->
3149
+
3150
+
2924
3151
  <!-- horizontal row separator -->
2925
3152
 
2926
3153
  <xsl:if test="../*[local-name()='note']">
@@ -2940,28 +3167,122 @@
2940
3167
  </fo:table-footer>
2941
3168
 
2942
3169
  </xsl:if>
2943
- </xsl:template><xsl:template match="*[local-name()='tbody']">
2944
-
2945
- <xsl:variable name="cols-count">
2946
- <xsl:choose>
2947
- <xsl:when test="../*[local-name()='thead']">
2948
- <xsl:call-template name="calculate-columns-numbers">
2949
- <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2950
- </xsl:call-template>
2951
- </xsl:when>
2952
- <xsl:otherwise>
2953
- <xsl:call-template name="calculate-columns-numbers">
2954
- <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2955
- </xsl:call-template>
2956
- </xsl:otherwise>
2957
- </xsl:choose>
2958
- </xsl:variable>
3170
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3171
+ <xsl:param name="table_attributes"/>
3172
+ <xsl:param name="colwidths"/>
2959
3173
 
3174
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3175
+
3176
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3177
+
3178
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3179
+
3180
+ <fo:table keep-with-previous="always">
3181
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3182
+ <xsl:choose>
3183
+ <xsl:when test="@name = 'border-top'">
3184
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
3185
+ </xsl:when>
3186
+ <xsl:when test="@name = 'border'">
3187
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3188
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3189
+ </xsl:when>
3190
+ <xsl:otherwise>
3191
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3192
+ </xsl:otherwise>
3193
+ </xsl:choose>
3194
+ </xsl:for-each>
3195
+
3196
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3197
+ <xsl:choose>
3198
+ <xsl:when test=". = 1 or . = 0">
3199
+ <fo:table-column column-width="proportional-column-width(2)"/>
3200
+ </xsl:when>
3201
+ <xsl:otherwise>
3202
+ <fo:table-column column-width="proportional-column-width({.})"/>
3203
+ </xsl:otherwise>
3204
+ </xsl:choose>
3205
+ </xsl:for-each>
3206
+
3207
+ <fo:table-body>
3208
+ <fo:table-row>
3209
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3210
+
3211
+
3212
+ <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
3213
+
3214
+
3215
+ <!-- fn will be processed inside 'note' processing -->
3216
+
3217
+ <xsl:if test="../*[local-name()='note']">
3218
+ <fo:block margin-bottom="6pt"> </fo:block>
3219
+ </xsl:if>
3220
+
3221
+
3222
+
3223
+
3224
+
3225
+
3226
+
3227
+ <!-- except gb -->
3228
+
3229
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3230
+
3231
+
3232
+ <!-- <xsl:if test="$namespace = 'bipm'">
3233
+ <xsl:choose>
3234
+ <xsl:when test="ancestor::*[local-name()='preface']">
3235
+ show Note under table in preface (ex. abstract) sections
3236
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3237
+ </xsl:when>
3238
+ <xsl:otherwise>
3239
+ empty, because notes show at page side in main sections
3240
+ <fo:block/>
3241
+ </xsl:otherwise>
3242
+ </xsl:choose>
3243
+ </xsl:if> -->
3244
+
3245
+
3246
+ <!-- horizontal row separator -->
3247
+
3248
+ <xsl:if test="../*[local-name()='note']">
3249
+ <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3250
+ <fo:block font-size="1pt"> </fo:block>
3251
+ </fo:block-container>
3252
+ </xsl:if>
3253
+
3254
+
3255
+ <!-- fn processing -->
3256
+ <xsl:call-template name="fn_display"/>
3257
+
3258
+ </fo:table-cell>
3259
+ </fo:table-row>
3260
+ </fo:table-body>
3261
+
3262
+ </fo:table>
3263
+ </xsl:if>
3264
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
3265
+
3266
+ <xsl:variable name="cols-count">
3267
+ <xsl:choose>
3268
+ <xsl:when test="../*[local-name()='thead']">
3269
+ <xsl:call-template name="calculate-columns-numbers">
3270
+ <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
3271
+ </xsl:call-template>
3272
+ </xsl:when>
3273
+ <xsl:otherwise>
3274
+ <xsl:call-template name="calculate-columns-numbers">
3275
+ <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
3276
+ </xsl:call-template>
3277
+ </xsl:otherwise>
3278
+ </xsl:choose>
3279
+ </xsl:variable>
2960
3280
 
2961
3281
 
2962
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2963
- <xsl:with-param name="cols-count" select="$cols-count"/>
2964
- </xsl:apply-templates>
3282
+
3283
+ <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
3284
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3285
+ </xsl:apply-templates>
2965
3286
 
2966
3287
  <xsl:call-template name="insertTableFooter">
2967
3288
  <xsl:with-param name="cols-count" select="$cols-count"/>
@@ -2998,8 +3319,12 @@
2998
3319
 
2999
3320
  </xsl:if>
3000
3321
 
3001
-
3002
-
3322
+
3323
+
3324
+
3325
+ <!-- <xsl:if test="$namespace = 'bipm'">
3326
+ <xsl:attribute name="height">8mm</xsl:attribute>
3327
+ </xsl:if> -->
3003
3328
 
3004
3329
  <xsl:apply-templates/>
3005
3330
  </fo:table-row>
@@ -3031,6 +3356,7 @@
3031
3356
 
3032
3357
 
3033
3358
 
3359
+
3034
3360
  <xsl:if test="@colspan">
3035
3361
  <xsl:attribute name="number-columns-spanned">
3036
3362
  <xsl:value-of select="@colspan"/>
@@ -3076,7 +3402,7 @@
3076
3402
  <xsl:attribute name="border">solid black 0</xsl:attribute>
3077
3403
  </xsl:if>
3078
3404
 
3079
-
3405
+
3080
3406
 
3081
3407
  <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
3082
3408
  <xsl:if test="ancestor::*[local-name()='preface']">
@@ -3088,6 +3414,7 @@
3088
3414
 
3089
3415
 
3090
3416
 
3417
+
3091
3418
  <xsl:if test="@colspan">
3092
3419
  <xsl:attribute name="number-columns-spanned">
3093
3420
  <xsl:value-of select="@colspan"/>
@@ -3099,7 +3426,8 @@
3099
3426
  </xsl:attribute>
3100
3427
  </xsl:if>
3101
3428
  <xsl:call-template name="display-align"/>
3102
- <fo:block>
3429
+ <fo:block>
3430
+
3103
3431
  <xsl:apply-templates/>
3104
3432
  </fo:block>
3105
3433
  </fo:table-cell>
@@ -3114,14 +3442,17 @@
3114
3442
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3115
3443
 
3116
3444
 
3445
+
3446
+
3117
3447
  <fo:inline padding-right="2mm">
3118
3448
 
3119
3449
 
3120
3450
 
3121
-
3451
+
3122
3452
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3123
3453
 
3124
3454
  </fo:inline>
3455
+
3125
3456
  <xsl:apply-templates mode="process"/>
3126
3457
  </fo:block>
3127
3458
 
@@ -3150,6 +3481,7 @@
3150
3481
  <xsl:attribute name="margin-left">6mm</xsl:attribute>
3151
3482
 
3152
3483
 
3484
+
3153
3485
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
3154
3486
 
3155
3487
 
@@ -3160,12 +3492,15 @@
3160
3492
 
3161
3493
 
3162
3494
 
3495
+
3163
3496
  <xsl:value-of select="@reference"/>
3164
3497
 
3498
+
3165
3499
  </fo:inline>
3166
3500
  <fo:inline>
3167
3501
 
3168
- <xsl:apply-templates/>
3502
+ <!-- <xsl:apply-templates /> -->
3503
+ <xsl:copy-of select="./node()"/>
3169
3504
  </fo:inline>
3170
3505
  </fo:block>
3171
3506
  </xsl:if>
@@ -3202,7 +3537,20 @@
3202
3537
  <xsl:variable name="following_dl_colwidths">
3203
3538
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3204
3539
  <xsl:variable name="html-table">
3205
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3540
+ <xsl:variable name="doc_ns">
3541
+
3542
+ </xsl:variable>
3543
+ <xsl:variable name="ns">
3544
+ <xsl:choose>
3545
+ <xsl:when test="normalize-space($doc_ns) != ''">
3546
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3547
+ </xsl:when>
3548
+ <xsl:otherwise>
3549
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3550
+ </xsl:otherwise>
3551
+ </xsl:choose>
3552
+ </xsl:variable>
3553
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3206
3554
  <xsl:element name="{$ns}:table">
3207
3555
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3208
3556
  <tbody>
@@ -3276,7 +3624,8 @@
3276
3624
 
3277
3625
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
3278
3626
 
3279
- <xsl:apply-templates/>
3627
+ <!-- <xsl:apply-templates /> -->
3628
+ <xsl:copy-of select="./node()"/>
3280
3629
  </fo:block>
3281
3630
  </fo:table-cell>
3282
3631
  </fo:table-row>
@@ -3301,9 +3650,12 @@
3301
3650
 
3302
3651
 
3303
3652
 
3653
+
3304
3654
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3305
3655
 
3656
+
3306
3657
  <xsl:value-of select="@reference"/>
3658
+
3307
3659
  </fo:basic-link>
3308
3660
  </fo:inline>
3309
3661
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -3311,7 +3663,11 @@
3311
3663
  <xsl:apply-templates/>
3312
3664
  </fo:inline>
3313
3665
  </xsl:template><xsl:template match="*[local-name()='dl']">
3314
- <fo:block-container margin-left="0mm">
3666
+ <fo:block-container>
3667
+
3668
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3669
+
3670
+
3315
3671
  <xsl:if test="parent::*[local-name() = 'note']">
3316
3672
  <xsl:attribute name="margin-left">
3317
3673
  <xsl:choose>
@@ -3321,8 +3677,11 @@
3321
3677
  </xsl:attribute>
3322
3678
 
3323
3679
  </xsl:if>
3324
- <fo:block-container margin-left="0mm">
3325
-
3680
+ <fo:block-container>
3681
+
3682
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3683
+
3684
+
3326
3685
  <xsl:variable name="parent" select="local-name(..)"/>
3327
3686
 
3328
3687
  <xsl:variable name="key_iso">
@@ -3340,9 +3699,12 @@
3340
3699
 
3341
3700
 
3342
3701
  <xsl:variable name="title-where">
3343
- <xsl:call-template name="getTitle">
3344
- <xsl:with-param name="name" select="'title-where'"/>
3345
- </xsl:call-template>
3702
+
3703
+
3704
+ <xsl:call-template name="getTitle">
3705
+ <xsl:with-param name="name" select="'title-where'"/>
3706
+ </xsl:call-template>
3707
+
3346
3708
  </xsl:variable>
3347
3709
  <xsl:value-of select="$title-where"/>
3348
3710
  </fo:block>
@@ -3365,9 +3727,12 @@
3365
3727
 
3366
3728
 
3367
3729
  <xsl:variable name="title-where">
3368
- <xsl:call-template name="getTitle">
3369
- <xsl:with-param name="name" select="'title-where'"/>
3370
- </xsl:call-template>
3730
+
3731
+
3732
+ <xsl:call-template name="getTitle">
3733
+ <xsl:with-param name="name" select="'title-where'"/>
3734
+ </xsl:call-template>
3735
+
3371
3736
  </xsl:variable>
3372
3737
  <xsl:value-of select="$title-where"/>
3373
3738
  </fo:block>
@@ -3381,9 +3746,12 @@
3381
3746
 
3382
3747
 
3383
3748
  <xsl:variable name="title-key">
3384
- <xsl:call-template name="getTitle">
3385
- <xsl:with-param name="name" select="'title-key'"/>
3386
- </xsl:call-template>
3749
+
3750
+
3751
+ <xsl:call-template name="getTitle">
3752
+ <xsl:with-param name="name" select="'title-key'"/>
3753
+ </xsl:call-template>
3754
+
3387
3755
  </xsl:variable>
3388
3756
  <xsl:value-of select="$title-key"/>
3389
3757
  </fo:block>
@@ -3417,7 +3785,20 @@
3417
3785
  </xsl:choose>
3418
3786
  <!-- create virtual html table for dl/[dt and dd] -->
3419
3787
  <xsl:variable name="html-table">
3420
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3788
+ <xsl:variable name="doc_ns">
3789
+
3790
+ </xsl:variable>
3791
+ <xsl:variable name="ns">
3792
+ <xsl:choose>
3793
+ <xsl:when test="normalize-space($doc_ns) != ''">
3794
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3795
+ </xsl:when>
3796
+ <xsl:otherwise>
3797
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3798
+ </xsl:otherwise>
3799
+ </xsl:choose>
3800
+ </xsl:variable>
3801
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3421
3802
  <xsl:element name="{$ns}:table">
3422
3803
  <tbody>
3423
3804
  <xsl:apply-templates mode="dl"/>
@@ -3565,6 +3946,7 @@
3565
3946
 
3566
3947
 
3567
3948
 
3949
+
3568
3950
  <xsl:apply-templates/>
3569
3951
  <!-- <xsl:if test="$namespace = 'gb'">
3570
3952
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3618,6 +4000,7 @@
3618
4000
  </fo:inline>
3619
4001
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3620
4002
  <fo:inline font-weight="bold">
4003
+
3621
4004
  <xsl:apply-templates/>
3622
4005
  </fo:inline>
3623
4006
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3631,18 +4014,18 @@
3631
4014
  </xsl:template><xsl:template match="*[local-name()='tt']">
3632
4015
  <fo:inline xsl:use-attribute-sets="tt-style">
3633
4016
  <xsl:variable name="_font-size">
3634
-
3635
-
3636
-
4017
+
4018
+
4019
+
3637
4020
  10
3638
4021
 
3639
4022
 
3640
4023
 
3641
4024
 
3642
4025
 
3643
-
3644
4026
 
3645
-
4027
+
4028
+
3646
4029
 
3647
4030
 
3648
4031
  </xsl:variable>
@@ -3946,7 +4329,18 @@
3946
4329
  <xsl:with-param name="previousRow" select="$newRow"/>
3947
4330
  </xsl:apply-templates>
3948
4331
  </xsl:template><xsl:template name="getLang">
3949
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4332
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4333
+ <xsl:variable name="language">
4334
+ <xsl:choose>
4335
+ <xsl:when test="$language_current != ''">
4336
+ <xsl:value-of select="$language_current"/>
4337
+ </xsl:when>
4338
+ <xsl:otherwise>
4339
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4340
+ </xsl:otherwise>
4341
+ </xsl:choose>
4342
+ </xsl:variable>
4343
+
3950
4344
  <xsl:choose>
3951
4345
  <xsl:when test="$language = 'English'">en</xsl:when>
3952
4346
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3980,7 +4374,8 @@
3980
4374
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3981
4375
  <xsl:value-of select="substring($str, 2)"/>
3982
4376
  </xsl:template><xsl:template match="mathml:math">
3983
- <fo:inline font-family="STIX2Math">
4377
+ <fo:inline font-family="STIX Two Math"> <!-- -->
4378
+
3984
4379
  <xsl:variable name="mathml">
3985
4380
  <xsl:apply-templates select="." mode="mathml"/>
3986
4381
  </xsl:variable>
@@ -4010,6 +4405,11 @@
4010
4405
  </xsl:choose>
4011
4406
  </xsl:variable>
4012
4407
  <fo:inline xsl:use-attribute-sets="link-style">
4408
+
4409
+ <xsl:if test="ancestor::*[local-name()='feedback-statement']">
4410
+ <xsl:attribute name="color">blue</xsl:attribute>
4411
+ </xsl:if>
4412
+
4013
4413
  <xsl:choose>
4014
4414
  <xsl:when test="$target = ''">
4015
4415
  <xsl:apply-templates/>
@@ -4063,10 +4463,14 @@
4063
4463
  </fo:inline>
4064
4464
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4065
4465
  <xsl:variable name="title-modified">
4066
- <xsl:call-template name="getTitle">
4067
- <xsl:with-param name="name" select="'title-modified'"/>
4068
- </xsl:call-template>
4466
+
4467
+
4468
+ <xsl:call-template name="getTitle">
4469
+ <xsl:with-param name="name" select="'title-modified'"/>
4470
+ </xsl:call-template>
4471
+
4069
4472
  </xsl:variable>
4473
+
4070
4474
  <xsl:choose>
4071
4475
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4072
4476
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4074,7 +4478,7 @@
4074
4478
  <xsl:apply-templates/>
4075
4479
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4076
4480
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4077
-
4481
+
4078
4482
  <xsl:apply-templates/>
4079
4483
  </fo:basic-link>
4080
4484
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4127,6 +4531,8 @@
4127
4531
 
4128
4532
 
4129
4533
 
4534
+
4535
+
4130
4536
  <fo:inline xsl:use-attribute-sets="note-name-style">
4131
4537
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4132
4538
  </fo:inline>
@@ -4217,7 +4623,8 @@
4217
4623
  </fo:inline>
4218
4624
  </xsl:if>
4219
4625
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4220
- <fo:block-container id="{@id}">
4626
+ <fo:block-container id="{@id}">
4627
+
4221
4628
  <fo:block>
4222
4629
  <xsl:apply-templates/>
4223
4630
  </fo:block>
@@ -4252,15 +4659,136 @@
4252
4659
 
4253
4660
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4254
4661
  </fo:block>
4255
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4662
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4256
4663
  <xsl:apply-templates mode="contents"/>
4257
4664
  <xsl:text> </xsl:text>
4258
- </xsl:template><xsl:template match="text()" mode="contents">
4665
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
4666
+ <xsl:apply-templates mode="bookmarks"/>
4667
+ <xsl:text> </xsl:text>
4668
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4259
4669
  <xsl:value-of select="."/>
4260
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4670
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4671
+ <xsl:value-of select="."/>
4672
+ </xsl:template><xsl:template match="node()" mode="contents">
4673
+ <xsl:apply-templates mode="contents"/>
4674
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
4675
+ <xsl:apply-templates mode="bookmarks"/>
4676
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4677
+ <xsl:apply-templates select="."/>
4678
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4679
+ <xsl:apply-templates mode="bookmarks"/>
4680
+ </xsl:template><xsl:template name="addBookmarks">
4681
+ <xsl:param name="contents"/>
4682
+ <xsl:if test="xalan:nodeset($contents)//item">
4683
+ <fo:bookmark-tree>
4684
+ <xsl:choose>
4685
+ <xsl:when test="xalan:nodeset($contents)/doc">
4686
+ <xsl:choose>
4687
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4688
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4689
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4690
+ <fo:bookmark-title>
4691
+ <xsl:variable name="bookmark-title_">
4692
+ <xsl:call-template name="getLangVersion">
4693
+ <xsl:with-param name="lang" select="@lang"/>
4694
+ </xsl:call-template>
4695
+ </xsl:variable>
4696
+ <xsl:choose>
4697
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4698
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4699
+ </xsl:when>
4700
+ <xsl:otherwise>
4701
+ <xsl:choose>
4702
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4703
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4704
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4705
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4706
+ </xsl:choose>
4707
+ </xsl:otherwise>
4708
+ </xsl:choose>
4709
+ </fo:bookmark-title>
4710
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4711
+ </fo:bookmark>
4712
+
4713
+ </xsl:for-each>
4714
+ </xsl:when>
4715
+ <xsl:otherwise>
4716
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4717
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4718
+ </xsl:for-each>
4719
+ </xsl:otherwise>
4720
+ </xsl:choose>
4721
+ </xsl:when>
4722
+ <xsl:otherwise>
4723
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
4724
+ </xsl:otherwise>
4725
+ </xsl:choose>
4726
+
4727
+
4728
+
4729
+ <xsl:if test="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4730
+ <fo:bookmark internal-destination="{//*[local-name() = 'figure'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4731
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4732
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
4733
+ <fo:bookmark internal-destination="{@id}">
4734
+ <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']/text()" mode="bookmarks"/></fo:bookmark-title>
4735
+ </fo:bookmark>
4736
+ </xsl:for-each>
4737
+ </fo:bookmark>
4738
+ </xsl:if>
4739
+
4740
+
4741
+
4742
+ <xsl:if test="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4743
+ <fo:bookmark internal-destination="{//*[local-name() = 'table'][@id and *[local-name() = 'name']][1]/@id}" starting-state="hide">
4744
+ <fo:bookmark-title>
4745
+ <xsl:choose>
4746
+ <xsl:when test="@lang = 'fr'">Tableaux</xsl:when>
4747
+ <xsl:otherwise>Tables</xsl:otherwise>
4748
+ </xsl:choose>
4749
+ </fo:bookmark-title>
4750
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
4751
+ <fo:bookmark internal-destination="{@id}">
4752
+ <fo:bookmark-title><xsl:apply-templates select="*[local-name() = 'name']//text()" mode="bookmarks"/></fo:bookmark-title>
4753
+ </fo:bookmark>
4754
+ </xsl:for-each>
4755
+ </fo:bookmark>
4756
+ </xsl:if>
4757
+
4758
+
4759
+
4760
+
4761
+ </fo:bookmark-tree>
4762
+ </xsl:if>
4763
+ </xsl:template><xsl:template name="getLangVersion">
4764
+ <xsl:param name="lang"/>
4765
+ <xsl:choose>
4766
+ <xsl:when test="$lang = 'en'">
4767
+ English
4768
+
4769
+ </xsl:when>
4770
+ <xsl:when test="$lang = 'fr'">
4771
+ Français
4772
+
4773
+ </xsl:when>
4774
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
4775
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4776
+ </xsl:choose>
4777
+ </xsl:template><xsl:template match="item" mode="bookmark">
4778
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4779
+ <fo:bookmark-title>
4780
+ <xsl:if test="@section != ''">
4781
+ <xsl:value-of select="@section"/>
4782
+ <xsl:text> </xsl:text>
4783
+ </xsl:if>
4784
+ <xsl:value-of select="normalize-space(title)"/>
4785
+ </fo:bookmark-title>
4786
+ <xsl:apply-templates mode="bookmark"/>
4787
+ </fo:bookmark>
4788
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4261
4789
  <xsl:if test="normalize-space() != ''">
4262
4790
  <fo:block xsl:use-attribute-sets="figure-name-style">
4263
-
4791
+
4264
4792
  <xsl:apply-templates/>
4265
4793
  </fo:block>
4266
4794
  </xsl:if>
@@ -4315,7 +4843,7 @@
4315
4843
  <xsl:apply-templates/>
4316
4844
  </xsl:otherwise>
4317
4845
  </xsl:choose>
4318
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
4846
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
4319
4847
  <xsl:text> </xsl:text>
4320
4848
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
4321
4849
  <xsl:copy>
@@ -4697,9 +5225,14 @@
4697
5225
 
4698
5226
  <fo:inline>
4699
5227
 
4700
- <xsl:call-template name="getTitle">
4701
- <xsl:with-param name="name" select="'title-source'"/>
4702
- </xsl:call-template>
5228
+
5229
+
5230
+
5231
+ <xsl:call-template name="getTitle">
5232
+ <xsl:with-param name="name" select="'title-source'"/>
5233
+ </xsl:call-template>
5234
+
5235
+
4703
5236
  <xsl:text>: </xsl:text>
4704
5237
  </fo:inline>
4705
5238
 
@@ -4850,9 +5383,12 @@
4850
5383
  </fo:block>
4851
5384
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4852
5385
  <xsl:variable name="title-deprecated">
4853
- <xsl:call-template name="getTitle">
4854
- <xsl:with-param name="name" select="'title-deprecated'"/>
4855
- </xsl:call-template>
5386
+
5387
+
5388
+ <xsl:call-template name="getTitle">
5389
+ <xsl:with-param name="name" select="'title-deprecated'"/>
5390
+ </xsl:call-template>
5391
+
4856
5392
  </xsl:variable>
4857
5393
  <fo:block xsl:use-attribute-sets="deprecates-style">
4858
5394
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4894,13 +5430,14 @@
4894
5430
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4895
5431
  <fo:block>
4896
5432
  <xsl:call-template name="setId"/>
5433
+
4897
5434
  <xsl:apply-templates/>
4898
5435
  </fo:block>
4899
5436
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
4900
5437
  <fo:block id="{@id}">
4901
5438
  <xsl:apply-templates/>
4902
5439
  </fo:block>
4903
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5440
+ </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']">
4904
5441
 
4905
5442
  <fo:block id="{@id}">
4906
5443
  <xsl:apply-templates/>
@@ -4919,20 +5456,30 @@
4919
5456
  <!-- 0xA0 to space replacement -->
4920
5457
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4921
5458
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4922
- <fo:block-container margin-left="0mm">
4923
- <xsl:if test="parent::*[local-name() = 'note']">
4924
- <xsl:attribute name="margin-left">
4925
- <xsl:choose>
4926
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4927
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4928
- </xsl:choose>
4929
- </xsl:attribute>
4930
-
4931
- </xsl:if>
4932
- <fo:block-container margin-left="0mm">
4933
- <xsl:apply-templates select="." mode="ul_ol"/>
4934
- </fo:block-container>
4935
- </fo:block-container>
5459
+ <xsl:choose>
5460
+ <xsl:when test="parent::*[local-name() = 'note']">
5461
+ <fo:block-container>
5462
+ <xsl:attribute name="margin-left">
5463
+ <xsl:choose>
5464
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
5465
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
5466
+ </xsl:choose>
5467
+ </xsl:attribute>
5468
+
5469
+
5470
+ <fo:block-container margin-left="0mm">
5471
+ <fo:block>
5472
+ <xsl:apply-templates select="." mode="ul_ol"/>
5473
+ </fo:block>
5474
+ </fo:block-container>
5475
+ </fo:block-container>
5476
+ </xsl:when>
5477
+ <xsl:otherwise>
5478
+ <fo:block>
5479
+ <xsl:apply-templates select="." mode="ul_ol"/>
5480
+ </fo:block>
5481
+ </xsl:otherwise>
5482
+ </xsl:choose>
4936
5483
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4937
5484
  <!-- <row>
4938
5485
  <date>05-07-2013</date>
@@ -5105,6 +5652,7 @@
5105
5652
 
5106
5653
 
5107
5654
 
5655
+
5108
5656
 
5109
5657
  </xsl:variable>
5110
5658
  <xsl:choose>
@@ -5119,6 +5667,7 @@
5119
5667
  <dc:creator>
5120
5668
 
5121
5669
 
5670
+
5122
5671
  </dc:creator>
5123
5672
  <dc:description>
5124
5673
  <xsl:variable name="abstract">
@@ -5128,6 +5677,7 @@
5128
5677
 
5129
5678
 
5130
5679
 
5680
+
5131
5681
  </xsl:variable>
5132
5682
  <xsl:value-of select="normalize-space($abstract)"/>
5133
5683
  </dc:description>
@@ -5199,13 +5749,22 @@
5199
5749
  </xsl:template><xsl:template name="split">
5200
5750
  <xsl:param name="pText" select="."/>
5201
5751
  <xsl:param name="sep" select="','"/>
5752
+ <xsl:param name="normalize-space" select="'true'"/>
5202
5753
  <xsl:if test="string-length($pText) &gt;0">
5203
5754
  <item>
5204
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5755
+ <xsl:choose>
5756
+ <xsl:when test="$normalize-space = 'true'">
5757
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5758
+ </xsl:when>
5759
+ <xsl:otherwise>
5760
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5761
+ </xsl:otherwise>
5762
+ </xsl:choose>
5205
5763
  </item>
5206
5764
  <xsl:call-template name="split">
5207
5765
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5208
5766
  <xsl:with-param name="sep" select="$sep"/>
5767
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5209
5768
  </xsl:call-template>
5210
5769
  </xsl:if>
5211
5770
  </xsl:template><xsl:template name="getDocumentId">
@@ -5228,6 +5787,7 @@
5228
5787
 
5229
5788
 
5230
5789
 
5790
+
5231
5791
  </xsl:variable>
5232
5792
  <xsl:if test="$documentNS != $XSLNS">
5233
5793
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5253,4 +5813,40 @@
5253
5813
  </xsl:otherwise>
5254
5814
  </xsl:choose>
5255
5815
  </xsl:attribute>
5816
+ </xsl:template><xsl:template name="add-letter-spacing">
5817
+ <xsl:param name="text"/>
5818
+ <xsl:param name="letter-spacing" select="'0.15'"/>
5819
+ <xsl:if test="string-length($text) &gt; 0">
5820
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
5821
+ <fo:inline padding-right="{$letter-spacing}mm">
5822
+ <xsl:if test="$char = '®'">
5823
+ <xsl:attribute name="font-size">58%</xsl:attribute>
5824
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
5825
+ </xsl:if>
5826
+ <xsl:value-of select="$char"/>
5827
+ </fo:inline>
5828
+ <xsl:call-template name="add-letter-spacing">
5829
+ <xsl:with-param name="text" select="substring($text, 2)"/>
5830
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5831
+ </xsl:call-template>
5832
+ </xsl:if>
5833
+ </xsl:template><xsl:template name="repeat">
5834
+ <xsl:param name="char" select="'*'"/>
5835
+ <xsl:param name="count"/>
5836
+ <xsl:if test="$count &gt; 0">
5837
+ <xsl:value-of select="$char"/>
5838
+ <xsl:call-template name="repeat">
5839
+ <xsl:with-param name="char" select="$char"/>
5840
+ <xsl:with-param name="count" select="$count - 1"/>
5841
+ </xsl:call-template>
5842
+ </xsl:if>
5843
+ </xsl:template><xsl:template name="getLocalizedString">
5844
+ <xsl:param name="key"/>
5845
+
5846
+ <xsl:variable name="curr_lang">
5847
+ <xsl:call-template name="getLang"/>
5848
+ </xsl:variable>
5849
+
5850
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5851
+
5256
5852
  </xsl:template></xsl:stylesheet>