metanorma-itu 1.2.5 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) 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/itu/basicdoc.rng +50 -3
  5. data/lib/asciidoctor/itu/boilerplate.xml +3 -0
  6. data/lib/asciidoctor/itu/front.rb +58 -3
  7. data/lib/asciidoctor/itu/isodoc.rng +36 -43
  8. data/lib/asciidoctor/itu/itu.rng +1 -0
  9. data/lib/asciidoctor/itu/validate.rb +2 -9
  10. data/lib/isodoc/itu/base_convert.rb +1 -6
  11. data/lib/isodoc/itu/html/_coverpage.css +4 -0
  12. data/lib/isodoc/itu/html/header.html +8 -16
  13. data/lib/isodoc/itu/html/html_itu_intro.html +4 -3
  14. data/lib/isodoc/itu/html/html_itu_titlepage.html +22 -13
  15. data/lib/isodoc/itu/html/htmlstyle.css +789 -769
  16. data/lib/isodoc/itu/html/htmlstyle.scss +7 -8
  17. data/lib/isodoc/itu/html/itu.css +43 -43
  18. data/lib/isodoc/itu/html/itu.scss +44 -43
  19. data/lib/isodoc/itu/html/logo-sp.png +0 -0
  20. data/lib/isodoc/itu/html/word_itu_intro.html +13 -3
  21. data/lib/isodoc/itu/html/word_itu_titlepage.html +128 -5
  22. data/lib/isodoc/itu/html/word_itu_titlepage_sp.html +108 -0
  23. data/lib/isodoc/itu/html/wordstyle.css +37 -37
  24. data/lib/isodoc/itu/html/wordstyle.scss +37 -37
  25. data/lib/isodoc/itu/html_convert.rb +7 -2
  26. data/lib/isodoc/itu/i18n-en.yaml +40 -0
  27. data/lib/isodoc/itu/itu.recommendation-annex.xsl +730 -156
  28. data/lib/isodoc/itu/itu.recommendation.xsl +730 -156
  29. data/lib/isodoc/itu/itu.resolution.xsl +730 -156
  30. data/lib/isodoc/itu/itu.technical-paper.xsl +5268 -0
  31. data/lib/isodoc/itu/itu.technical-report.xsl +5268 -0
  32. data/lib/isodoc/itu/metadata.rb +70 -5
  33. data/lib/isodoc/itu/pdf_convert.rb +2 -0
  34. data/lib/isodoc/itu/presentation_xml_convert.rb +64 -4
  35. data/lib/isodoc/itu/ref.rb +0 -13
  36. data/lib/isodoc/itu/terms.rb +7 -30
  37. data/lib/isodoc/itu/word_cleanup.rb +5 -1
  38. data/lib/isodoc/itu/word_convert.rb +15 -1
  39. data/lib/isodoc/itu/xref.rb +2 -2
  40. data/lib/metanorma/itu/processor.rb +10 -8
  41. data/lib/metanorma/itu/version.rb +1 -1
  42. data/metanorma-itu.gemspec +4 -2
  43. metadata +39 -9
  44. data/.github/workflows/macos.yml +0 -38
  45. data/.github/workflows/ubuntu.yml +0 -56
  46. data/.github/workflows/windows.yml +0 -40
@@ -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)"/>
67
- <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum)"/>
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>
436
644
  </xsl:if>
437
- <fo:block>
438
- <xsl:if test="@section">
439
- <xsl:value-of select="@section"/>
440
- </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"/>
658
+ </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
 
@@ -1572,6 +1929,7 @@
1572
1929
 
1573
1930
 
1574
1931
 
1932
+
1575
1933
  </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">
1576
1934
 
1577
1935
 
@@ -1612,6 +1970,7 @@
1612
1970
 
1613
1971
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1614
1972
 
1973
+
1615
1974
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1616
1975
 
1617
1976
 
@@ -1642,6 +2001,7 @@
1642
2001
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1643
2002
 
1644
2003
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2004
+
1645
2005
 
1646
2006
 
1647
2007
 
@@ -1770,7 +2130,9 @@
1770
2130
 
1771
2131
 
1772
2132
 
1773
-
2133
+ <!-- <xsl:if test="$namespace = 'bipm'">
2134
+ <fo:block>&#xA0;</fo:block>
2135
+ </xsl:if> -->
1774
2136
 
1775
2137
  <!-- $namespace = 'iso' or -->
1776
2138
 
@@ -1804,10 +2166,12 @@
1804
2166
 
1805
2167
 
1806
2168
  <xsl:variable name="colwidths">
1807
- <xsl:call-template name="calculate-column-widths">
1808
- <xsl:with-param name="cols-count" select="$cols-count"/>
1809
- <xsl:with-param name="table" select="$simple-table"/>
1810
- </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>
1811
2175
  </xsl:variable>
1812
2176
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1813
2177
 
@@ -1886,16 +2250,25 @@
1886
2250
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1887
2251
  </xsl:if>
1888
2252
 
1889
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1890
- <xsl:choose>
1891
- <xsl:when test=". = 1 or . = 0">
1892
- <fo:table-column column-width="proportional-column-width(2)"/>
1893
- </xsl:when>
1894
- <xsl:otherwise>
1895
- <fo:table-column column-width="proportional-column-width({.})"/>
1896
- </xsl:otherwise>
1897
- </xsl:choose>
1898
- </xsl:for-each>
2253
+ <xsl:choose>
2254
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2255
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2256
+ <fo:table-column column-width="{@width}"/>
2257
+ </xsl:for-each>
2258
+ </xsl:when>
2259
+ <xsl:otherwise>
2260
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2261
+ <xsl:choose>
2262
+ <xsl:when test=". = 1 or . = 0">
2263
+ <fo:table-column column-width="proportional-column-width(2)"/>
2264
+ </xsl:when>
2265
+ <xsl:otherwise>
2266
+ <fo:table-column column-width="proportional-column-width({.})"/>
2267
+ </xsl:otherwise>
2268
+ </xsl:choose>
2269
+ </xsl:for-each>
2270
+ </xsl:otherwise>
2271
+ </xsl:choose>
1899
2272
 
1900
2273
  <xsl:choose>
1901
2274
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1908,10 +2281,12 @@
1908
2281
 
1909
2282
  </fo:table>
1910
2283
 
2284
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1911
2285
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1912
2286
  <xsl:call-template name="insertTableFooterInSeparateTable">
1913
2287
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1914
2288
  <xsl:with-param name="colwidths" select="$colwidths"/>
2289
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1915
2290
  </xsl:call-template>
1916
2291
  </xsl:for-each>
1917
2292
 
@@ -1944,6 +2319,7 @@
1944
2319
  <xsl:if test="normalize-space() != ''">
1945
2320
  <fo:block xsl:use-attribute-sets="table-name-style">
1946
2321
 
2322
+
1947
2323
  <xsl:apply-templates/>
1948
2324
  </fo:block>
1949
2325
  </xsl:if>
@@ -2130,12 +2506,26 @@
2130
2506
 
2131
2507
 
2132
2508
 
2133
- <!-- except gb and bipm -->
2134
2509
 
2135
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2136
2510
 
2137
2511
 
2512
+ <!-- except gb -->
2138
2513
 
2514
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2515
+
2516
+
2517
+ <!-- show Note under table in preface (ex. abstract) sections -->
2518
+ <!-- empty, because notes show at page side in main sections -->
2519
+ <!-- <xsl:if test="$namespace = 'bipm'">
2520
+ <xsl:choose>
2521
+ <xsl:when test="ancestor::*[local-name()='preface']">
2522
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2523
+ </xsl:when>
2524
+ <xsl:otherwise>
2525
+ <fo:block/>
2526
+ </xsl:otherwise>
2527
+ </xsl:choose>
2528
+ </xsl:if> -->
2139
2529
 
2140
2530
 
2141
2531
  <!-- horizontal row separator -->
@@ -2154,12 +2544,22 @@
2154
2544
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2155
2545
  <xsl:param name="table_attributes"/>
2156
2546
  <xsl:param name="colwidths"/>
2547
+ <xsl:param name="colgroup"/>
2157
2548
 
2158
2549
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2159
2550
 
2160
2551
  <xsl:if test="$isNoteOrFnExist = 'true'">
2161
2552
 
2162
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2553
+ <xsl:variable name="cols-count">
2554
+ <xsl:choose>
2555
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2556
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2557
+ </xsl:when>
2558
+ <xsl:otherwise>
2559
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2560
+ </xsl:otherwise>
2561
+ </xsl:choose>
2562
+ </xsl:variable>
2163
2563
 
2164
2564
  <fo:table keep-with-previous="always">
2165
2565
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -2177,16 +2577,25 @@
2177
2577
  </xsl:choose>
2178
2578
  </xsl:for-each>
2179
2579
 
2180
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2181
- <xsl:choose>
2182
- <xsl:when test=". = 1 or . = 0">
2183
- <fo:table-column column-width="proportional-column-width(2)"/>
2184
- </xsl:when>
2185
- <xsl:otherwise>
2186
- <fo:table-column column-width="proportional-column-width({.})"/>
2187
- </xsl:otherwise>
2188
- </xsl:choose>
2189
- </xsl:for-each>
2580
+ <xsl:choose>
2581
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2582
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2583
+ <fo:table-column column-width="{@width}"/>
2584
+ </xsl:for-each>
2585
+ </xsl:when>
2586
+ <xsl:otherwise>
2587
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2588
+ <xsl:choose>
2589
+ <xsl:when test=". = 1 or . = 0">
2590
+ <fo:table-column column-width="proportional-column-width(2)"/>
2591
+ </xsl:when>
2592
+ <xsl:otherwise>
2593
+ <fo:table-column column-width="proportional-column-width({.})"/>
2594
+ </xsl:otherwise>
2595
+ </xsl:choose>
2596
+ </xsl:for-each>
2597
+ </xsl:otherwise>
2598
+ </xsl:choose>
2190
2599
 
2191
2600
  <fo:table-body>
2192
2601
  <fo:table-row>
@@ -2202,7 +2611,11 @@
2202
2611
 
2203
2612
 
2204
2613
 
2205
- <!-- except gb and bipm -->
2614
+
2615
+
2616
+
2617
+
2618
+ <!-- except gb -->
2206
2619
 
2207
2620
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2208
2621
 
@@ -2288,6 +2701,10 @@
2288
2701
 
2289
2702
 
2290
2703
 
2704
+ <!-- <xsl:if test="$namespace = 'bipm'">
2705
+ <xsl:attribute name="height">8mm</xsl:attribute>
2706
+ </xsl:if> -->
2707
+
2291
2708
  <xsl:apply-templates/>
2292
2709
  </fo:table-row>
2293
2710
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -2378,7 +2795,8 @@
2378
2795
  </xsl:attribute>
2379
2796
  </xsl:if>
2380
2797
  <xsl:call-template name="display-align"/>
2381
- <fo:block>
2798
+ <fo:block>
2799
+
2382
2800
  <xsl:apply-templates/>
2383
2801
  </fo:block>
2384
2802
  </fo:table-cell>
@@ -2609,7 +3027,13 @@
2609
3027
  <xsl:apply-templates/>
2610
3028
  </fo:inline>
2611
3029
  </xsl:template><xsl:template match="*[local-name()='dl']">
2612
- <fo:block-container margin-left="0mm">
3030
+ <fo:block-container>
3031
+
3032
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3033
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3034
+ </xsl:if>
3035
+
3036
+
2613
3037
  <xsl:if test="parent::*[local-name() = 'note']">
2614
3038
  <xsl:attribute name="margin-left">
2615
3039
  <xsl:choose>
@@ -2619,8 +3043,12 @@
2619
3043
  </xsl:attribute>
2620
3044
 
2621
3045
  </xsl:if>
2622
- <fo:block-container margin-left="0mm">
2623
-
3046
+ <fo:block-container>
3047
+
3048
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3049
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3050
+
3051
+
2624
3052
  <xsl:variable name="parent" select="local-name(..)"/>
2625
3053
 
2626
3054
  <xsl:variable name="key_iso">
@@ -2634,9 +3062,12 @@
2634
3062
  <fo:block margin-bottom="12pt" text-align="left">
2635
3063
 
2636
3064
  <xsl:variable name="title-where">
2637
- <xsl:call-template name="getTitle">
2638
- <xsl:with-param name="name" select="'title-where'"/>
2639
- </xsl:call-template>
3065
+
3066
+
3067
+ <xsl:call-template name="getTitle">
3068
+ <xsl:with-param name="name" select="'title-where'"/>
3069
+ </xsl:call-template>
3070
+
2640
3071
  </xsl:variable>
2641
3072
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2642
3073
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2654,9 +3085,12 @@
2654
3085
 
2655
3086
 
2656
3087
  <xsl:variable name="title-where">
2657
- <xsl:call-template name="getTitle">
2658
- <xsl:with-param name="name" select="'title-where'"/>
2659
- </xsl:call-template>
3088
+
3089
+
3090
+ <xsl:call-template name="getTitle">
3091
+ <xsl:with-param name="name" select="'title-where'"/>
3092
+ </xsl:call-template>
3093
+
2660
3094
  </xsl:variable>
2661
3095
  <xsl:value-of select="$title-where"/>:
2662
3096
  </fo:block>
@@ -2667,9 +3101,12 @@
2667
3101
 
2668
3102
 
2669
3103
  <xsl:variable name="title-key">
2670
- <xsl:call-template name="getTitle">
2671
- <xsl:with-param name="name" select="'title-key'"/>
2672
- </xsl:call-template>
3104
+
3105
+
3106
+ <xsl:call-template name="getTitle">
3107
+ <xsl:with-param name="name" select="'title-key'"/>
3108
+ </xsl:call-template>
3109
+
2673
3110
  </xsl:variable>
2674
3111
  <xsl:value-of select="$title-key"/>
2675
3112
  </fo:block>
@@ -2802,12 +3239,32 @@
2802
3239
  </xsl:otherwise>
2803
3240
  </xsl:choose>
2804
3241
  </xsl:template><xsl:template name="getMaxLength_dt">
2805
- <xsl:for-each select="*[local-name()='dt']">
2806
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2807
- <xsl:if test="position() = 1">
2808
- <xsl:value-of select="string-length(normalize-space(.))"/>
2809
- </xsl:if>
2810
- </xsl:for-each>
3242
+ <xsl:variable name="lengths">
3243
+ <xsl:for-each select="*[local-name()='dt']">
3244
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3245
+ <xsl:variable name="attributes">
3246
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3247
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3248
+ </xsl:variable>
3249
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3250
+ </xsl:for-each>
3251
+ </xsl:variable>
3252
+ <xsl:variable name="maxLength">
3253
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3254
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3255
+ <xsl:if test="position() = 1">
3256
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3257
+ </xsl:if>
3258
+ </xsl:for-each> -->
3259
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3260
+ <xsl:sort select="." data-type="number" order="descending"/>
3261
+ <xsl:if test="position() = 1">
3262
+ <xsl:value-of select="."/>
3263
+ </xsl:if>
3264
+ </xsl:for-each>
3265
+ </xsl:variable>
3266
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3267
+ <xsl:value-of select="$maxLength"/>
2811
3268
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2812
3269
  <xsl:param name="key_iso"/>
2813
3270
 
@@ -2929,6 +3386,7 @@
2929
3386
  </fo:inline>
2930
3387
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2931
3388
  <fo:inline font-weight="bold">
3389
+
2932
3390
  <xsl:apply-templates/>
2933
3391
  </fo:inline>
2934
3392
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3257,7 +3715,18 @@
3257
3715
  <xsl:with-param name="previousRow" select="$newRow"/>
3258
3716
  </xsl:apply-templates>
3259
3717
  </xsl:template><xsl:template name="getLang">
3260
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3718
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3719
+ <xsl:variable name="language">
3720
+ <xsl:choose>
3721
+ <xsl:when test="$language_current != ''">
3722
+ <xsl:value-of select="$language_current"/>
3723
+ </xsl:when>
3724
+ <xsl:otherwise>
3725
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3726
+ </xsl:otherwise>
3727
+ </xsl:choose>
3728
+ </xsl:variable>
3729
+
3261
3730
  <xsl:choose>
3262
3731
  <xsl:when test="$language = 'English'">en</xsl:when>
3263
3732
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3292,6 +3761,7 @@
3292
3761
  <xsl:value-of select="substring($str, 2)"/>
3293
3762
  </xsl:template><xsl:template match="mathml:math">
3294
3763
  <fo:inline font-family="STIX Two Math"> <!-- -->
3764
+
3295
3765
  <xsl:variable name="mathml">
3296
3766
  <xsl:apply-templates select="." mode="mathml"/>
3297
3767
  </xsl:variable>
@@ -3321,6 +3791,7 @@
3321
3791
  </xsl:choose>
3322
3792
  </xsl:variable>
3323
3793
  <fo:inline xsl:use-attribute-sets="link-style">
3794
+
3324
3795
  <xsl:choose>
3325
3796
  <xsl:when test="$target = ''">
3326
3797
  <xsl:apply-templates/>
@@ -3374,10 +3845,14 @@
3374
3845
  </fo:inline>
3375
3846
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3376
3847
  <xsl:variable name="title-modified">
3377
- <xsl:call-template name="getTitle">
3378
- <xsl:with-param name="name" select="'title-modified'"/>
3379
- </xsl:call-template>
3848
+
3849
+
3850
+ <xsl:call-template name="getTitle">
3851
+ <xsl:with-param name="name" select="'title-modified'"/>
3852
+ </xsl:call-template>
3853
+
3380
3854
  </xsl:variable>
3855
+
3381
3856
  <xsl:choose>
3382
3857
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3383
3858
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3442,6 +3917,8 @@
3442
3917
 
3443
3918
 
3444
3919
 
3920
+
3921
+
3445
3922
  <fo:inline xsl:use-attribute-sets="note-name-style">
3446
3923
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3447
3924
  </fo:inline>
@@ -3534,7 +4011,8 @@
3534
4011
  </fo:inline>
3535
4012
  </xsl:if>
3536
4013
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3537
- <fo:block-container id="{@id}">
4014
+ <fo:block-container id="{@id}">
4015
+
3538
4016
  <fo:block>
3539
4017
  <xsl:apply-templates/>
3540
4018
  </fo:block>
@@ -3585,7 +4063,7 @@
3585
4063
  <xsl:apply-templates mode="bookmarks"/>
3586
4064
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3587
4065
  <xsl:apply-templates select="."/>
3588
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4066
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3589
4067
  <xsl:apply-templates mode="bookmarks"/>
3590
4068
  </xsl:template><xsl:template name="addBookmarks">
3591
4069
  <xsl:param name="contents"/>
@@ -3601,6 +4079,8 @@
3601
4079
  <xsl:variable name="bookmark-title_">
3602
4080
  <xsl:call-template name="getLangVersion">
3603
4081
  <xsl:with-param name="lang" select="@lang"/>
4082
+ <xsl:with-param name="doctype" select="@doctype"/>
4083
+ <xsl:with-param name="title" select="@title-part"/>
3604
4084
  </xsl:call-template>
3605
4085
  </xsl:variable>
3606
4086
  <xsl:choose>
@@ -3618,13 +4098,34 @@
3618
4098
  </xsl:choose>
3619
4099
  </fo:bookmark-title>
3620
4100
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4101
+
4102
+ <xsl:call-template name="insertFigureBookmarks">
4103
+ <xsl:with-param name="contents" select="contents"/>
4104
+ </xsl:call-template>
4105
+
4106
+ <xsl:call-template name="insertTableBookmarks">
4107
+ <xsl:with-param name="contents" select="contents"/>
4108
+ <xsl:with-param name="lang" select="@lang"/>
4109
+ </xsl:call-template>
4110
+
3621
4111
  </fo:bookmark>
3622
4112
 
3623
4113
  </xsl:for-each>
3624
4114
  </xsl:when>
3625
4115
  <xsl:otherwise>
3626
4116
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4117
+
3627
4118
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4119
+
4120
+ <xsl:call-template name="insertFigureBookmarks">
4121
+ <xsl:with-param name="contents" select="contents"/>
4122
+ </xsl:call-template>
4123
+
4124
+ <xsl:call-template name="insertTableBookmarks">
4125
+ <xsl:with-param name="contents" select="contents"/>
4126
+ <xsl:with-param name="lang" select="@lang"/>
4127
+ </xsl:call-template>
4128
+
3628
4129
  </xsl:for-each>
3629
4130
  </xsl:otherwise>
3630
4131
  </xsl:choose>
@@ -3643,8 +4144,44 @@
3643
4144
 
3644
4145
  </fo:bookmark-tree>
3645
4146
  </xsl:if>
4147
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4148
+ <xsl:param name="contents"/>
4149
+ <xsl:if test="xalan:nodeset($contents)/figure">
4150
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4151
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4152
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4153
+ <fo:bookmark internal-destination="{@id}">
4154
+ <fo:bookmark-title>
4155
+ <xsl:value-of select="normalize-space(title)"/>
4156
+ </fo:bookmark-title>
4157
+ </fo:bookmark>
4158
+ </xsl:for-each>
4159
+ </fo:bookmark>
4160
+ </xsl:if>
4161
+ </xsl:template><xsl:template name="insertTableBookmarks">
4162
+ <xsl:param name="contents"/>
4163
+ <xsl:param name="lang"/>
4164
+ <xsl:if test="xalan:nodeset($contents)/table">
4165
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4166
+ <fo:bookmark-title>
4167
+ <xsl:choose>
4168
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4169
+ <xsl:otherwise>Tables</xsl:otherwise>
4170
+ </xsl:choose>
4171
+ </fo:bookmark-title>
4172
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4173
+ <fo:bookmark internal-destination="{@id}">
4174
+ <fo:bookmark-title>
4175
+ <xsl:value-of select="normalize-space(title)"/>
4176
+ </fo:bookmark-title>
4177
+ </fo:bookmark>
4178
+ </xsl:for-each>
4179
+ </fo:bookmark>
4180
+ </xsl:if>
3646
4181
  </xsl:template><xsl:template name="getLangVersion">
3647
4182
  <xsl:param name="lang"/>
4183
+ <xsl:param name="doctype" select="''"/>
4184
+ <xsl:param name="title" select="''"/>
3648
4185
  <xsl:choose>
3649
4186
  <xsl:when test="$lang = 'en'">
3650
4187
 
@@ -4127,7 +4664,8 @@
4127
4664
  <fo:block-container margin-left="0mm">
4128
4665
 
4129
4666
  <fo:block xsl:use-attribute-sets="quote-style">
4130
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4667
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4668
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4131
4669
  </fo:block>
4132
4670
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4133
4671
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4254,9 +4792,12 @@
4254
4792
  </fo:block>
4255
4793
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4256
4794
  <xsl:variable name="title-deprecated">
4257
- <xsl:call-template name="getTitle">
4258
- <xsl:with-param name="name" select="'title-deprecated'"/>
4259
- </xsl:call-template>
4795
+
4796
+
4797
+ <xsl:call-template name="getTitle">
4798
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4799
+ </xsl:call-template>
4800
+
4260
4801
  </xsl:variable>
4261
4802
  <fo:block xsl:use-attribute-sets="deprecates-style">
4262
4803
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4305,7 +4846,7 @@
4305
4846
  <fo:block id="{@id}">
4306
4847
  <xsl:apply-templates/>
4307
4848
  </fo:block>
4308
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4849
+ </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']">
4309
4850
 
4310
4851
  <fo:block id="{@id}">
4311
4852
  <xsl:apply-templates/>
@@ -4362,7 +4903,8 @@
4362
4903
  <fo:table-column column-width="107mm"/>
4363
4904
  <fo:table-column column-width="15mm"/>
4364
4905
  <fo:table-body>
4365
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4906
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4907
+
4366
4908
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4367
4909
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4368
4910
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4380,6 +4922,10 @@
4380
4922
  <fo:block><xsl:apply-templates/></fo:block>
4381
4923
  </fo:table-cell>
4382
4924
  </xsl:template><xsl:template name="processBibitem">
4925
+
4926
+
4927
+ <!-- end BIPM bibitem processing-->
4928
+
4383
4929
 
4384
4930
 
4385
4931
 
@@ -4619,13 +5165,22 @@
4619
5165
  </xsl:template><xsl:template name="split">
4620
5166
  <xsl:param name="pText" select="."/>
4621
5167
  <xsl:param name="sep" select="','"/>
5168
+ <xsl:param name="normalize-space" select="'true'"/>
4622
5169
  <xsl:if test="string-length($pText) &gt;0">
4623
5170
  <item>
4624
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5171
+ <xsl:choose>
5172
+ <xsl:when test="$normalize-space = 'true'">
5173
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5174
+ </xsl:when>
5175
+ <xsl:otherwise>
5176
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5177
+ </xsl:otherwise>
5178
+ </xsl:choose>
4625
5179
  </item>
4626
5180
  <xsl:call-template name="split">
4627
5181
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4628
5182
  <xsl:with-param name="sep" select="$sep"/>
5183
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4629
5184
  </xsl:call-template>
4630
5185
  </xsl:if>
4631
5186
  </xsl:template><xsl:template name="getDocumentId">
@@ -4691,4 +5246,23 @@
4691
5246
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4692
5247
  </xsl:call-template>
4693
5248
  </xsl:if>
5249
+ </xsl:template><xsl:template name="repeat">
5250
+ <xsl:param name="char" select="'*'"/>
5251
+ <xsl:param name="count"/>
5252
+ <xsl:if test="$count &gt; 0">
5253
+ <xsl:value-of select="$char"/>
5254
+ <xsl:call-template name="repeat">
5255
+ <xsl:with-param name="char" select="$char"/>
5256
+ <xsl:with-param name="count" select="$count - 1"/>
5257
+ </xsl:call-template>
5258
+ </xsl:if>
5259
+ </xsl:template><xsl:template name="getLocalizedString">
5260
+ <xsl:param name="key"/>
5261
+
5262
+ <xsl:variable name="curr_lang">
5263
+ <xsl:call-template name="getLang"/>
5264
+ </xsl:variable>
5265
+
5266
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5267
+
4694
5268
  </xsl:template></xsl:stylesheet>