metanorma-itu 1.2.4 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +62 -0
  3. data/README.adoc +3 -4
  4. data/lib/asciidoctor/itu/basicdoc.rng +32 -0
  5. data/lib/asciidoctor/itu/boilerplate.xml +3 -0
  6. data/lib/asciidoctor/itu/converter.rb +3 -2
  7. data/lib/asciidoctor/itu/front.rb +74 -15
  8. data/lib/asciidoctor/itu/isodoc.rng +29 -44
  9. data/lib/asciidoctor/itu/itu.rng +61 -0
  10. data/lib/asciidoctor/itu/validate.rb +2 -9
  11. data/lib/isodoc/itu/base_convert.rb +1 -6
  12. data/lib/isodoc/itu/html/_coverpage.css +8 -1
  13. data/lib/isodoc/itu/html/_coverpage.scss +4 -0
  14. data/lib/isodoc/itu/html/header.html +8 -16
  15. data/lib/isodoc/itu/html/html_itu_intro.html +4 -3
  16. data/lib/isodoc/itu/html/html_itu_titlepage.html +30 -13
  17. data/lib/isodoc/itu/html/htmlstyle.css +782 -759
  18. data/lib/isodoc/itu/html/htmlstyle.scss +7 -8
  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 +29 -3
  23. data/lib/isodoc/itu/html/word_itu_titlepage.html +143 -4
  24. data/lib/isodoc/itu/html/word_itu_titlepage_sp.html +108 -0
  25. data/lib/isodoc/itu/html/wordstyle.css +37 -37
  26. data/lib/isodoc/itu/html/wordstyle.scss +37 -37
  27. data/lib/isodoc/itu/html_convert.rb +7 -2
  28. data/lib/isodoc/itu/i18n-en.yaml +42 -0
  29. data/lib/isodoc/itu/itu.recommendation-annex.xsl +921 -180
  30. data/lib/isodoc/itu/itu.recommendation.xsl +921 -180
  31. data/lib/isodoc/itu/itu.resolution.xsl +921 -180
  32. data/lib/isodoc/itu/itu.technical-paper.xsl +5184 -0
  33. data/lib/isodoc/itu/itu.technical-report.xsl +5184 -0
  34. data/lib/isodoc/itu/metadata.rb +79 -4
  35. data/lib/isodoc/itu/pdf_convert.rb +2 -0
  36. data/lib/isodoc/itu/presentation_xml_convert.rb +68 -0
  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 +2 -2
  42. data/lib/metanorma/itu/fonts_manifest.yaml +4 -0
  43. data/lib/metanorma/itu/processor.rb +0 -8
  44. data/lib/metanorma/itu/version.rb +1 -1
  45. data/metanorma-itu.gemspec +3 -1
  46. metadata +38 -7
  47. data/.github/workflows/macos.yml +0 -38
  48. data/.github/workflows/ubuntu.yml +0 -56
  49. 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,10 +75,39 @@
63
75
  <xsl:call-template name="getLang"/>
64
76
  </xsl:variable>
65
77
 
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])"/>
95
+
66
96
  <xsl:template match="/">
67
97
  <xsl:call-template name="namespaceCheck"/>
68
- <fo:root font-family="Times New Roman, STIX2Math" font-size="12pt" xml:lang="{$lang}">
98
+ <fo:root font-family="Times New Roman, STIX Two Math" font-size="12pt" xml:lang="{$lang}">
69
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
+
70
111
  <!-- cover page -->
71
112
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
72
113
  <fo:region-body margin-top="19.2mm" margin-bottom="5mm" margin-left="19.2mm" margin-right="19.2mm"/>
@@ -128,6 +169,130 @@
128
169
  <xsl:with-param name="contents" select="$contents"/>
129
170
  </xsl:call-template>
130
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
+
131
296
  <!-- cover page -->
132
297
  <fo:page-sequence master-reference="cover-page">
133
298
  <fo:flow flow-name="xsl-region-body">
@@ -169,12 +334,24 @@
169
334
  </fo:table-cell>
170
335
  <fo:table-cell padding-top="2mm" padding-bottom="-1mm">
171
336
  <fo:block font-family="Arial" font-size="36pt" font-weight="bold" margin-top="6pt" letter-spacing="2pt"> <!-- Helvetica for letter-spacing working -->
172
- <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'], ' ')"/>
173
338
  </fo:block>
174
339
  </fo:table-cell>
175
340
  <fo:table-cell padding-top="1mm" number-columns-spanned="2" padding-bottom="-1mm">
176
341
  <fo:block font-size="30pt" font-weight="bold" text-align="right" margin-top="12pt" padding="0mm">
177
- <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>
178
355
  </fo:block>
179
356
  </fo:table-cell>
180
357
  </fo:table-row>
@@ -204,10 +381,31 @@
204
381
  <xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
205
382
  </fo:block>
206
383
  </xsl:if>
384
+ <xsl:if test="$isAmendment != ''">
385
+ <fo:block font-size="18pt" font-weight="bold">
386
+ <xsl:value-of select="$isAmendment"/>
387
+ </fo:block>
388
+ </xsl:if>
389
+ <xsl:if test="$isCorrigendum != ''">
390
+ <fo:block font-size="18pt" font-weight="bold">
391
+ <xsl:value-of select="$isCorrigendum"/>
392
+ </fo:block>
393
+ </xsl:if>
207
394
  <fo:block font-size="14pt">
208
- <xsl:call-template name="formatDate">
209
- <xsl:with-param name="date" select="/itu:itu-standard/itu:bibdata/itu:date[@type = 'published']/itu:on"/>
210
- </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>
211
409
  </fo:block>
212
410
  </fo:table-cell>
213
411
  </fo:table-row>
@@ -244,9 +442,18 @@
244
442
  </fo:table-cell>
245
443
  <fo:table-cell font-size="18pt" number-columns-spanned="3">
246
444
  <fo:block padding-right="2mm" margin-top="6pt">
247
- <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en'])">
445
+ <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
248
446
  <xsl:attribute name="font-weight">bold</xsl:attribute>
249
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>
250
457
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
251
458
  </fo:block>
252
459
  <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
@@ -254,6 +461,24 @@
254
461
  <xsl:value-of select="."/>
255
462
  </fo:block>
256
463
  </xsl:for-each>
464
+ <xsl:if test="$isAmendment != ''">
465
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
466
+ <xsl:value-of select="$isAmendment"/>
467
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']">
468
+ <xsl:text>: </xsl:text>
469
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']"/>
470
+ </xsl:if>
471
+ </fo:block>
472
+ </xsl:if>
473
+ <xsl:if test="$isCorrigendum != ''">
474
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
475
+ <xsl:value-of select="$isCorrigendum"/>
476
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']">
477
+ <xsl:text>: </xsl:text>
478
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']"/>
479
+ </xsl:if>
480
+ </fo:block>
481
+ </xsl:if>
257
482
  </fo:table-cell>
258
483
  </fo:table-row>
259
484
  <fo:table-row height="40mm">
@@ -280,13 +505,37 @@
280
505
  </fo:table-cell>
281
506
  <fo:table-cell number-columns-spanned="3">
282
507
  <fo:block font-size="16pt" margin-top="3pt">
283
- <xsl:value-of select="$doctype"/>
284
- <xsl:text>  </xsl:text>
285
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
286
- <xsl:text>-</xsl:text>
287
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
288
- <xsl:text>  </xsl:text>
289
- <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
+
290
539
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
291
540
  <xsl:variable name="title-annex">
292
541
  <xsl:call-template name="getTitle">
@@ -310,7 +559,7 @@
310
559
  <fo:flow flow-name="xsl-region-body">
311
560
  <fo:block-container font-size="14pt" font-weight="bold">
312
561
  <fo:block>
313
- <xsl:value-of select="$doctype"/>
562
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
314
563
  <xsl:text> </xsl:text>
315
564
  <xsl:value-of select="$docname"/>
316
565
  </fo:block>
@@ -372,58 +621,117 @@
372
621
  <fo:block margin-top="6pt" text-align="center" font-weight="bold"><xsl:value-of select="$title-toc"/></fo:block>
373
622
  <fo:block margin-top="6pt" text-align="right" font-weight="bold"><xsl:value-of select="$title-page"/></fo:block>
374
623
 
375
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
376
- <fo:block>
377
- <xsl:if test="@level = 1">
378
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
379
- </xsl:if>
380
- <xsl:if test="@level = 2">
381
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
382
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
383
- </xsl:if>
384
- <fo:list-block provisional-label-separation="3mm">
385
- <xsl:attribute name="provisional-distance-between-starts">
386
- <xsl:choose>
387
- <xsl:when test="@section != ''">
388
- <xsl:if test="@level = 1">
389
- <xsl:choose>
390
- <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
391
- <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
392
- <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
393
- <xsl:otherwise>12mm</xsl:otherwise>
394
- </xsl:choose>
395
- </xsl:if>
396
- <xsl:if test="@level = 2">26mm</xsl:if>
397
- </xsl:when> <!-- -->
398
- <xsl:otherwise>0mm</xsl:otherwise>
399
- </xsl:choose>
400
- </xsl:attribute>
401
- <fo:list-item>
402
- <fo:list-item-label end-indent="label-end()">
403
- <xsl:if test="@level =2">
404
- <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"/>
405
658
  </xsl:if>
406
- <fo:block>
407
- <xsl:if test="@section">
408
- <xsl:value-of select="@section"/>
409
- </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>
410
670
  </fo:block>
411
- </fo:list-item-label>
412
- <fo:list-item-body start-indent="body-start()">
413
- <fo:block text-align-last="justify">
414
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
415
- <xsl:apply-templates select="title"/>
416
- <fo:inline keep-together.within-line="always">
417
- <fo:leader leader-pattern="dots"/>
418
- <fo:page-number-citation ref-id="{@id}"/>
419
- </fo:inline>
420
- </fo:basic-link>
421
- </fo:block>
422
- </fo:list-item-body>
423
- </fo:list-item>
424
- </fo:list-block>
425
- </fo:block>
426
- </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
+
427
735
  </fo:block-container>
428
736
  </xsl:if>
429
737
 
@@ -444,30 +752,40 @@
444
752
 
445
753
  <fo:block-container font-size="14pt" font-weight="bold">
446
754
  <fo:block>
447
- <xsl:value-of select="$doctype"/>
755
+ <xsl:value-of select="$doctypeCapitalizedTitle"/>
448
756
  <xsl:text> </xsl:text>
449
757
  <xsl:value-of select="$docname"/>
450
758
  </fo:block>
451
759
  <fo:block text-align="center" margin-top="15pt" margin-bottom="15pt">
452
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
+
453
768
  </fo:block>
769
+
770
+
771
+
454
772
  </fo:block-container>
455
773
 
456
774
 
457
775
  <!-- Clause(s) -->
458
776
  <fo:block>
459
777
  <!-- Scope -->
460
- <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' -->
461
779
 
462
780
  <!-- Normative references -->
463
- <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' -->
464
782
 
465
- <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' -->
466
784
 
467
785
  <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
468
786
 
469
787
  <!-- Bibliography -->
470
- <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' -->
471
789
  </fo:block>
472
790
 
473
791
  </fo:flow>
@@ -573,13 +891,13 @@
573
891
  <!-- for Ordered Lists -->
574
892
  <xsl:choose>
575
893
  <xsl:when test="../@type = 'arabic'">
576
- <xsl:number format="a)"/>
894
+ <xsl:number format="a)" lang="en"/>
577
895
  </xsl:when>
578
896
  <xsl:when test="../@class = 'steps'">
579
897
  <xsl:number format="1)"/>
580
898
  </xsl:when>
581
899
  <xsl:when test="$level = 1">
582
- <xsl:number format="a)"/>
900
+ <xsl:number format="a)" lang="en"/>
583
901
  </xsl:when>
584
902
  <xsl:when test="$level = 2">
585
903
  <xsl:number format="i)"/>
@@ -740,7 +1058,7 @@
740
1058
 
741
1059
 
742
1060
  <xsl:template match="itu:clause[@id='draft-warning']/itu:title" mode="caution">
743
- <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">
744
1062
  <xsl:apply-templates/>
745
1063
  </fo:block>
746
1064
  </xsl:template>
@@ -867,24 +1185,38 @@
867
1185
  <xsl:apply-templates/>
868
1186
  </fo:inline>
869
1187
  <xsl:if test="../itu:termsource/itu:origin">
1188
+ <xsl:text>: </xsl:text>
870
1189
  <xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
871
- <xsl:choose>
872
- <xsl:when test="contains($citeas, '[')">
873
- <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
874
- </xsl:when>
875
- <xsl:otherwise>
876
- <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
877
- </xsl:otherwise>
878
- </xsl:choose>
879
- </xsl:if>
880
- <xsl:text>: </xsl:text>
881
- <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>
882
1211
  </fo:block>
883
1212
  <!-- <xsl:if test="following-sibling::itu:table">
884
1213
  <fo:block space-after="18pt">&#xA0;</fo:block>
885
1214
  </xsl:if> -->
886
1215
  </xsl:template>
887
1216
 
1217
+ <xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
1218
+
1219
+
888
1220
  <xsl:template match="itu:definition/itu:p" priority="2"/>
889
1221
  <xsl:template match="itu:definition/itu:formula" priority="2"/>
890
1222
 
@@ -1122,7 +1454,7 @@
1122
1454
  </xsl:template>
1123
1455
 
1124
1456
  <xsl:template match="mathml:math" priority="2">
1125
- <fo:inline font-family="STIX2Math" font-size="11pt">
1457
+ <fo:inline font-family="STIX Two Math" font-size="11pt">
1126
1458
  <xsl:variable name="mathml">
1127
1459
  <xsl:apply-templates select="." mode="mathml"/>
1128
1460
  </xsl:variable>
@@ -1162,7 +1494,17 @@
1162
1494
  </fo:table-cell>
1163
1495
  <fo:table-cell font-weight="bold" text-align="left" padding-bottom="8mm">
1164
1496
  <fo:block>
1165
- <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>
1166
1508
  </fo:block>
1167
1509
  </fo:table-cell>
1168
1510
  </fo:table-row>
@@ -1179,7 +1521,17 @@
1179
1521
  <fo:table-row>
1180
1522
  <fo:table-cell font-weight="bold" text-align="right" padding-bottom="8mm">
1181
1523
  <fo:block>
1182
- <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>
1183
1535
  </fo:block>
1184
1536
  </fo:table-cell>
1185
1537
  <fo:table-cell text-align="right" padding-bottom="8mm" padding-right="2mm">
@@ -1211,6 +1563,33 @@
1211
1563
  </xsl:if>
1212
1564
  </xsl:template>
1213
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
+
1214
1593
 
1215
1594
  <xsl:template name="addLetterSpacing">
1216
1595
  <xsl:param name="text"/>
@@ -1253,7 +1632,12 @@
1253
1632
 
1254
1633
 
1255
1634
  </title-toc>
1256
- <title-toc lang="fr">Sommaire</title-toc>
1635
+ <title-toc lang="fr">
1636
+
1637
+ <xsl:text>Sommaire</xsl:text>
1638
+
1639
+
1640
+ </title-toc>
1257
1641
 
1258
1642
  <title-toc lang="zh">Contents</title-toc>
1259
1643
 
@@ -1273,13 +1657,22 @@
1273
1657
  <title-part lang="en">
1274
1658
 
1275
1659
 
1660
+
1276
1661
  </title-part>
1277
1662
  <title-part lang="fr">
1278
1663
 
1279
1664
 
1665
+
1280
1666
  </title-part>
1281
1667
  <title-part lang="zh">第 # 部分:</title-part>
1282
1668
 
1669
+ <title-subpart lang="en">
1670
+
1671
+ </title-subpart>
1672
+ <title-subpart lang="fr">
1673
+
1674
+ </title-subpart>
1675
+
1283
1676
  <title-modified lang="en">modified</title-modified>
1284
1677
  <title-modified lang="fr">modifiée</title-modified>
1285
1678
 
@@ -1341,10 +1734,19 @@
1341
1734
 
1342
1735
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1343
1736
  <xsl:param name="name"/>
1344
- <xsl:variable name="lang">
1345
- <xsl:call-template name="getLang"/>
1737
+ <xsl:param name="lang"/>
1738
+ <xsl:variable name="lang_">
1739
+ <xsl:choose>
1740
+ <xsl:when test="$lang != ''">
1741
+ <xsl:value-of select="$lang"/>
1742
+ </xsl:when>
1743
+ <xsl:otherwise>
1744
+ <xsl:call-template name="getLang"/>
1745
+ </xsl:otherwise>
1746
+ </xsl:choose>
1346
1747
  </xsl:variable>
1347
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1748
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1749
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1348
1750
  <xsl:choose>
1349
1751
  <xsl:when test="normalize-space($title_) != ''">
1350
1752
  <xsl:value-of select="$title_"/>
@@ -1485,6 +1887,7 @@
1485
1887
 
1486
1888
 
1487
1889
 
1890
+
1488
1891
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1489
1892
 
1490
1893
 
@@ -1526,6 +1929,7 @@
1526
1929
 
1527
1930
 
1528
1931
 
1932
+
1529
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">
1530
1934
 
1531
1935
 
@@ -1596,6 +2000,7 @@
1596
2000
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1597
2001
 
1598
2002
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2003
+
1599
2004
 
1600
2005
 
1601
2006
 
@@ -1724,6 +2129,10 @@
1724
2129
 
1725
2130
 
1726
2131
 
2132
+ <!-- <xsl:if test="$namespace = 'bipm'">
2133
+ <fo:block>&#xA0;</fo:block>
2134
+ </xsl:if> -->
2135
+
1727
2136
  <!-- $namespace = 'iso' or -->
1728
2137
 
1729
2138
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1756,11 +2165,14 @@
1756
2165
 
1757
2166
 
1758
2167
  <xsl:variable name="colwidths">
1759
- <xsl:call-template name="calculate-column-widths">
1760
- <xsl:with-param name="cols-count" select="$cols-count"/>
1761
- <xsl:with-param name="table" select="$simple-table"/>
1762
- </xsl:call-template>
2168
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2169
+ <xsl:call-template name="calculate-column-widths">
2170
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2171
+ <xsl:with-param name="table" select="$simple-table"/>
2172
+ </xsl:call-template>
2173
+ </xsl:if>
1763
2174
  </xsl:variable>
2175
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1764
2176
 
1765
2177
  <!-- <xsl:variable name="colwidths2">
1766
2178
  <xsl:call-template name="calculate-column-widths">
@@ -1781,39 +2193,109 @@
1781
2193
 
1782
2194
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1783
2195
 
1784
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1785
-
2196
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1786
2197
 
1787
2198
 
2199
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1788
2200
 
2201
+
2202
+
2203
+
1789
2204
 
1790
2205
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1791
2206
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
1792
2207
  <xsl:attribute name="space-after">18pt</xsl:attribute>
1793
2208
 
1794
-
1795
2209
 
2210
+
1796
2211
 
1797
2212
 
1798
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1799
-
1800
-
1801
-
1802
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1803
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2213
+
2214
+
2215
+
2216
+
2217
+
2218
+ <xsl:variable name="table_attributes">
2219
+ <attribute name="table-layout">fixed</attribute>
2220
+ <attribute name="width">100%</attribute>
2221
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2222
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1804
2223
 
1805
2224
 
1806
2225
 
2226
+ <attribute name="margin-left">0mm</attribute>
2227
+ <attribute name="margin-right">0mm</attribute>
1807
2228
 
1808
2229
 
2230
+
2231
+
2232
+
1809
2233
 
2234
+
1810
2235
 
1811
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2236
+ </xsl:variable>
2237
+
2238
+
2239
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1812
2240
 
2241
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2242
+ <xsl:attribute name="{@name}">
2243
+ <xsl:value-of select="."/>
2244
+ </xsl:attribute>
2245
+ </xsl:for-each>
1813
2246
 
2247
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2248
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2249
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2250
+ </xsl:if>
1814
2251
 
2252
+ <xsl:choose>
2253
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2254
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2255
+ <fo:table-column column-width="{@width}"/>
2256
+ </xsl:for-each>
2257
+ </xsl:when>
2258
+ <xsl:otherwise>
2259
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2260
+ <xsl:choose>
2261
+ <xsl:when test=". = 1 or . = 0">
2262
+ <fo:table-column column-width="proportional-column-width(2)"/>
2263
+ </xsl:when>
2264
+ <xsl:otherwise>
2265
+ <fo:table-column column-width="proportional-column-width({.})"/>
2266
+ </xsl:otherwise>
2267
+ </xsl:choose>
2268
+ </xsl:for-each>
2269
+ </xsl:otherwise>
2270
+ </xsl:choose>
1815
2271
 
2272
+ <xsl:choose>
2273
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2274
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2275
+ </xsl:when>
2276
+ <xsl:otherwise>
2277
+ <xsl:apply-templates/>
2278
+ </xsl:otherwise>
2279
+ </xsl:choose>
1816
2280
 
2281
+ </fo:table>
2282
+
2283
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2284
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2285
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2286
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2287
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2288
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2289
+ </xsl:call-template>
2290
+ </xsl:for-each>
2291
+
2292
+ <!-- insert footer as table -->
2293
+ <!-- <fo:table>
2294
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2295
+ <xsl:attribute name="{@name}">
2296
+ <xsl:value-of select="."/>
2297
+ </xsl:attribute>
2298
+ </xsl:for-each>
1817
2299
 
1818
2300
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1819
2301
  <xsl:choose>
@@ -1825,17 +2307,7 @@
1825
2307
  </xsl:otherwise>
1826
2308
  </xsl:choose>
1827
2309
  </xsl:for-each>
1828
-
1829
- <xsl:choose>
1830
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1831
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1832
- </xsl:when>
1833
- <xsl:otherwise>
1834
- <xsl:apply-templates/>
1835
- </xsl:otherwise>
1836
- </xsl:choose>
1837
-
1838
- </fo:table>
2310
+ </fo:table>-->
1839
2311
 
1840
2312
 
1841
2313
 
@@ -1846,6 +2318,7 @@
1846
2318
  <xsl:if test="normalize-space() != ''">
1847
2319
  <fo:block xsl:use-attribute-sets="table-name-style">
1848
2320
 
2321
+
1849
2322
  <xsl:apply-templates/>
1850
2323
  </fo:block>
1851
2324
  </xsl:if>
@@ -1901,6 +2374,13 @@
1901
2374
  <xsl:for-each select="xalan:nodeset($table)//tr">
1902
2375
  <xsl:variable name="td_text">
1903
2376
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2377
+
2378
+ <!-- <xsl:if test="$namespace = 'bipm'">
2379
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
2380
+ <word><xsl:value-of select="normalize-space(.)"/></word>
2381
+ </xsl:for-each>
2382
+ </xsl:if> -->
2383
+
1904
2384
  </xsl:variable>
1905
2385
  <xsl:variable name="words">
1906
2386
  <xsl:variable name="string_with_added_zerospaces">
@@ -1960,11 +2440,14 @@
1960
2440
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1961
2441
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1962
2442
  <xsl:value-of select="@target"/>
2443
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2444
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
2445
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1963
2446
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1964
2447
  <xsl:param name="cols-count"/>
1965
2448
  <!-- font-weight="bold" -->
1966
2449
  <fo:table-header>
1967
-
2450
+
1968
2451
  <xsl:apply-templates/>
1969
2452
  </fo:table-header>
1970
2453
  </xsl:template><xsl:template name="table-header-title">
@@ -1989,6 +2472,13 @@
1989
2472
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1990
2473
  <xsl:apply-templates/>
1991
2474
  </xsl:template><xsl:template name="insertTableFooter">
2475
+ <xsl:param name="cols-count"/>
2476
+ <xsl:if test="../*[local-name()='tfoot']">
2477
+ <fo:table-footer>
2478
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2479
+ </fo:table-footer>
2480
+ </xsl:if>
2481
+ </xsl:template><xsl:template name="insertTableFooter2">
1992
2482
  <xsl:param name="cols-count"/>
1993
2483
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1994
2484
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2014,11 +2504,29 @@
2014
2504
  <!-- fn will be processed inside 'note' processing -->
2015
2505
 
2016
2506
 
2507
+
2508
+
2509
+
2510
+
2017
2511
  <!-- except gb -->
2018
2512
 
2019
2513
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2020
2514
 
2021
2515
 
2516
+ <!-- show Note under table in preface (ex. abstract) sections -->
2517
+ <!-- empty, because notes show at page side in main sections -->
2518
+ <!-- <xsl:if test="$namespace = 'bipm'">
2519
+ <xsl:choose>
2520
+ <xsl:when test="ancestor::*[local-name()='preface']">
2521
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2522
+ </xsl:when>
2523
+ <xsl:otherwise>
2524
+ <fo:block/>
2525
+ </xsl:otherwise>
2526
+ </xsl:choose>
2527
+ </xsl:if> -->
2528
+
2529
+
2022
2530
  <!-- horizontal row separator -->
2023
2531
 
2024
2532
 
@@ -2032,6 +2540,111 @@
2032
2540
  </fo:table-footer>
2033
2541
 
2034
2542
  </xsl:if>
2543
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2544
+ <xsl:param name="table_attributes"/>
2545
+ <xsl:param name="colwidths"/>
2546
+ <xsl:param name="colgroup"/>
2547
+
2548
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2549
+
2550
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2551
+
2552
+ <xsl:variable name="cols-count">
2553
+ <xsl:choose>
2554
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2555
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2556
+ </xsl:when>
2557
+ <xsl:otherwise>
2558
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2559
+ </xsl:otherwise>
2560
+ </xsl:choose>
2561
+ </xsl:variable>
2562
+
2563
+ <fo:table keep-with-previous="always">
2564
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2565
+ <xsl:choose>
2566
+ <xsl:when test="@name = 'border-top'">
2567
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2568
+ </xsl:when>
2569
+ <xsl:when test="@name = 'border'">
2570
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2571
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2572
+ </xsl:when>
2573
+ <xsl:otherwise>
2574
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2575
+ </xsl:otherwise>
2576
+ </xsl:choose>
2577
+ </xsl:for-each>
2578
+
2579
+ <xsl:choose>
2580
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2581
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2582
+ <fo:table-column column-width="{@width}"/>
2583
+ </xsl:for-each>
2584
+ </xsl:when>
2585
+ <xsl:otherwise>
2586
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2587
+ <xsl:choose>
2588
+ <xsl:when test=". = 1 or . = 0">
2589
+ <fo:table-column column-width="proportional-column-width(2)"/>
2590
+ </xsl:when>
2591
+ <xsl:otherwise>
2592
+ <fo:table-column column-width="proportional-column-width({.})"/>
2593
+ </xsl:otherwise>
2594
+ </xsl:choose>
2595
+ </xsl:for-each>
2596
+ </xsl:otherwise>
2597
+ </xsl:choose>
2598
+
2599
+ <fo:table-body>
2600
+ <fo:table-row>
2601
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2602
+
2603
+
2604
+
2605
+ <xsl:if test="ancestor::*[local-name()='preface']">
2606
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2607
+ </xsl:if>
2608
+
2609
+ <!-- fn will be processed inside 'note' processing -->
2610
+
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+ <!-- except gb -->
2618
+
2619
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2620
+
2621
+
2622
+ <!-- <xsl:if test="$namespace = 'bipm'">
2623
+ <xsl:choose>
2624
+ <xsl:when test="ancestor::*[local-name()='preface']">
2625
+ show Note under table in preface (ex. abstract) sections
2626
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2627
+ </xsl:when>
2628
+ <xsl:otherwise>
2629
+ empty, because notes show at page side in main sections
2630
+ <fo:block/>
2631
+ </xsl:otherwise>
2632
+ </xsl:choose>
2633
+ </xsl:if> -->
2634
+
2635
+
2636
+ <!-- horizontal row separator -->
2637
+
2638
+
2639
+ <!-- fn processing -->
2640
+ <xsl:call-template name="fn_display"/>
2641
+
2642
+ </fo:table-cell>
2643
+ </fo:table-row>
2644
+ </fo:table-body>
2645
+
2646
+ </fo:table>
2647
+ </xsl:if>
2035
2648
  </xsl:template><xsl:template match="*[local-name()='tbody']">
2036
2649
 
2037
2650
  <xsl:variable name="cols-count">
@@ -2084,8 +2697,12 @@
2084
2697
 
2085
2698
  </xsl:if>
2086
2699
 
2087
-
2088
-
2700
+
2701
+
2702
+
2703
+ <!-- <xsl:if test="$namespace = 'bipm'">
2704
+ <xsl:attribute name="height">8mm</xsl:attribute>
2705
+ </xsl:if> -->
2089
2706
 
2090
2707
  <xsl:apply-templates/>
2091
2708
  </fo:table-row>
@@ -2113,6 +2730,7 @@
2113
2730
 
2114
2731
 
2115
2732
 
2733
+
2116
2734
  <xsl:if test="@colspan">
2117
2735
  <xsl:attribute name="number-columns-spanned">
2118
2736
  <xsl:value-of select="@colspan"/>
@@ -2157,7 +2775,8 @@
2157
2775
  <xsl:attribute name="display-align">before</xsl:attribute>
2158
2776
 
2159
2777
 
2160
-
2778
+
2779
+
2161
2780
 
2162
2781
 
2163
2782
 
@@ -2175,7 +2794,8 @@
2175
2794
  </xsl:attribute>
2176
2795
  </xsl:if>
2177
2796
  <xsl:call-template name="display-align"/>
2178
- <fo:block>
2797
+ <fo:block>
2798
+
2179
2799
  <xsl:apply-templates/>
2180
2800
  </fo:block>
2181
2801
  </fo:table-cell>
@@ -2187,14 +2807,17 @@
2187
2807
 
2188
2808
 
2189
2809
 
2810
+
2811
+
2190
2812
  <fo:inline padding-right="2mm">
2191
2813
 
2192
2814
 
2193
2815
 
2194
-
2816
+
2195
2817
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2196
2818
 
2197
2819
  </fo:inline>
2820
+
2198
2821
  <xsl:apply-templates mode="process"/>
2199
2822
  </fo:block>
2200
2823
 
@@ -2227,6 +2850,7 @@
2227
2850
  <xsl:attribute name="text-indent">-5mm</xsl:attribute>
2228
2851
  <xsl:attribute name="start-indent">5mm</xsl:attribute>
2229
2852
 
2853
+
2230
2854
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2231
2855
 
2232
2856
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -2239,8 +2863,10 @@
2239
2863
  <xsl:attribute name="font-size">70%</xsl:attribute>
2240
2864
 
2241
2865
 
2866
+
2242
2867
  <xsl:value-of select="@reference"/>
2243
2868
 
2869
+
2244
2870
  <!-- <xsl:if test="@preface = 'true'"> -->
2245
2871
  <xsl:text>)</xsl:text>
2246
2872
  <!-- </xsl:if> -->
@@ -2248,7 +2874,8 @@
2248
2874
  </fo:inline>
2249
2875
  <fo:inline>
2250
2876
 
2251
- <xsl:apply-templates/>
2877
+ <!-- <xsl:apply-templates /> -->
2878
+ <xsl:copy-of select="./node()"/>
2252
2879
  </fo:inline>
2253
2880
  </fo:block>
2254
2881
  </xsl:if>
@@ -2285,7 +2912,20 @@
2285
2912
  <xsl:variable name="following_dl_colwidths">
2286
2913
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2287
2914
  <xsl:variable name="html-table">
2288
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2915
+ <xsl:variable name="doc_ns">
2916
+
2917
+ </xsl:variable>
2918
+ <xsl:variable name="ns">
2919
+ <xsl:choose>
2920
+ <xsl:when test="normalize-space($doc_ns) != ''">
2921
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2922
+ </xsl:when>
2923
+ <xsl:otherwise>
2924
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2925
+ </xsl:otherwise>
2926
+ </xsl:choose>
2927
+ </xsl:variable>
2928
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2289
2929
  <xsl:element name="{$ns}:table">
2290
2930
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2291
2931
  <tbody>
@@ -2350,7 +2990,8 @@
2350
2990
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2351
2991
  </xsl:if>
2352
2992
 
2353
- <xsl:apply-templates/>
2993
+ <!-- <xsl:apply-templates /> -->
2994
+ <xsl:copy-of select="./node()"/>
2354
2995
  </fo:block>
2355
2996
  </fo:table-cell>
2356
2997
  </fo:table-row>
@@ -2372,9 +3013,12 @@
2372
3013
  <xsl:attribute name="color">blue</xsl:attribute>
2373
3014
 
2374
3015
 
3016
+
2375
3017
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2376
3018
 
3019
+
2377
3020
  <xsl:value-of select="@reference"/>
3021
+
2378
3022
  </fo:basic-link>
2379
3023
  </fo:inline>
2380
3024
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2382,7 +3026,11 @@
2382
3026
  <xsl:apply-templates/>
2383
3027
  </fo:inline>
2384
3028
  </xsl:template><xsl:template match="*[local-name()='dl']">
2385
- <fo:block-container margin-left="0mm">
3029
+ <fo:block-container>
3030
+
3031
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3032
+
3033
+
2386
3034
  <xsl:if test="parent::*[local-name() = 'note']">
2387
3035
  <xsl:attribute name="margin-left">
2388
3036
  <xsl:choose>
@@ -2392,8 +3040,11 @@
2392
3040
  </xsl:attribute>
2393
3041
 
2394
3042
  </xsl:if>
2395
- <fo:block-container margin-left="0mm">
2396
-
3043
+ <fo:block-container>
3044
+
3045
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3046
+
3047
+
2397
3048
  <xsl:variable name="parent" select="local-name(..)"/>
2398
3049
 
2399
3050
  <xsl:variable name="key_iso">
@@ -2407,9 +3058,12 @@
2407
3058
  <fo:block margin-bottom="12pt" text-align="left">
2408
3059
 
2409
3060
  <xsl:variable name="title-where">
2410
- <xsl:call-template name="getTitle">
2411
- <xsl:with-param name="name" select="'title-where'"/>
2412
- </xsl:call-template>
3061
+
3062
+
3063
+ <xsl:call-template name="getTitle">
3064
+ <xsl:with-param name="name" select="'title-where'"/>
3065
+ </xsl:call-template>
3066
+
2413
3067
  </xsl:variable>
2414
3068
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2415
3069
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2427,9 +3081,12 @@
2427
3081
 
2428
3082
 
2429
3083
  <xsl:variable name="title-where">
2430
- <xsl:call-template name="getTitle">
2431
- <xsl:with-param name="name" select="'title-where'"/>
2432
- </xsl:call-template>
3084
+
3085
+
3086
+ <xsl:call-template name="getTitle">
3087
+ <xsl:with-param name="name" select="'title-where'"/>
3088
+ </xsl:call-template>
3089
+
2433
3090
  </xsl:variable>
2434
3091
  <xsl:value-of select="$title-where"/>:
2435
3092
  </fo:block>
@@ -2440,9 +3097,12 @@
2440
3097
 
2441
3098
 
2442
3099
  <xsl:variable name="title-key">
2443
- <xsl:call-template name="getTitle">
2444
- <xsl:with-param name="name" select="'title-key'"/>
2445
- </xsl:call-template>
3100
+
3101
+
3102
+ <xsl:call-template name="getTitle">
3103
+ <xsl:with-param name="name" select="'title-key'"/>
3104
+ </xsl:call-template>
3105
+
2446
3106
  </xsl:variable>
2447
3107
  <xsl:value-of select="$title-key"/>
2448
3108
  </fo:block>
@@ -2459,7 +3119,7 @@
2459
3119
  </xsl:if>
2460
3120
  <xsl:if test="$parent = 'li'">
2461
3121
  <!-- <xsl:attribute name="margin-left">-4mm</xsl:attribute> -->
2462
- </xsl:if>
3122
+ </xsl:if>
2463
3123
 
2464
3124
 
2465
3125
 
@@ -2481,7 +3141,20 @@
2481
3141
  </xsl:choose>
2482
3142
  <!-- create virtual html table for dl/[dt and dd] -->
2483
3143
  <xsl:variable name="html-table">
2484
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3144
+ <xsl:variable name="doc_ns">
3145
+
3146
+ </xsl:variable>
3147
+ <xsl:variable name="ns">
3148
+ <xsl:choose>
3149
+ <xsl:when test="normalize-space($doc_ns) != ''">
3150
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3151
+ </xsl:when>
3152
+ <xsl:otherwise>
3153
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3154
+ </xsl:otherwise>
3155
+ </xsl:choose>
3156
+ </xsl:variable>
3157
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2485
3158
  <xsl:element name="{$ns}:table">
2486
3159
  <tbody>
2487
3160
  <xsl:apply-templates mode="dl"/>
@@ -2633,6 +3306,7 @@
2633
3306
  </xsl:if>
2634
3307
 
2635
3308
 
3309
+
2636
3310
  <xsl:apply-templates/>
2637
3311
  <!-- <xsl:if test="$namespace = 'gb'">
2638
3312
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2688,6 +3362,7 @@
2688
3362
  </fo:inline>
2689
3363
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2690
3364
  <fo:inline font-weight="bold">
3365
+
2691
3366
  <xsl:apply-templates/>
2692
3367
  </fo:inline>
2693
3368
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2701,18 +3376,18 @@
2701
3376
  </xsl:template><xsl:template match="*[local-name()='tt']">
2702
3377
  <fo:inline xsl:use-attribute-sets="tt-style">
2703
3378
  <xsl:variable name="_font-size">
2704
-
2705
-
2706
-
2707
3379
 
2708
3380
 
2709
3381
 
2710
3382
 
2711
3383
 
2712
3384
 
2713
-
2714
3385
 
2715
-
3386
+
3387
+
3388
+
3389
+
3390
+
2716
3391
 
2717
3392
 
2718
3393
  </xsl:variable>
@@ -3016,7 +3691,18 @@
3016
3691
  <xsl:with-param name="previousRow" select="$newRow"/>
3017
3692
  </xsl:apply-templates>
3018
3693
  </xsl:template><xsl:template name="getLang">
3019
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3694
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3695
+ <xsl:variable name="language">
3696
+ <xsl:choose>
3697
+ <xsl:when test="$language_current != ''">
3698
+ <xsl:value-of select="$language_current"/>
3699
+ </xsl:when>
3700
+ <xsl:otherwise>
3701
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3702
+ </xsl:otherwise>
3703
+ </xsl:choose>
3704
+ </xsl:variable>
3705
+
3020
3706
  <xsl:choose>
3021
3707
  <xsl:when test="$language = 'English'">en</xsl:when>
3022
3708
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3050,7 +3736,8 @@
3050
3736
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3051
3737
  <xsl:value-of select="substring($str, 2)"/>
3052
3738
  </xsl:template><xsl:template match="mathml:math">
3053
- <fo:inline font-family="STIX2Math">
3739
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3740
+
3054
3741
  <xsl:variable name="mathml">
3055
3742
  <xsl:apply-templates select="." mode="mathml"/>
3056
3743
  </xsl:variable>
@@ -3080,6 +3767,7 @@
3080
3767
  </xsl:choose>
3081
3768
  </xsl:variable>
3082
3769
  <fo:inline xsl:use-attribute-sets="link-style">
3770
+
3083
3771
  <xsl:choose>
3084
3772
  <xsl:when test="$target = ''">
3085
3773
  <xsl:apply-templates/>
@@ -3133,10 +3821,14 @@
3133
3821
  </fo:inline>
3134
3822
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3135
3823
  <xsl:variable name="title-modified">
3136
- <xsl:call-template name="getTitle">
3137
- <xsl:with-param name="name" select="'title-modified'"/>
3138
- </xsl:call-template>
3824
+
3825
+
3826
+ <xsl:call-template name="getTitle">
3827
+ <xsl:with-param name="name" select="'title-modified'"/>
3828
+ </xsl:call-template>
3829
+
3139
3830
  </xsl:variable>
3831
+
3140
3832
  <xsl:choose>
3141
3833
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3142
3834
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3144,7 +3836,7 @@
3144
3836
  <xsl:apply-templates/>
3145
3837
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3146
3838
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3147
-
3839
+
3148
3840
  <xsl:apply-templates/>
3149
3841
  </fo:basic-link>
3150
3842
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3201,6 +3893,8 @@
3201
3893
 
3202
3894
 
3203
3895
 
3896
+
3897
+
3204
3898
  <fo:inline xsl:use-attribute-sets="note-name-style">
3205
3899
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3206
3900
  </fo:inline>
@@ -3293,7 +3987,8 @@
3293
3987
  </fo:inline>
3294
3988
  </xsl:if>
3295
3989
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3296
- <fo:block-container id="{@id}">
3990
+ <fo:block-container id="{@id}">
3991
+
3297
3992
  <fo:block>
3298
3993
  <xsl:apply-templates/>
3299
3994
  </fo:block>
@@ -3344,7 +4039,7 @@
3344
4039
  <xsl:apply-templates mode="bookmarks"/>
3345
4040
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3346
4041
  <xsl:apply-templates select="."/>
3347
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4042
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3348
4043
  <xsl:apply-templates mode="bookmarks"/>
3349
4044
  </xsl:template><xsl:template name="addBookmarks">
3350
4045
  <xsl:param name="contents"/>
@@ -3358,18 +4053,9 @@
3358
4053
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3359
4054
  <fo:bookmark-title>
3360
4055
  <xsl:variable name="bookmark-title_">
3361
- <xsl:choose>
3362
- <xsl:when test="@lang = 'en'">
3363
-
3364
-
3365
- </xsl:when>
3366
- <xsl:when test="@lang = 'fr'">
3367
-
3368
-
3369
- </xsl:when>
3370
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3371
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3372
- </xsl:choose>
4056
+ <xsl:call-template name="getLangVersion">
4057
+ <xsl:with-param name="lang" select="@lang"/>
4058
+ </xsl:call-template>
3373
4059
  </xsl:variable>
3374
4060
  <xsl:choose>
3375
4061
  <xsl:when test="normalize-space($bookmark-title_) != ''">
@@ -3411,6 +4097,20 @@
3411
4097
 
3412
4098
  </fo:bookmark-tree>
3413
4099
  </xsl:if>
4100
+ </xsl:template><xsl:template name="getLangVersion">
4101
+ <xsl:param name="lang"/>
4102
+ <xsl:choose>
4103
+ <xsl:when test="$lang = 'en'">
4104
+
4105
+
4106
+ </xsl:when>
4107
+ <xsl:when test="$lang = 'fr'">
4108
+
4109
+
4110
+ </xsl:when>
4111
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
4112
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4113
+ </xsl:choose>
3414
4114
  </xsl:template><xsl:template match="item" mode="bookmark">
3415
4115
  <fo:bookmark internal-destination="{@id}" starting-state="hide">
3416
4116
  <fo:bookmark-title>
@@ -3425,7 +4125,7 @@
3425
4125
  </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3426
4126
  <xsl:if test="normalize-space() != ''">
3427
4127
  <fo:block xsl:use-attribute-sets="figure-name-style">
3428
-
4128
+
3429
4129
  <xsl:apply-templates/>
3430
4130
  </fo:block>
3431
4131
  </xsl:if>
@@ -4008,9 +4708,12 @@
4008
4708
  </fo:block>
4009
4709
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4010
4710
  <xsl:variable name="title-deprecated">
4011
- <xsl:call-template name="getTitle">
4012
- <xsl:with-param name="name" select="'title-deprecated'"/>
4013
- </xsl:call-template>
4711
+
4712
+
4713
+ <xsl:call-template name="getTitle">
4714
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4715
+ </xsl:call-template>
4716
+
4014
4717
  </xsl:variable>
4015
4718
  <fo:block xsl:use-attribute-sets="deprecates-style">
4016
4719
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4052,13 +4755,14 @@
4052
4755
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4053
4756
  <fo:block>
4054
4757
  <xsl:call-template name="setId"/>
4758
+
4055
4759
  <xsl:apply-templates/>
4056
4760
  </fo:block>
4057
4761
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
4058
4762
  <fo:block id="{@id}">
4059
4763
  <xsl:apply-templates/>
4060
4764
  </fo:block>
4061
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4765
+ </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']">
4062
4766
 
4063
4767
  <fo:block id="{@id}">
4064
4768
  <xsl:apply-templates/>
@@ -4087,6 +4791,7 @@
4087
4791
  </xsl:choose>
4088
4792
  </xsl:attribute>
4089
4793
 
4794
+
4090
4795
  <fo:block-container margin-left="0mm">
4091
4796
  <fo:block>
4092
4797
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4114,7 +4819,8 @@
4114
4819
  <fo:table-column column-width="107mm"/>
4115
4820
  <fo:table-column column-width="15mm"/>
4116
4821
  <fo:table-body>
4117
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4822
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4823
+
4118
4824
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4119
4825
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4120
4826
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4132,6 +4838,10 @@
4132
4838
  <fo:block><xsl:apply-templates/></fo:block>
4133
4839
  </fo:table-cell>
4134
4840
  </xsl:template><xsl:template name="processBibitem">
4841
+
4842
+
4843
+ <!-- end BIPM bibitem processing-->
4844
+
4135
4845
 
4136
4846
 
4137
4847
 
@@ -4271,6 +4981,7 @@
4271
4981
 
4272
4982
 
4273
4983
 
4984
+
4274
4985
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@type='main']"/>
4275
4986
 
4276
4987
  </xsl:variable>
@@ -4288,6 +4999,7 @@
4288
4999
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
4289
5000
 
4290
5001
 
5002
+
4291
5003
  </dc:creator>
4292
5004
  <dc:description>
4293
5005
  <xsl:variable name="abstract">
@@ -4297,6 +5009,7 @@
4297
5009
 
4298
5010
  <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
4299
5011
 
5012
+
4300
5013
  </xsl:variable>
4301
5014
  <xsl:value-of select="normalize-space($abstract)"/>
4302
5015
  </dc:description>
@@ -4368,13 +5081,22 @@
4368
5081
  </xsl:template><xsl:template name="split">
4369
5082
  <xsl:param name="pText" select="."/>
4370
5083
  <xsl:param name="sep" select="','"/>
5084
+ <xsl:param name="normalize-space" select="'true'"/>
4371
5085
  <xsl:if test="string-length($pText) &gt;0">
4372
5086
  <item>
4373
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5087
+ <xsl:choose>
5088
+ <xsl:when test="$normalize-space = 'true'">
5089
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5090
+ </xsl:when>
5091
+ <xsl:otherwise>
5092
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5093
+ </xsl:otherwise>
5094
+ </xsl:choose>
4374
5095
  </item>
4375
5096
  <xsl:call-template name="split">
4376
5097
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4377
5098
  <xsl:with-param name="sep" select="$sep"/>
5099
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4378
5100
  </xsl:call-template>
4379
5101
  </xsl:if>
4380
5102
  </xsl:template><xsl:template name="getDocumentId">
@@ -4440,4 +5162,23 @@
4440
5162
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4441
5163
  </xsl:call-template>
4442
5164
  </xsl:if>
5165
+ </xsl:template><xsl:template name="repeat">
5166
+ <xsl:param name="char" select="'*'"/>
5167
+ <xsl:param name="count"/>
5168
+ <xsl:if test="$count &gt; 0">
5169
+ <xsl:value-of select="$char"/>
5170
+ <xsl:call-template name="repeat">
5171
+ <xsl:with-param name="char" select="$char"/>
5172
+ <xsl:with-param name="count" select="$count - 1"/>
5173
+ </xsl:call-template>
5174
+ </xsl:if>
5175
+ </xsl:template><xsl:template name="getLocalizedString">
5176
+ <xsl:param name="key"/>
5177
+
5178
+ <xsl:variable name="curr_lang">
5179
+ <xsl:call-template name="getLang"/>
5180
+ </xsl:variable>
5181
+
5182
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5183
+
4443
5184
  </xsl:template></xsl:stylesheet>