metanorma-itu 1.2.6 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) 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/itu/basicdoc.rng +50 -3
  5. data/lib/asciidoctor/itu/boilerplate.xml +8 -2
  6. data/lib/asciidoctor/itu/cleanup.rb +9 -0
  7. data/lib/asciidoctor/itu/converter.rb +1 -0
  8. data/lib/asciidoctor/itu/front.rb +42 -8
  9. data/lib/asciidoctor/itu/isodoc.rng +61 -3
  10. data/lib/asciidoctor/itu/itu.rng +71 -0
  11. data/lib/asciidoctor/itu/validate.rb +14 -13
  12. data/lib/isodoc/itu/base_convert.rb +65 -58
  13. data/lib/isodoc/itu/cleanup.rb +55 -0
  14. data/lib/isodoc/itu/html/header.html +12 -16
  15. data/lib/isodoc/itu/html/html_itu_intro.html +4 -3
  16. data/lib/isodoc/itu/html/html_itu_titlepage.html +23 -17
  17. data/lib/isodoc/itu/html/htmlstyle.css +793 -745
  18. data/lib/isodoc/itu/html/htmlstyle.scss +15 -12
  19. data/lib/isodoc/itu/html/itu.css +43 -43
  20. data/lib/isodoc/itu/html/itu.scss +44 -43
  21. data/lib/isodoc/itu/html/logo-sp.png +0 -0
  22. data/lib/isodoc/itu/html/word_itu_intro.html +19 -3
  23. data/lib/isodoc/itu/html/word_itu_titlepage.html +37 -8
  24. data/lib/isodoc/itu/html/word_itu_titlepage_sp.html +108 -0
  25. data/lib/isodoc/itu/html/wordstyle.css +40 -37
  26. data/lib/isodoc/itu/html/wordstyle.scss +40 -37
  27. data/lib/isodoc/itu/html_convert.rb +4 -1
  28. data/lib/isodoc/itu/i18n-en.yaml +44 -0
  29. data/lib/isodoc/itu/itu.recommendation-annex.xsl +720 -154
  30. data/lib/isodoc/itu/itu.recommendation.xsl +720 -154
  31. data/lib/isodoc/itu/itu.resolution.xsl +720 -154
  32. data/lib/isodoc/itu/itu.technical-paper.xsl +5284 -0
  33. data/lib/isodoc/itu/itu.technical-report.xsl +5284 -0
  34. data/lib/isodoc/itu/metadata.rb +59 -9
  35. data/lib/isodoc/itu/pdf_convert.rb +2 -0
  36. data/lib/isodoc/itu/presentation_xml_convert.rb +104 -2
  37. data/lib/isodoc/itu/ref.rb +0 -13
  38. data/lib/isodoc/itu/terms.rb +7 -30
  39. data/lib/isodoc/itu/word_cleanup.rb +5 -1
  40. data/lib/isodoc/itu/word_convert.rb +15 -1
  41. data/lib/isodoc/itu/xref.rb +93 -39
  42. data/lib/metanorma/itu/processor.rb +10 -8
  43. data/lib/metanorma/itu/version.rb +1 -1
  44. data/metanorma-itu.gemspec +2 -2
  45. metadata +11 -6
@@ -18,9 +18,9 @@
18
18
  <!-- Rec. ITU-T G.650.1 (03/2018) -->
19
19
  <xsl:variable name="footerprefix" select="'Rec. '"/>
20
20
  <xsl:variable name="docname">
21
- <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier, ' ')"/>
21
+ <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
22
22
  <xsl:text> </xsl:text>
23
- <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier, ' ')"/>
23
+ <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
24
24
  <xsl:text> </xsl:text>
25
25
  </xsl:variable>
26
26
  <xsl:variable name="docdate">
@@ -28,13 +28,25 @@
28
28
  <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:date[@type = 'published']/itu:on"/>
29
29
  </xsl:call-template>
30
30
  </xsl:variable>
31
- <xsl:variable name="doctype">
31
+ <xsl:variable name="doctype" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype"/>
32
+ <xsl:variable name="doctypeTitle">
32
33
  <xsl:call-template name="capitalize">
33
- <xsl:with-param name="str" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype"/>
34
+ <xsl:with-param name="str" select="$doctype"/>
34
35
  </xsl:call-template>
35
36
  </xsl:variable>
37
+ <xsl:variable name="doctypeCapitalizedTitle">
38
+ <xsl:call-template name="capitalizeWords">
39
+ <xsl:with-param name="str" select="$doctype"/>
40
+ </xsl:call-template>
41
+ </xsl:variable>
42
+
43
+ <xsl:variable name="xSTR-ACRONYM">
44
+ <xsl:variable name="x" select="substring(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title, 1, 1)"/>
45
+ <xsl:variable name="acronym" select="/itu:itu-standard/itu:bibdata/itu:docnumber"/>
46
+ <xsl:value-of select="concat($x,'STR-', $acronym)"/>
47
+ </xsl:variable>
36
48
 
37
-
49
+
38
50
  <!-- Example:
39
51
  <item level="1" id="Foreword" display="true">Foreword</item>
40
52
  <item id="term-script" display="false">3.2</item>
@@ -42,17 +54,17 @@
42
54
  <xsl:variable name="contents">
43
55
  <contents>
44
56
  <!-- <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()" mode="contents"/> -->
45
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[1]" mode="contents"/> <!-- @id = 'scope' -->
57
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents"/> <!-- @id = 'scope' -->
46
58
 
47
59
  <!-- Normative references -->
48
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[1]" mode="contents"/> <!-- @id = 'references' -->
60
+ <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents"/> <!-- @id = 'references' -->
49
61
 
50
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[position() != 1]" mode="contents"/> <!-- @id != 'scope' -->
62
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents"/> <!-- @id != 'scope' -->
51
63
 
52
64
  <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/>
53
65
 
54
66
  <!-- Bibliography -->
55
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[position() != 1]" mode="contents"/> <!-- @id = 'bibliography' -->
67
+ <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> <!-- @id = 'bibliography' -->
56
68
 
57
69
  <xsl:apply-templates select="//itu:table" mode="contents"/>
58
70
 
@@ -63,13 +75,39 @@
63
75
  <xsl:call-template name="getLang"/>
64
76
  </xsl:variable>
65
77
 
66
- <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
- <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
78
+
79
+ <xsl:variable name="footer-TR">
80
+ <xsl:variable name="date" select="concat('(',substring(/itu:itu-standard/itu:bibdata/itu:version/itu:revision-date,1,7), ')')"/>
81
+ <xsl:value-of select="concat($xSTR-ACRONYM, ' ', $date)"/>
82
+ </xsl:variable>
83
+
84
+ <xsl:variable name="footer-IG">
85
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
86
+ <xsl:text> for </xsl:text>
87
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU-Recommendation']"/>
88
+ <xsl:text> </xsl:text>
89
+ <xsl:variable name="date" select="concat('(',substring(/itu:itu-standard/itu:bibdata/itu:date[@type = 'published']/itu:on,1,7), ')')"/>
90
+ <xsl:value-of select="$date"/>
91
+ </xsl:variable>
92
+
93
+ <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
94
+ <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
68
95
 
69
96
  <xsl:template match="/">
70
97
  <xsl:call-template name="namespaceCheck"/>
71
98
  <fo:root font-family="Times New Roman, STIX Two Math" font-size="12pt" xml:lang="{$lang}">
72
99
  <fo:layout-master-set>
100
+
101
+
102
+ <!-- Technical Report first page -->
103
+ <fo:simple-page-master master-name="TR-first-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
104
+ <fo:region-body margin-top="21.6mm" margin-bottom="25.4mm" margin-left="20.1mm" margin-right="22.6mm"/>
105
+ <fo:region-before region-name="TR-first-page-header" extent="21.6mm" display-align="center"/>
106
+ <fo:region-after region-name="TR-first-page-footer" extent="25.4mm" display-align="center"/>
107
+ <fo:region-start region-name="TR-first-page-left-region" extent="20.1mm"/>
108
+ <fo:region-end region-name="TR-first-page-right-region" extent="22.6mm"/>
109
+ </fo:simple-page-master>
110
+
73
111
  <!-- cover page -->
74
112
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
75
113
  <fo:region-body margin-top="19.2mm" margin-bottom="5mm" margin-left="19.2mm" margin-right="19.2mm"/>
@@ -131,6 +169,130 @@
131
169
  <xsl:with-param name="contents" select="$contents"/>
132
170
  </xsl:call-template>
133
171
 
172
+
173
+ <xsl:if test="$doctype = 'technical-report' or $doctype = 'technical-paper' or $doctype = 'implementers-guide'">
174
+ <fo:page-sequence master-reference="TR-first-page">
175
+ <fo:flow flow-name="xsl-region-body">
176
+ <fo:block>
177
+ <fo:table width="175mm" table-layout="fixed" border-top="1.5pt solid black">
178
+ <fo:table-column column-width="29mm"/>
179
+ <fo:table-column column-width="45mm"/>
180
+ <fo:table-column column-width="28mm"/>
181
+ <fo:table-column column-width="72mm"/>
182
+ <fo:table-body>
183
+ <fo:table-row>
184
+ <fo:table-cell padding-left="1mm" padding-top="3mm">
185
+ <fo:block font-weight="bold">Question(s):</fo:block>
186
+ </fo:table-cell>
187
+ <fo:table-cell padding-top="3mm">
188
+ <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:group/itu:name"/></fo:block>
189
+ </fo:table-cell>
190
+ <fo:table-cell padding-top="3mm">
191
+ <fo:block font-weight="bold">Meeting, date:</fo:block>
192
+ </fo:table-cell>
193
+ <fo:table-cell padding-top="3mm" text-align="right" padding-right="1mm">
194
+ <fo:block>
195
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting"/>
196
+ <xsl:text>, </xsl:text>
197
+ <xsl:call-template name="formatMeetingDate">
198
+ <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:from"/>
199
+ </xsl:call-template>
200
+ <xsl:text>/</xsl:text>
201
+ <xsl:call-template name="formatMeetingDate">
202
+ <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:to"/>
203
+ </xsl:call-template>
204
+ </fo:block>
205
+ </fo:table-cell>
206
+ </fo:table-row>
207
+ </fo:table-body>
208
+ </fo:table>
209
+
210
+ <fo:table width="175mm" table-layout="fixed">
211
+ <fo:table-column column-width="29mm"/>
212
+ <fo:table-column column-width="10mm"/>
213
+ <fo:table-column column-width="35mm"/>
214
+ <fo:table-column column-width="9mm"/>
215
+ <fo:table-column column-width="83mm"/>
216
+ <fo:table-column column-width="6mm"/>
217
+ <fo:table-body>
218
+ <fo:table-row>
219
+ <fo:table-cell padding-left="1mm" padding-top="2mm">
220
+ <fo:block font-weight="bold">Study Group:</fo:block>
221
+ </fo:table-cell>
222
+ <fo:table-cell padding-top="2mm">
223
+ <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:subgroup/itu:name"/></fo:block>
224
+ </fo:table-cell>
225
+ <fo:table-cell padding-top="2mm">
226
+ <fo:block font-weight="bold">Working Party:</fo:block>
227
+ </fo:table-cell>
228
+ <fo:table-cell padding-top="2mm">
229
+ <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:workgroup/itu:name"/></fo:block>
230
+ </fo:table-cell>
231
+ <fo:table-cell padding-top="2mm">
232
+ <fo:block font-weight="bold">Intended type of document <fo:inline font-weight="normal">(R-C-TD)</fo:inline>:</fo:block>
233
+ </fo:table-cell>
234
+ <fo:table-cell padding-top="2mm">
235
+ <fo:block font-weight="normal"><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:intended-type"/></fo:block>
236
+ </fo:table-cell>
237
+ </fo:table-row>
238
+ <fo:table-row>
239
+ <fo:table-cell padding-left="1mm" padding-top="2mm">
240
+ <fo:block font-weight="bold">Source:</fo:block>
241
+ </fo:table-cell>
242
+ <fo:table-cell number-columns-spanned="4" padding-top="2mm">
243
+ <fo:block><xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/itu:itu-standard/itu:bibdata/itu:ext/itu:source))"/></fo:block>
244
+ </fo:table-cell>
245
+ </fo:table-row>
246
+ <fo:table-row>
247
+ <fo:table-cell padding-left="1mm" padding-top="2mm">
248
+ <fo:block font-weight="bold">Title:</fo:block>
249
+ </fo:table-cell>
250
+ <fo:table-cell number-columns-spanned="4" padding-top="2mm">
251
+ <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@language='en' and @type='main']"/></fo:block>
252
+ </fo:table-cell>
253
+ </fo:table-row>
254
+ </fo:table-body>
255
+ </fo:table>
256
+
257
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:person">
258
+ <fo:table width="175mm" table-layout="fixed" line-height="110%">
259
+ <fo:table-column column-width="29mm"/>
260
+ <fo:table-column column-width="75mm"/>
261
+ <fo:table-column column-width="71mm"/>
262
+ <fo:table-body>
263
+
264
+ <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:person">
265
+
266
+
267
+ <fo:table-row border-top="1.5pt solid black">
268
+ <xsl:if test="position() = last()">
269
+ <xsl:attribute name="border-bottom">1.5pt solid black</xsl:attribute>
270
+ </xsl:if>
271
+ <fo:table-cell padding-left="1mm" padding-top="2.5mm">
272
+ <fo:block font-weight="bold">Contact:</fo:block>
273
+ </fo:table-cell>
274
+ <fo:table-cell padding-top="3mm">
275
+ <fo:block><xsl:value-of select="itu:name/itu:completename"/></fo:block>
276
+ <fo:block><xsl:value-of select="itu:affiliation/itu:organization/itu:name"/></fo:block>
277
+ <fo:block><xsl:value-of select="itu:affiliation/itu:organization/itu:address/itu:formattedAddress"/></fo:block>
278
+ </fo:table-cell>
279
+ <fo:table-cell padding-top="3mm">
280
+ <fo:block>Tel: <xsl:value-of select="itu:phone[not(@type)]"/></fo:block>
281
+ <fo:block>Fax: <xsl:value-of select="itu:phone[@type = 'fax']"/></fo:block>
282
+ <fo:block>E-mail: <xsl:value-of select="itu:email"/></fo:block>
283
+ </fo:table-cell>
284
+ </fo:table-row>
285
+ </xsl:for-each>
286
+ </fo:table-body>
287
+ </fo:table>
288
+ </xsl:if>
289
+ <fo:block space-before="0.5mm" font-size="9pt" margin-left="1mm">Please do not change the structure of this table, just insert the necessary information.</fo:block>
290
+ <fo:block space-before="6pt">&lt;INSERT TEXT&gt;</fo:block>
291
+ </fo:block>
292
+ </fo:flow>
293
+ </fo:page-sequence>
294
+ </xsl:if>
295
+
134
296
  <!-- cover page -->
135
297
  <fo:page-sequence master-reference="cover-page">
136
298
  <fo:flow flow-name="xsl-region-body">
@@ -172,12 +334,24 @@
172
334
  </fo:table-cell>
173
335
  <fo:table-cell padding-top="2mm" padding-bottom="-1mm">
174
336
  <fo:block font-family="Arial" font-size="36pt" font-weight="bold" margin-top="6pt" letter-spacing="2pt"> <!-- Helvetica for letter-spacing working -->
175
- <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier, ' ')"/>
337
+ <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
176
338
  </fo:block>
177
339
  </fo:table-cell>
178
340
  <fo:table-cell padding-top="1mm" number-columns-spanned="2" padding-bottom="-1mm">
179
341
  <fo:block font-size="30pt" font-weight="bold" text-align="right" margin-top="12pt" padding="0mm">
180
- <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier, ' ')"/>
342
+ <xsl:choose>
343
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
344
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
345
+ </xsl:when>
346
+ <xsl:when test="$doctype = 'implementers-guide'">
347
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU-Recommendation']"/>
348
+ <xsl:text> </xsl:text>
349
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
350
+ </xsl:when>
351
+ <xsl:otherwise>
352
+ <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
353
+ </xsl:otherwise>
354
+ </xsl:choose>
181
355
  </fo:block>
182
356
  </fo:table-cell>
183
357
  </fo:table-row>
@@ -218,9 +392,20 @@
218
392
  </fo:block>
219
393
  </xsl:if>
220
394
  <fo:block font-size="14pt">
221
- <xsl:call-template name="formatDate">
222
- <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:date[@type = 'published']/itu:on"/>
223
- </xsl:call-template>
395
+ <xsl:choose>
396
+ <xsl:when test="($doctype = 'technical-report' or $doctype = 'technical-paper') and /itu:itu-standard/itu:bibdata/itu:version/itu:revision-date">
397
+ <xsl:text>(</xsl:text>
398
+ <xsl:call-template name="formatMeetingDate">
399
+ <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:version/itu:revision-date"/>
400
+ </xsl:call-template>
401
+ <xsl:text>)</xsl:text>
402
+ </xsl:when>
403
+ <xsl:otherwise>
404
+ <xsl:call-template name="formatDate">
405
+ <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:date[@type = 'published']/itu:on"/>
406
+ </xsl:call-template>
407
+ </xsl:otherwise>
408
+ </xsl:choose>
224
409
  </fo:block>
225
410
  </fo:table-cell>
226
411
  </fo:table-row>
@@ -260,6 +445,15 @@
260
445
  <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
261
446
  <xsl:attribute name="font-weight">bold</xsl:attribute>
262
447
  </xsl:if>
448
+ <xsl:if test="($doctype = 'technical-report' or $doctype = 'technical-paper') and /itu:itu-standard/itu:bibdata/itu:docnumber">
449
+ <fo:block font-weight="bold">
450
+ <xsl:value-of select="$xSTR-ACRONYM"/>
451
+ </fo:block>
452
+ </xsl:if>
453
+ <xsl:if test="$doctype = 'implementers-guide'">
454
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
455
+ <xsl:text> for </xsl:text>
456
+ </xsl:if>
263
457
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
264
458
  </fo:block>
265
459
  <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
@@ -311,13 +505,37 @@
311
505
  </fo:table-cell>
312
506
  <fo:table-cell number-columns-spanned="3">
313
507
  <fo:block font-size="16pt" margin-top="3pt">
314
- <xsl:value-of select="$doctype"/>
315
- <xsl:text>  </xsl:text>
316
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
317
- <xsl:text>-</xsl:text>
318
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
319
- <xsl:text>  </xsl:text>
320
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
508
+ <xsl:if test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
509
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
510
+ </xsl:if>
511
+
512
+ <xsl:choose>
513
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
514
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage">
515
+ <xsl:call-template name="capitalizeWords">
516
+ <xsl:with-param name="str" select="/itu:itu-standard/itu:bibdata/itu:status/itu:stage"/>
517
+ </xsl:call-template>
518
+ <xsl:text> </xsl:text>
519
+ </xsl:if>
520
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
521
+ <xsl:text>  </xsl:text>
522
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU']"/>
523
+ </xsl:when>
524
+ <xsl:when test="$doctype = 'implementers-guide'">
525
+ </xsl:when>
526
+ <xsl:otherwise>
527
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
528
+ <xsl:text>  </xsl:text>
529
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
530
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
531
+ <xsl:text>-</xsl:text>
532
+ </xsl:if>
533
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
534
+ <xsl:text>  </xsl:text>
535
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
536
+ </xsl:otherwise>
537
+ </xsl:choose>
538
+
321
539
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
322
540
  <xsl:variable name="title-annex">
323
541
  <xsl:call-template name="getTitle">
@@ -341,7 +559,7 @@
341
559
  <fo:flow flow-name="xsl-region-body">
342
560
  <fo:block-container font-size="14pt" font-weight="bold">
343
561
  <fo:block>
344
- <xsl:value-of select="$doctype"/>
562
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
345
563
  <xsl:text> </xsl:text>
346
564
  <xsl:value-of select="$docname"/>
347
565
  </fo:block>
@@ -403,58 +621,117 @@
403
621
  <fo:block margin-top="6pt" text-align="center" font-weight="bold"><xsl:value-of select="$title-toc"/></fo:block>
404
622
  <fo:block margin-top="6pt" text-align="right" font-weight="bold"><xsl:value-of select="$title-page"/></fo:block>
405
623
 
406
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
407
- <fo:block>
408
- <xsl:if test="@level = 1">
409
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
410
- </xsl:if>
411
- <xsl:if test="@level = 2">
412
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
413
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
414
- </xsl:if>
415
- <fo:list-block provisional-label-separation="3mm">
416
- <xsl:attribute name="provisional-distance-between-starts">
417
- <xsl:choose>
418
- <xsl:when test="@section != ''">
419
- <xsl:if test="@level = 1">
420
- <xsl:choose>
421
- <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
422
- <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
423
- <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
424
- <xsl:otherwise>12mm</xsl:otherwise>
425
- </xsl:choose>
426
- </xsl:if>
427
- <xsl:if test="@level = 2">26mm</xsl:if>
428
- </xsl:when> <!-- -->
429
- <xsl:otherwise>0mm</xsl:otherwise>
430
- </xsl:choose>
431
- </xsl:attribute>
432
- <fo:list-item>
433
- <fo:list-item-label end-indent="label-end()">
434
- <xsl:if test="@level =2">
435
- <xsl:attribute name="start-indent">12mm</xsl:attribute>
624
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
625
+ <fo:block>
626
+ <xsl:if test="@level = 1">
627
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
628
+ </xsl:if>
629
+ <xsl:if test="@level = 2">
630
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
631
+ <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
632
+ </xsl:if>
633
+ <fo:list-block provisional-label-separation="3mm">
634
+ <xsl:attribute name="provisional-distance-between-starts">
635
+ <xsl:choose>
636
+ <xsl:when test="@section != ''">
637
+ <xsl:if test="@level = 1">
638
+ <xsl:choose>
639
+ <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
640
+ <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
641
+ <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
642
+ <xsl:otherwise>12mm</xsl:otherwise>
643
+ </xsl:choose>
644
+ </xsl:if>
645
+ <xsl:if test="@level = 2">26mm</xsl:if>
646
+ </xsl:when> <!-- -->
647
+ <xsl:otherwise>0mm</xsl:otherwise>
648
+ </xsl:choose>
649
+ </xsl:attribute>
650
+ <fo:list-item>
651
+ <fo:list-item-label end-indent="label-end()">
652
+ <xsl:if test="@level =2">
653
+ <xsl:attribute name="start-indent">12mm</xsl:attribute>
654
+ </xsl:if>
655
+ <fo:block>
656
+ <xsl:if test="@section">
657
+ <xsl:value-of select="@section"/>
436
658
  </xsl:if>
437
- <fo:block>
438
- <xsl:if test="@section">
439
- <xsl:value-of select="@section"/>
440
- </xsl:if>
659
+ </fo:block>
660
+ </fo:list-item-label>
661
+ <fo:list-item-body start-indent="body-start()">
662
+ <fo:block text-align-last="justify">
663
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
664
+ <xsl:apply-templates select="title"/>
665
+ <fo:inline keep-together.within-line="always">
666
+ <fo:leader leader-pattern="dots"/>
667
+ <fo:page-number-citation ref-id="{@id}"/>
668
+ </fo:inline>
669
+ </fo:basic-link>
441
670
  </fo:block>
442
- </fo:list-item-label>
443
- <fo:list-item-body start-indent="body-start()">
444
- <fo:block text-align-last="justify">
445
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
446
- <xsl:apply-templates select="title"/>
447
- <fo:inline keep-together.within-line="always">
448
- <fo:leader leader-pattern="dots"/>
449
- <fo:page-number-citation ref-id="{@id}"/>
450
- </fo:inline>
451
- </fo:basic-link>
452
- </fo:block>
453
- </fo:list-item-body>
454
- </fo:list-item>
455
- </fo:list-block>
456
- </fo:block>
457
- </xsl:for-each>
671
+ </fo:list-item-body>
672
+ </fo:list-item>
673
+ </fo:list-block>
674
+ </fo:block>
675
+ </xsl:for-each>
676
+
677
+
678
+ <xsl:if test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
679
+ <xsl:if test="//itu:table[@id and itu:name]">
680
+ <xsl:variable name="title-list-tables">
681
+ <xsl:call-template name="getTitle">
682
+ <xsl:with-param name="name" select="'title-list-tables'"/>
683
+ </xsl:call-template>
684
+ </xsl:variable>
685
+
686
+ <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
687
+ <xsl:value-of select="$title-list-tables"/>
688
+ </fo:block>
689
+ <fo:block margin-top="6pt" text-align="right" font-weight="bold" keep-with-next="always"><xsl:value-of select="$title-page"/></fo:block>
690
+
691
+ <fo:block-container>
692
+ <xsl:for-each select="//itu:table[@id and itu:name]">
693
+ <fo:block text-align-last="justify" margin-top="6pt">
694
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
695
+ <xsl:apply-templates select="itu:name" mode="contents"/>
696
+ <fo:inline keep-together.within-line="always">
697
+ <fo:leader leader-pattern="dots"/>
698
+ <fo:page-number-citation ref-id="{@id}"/>
699
+ </fo:inline>
700
+ </fo:basic-link>
701
+ </fo:block>
702
+ </xsl:for-each>
703
+ </fo:block-container>
704
+ </xsl:if>
705
+
706
+ <xsl:if test="//itu:figure[@id and itu:name]">
707
+ <xsl:variable name="title-list-figures">
708
+ <xsl:call-template name="getTitle">
709
+ <xsl:with-param name="name" select="'title-list-figures'"/>
710
+ </xsl:call-template>
711
+ </xsl:variable>
712
+
713
+
714
+ <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
715
+ <xsl:value-of select="$title-list-figures"/>
716
+ </fo:block>
717
+ <fo:block margin-top="6pt" text-align="right" font-weight="bold" keep-with-next="always"><xsl:value-of select="$title-page"/></fo:block>
718
+
719
+ <fo:block-container>
720
+ <xsl:for-each select="//itu:figure[@id and itu:name]">
721
+ <fo:block text-align-last="justify" margin-top="6pt">
722
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
723
+ <xsl:apply-templates select="itu:name" mode="contents"/>
724
+ <fo:inline keep-together.within-line="always">
725
+ <fo:leader leader-pattern="dots"/>
726
+ <fo:page-number-citation ref-id="{@id}"/>
727
+ </fo:inline>
728
+ </fo:basic-link>
729
+ </fo:block>
730
+ </xsl:for-each>
731
+ </fo:block-container>
732
+ </xsl:if>
733
+ </xsl:if>
734
+
458
735
  </fo:block-container>
459
736
  </xsl:if>
460
737
 
@@ -475,30 +752,40 @@
475
752
 
476
753
  <fo:block-container font-size="14pt" font-weight="bold">
477
754
  <fo:block>
478
- <xsl:value-of select="$doctype"/>
755
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
479
756
  <xsl:text> </xsl:text>
480
757
  <xsl:value-of select="$docname"/>
481
758
  </fo:block>
482
759
  <fo:block text-align="center" margin-top="15pt" margin-bottom="15pt">
483
760
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
761
+
762
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = 'en']">
763
+ <fo:block margin-top="18pt" font-weight="normal" font-style="italic">
764
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = 'en']"/>
765
+ </fo:block>
766
+ </xsl:if>
767
+
484
768
  </fo:block>
769
+
770
+
771
+
485
772
  </fo:block-container>
486
773
 
487
774
 
488
775
  <!-- Clause(s) -->
489
776
  <fo:block>
490
777
  <!-- Scope -->
491
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[1]"/> <!-- @id = 'scope' -->
778
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']"/> <!-- @id = 'scope' -->
492
779
 
493
780
  <!-- Normative references -->
494
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[1]"/> <!-- @id = 'references' -->
781
+ <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']"/> <!-- @id = 'references' -->
495
782
 
496
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[position() != 1]"/> <!-- @id != 'scope' -->
783
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]"/> <!-- @id != 'scope' -->
497
784
 
498
785
  <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
499
786
 
500
787
  <!-- Bibliography -->
501
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[position() != 1]"/> <!-- @id = 'bibliography' -->
788
+ <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> <!-- @id = 'bibliography' -->
502
789
  </fo:block>
503
790
 
504
791
  </fo:flow>
@@ -604,13 +891,13 @@
604
891
  <!-- for Ordered Lists -->
605
892
  <xsl:choose>
606
893
  <xsl:when test="../@type = 'arabic'">
607
- <xsl:number format="a)"/>
894
+ <xsl:number format="a)" lang="en"/>
608
895
  </xsl:when>
609
896
  <xsl:when test="../@class = 'steps'">
610
897
  <xsl:number format="1)"/>
611
898
  </xsl:when>
612
899
  <xsl:when test="$level = 1">
613
- <xsl:number format="a)"/>
900
+ <xsl:number format="a)" lang="en"/>
614
901
  </xsl:when>
615
902
  <xsl:when test="$level = 2">
616
903
  <xsl:number format="i)"/>
@@ -771,7 +1058,7 @@
771
1058
 
772
1059
 
773
1060
  <xsl:template match="itu:clause[@id='draft-warning']/itu:title" mode="caution">
774
- <fo:block font-size="16pt" font-family="Times New Roman" font-style="italic" font-weight="bold" text-align="center">
1061
+ <fo:block font-size="16pt" font-family="Times New Roman" font-style="italic" font-weight="bold" text-align="center" space-after="6pt">
775
1062
  <xsl:apply-templates/>
776
1063
  </fo:block>
777
1064
  </xsl:template>
@@ -898,24 +1185,38 @@
898
1185
  <xsl:apply-templates/>
899
1186
  </fo:inline>
900
1187
  <xsl:if test="../itu:termsource/itu:origin">
1188
+ <xsl:text>: </xsl:text>
901
1189
  <xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
902
- <xsl:choose>
903
- <xsl:when test="contains($citeas, '[')">
904
- <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
905
- </xsl:when>
906
- <xsl:otherwise>
907
- <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
908
- </xsl:otherwise>
909
- </xsl:choose>
910
- </xsl:if>
911
- <xsl:text>: </xsl:text>
912
- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
1190
+ <xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
1191
+ <xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
1192
+
1193
+ <fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
1194
+ <xsl:choose>
1195
+ <xsl:when test="$origin_text != ''">
1196
+ <xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
1197
+ </xsl:when>
1198
+ <xsl:when test="contains($citeas, '[')">
1199
+ <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
1200
+ </xsl:when>
1201
+ <xsl:otherwise>
1202
+ <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
1203
+ </xsl:otherwise>
1204
+ </xsl:choose>
1205
+ </fo:basic-link>
1206
+ </xsl:if>
1207
+ <xsl:if test="following-sibling::itu:definition/node()">
1208
+ <xsl:text>: </xsl:text>
1209
+ <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
1210
+ </xsl:if>
913
1211
  </fo:block>
914
1212
  <!-- <xsl:if test="following-sibling::itu:table">
915
1213
  <fo:block space-after="18pt">&#xA0;</fo:block>
916
1214
  </xsl:if> -->
917
1215
  </xsl:template>
918
1216
 
1217
+ <xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
1218
+
1219
+
919
1220
  <xsl:template match="itu:definition/itu:p" priority="2"/>
920
1221
  <xsl:template match="itu:definition/itu:formula" priority="2"/>
921
1222
 
@@ -1193,7 +1494,17 @@
1193
1494
  </fo:table-cell>
1194
1495
  <fo:table-cell font-weight="bold" text-align="left" padding-bottom="8mm">
1195
1496
  <fo:block>
1196
- <xsl:value-of select="concat($footerprefix, $docname, ' ', $docdate)"/>
1497
+ <xsl:choose>
1498
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
1499
+ <xsl:value-of select="$footer-TR"/>
1500
+ </xsl:when>
1501
+ <xsl:when test="$doctype = 'implementers-guide'">
1502
+ <xsl:value-of select="$footer-IG"/>
1503
+ </xsl:when>
1504
+ <xsl:otherwise>
1505
+ <xsl:value-of select="concat($footerprefix, $docname, ' ', $docdate)"/>
1506
+ </xsl:otherwise>
1507
+ </xsl:choose>
1197
1508
  </fo:block>
1198
1509
  </fo:table-cell>
1199
1510
  </fo:table-row>
@@ -1210,7 +1521,17 @@
1210
1521
  <fo:table-row>
1211
1522
  <fo:table-cell font-weight="bold" text-align="right" padding-bottom="8mm">
1212
1523
  <fo:block>
1213
- <xsl:value-of select="concat($footerprefix, $docname, ' ', $docdate)"/>
1524
+ <xsl:choose>
1525
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
1526
+ <xsl:value-of select="$footer-TR"/>
1527
+ </xsl:when>
1528
+ <xsl:when test="$doctype = 'implementers-guide'">
1529
+ <xsl:value-of select="$footer-IG"/>
1530
+ </xsl:when>
1531
+ <xsl:otherwise>
1532
+ <xsl:value-of select="concat($footerprefix, $docname, ' ', $docdate)"/>
1533
+ </xsl:otherwise>
1534
+ </xsl:choose>
1214
1535
  </fo:block>
1215
1536
  </fo:table-cell>
1216
1537
  <fo:table-cell text-align="right" padding-bottom="8mm" padding-right="2mm">
@@ -1242,6 +1563,33 @@
1242
1563
  </xsl:if>
1243
1564
  </xsl:template>
1244
1565
 
1566
+ <xsl:template name="formatMeetingDate">
1567
+ <xsl:param name="date"/>
1568
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
1569
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
1570
+ <xsl:variable name="day" select="substring($date, 9)"/>
1571
+
1572
+ <xsl:variable name="monthStr">
1573
+ <xsl:choose>
1574
+ <xsl:when test="$month = '01'">Jan</xsl:when>
1575
+ <xsl:when test="$month = '02'">Feb</xsl:when>
1576
+ <xsl:when test="$month = '03'">Mar</xsl:when>
1577
+ <xsl:when test="$month = '04'">Apr</xsl:when>
1578
+ <xsl:when test="$month = '05'">May</xsl:when>
1579
+ <xsl:when test="$month = '06'">Jun</xsl:when>
1580
+ <xsl:when test="$month = '07'">Jul</xsl:when>
1581
+ <xsl:when test="$month = '08'">Aug</xsl:when>
1582
+ <xsl:when test="$month = '09'">Sep</xsl:when>
1583
+ <xsl:when test="$month = '10'">Oct</xsl:when>
1584
+ <xsl:when test="$month = '11'">Nov</xsl:when>
1585
+ <xsl:when test="$month = '12'">Dec</xsl:when>
1586
+ </xsl:choose>
1587
+ </xsl:variable>
1588
+
1589
+ <xsl:value-of select="$day"/><xsl:text> </xsl:text><xsl:value-of select="$monthStr"/><xsl:text> </xsl:text><xsl:value-of select="$year"/>
1590
+
1591
+ </xsl:template>
1592
+
1245
1593
 
1246
1594
  <xsl:template name="addLetterSpacing">
1247
1595
  <xsl:param name="text"/>
@@ -1309,13 +1657,22 @@
1309
1657
  <title-part lang="en">
1310
1658
 
1311
1659
 
1660
+
1312
1661
  </title-part>
1313
1662
  <title-part lang="fr">
1314
1663
 
1315
1664
 
1665
+
1316
1666
  </title-part>
1317
1667
  <title-part lang="zh">第 # 部分:</title-part>
1318
1668
 
1669
+ <title-subpart lang="en">
1670
+
1671
+ </title-subpart>
1672
+ <title-subpart lang="fr">
1673
+
1674
+ </title-subpart>
1675
+
1319
1676
  <title-modified lang="en">modified</title-modified>
1320
1677
  <title-modified lang="fr">modifiée</title-modified>
1321
1678
 
@@ -1613,6 +1970,7 @@
1613
1970
 
1614
1971
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1615
1972
 
1973
+
1616
1974
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1617
1975
 
1618
1976
 
@@ -1643,6 +2001,7 @@
1643
2001
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1644
2002
 
1645
2003
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2004
+
1646
2005
 
1647
2006
 
1648
2007
 
@@ -1771,7 +2130,9 @@
1771
2130
 
1772
2131
 
1773
2132
 
1774
-
2133
+ <!-- <xsl:if test="$namespace = 'bipm'">
2134
+ <fo:block>&#xA0;</fo:block>
2135
+ </xsl:if> -->
1775
2136
 
1776
2137
  <!-- $namespace = 'iso' or -->
1777
2138
 
@@ -1805,10 +2166,12 @@
1805
2166
 
1806
2167
 
1807
2168
  <xsl:variable name="colwidths">
1808
- <xsl:call-template name="calculate-column-widths">
1809
- <xsl:with-param name="cols-count" select="$cols-count"/>
1810
- <xsl:with-param name="table" select="$simple-table"/>
1811
- </xsl:call-template>
2169
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2170
+ <xsl:call-template name="calculate-column-widths">
2171
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2172
+ <xsl:with-param name="table" select="$simple-table"/>
2173
+ </xsl:call-template>
2174
+ </xsl:if>
1812
2175
  </xsl:variable>
1813
2176
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1814
2177
 
@@ -1855,7 +2218,12 @@
1855
2218
 
1856
2219
  <xsl:variable name="table_attributes">
1857
2220
  <attribute name="table-layout">fixed</attribute>
1858
- <attribute name="width">100%</attribute>
2221
+ <attribute name="width">
2222
+ <xsl:choose>
2223
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2224
+ <xsl:otherwise>100%</xsl:otherwise>
2225
+ </xsl:choose>
2226
+ </attribute>
1859
2227
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1860
2228
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1861
2229
 
@@ -1887,16 +2255,25 @@
1887
2255
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1888
2256
  </xsl:if>
1889
2257
 
1890
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1891
- <xsl:choose>
1892
- <xsl:when test=". = 1 or . = 0">
1893
- <fo:table-column column-width="proportional-column-width(2)"/>
1894
- </xsl:when>
1895
- <xsl:otherwise>
1896
- <fo:table-column column-width="proportional-column-width({.})"/>
1897
- </xsl:otherwise>
1898
- </xsl:choose>
1899
- </xsl:for-each>
2258
+ <xsl:choose>
2259
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2260
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2261
+ <fo:table-column column-width="{@width}"/>
2262
+ </xsl:for-each>
2263
+ </xsl:when>
2264
+ <xsl:otherwise>
2265
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2266
+ <xsl:choose>
2267
+ <xsl:when test=". = 1 or . = 0">
2268
+ <fo:table-column column-width="proportional-column-width(2)"/>
2269
+ </xsl:when>
2270
+ <xsl:otherwise>
2271
+ <fo:table-column column-width="proportional-column-width({.})"/>
2272
+ </xsl:otherwise>
2273
+ </xsl:choose>
2274
+ </xsl:for-each>
2275
+ </xsl:otherwise>
2276
+ </xsl:choose>
1900
2277
 
1901
2278
  <xsl:choose>
1902
2279
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1909,10 +2286,12 @@
1909
2286
 
1910
2287
  </fo:table>
1911
2288
 
2289
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1912
2290
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1913
2291
  <xsl:call-template name="insertTableFooterInSeparateTable">
1914
2292
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1915
2293
  <xsl:with-param name="colwidths" select="$colwidths"/>
2294
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1916
2295
  </xsl:call-template>
1917
2296
  </xsl:for-each>
1918
2297
 
@@ -1945,6 +2324,7 @@
1945
2324
  <xsl:if test="normalize-space() != ''">
1946
2325
  <fo:block xsl:use-attribute-sets="table-name-style">
1947
2326
 
2327
+
1948
2328
  <xsl:apply-templates/>
1949
2329
  </fo:block>
1950
2330
  </xsl:if>
@@ -2169,12 +2549,22 @@
2169
2549
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2170
2550
  <xsl:param name="table_attributes"/>
2171
2551
  <xsl:param name="colwidths"/>
2552
+ <xsl:param name="colgroup"/>
2172
2553
 
2173
2554
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2174
2555
 
2175
2556
  <xsl:if test="$isNoteOrFnExist = 'true'">
2176
2557
 
2177
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2558
+ <xsl:variable name="cols-count">
2559
+ <xsl:choose>
2560
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2561
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2562
+ </xsl:when>
2563
+ <xsl:otherwise>
2564
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2565
+ </xsl:otherwise>
2566
+ </xsl:choose>
2567
+ </xsl:variable>
2178
2568
 
2179
2569
  <fo:table keep-with-previous="always">
2180
2570
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -2192,16 +2582,25 @@
2192
2582
  </xsl:choose>
2193
2583
  </xsl:for-each>
2194
2584
 
2195
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2196
- <xsl:choose>
2197
- <xsl:when test=". = 1 or . = 0">
2198
- <fo:table-column column-width="proportional-column-width(2)"/>
2199
- </xsl:when>
2200
- <xsl:otherwise>
2201
- <fo:table-column column-width="proportional-column-width({.})"/>
2202
- </xsl:otherwise>
2203
- </xsl:choose>
2204
- </xsl:for-each>
2585
+ <xsl:choose>
2586
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2587
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2588
+ <fo:table-column column-width="{@width}"/>
2589
+ </xsl:for-each>
2590
+ </xsl:when>
2591
+ <xsl:otherwise>
2592
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2593
+ <xsl:choose>
2594
+ <xsl:when test=". = 1 or . = 0">
2595
+ <fo:table-column column-width="proportional-column-width(2)"/>
2596
+ </xsl:when>
2597
+ <xsl:otherwise>
2598
+ <fo:table-column column-width="proportional-column-width({.})"/>
2599
+ </xsl:otherwise>
2600
+ </xsl:choose>
2601
+ </xsl:for-each>
2602
+ </xsl:otherwise>
2603
+ </xsl:choose>
2205
2604
 
2206
2605
  <fo:table-body>
2207
2606
  <fo:table-row>
@@ -2306,6 +2705,7 @@
2306
2705
 
2307
2706
 
2308
2707
 
2708
+
2309
2709
  <!-- <xsl:if test="$namespace = 'bipm'">
2310
2710
  <xsl:attribute name="height">8mm</xsl:attribute>
2311
2711
  </xsl:if> -->
@@ -2400,7 +2800,8 @@
2400
2800
  </xsl:attribute>
2401
2801
  </xsl:if>
2402
2802
  <xsl:call-template name="display-align"/>
2403
- <fo:block>
2803
+ <fo:block>
2804
+
2404
2805
  <xsl:apply-templates/>
2405
2806
  </fo:block>
2406
2807
  </fo:table-cell>
@@ -2631,7 +3032,13 @@
2631
3032
  <xsl:apply-templates/>
2632
3033
  </fo:inline>
2633
3034
  </xsl:template><xsl:template match="*[local-name()='dl']">
2634
- <fo:block-container margin-left="0mm">
3035
+ <fo:block-container>
3036
+
3037
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3038
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3039
+ </xsl:if>
3040
+
3041
+
2635
3042
  <xsl:if test="parent::*[local-name() = 'note']">
2636
3043
  <xsl:attribute name="margin-left">
2637
3044
  <xsl:choose>
@@ -2641,8 +3048,12 @@
2641
3048
  </xsl:attribute>
2642
3049
 
2643
3050
  </xsl:if>
2644
- <fo:block-container margin-left="0mm">
2645
-
3051
+ <fo:block-container>
3052
+
3053
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3054
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3055
+
3056
+
2646
3057
  <xsl:variable name="parent" select="local-name(..)"/>
2647
3058
 
2648
3059
  <xsl:variable name="key_iso">
@@ -2656,9 +3067,12 @@
2656
3067
  <fo:block margin-bottom="12pt" text-align="left">
2657
3068
 
2658
3069
  <xsl:variable name="title-where">
2659
- <xsl:call-template name="getTitle">
2660
- <xsl:with-param name="name" select="'title-where'"/>
2661
- </xsl:call-template>
3070
+
3071
+
3072
+ <xsl:call-template name="getTitle">
3073
+ <xsl:with-param name="name" select="'title-where'"/>
3074
+ </xsl:call-template>
3075
+
2662
3076
  </xsl:variable>
2663
3077
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2664
3078
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2676,9 +3090,12 @@
2676
3090
 
2677
3091
 
2678
3092
  <xsl:variable name="title-where">
2679
- <xsl:call-template name="getTitle">
2680
- <xsl:with-param name="name" select="'title-where'"/>
2681
- </xsl:call-template>
3093
+
3094
+
3095
+ <xsl:call-template name="getTitle">
3096
+ <xsl:with-param name="name" select="'title-where'"/>
3097
+ </xsl:call-template>
3098
+
2682
3099
  </xsl:variable>
2683
3100
  <xsl:value-of select="$title-where"/>:
2684
3101
  </fo:block>
@@ -2689,9 +3106,12 @@
2689
3106
 
2690
3107
 
2691
3108
  <xsl:variable name="title-key">
2692
- <xsl:call-template name="getTitle">
2693
- <xsl:with-param name="name" select="'title-key'"/>
2694
- </xsl:call-template>
3109
+
3110
+
3111
+ <xsl:call-template name="getTitle">
3112
+ <xsl:with-param name="name" select="'title-key'"/>
3113
+ </xsl:call-template>
3114
+
2695
3115
  </xsl:variable>
2696
3116
  <xsl:value-of select="$title-key"/>
2697
3117
  </fo:block>
@@ -2824,12 +3244,32 @@
2824
3244
  </xsl:otherwise>
2825
3245
  </xsl:choose>
2826
3246
  </xsl:template><xsl:template name="getMaxLength_dt">
2827
- <xsl:for-each select="*[local-name()='dt']">
2828
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2829
- <xsl:if test="position() = 1">
2830
- <xsl:value-of select="string-length(normalize-space(.))"/>
2831
- </xsl:if>
2832
- </xsl:for-each>
3247
+ <xsl:variable name="lengths">
3248
+ <xsl:for-each select="*[local-name()='dt']">
3249
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3250
+ <xsl:variable name="attributes">
3251
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3252
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3253
+ </xsl:variable>
3254
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3255
+ </xsl:for-each>
3256
+ </xsl:variable>
3257
+ <xsl:variable name="maxLength">
3258
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3259
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3260
+ <xsl:if test="position() = 1">
3261
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3262
+ </xsl:if>
3263
+ </xsl:for-each> -->
3264
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3265
+ <xsl:sort select="." data-type="number" order="descending"/>
3266
+ <xsl:if test="position() = 1">
3267
+ <xsl:value-of select="."/>
3268
+ </xsl:if>
3269
+ </xsl:for-each>
3270
+ </xsl:variable>
3271
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3272
+ <xsl:value-of select="$maxLength"/>
2833
3273
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2834
3274
  <xsl:param name="key_iso"/>
2835
3275
 
@@ -2951,6 +3391,7 @@
2951
3391
  </fo:inline>
2952
3392
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2953
3393
  <fo:inline font-weight="bold">
3394
+
2954
3395
  <xsl:apply-templates/>
2955
3396
  </fo:inline>
2956
3397
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2990,6 +3431,10 @@
2990
3431
  </xsl:if>
2991
3432
  <xsl:apply-templates/>
2992
3433
  </fo:inline>
3434
+ </xsl:template><xsl:template match="*[local-name()='underline']">
3435
+ <fo:inline text-decoration="underline">
3436
+ <xsl:apply-templates/>
3437
+ </fo:inline>
2993
3438
  </xsl:template><xsl:template match="*[local-name()='del']">
2994
3439
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2995
3440
  <xsl:apply-templates/>
@@ -3279,7 +3724,18 @@
3279
3724
  <xsl:with-param name="previousRow" select="$newRow"/>
3280
3725
  </xsl:apply-templates>
3281
3726
  </xsl:template><xsl:template name="getLang">
3282
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3727
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3728
+ <xsl:variable name="language">
3729
+ <xsl:choose>
3730
+ <xsl:when test="$language_current != ''">
3731
+ <xsl:value-of select="$language_current"/>
3732
+ </xsl:when>
3733
+ <xsl:otherwise>
3734
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3735
+ </xsl:otherwise>
3736
+ </xsl:choose>
3737
+ </xsl:variable>
3738
+
3283
3739
  <xsl:choose>
3284
3740
  <xsl:when test="$language = 'English'">en</xsl:when>
3285
3741
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3314,6 +3770,7 @@
3314
3770
  <xsl:value-of select="substring($str, 2)"/>
3315
3771
  </xsl:template><xsl:template match="mathml:math">
3316
3772
  <fo:inline font-family="STIX Two Math"> <!-- -->
3773
+
3317
3774
  <xsl:variable name="mathml">
3318
3775
  <xsl:apply-templates select="." mode="mathml"/>
3319
3776
  </xsl:variable>
@@ -3343,6 +3800,7 @@
3343
3800
  </xsl:choose>
3344
3801
  </xsl:variable>
3345
3802
  <fo:inline xsl:use-attribute-sets="link-style">
3803
+
3346
3804
  <xsl:choose>
3347
3805
  <xsl:when test="$target = ''">
3348
3806
  <xsl:apply-templates/>
@@ -3396,10 +3854,14 @@
3396
3854
  </fo:inline>
3397
3855
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3398
3856
  <xsl:variable name="title-modified">
3399
- <xsl:call-template name="getTitle">
3400
- <xsl:with-param name="name" select="'title-modified'"/>
3401
- </xsl:call-template>
3857
+
3858
+
3859
+ <xsl:call-template name="getTitle">
3860
+ <xsl:with-param name="name" select="'title-modified'"/>
3861
+ </xsl:call-template>
3862
+
3402
3863
  </xsl:variable>
3864
+
3403
3865
  <xsl:choose>
3404
3866
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3405
3867
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3558,7 +4020,8 @@
3558
4020
  </fo:inline>
3559
4021
  </xsl:if>
3560
4022
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3561
- <fo:block-container id="{@id}">
4023
+ <fo:block-container id="{@id}">
4024
+
3562
4025
  <fo:block>
3563
4026
  <xsl:apply-templates/>
3564
4027
  </fo:block>
@@ -3609,7 +4072,7 @@
3609
4072
  <xsl:apply-templates mode="bookmarks"/>
3610
4073
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3611
4074
  <xsl:apply-templates select="."/>
3612
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4075
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3613
4076
  <xsl:apply-templates mode="bookmarks"/>
3614
4077
  </xsl:template><xsl:template name="addBookmarks">
3615
4078
  <xsl:param name="contents"/>
@@ -3625,6 +4088,8 @@
3625
4088
  <xsl:variable name="bookmark-title_">
3626
4089
  <xsl:call-template name="getLangVersion">
3627
4090
  <xsl:with-param name="lang" select="@lang"/>
4091
+ <xsl:with-param name="doctype" select="@doctype"/>
4092
+ <xsl:with-param name="title" select="@title-part"/>
3628
4093
  </xsl:call-template>
3629
4094
  </xsl:variable>
3630
4095
  <xsl:choose>
@@ -3642,13 +4107,34 @@
3642
4107
  </xsl:choose>
3643
4108
  </fo:bookmark-title>
3644
4109
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4110
+
4111
+ <xsl:call-template name="insertFigureBookmarks">
4112
+ <xsl:with-param name="contents" select="contents"/>
4113
+ </xsl:call-template>
4114
+
4115
+ <xsl:call-template name="insertTableBookmarks">
4116
+ <xsl:with-param name="contents" select="contents"/>
4117
+ <xsl:with-param name="lang" select="@lang"/>
4118
+ </xsl:call-template>
4119
+
3645
4120
  </fo:bookmark>
3646
4121
 
3647
4122
  </xsl:for-each>
3648
4123
  </xsl:when>
3649
4124
  <xsl:otherwise>
3650
4125
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4126
+
3651
4127
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4128
+
4129
+ <xsl:call-template name="insertFigureBookmarks">
4130
+ <xsl:with-param name="contents" select="contents"/>
4131
+ </xsl:call-template>
4132
+
4133
+ <xsl:call-template name="insertTableBookmarks">
4134
+ <xsl:with-param name="contents" select="contents"/>
4135
+ <xsl:with-param name="lang" select="@lang"/>
4136
+ </xsl:call-template>
4137
+
3652
4138
  </xsl:for-each>
3653
4139
  </xsl:otherwise>
3654
4140
  </xsl:choose>
@@ -3667,8 +4153,44 @@
3667
4153
 
3668
4154
  </fo:bookmark-tree>
3669
4155
  </xsl:if>
4156
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4157
+ <xsl:param name="contents"/>
4158
+ <xsl:if test="xalan:nodeset($contents)/figure">
4159
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4160
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4161
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4162
+ <fo:bookmark internal-destination="{@id}">
4163
+ <fo:bookmark-title>
4164
+ <xsl:value-of select="normalize-space(title)"/>
4165
+ </fo:bookmark-title>
4166
+ </fo:bookmark>
4167
+ </xsl:for-each>
4168
+ </fo:bookmark>
4169
+ </xsl:if>
4170
+ </xsl:template><xsl:template name="insertTableBookmarks">
4171
+ <xsl:param name="contents"/>
4172
+ <xsl:param name="lang"/>
4173
+ <xsl:if test="xalan:nodeset($contents)/table">
4174
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4175
+ <fo:bookmark-title>
4176
+ <xsl:choose>
4177
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4178
+ <xsl:otherwise>Tables</xsl:otherwise>
4179
+ </xsl:choose>
4180
+ </fo:bookmark-title>
4181
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4182
+ <fo:bookmark internal-destination="{@id}">
4183
+ <fo:bookmark-title>
4184
+ <xsl:value-of select="normalize-space(title)"/>
4185
+ </fo:bookmark-title>
4186
+ </fo:bookmark>
4187
+ </xsl:for-each>
4188
+ </fo:bookmark>
4189
+ </xsl:if>
3670
4190
  </xsl:template><xsl:template name="getLangVersion">
3671
4191
  <xsl:param name="lang"/>
4192
+ <xsl:param name="doctype" select="''"/>
4193
+ <xsl:param name="title" select="''"/>
3672
4194
  <xsl:choose>
3673
4195
  <xsl:when test="$lang = 'en'">
3674
4196
 
@@ -4151,7 +4673,8 @@
4151
4673
  <fo:block-container margin-left="0mm">
4152
4674
 
4153
4675
  <fo:block xsl:use-attribute-sets="quote-style">
4154
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4676
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4677
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4155
4678
  </fo:block>
4156
4679
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4157
4680
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4278,9 +4801,12 @@
4278
4801
  </fo:block>
4279
4802
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4280
4803
  <xsl:variable name="title-deprecated">
4281
- <xsl:call-template name="getTitle">
4282
- <xsl:with-param name="name" select="'title-deprecated'"/>
4283
- </xsl:call-template>
4804
+
4805
+
4806
+ <xsl:call-template name="getTitle">
4807
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4808
+ </xsl:call-template>
4809
+
4284
4810
  </xsl:variable>
4285
4811
  <fo:block xsl:use-attribute-sets="deprecates-style">
4286
4812
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4329,7 +4855,7 @@
4329
4855
  <fo:block id="{@id}">
4330
4856
  <xsl:apply-templates/>
4331
4857
  </fo:block>
4332
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4858
+ </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']">
4333
4859
 
4334
4860
  <fo:block id="{@id}">
4335
4861
  <xsl:apply-templates/>
@@ -4386,7 +4912,8 @@
4386
4912
  <fo:table-column column-width="107mm"/>
4387
4913
  <fo:table-column column-width="15mm"/>
4388
4914
  <fo:table-body>
4389
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4915
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4916
+
4390
4917
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4391
4918
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4392
4919
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4404,6 +4931,10 @@
4404
4931
  <fo:block><xsl:apply-templates/></fo:block>
4405
4932
  </fo:table-cell>
4406
4933
  </xsl:template><xsl:template name="processBibitem">
4934
+
4935
+
4936
+ <!-- end BIPM bibitem processing-->
4937
+
4407
4938
 
4408
4939
 
4409
4940
 
@@ -4462,6 +4993,8 @@
4462
4993
  <xsl:value-of select="translate(.,'. ','')"/>
4463
4994
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4464
4995
  <xsl:value-of select="substring(.,1,1)"/>
4996
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4997
+ <fo:inline><xsl:apply-templates/></fo:inline>
4465
4998
  </xsl:template><xsl:template name="convertDate">
4466
4999
  <xsl:param name="date"/>
4467
5000
  <xsl:param name="format" select="'short'"/>
@@ -4643,13 +5176,22 @@
4643
5176
  </xsl:template><xsl:template name="split">
4644
5177
  <xsl:param name="pText" select="."/>
4645
5178
  <xsl:param name="sep" select="','"/>
5179
+ <xsl:param name="normalize-space" select="'true'"/>
4646
5180
  <xsl:if test="string-length($pText) &gt;0">
4647
5181
  <item>
4648
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5182
+ <xsl:choose>
5183
+ <xsl:when test="$normalize-space = 'true'">
5184
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5185
+ </xsl:when>
5186
+ <xsl:otherwise>
5187
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5188
+ </xsl:otherwise>
5189
+ </xsl:choose>
4649
5190
  </item>
4650
5191
  <xsl:call-template name="split">
4651
5192
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4652
5193
  <xsl:with-param name="sep" select="$sep"/>
5194
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4653
5195
  </xsl:call-template>
4654
5196
  </xsl:if>
4655
5197
  </xsl:template><xsl:template name="getDocumentId">
@@ -4715,4 +5257,28 @@
4715
5257
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4716
5258
  </xsl:call-template>
4717
5259
  </xsl:if>
5260
+ </xsl:template><xsl:template name="repeat">
5261
+ <xsl:param name="char" select="'*'"/>
5262
+ <xsl:param name="count"/>
5263
+ <xsl:if test="$count &gt; 0">
5264
+ <xsl:value-of select="$char"/>
5265
+ <xsl:call-template name="repeat">
5266
+ <xsl:with-param name="char" select="$char"/>
5267
+ <xsl:with-param name="count" select="$count - 1"/>
5268
+ </xsl:call-template>
5269
+ </xsl:if>
5270
+ </xsl:template><xsl:template name="getLocalizedString">
5271
+ <xsl:param name="key"/>
5272
+
5273
+ <xsl:variable name="curr_lang">
5274
+ <xsl:call-template name="getLang"/>
5275
+ </xsl:variable>
5276
+
5277
+ <xsl:choose>
5278
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5279
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5280
+ </xsl:when>
5281
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5282
+ </xsl:choose>
5283
+
4718
5284
  </xsl:template></xsl:stylesheet>