metanorma-m3aawg 1.5.3 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,7 +70,7 @@
70
70
  margin:0cm;
71
71
  margin-bottom:12.0pt;
72
72
  mso-pagination:widow-orphan;
73
- font-size:11.0pt;
73
+ font-size:$normalfontsize;
74
74
  font-family:$bodyfont;
75
75
  mso-fareast-font-family:"Times New Roman";
76
76
  mso-ansi-language:EN-US;
@@ -85,7 +85,7 @@ p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
85
85
  /* do not put in margin-left, it is specific to list level */
86
86
  mso-add-space:auto;
87
87
  mso-pagination:widow-orphan;
88
- font-size:11.0pt;
88
+ font-size:$normalfontsize;
89
89
  font-family:$bodyfont;
90
90
  mso-ansi-language:EN-AU;
91
91
  mso-fareast-language:EN-US;}
@@ -100,7 +100,7 @@ p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphC
100
100
  /* do not put in margin-left, it is specific to list level */
101
101
  mso-add-space:auto;
102
102
  mso-pagination:widow-orphan;
103
- font-size:11.0pt;
103
+ font-size:$normalfontsize;
104
104
  font-family:$bodyfont;
105
105
  mso-ansi-language:EN-AU;
106
106
  mso-fareast-language:EN-US;}
@@ -115,7 +115,7 @@ p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagrap
115
115
  /* do not put in margin-left, it is specific to list level */
116
116
  mso-add-space:auto;
117
117
  mso-pagination:widow-orphan;
118
- font-size:11.0pt;
118
+ font-size:$normalfontsize;
119
119
  font-family:$bodyfont;
120
120
  mso-ansi-language:EN-AU;
121
121
  mso-fareast-language:EN-US;}
@@ -130,7 +130,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
130
130
  /* do not put in margin-left, it is specific to list level */
131
131
  mso-add-space:auto;
132
132
  mso-pagination:widow-orphan;
133
- font-size:11.0pt;
133
+ font-size:$normalfontsize;
134
134
  font-family:$bodyfont;
135
135
  mso-ansi-language:EN-AU;
136
136
  mso-fareast-language:EN-US;}
@@ -141,7 +141,7 @@ p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
141
141
  margin:0cm;
142
142
  margin-bottom:.0001pt;
143
143
  mso-pagination:widow-orphan;
144
- font-size:10.0pt;
144
+ font-size:$footnotefontsize;
145
145
  font-family:$bodyfont;
146
146
  mso-fareast-font-family:"Times New Roman";
147
147
  mso-ansi-language:EN-US;
@@ -152,7 +152,7 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
152
152
  margin-bottom:.0001pt;
153
153
  mso-pagination:widow-orphan;
154
154
  tab-stops:center 216.0pt right 432.0pt;
155
- font-size:11.0pt;
155
+ font-size:$normalfontsize;
156
156
  font-family:$bodyfont;
157
157
  mso-fareast-font-family:"Times New Roman";
158
158
  mso-ansi-language:EN-US;
@@ -163,7 +163,7 @@ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
163
163
  margin-bottom:.0001pt;
164
164
  mso-pagination:widow-orphan;
165
165
  tab-stops:center 342.1pt right 684.3pt;
166
- font-size:11.0pt;
166
+ font-size:$normalfontsize;
167
167
  font-family:$bodyfont;
168
168
  mso-fareast-font-family:"Times New Roman";
169
169
  mso-ansi-language:EN-US;
@@ -174,7 +174,7 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
174
174
  margin-bottom:.0001pt;
175
175
  mso-pagination:widow-orphan;
176
176
  tab-stops:center 216.0pt right 432.0pt;
177
- font-size:11.0pt;
177
+ font-size:$normalfontsize;
178
178
  font-family:$bodyfont;
179
179
  mso-fareast-font-family:"Times New Roman";
180
180
  mso-ansi-language:EN-US;
@@ -185,7 +185,7 @@ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
185
185
  margin-bottom:.0001pt;
186
186
  mso-pagination:widow-orphan;
187
187
  tab-stops:center 342.1pt right 684.3pt;
188
- font-size:11.0pt;
188
+ font-size:$normalfontsize;
189
189
  font-family:$bodyfont;
190
190
  mso-fareast-font-family:"Times New Roman";
191
191
  mso-ansi-language:EN-US;
@@ -230,7 +230,7 @@ p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
230
230
  margin:0cm;
231
231
  margin-bottom:.0001pt;
232
232
  mso-pagination:widow-orphan;
233
- font-size:10.0pt;
233
+ font-size:$footnotefontsize;
234
234
  font-family:$bodyfont;
235
235
  mso-fareast-font-family:"Times New Roman";
236
236
  mso-ansi-language:EN-US;
@@ -282,7 +282,7 @@ h1
282
282
  mso-hyphenate:none;
283
283
  tab-stops:20.0pt list 21.6pt left 28.0pt;
284
284
  font-size:13.0pt;
285
- mso-bidi-font-size:11.0pt;
285
+ mso-bidi-font-size:$normalfontsize;
286
286
  font-family:$headerfont;
287
287
  mso-fareast-font-family:$headerfont;
288
288
  mso-font-kerning:0pt;
@@ -310,7 +310,7 @@ h1.Annex
310
310
  mso-hyphenate:none;
311
311
  tab-stops:20.0pt list 21.6pt left 28.0pt;
312
312
  font-size:13.0pt;
313
- mso-bidi-font-size:11.0pt;
313
+ mso-bidi-font-size:$normalfontsize;
314
314
  font-family:$headerfont;
315
315
  mso-fareast-font-family:$headerfont;
316
316
  mso-font-kerning:0pt;
@@ -336,7 +336,7 @@ h1.Annex
336
336
  mso-hyphenate:none;
337
337
  tab-stops:27.0pt 35.0pt;
338
338
  font-size:12.0pt;
339
- mso-bidi-font-size:11.0pt;
339
+ mso-bidi-font-size:$normalfontsize;
340
340
  font-family:$headerfont;
341
341
  font-weight:bold;
342
342
  mso-fareast-font-family:$headerfont;
@@ -363,7 +363,7 @@ h2
363
363
  mso-hyphenate:none;
364
364
  tab-stops:27.0pt 35.0pt;
365
365
  font-size:12.0pt;
366
- mso-bidi-font-size:11.0pt;
366
+ mso-bidi-font-size:$normalfontsize;
367
367
  font-family:$headerfont;
368
368
  mso-fareast-font-family:$headerfont;
369
369
  mso-ansi-language:EN-GB;
@@ -388,7 +388,7 @@ h3
388
388
  mso-list:l1 level3 lfo6;
389
389
  mso-hyphenate:none;
390
390
  tab-stops:list 36.0pt left 44.0pt;
391
- font-size:11.0pt;
391
+ font-size:$normalfontsize;
392
392
  font-family:$headerfont;
393
393
  mso-fareast-font-family:$headerfont;
394
394
  mso-ansi-language:EN-GB;
@@ -413,7 +413,7 @@ h4
413
413
  mso-list:l1 level4 lfo6;
414
414
  mso-hyphenate:none;
415
415
  tab-stops:51.05pt 57.0pt 68.0pt;
416
- font-size:11.0pt;
416
+ font-size:$normalfontsize;
417
417
  font-family:$headerfont;
418
418
  mso-fareast-font-family:$headerfont;
419
419
  mso-ansi-language:EN-GB;
@@ -438,7 +438,7 @@ h5
438
438
  mso-list:l1 level5 lfo6;
439
439
  mso-hyphenate:none;
440
440
  tab-stops:51.05pt list 54.0pt;
441
- font-size:11.0pt;
441
+ font-size:$normalfontsize;
442
442
  font-family:$headerfont;
443
443
  mso-fareast-font-family:$headerfont;
444
444
  mso-ansi-language:EN-GB;
@@ -463,7 +463,7 @@ h6
463
463
  mso-list:l1 level6 lfo6;
464
464
  mso-hyphenate:none;
465
465
  tab-stops:51.05pt list 72.0pt;
466
- font-size:11.0pt;
466
+ font-size:$normalfontsize;
467
467
  font-family:$headerfont;
468
468
  mso-fareast-font-family:$headerfont;
469
469
  mso-ansi-language:EN-GB;
@@ -483,7 +483,7 @@ p.MsoToc1, li.MsoToc1, div.MsoToc1
483
483
  mso-pagination:widow-orphan;
484
484
  mso-hyphenate:none;
485
485
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
486
- font-size:11.0pt;
486
+ font-size:$normalfontsize;
487
487
  font-family:$bodyfont;
488
488
  mso-fareast-font-family:$bodyfont;
489
489
  mso-bidi-font-family:$bodyfont;
@@ -506,7 +506,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2
506
506
  mso-pagination:widow-orphan;
507
507
  mso-hyphenate:none;
508
508
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
509
- font-size:11.0pt;
509
+ font-size:$normalfontsize;
510
510
  font-family:$bodyfont;
511
511
  mso-fareast-font-family:$bodyfont;
512
512
  mso-bidi-font-family:$bodyfont;
@@ -529,7 +529,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
529
529
  mso-pagination:widow-orphan;
530
530
  mso-hyphenate:none;
531
531
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
532
- font-size:11.0pt;
532
+ font-size:$normalfontsize;
533
533
  font-family:$bodyfont;
534
534
  mso-fareast-font-family:$bodyfont;
535
535
  mso-bidi-font-family:$bodyfont;
@@ -551,7 +551,7 @@ p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
551
551
  line-height:12.0pt;
552
552
  mso-pagination:widow-orphan;
553
553
  tab-stops:20.15pt;
554
- font-size:10.0pt;
554
+ font-size:$footnotefontsize;
555
555
  font-family:$bodyfont;
556
556
  mso-fareast-font-family:$bodyfont;
557
557
  mso-bidi-font-family:$bodyfont;
@@ -569,7 +569,7 @@ p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
569
569
  text-align:justify;
570
570
  line-height:12.0pt;
571
571
  mso-pagination:widow-orphan;
572
- font-size:11.0pt;
572
+ font-size:$normalfontsize;
573
573
  font-family:$bodyfont;
574
574
  mso-fareast-font-family:$bodyfont;
575
575
  mso-bidi-font-family:$bodyfont;
@@ -613,7 +613,7 @@ span.Heading3Char
613
613
  mso-style-locked:yes;
614
614
  mso-style-parent:"";
615
615
  mso-style-link:"Heading 3";
616
- mso-ansi-font-size:11.0pt;
616
+ mso-ansi-font-size:$normalfontsize;
617
617
  font-family:$headerfont;
618
618
  mso-ascii-font-family:$headerfont;
619
619
  mso-fareast-font-family:$headerfont;
@@ -629,7 +629,7 @@ span.Heading4Char
629
629
  mso-style-locked:yes;
630
630
  mso-style-parent:"";
631
631
  mso-style-link:"Heading 4";
632
- mso-ansi-font-size:11.0pt;
632
+ mso-ansi-font-size:$normalfontsize;
633
633
  font-family:$headerfont;
634
634
  mso-ascii-font-family:$headerfont;
635
635
  mso-fareast-font-family:$headerfont;
@@ -645,7 +645,7 @@ span.Heading5Char
645
645
  mso-style-locked:yes;
646
646
  mso-style-parent:"";
647
647
  mso-style-link:"Heading 5";
648
- mso-ansi-font-size:11.0pt;
648
+ mso-ansi-font-size:$normalfontsize;
649
649
  font-family:$headerfont;
650
650
  mso-ascii-font-family:$headerfont;
651
651
  mso-fareast-font-family:$headerfont;
@@ -661,7 +661,7 @@ span.Heading6Char
661
661
  mso-style-locked:yes;
662
662
  mso-style-parent:"";
663
663
  mso-style-link:"Heading 6";
664
- mso-ansi-font-size:11.0pt;
664
+ mso-ansi-font-size:$normalfontsize;
665
665
  font-family:$headerfont;
666
666
  mso-ascii-font-family:$headerfont;
667
667
  mso-fareast-font-family:$headerfont;
@@ -680,8 +680,8 @@ p.Tablebody, li.Tablebody, div.Tablebody
680
680
  margin-left:0cm;
681
681
  line-height:10.5pt;
682
682
  mso-pagination:widow-orphan;
683
- font-size:10.0pt;
684
- mso-bidi-font-size:11.0pt;
683
+ font-size:$smallerfontsize;
684
+ mso-bidi-font-size:$normalfontsize;
685
685
  font-family:$bodyfont;
686
686
  mso-fareast-font-family:$bodyfont;
687
687
  mso-bidi-font-family:$bodyfont;
@@ -1164,7 +1164,7 @@ table.MsoNormalTable
1164
1164
  mso-para-margin:0cm;
1165
1165
  mso-para-margin-bottom:.0001pt;
1166
1166
  mso-pagination:widow-orphan;
1167
- font-size:10.0pt;
1167
+ font-size:$smallerfontsize;
1168
1168
  font-family:$bodyfont;}
1169
1169
  ol
1170
1170
  {margin-bottom:0cm;
@@ -1,35 +1,18 @@
1
1
  require "isodoc"
2
+ require "isodoc/generic/html_convert"
2
3
  require_relative "base_convert"
3
4
  require_relative "init"
4
5
 
5
6
  module IsoDoc
6
7
  module M3AAWG
7
- # A {Converter} implementation that generates CSAND output, and a document
8
- # schema encapsulation of the document for validation
9
- class HtmlConvert < IsoDoc::HtmlConvert
10
- def initialize(options)
11
- @libdir = File.dirname(__FILE__)
12
- super
13
- end
14
-
15
- def default_fonts(options)
16
- {
17
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
18
- '"Overpass",sans-serif'),
19
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
20
- '"Overpass",sans-serif'),
21
- monospacefont: '"Space Mono",monospace'
22
- }
8
+ class HtmlConvert < IsoDoc::Generic::HtmlConvert
9
+ def configuration
10
+ Metanorma::M3AAWG.configuration
23
11
  end
24
12
 
25
- def default_file_locations(_options)
26
- {
27
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
28
- htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
29
- htmlintropage: html_doc_path("html_m3d_intro.html"),
30
- standardstylesheet: nil,
31
- scripts: html_doc_path("scripts.html"),
32
- }
13
+ def initialize(options)
14
+ #require "byebug"; byebug
15
+ super
33
16
  end
34
17
 
35
18
  def colophon(body, docxml)
@@ -45,13 +28,6 @@ module IsoDoc
45
28
  end
46
29
  end
47
30
 
48
- def googlefonts()
49
- <<~HEAD.freeze
50
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
51
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
52
- HEAD
53
- end
54
-
55
31
  def make_body(xml, docxml)
56
32
  body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72",
57
33
  "xml:lang": "EN-US", class: "container" }
@@ -1,9 +1,8 @@
1
1
  module IsoDoc
2
2
  module M3AAWG
3
- class I18n < IsoDoc::I18n
4
- def load_yaml1(lang, script)
5
- y = YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
6
- super.merge(y)
3
+ class I18n < IsoDoc::Generic::I18n
4
+ def configuration
5
+ Metanorma::M3AAWG.configuration
7
6
  end
8
7
  end
9
8
  end
@@ -11,16 +11,13 @@ module IsoDoc
11
11
  end
12
12
 
13
13
  def xref_init(lang, script, klass, labels, options)
14
- @xrefs = Xref.new(lang, script, HtmlConvert.new(language: lang, script: script), labels, options)
14
+ html = HtmlConvert.new(language: lang, script: script)
15
+ @xrefs = Xref.new(lang, script, html, labels, options)
15
16
  end
16
17
 
17
18
  def i18n_init(lang, script, i18nyaml = nil)
18
19
  @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
19
20
  end
20
-
21
- def fileloc(loc)
22
- File.join(File.dirname(__FILE__), loc)
23
- end
24
21
  end
25
22
  end
26
23
  end
@@ -75,6 +75,10 @@
75
75
 
76
76
  <xsl:call-template name="addPDFUAmeta"/>
77
77
 
78
+ <xsl:call-template name="addBookmarks">
79
+ <xsl:with-param name="contents" select="$contents"/>
80
+ </xsl:call-template>
81
+
78
82
  <fo:page-sequence master-reference="document" force-page-count="no-force">
79
83
 
80
84
  <fo:static-content flow-name="cover-header">
@@ -218,17 +222,17 @@
218
222
  <fo:table-column column-width="25mm"/>
219
223
  <fo:table-column column-width="155mm"/>
220
224
  <fo:table-body>
221
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
225
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
222
226
  <fo:table-row height="6mm">
223
227
  <fo:table-cell>
224
228
  <fo:block font-weight="bold">
225
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
229
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
226
230
  <xsl:choose>
227
231
  <xsl:when test="@section = ''">
228
- <xsl:apply-templates/>
232
+ <xsl:apply-templates select="title"/>
229
233
  </xsl:when>
230
234
  <xsl:when test="@type = 'references' and @section = ''">
231
- <xsl:apply-templates/>
235
+ <xsl:apply-templates select="title"/>
232
236
  </xsl:when>
233
237
  <xsl:when test="@level = 1">
234
238
  <xsl:value-of select="@section"/>
@@ -243,12 +247,12 @@
243
247
  <xsl:if test="@level = 1">
244
248
  <xsl:attribute name="font-weight">bold</xsl:attribute>
245
249
  </xsl:if>
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
247
251
  <xsl:choose>
248
252
  <xsl:when test="@section = ''"/>
249
253
  <xsl:when test="@type = 'references' and @section = ''"/>
250
254
  <xsl:otherwise>
251
- <xsl:apply-templates/>
255
+ <xsl:apply-templates select="title"/>
252
256
  </xsl:otherwise>
253
257
  </xsl:choose>
254
258
 
@@ -314,9 +318,7 @@
314
318
  </xsl:variable>
315
319
 
316
320
  <xsl:variable name="display">
317
- <xsl:choose>
318
- <xsl:when test="ancestor-or-self::m3d:bibitem">false</xsl:when>
319
- <xsl:when test="ancestor-or-self::m3d:term">false</xsl:when>
321
+ <xsl:choose>
320
322
  <xsl:when test="ancestor-or-self::m3d:preface and $level &gt;= 2">false</xsl:when>
321
323
  <xsl:when test="ancestor::m3d:annex and $level &gt;= 3">false</xsl:when>
322
324
  <xsl:when test="$level &lt;= 3">true</xsl:when>
@@ -324,8 +326,15 @@
324
326
  </xsl:choose>
325
327
  </xsl:variable>
326
328
 
329
+ <xsl:variable name="skip">
330
+ <xsl:choose>
331
+ <xsl:when test="ancestor-or-self::m3d:bibitem">true</xsl:when>
332
+ <xsl:when test="ancestor-or-self::m3d:term">true</xsl:when>
333
+ <xsl:otherwise>false</xsl:otherwise>
334
+ </xsl:choose>
335
+ </xsl:variable>
327
336
 
328
- <xsl:if test="$display = 'true'">
337
+ <xsl:if test="$skip = 'false'">
329
338
 
330
339
  <xsl:variable name="section">
331
340
  <xsl:call-template name="getSection"/>
@@ -339,12 +348,13 @@
339
348
  <xsl:value-of select="local-name()"/>
340
349
  </xsl:variable>
341
350
 
342
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
343
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
351
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
352
+ <title>
353
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
354
+ </title>
355
+ <xsl:apply-templates mode="contents"/>
344
356
  </item>
345
- <xsl:apply-templates mode="contents"/>
346
357
  </xsl:if>
347
-
348
358
  </xsl:template>
349
359
 
350
360
 
@@ -859,6 +869,12 @@
859
869
 
860
870
  </title-edition>
861
871
 
872
+ <title-edition lang="fr">
873
+
874
+ <xsl:text>Édition </xsl:text>
875
+
876
+ </title-edition>
877
+
862
878
 
863
879
  <title-toc lang="en">
864
880
 
@@ -867,7 +883,12 @@
867
883
 
868
884
 
869
885
  </title-toc>
870
- <title-toc lang="fr">Sommaire</title-toc>
886
+ <title-toc lang="fr">
887
+
888
+ <xsl:text>Sommaire</xsl:text>
889
+
890
+
891
+ </title-toc>
871
892
 
872
893
  <title-toc lang="zh">Contents</title-toc>
873
894
 
@@ -887,13 +908,22 @@
887
908
  <title-part lang="en">
888
909
 
889
910
 
911
+
890
912
  </title-part>
891
913
  <title-part lang="fr">
892
914
 
893
915
 
916
+
894
917
  </title-part>
895
918
  <title-part lang="zh">第 # 部分:</title-part>
896
919
 
920
+ <title-subpart lang="en">
921
+
922
+ </title-subpart>
923
+ <title-subpart lang="fr">
924
+
925
+ </title-subpart>
926
+
897
927
  <title-modified lang="en">modified</title-modified>
898
928
  <title-modified lang="fr">modifiée</title-modified>
899
929
 
@@ -955,10 +985,19 @@
955
985
 
956
986
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
957
987
  <xsl:param name="name"/>
958
- <xsl:variable name="lang">
959
- <xsl:call-template name="getLang"/>
988
+ <xsl:param name="lang"/>
989
+ <xsl:variable name="lang_">
990
+ <xsl:choose>
991
+ <xsl:when test="$lang != ''">
992
+ <xsl:value-of select="$lang"/>
993
+ </xsl:when>
994
+ <xsl:otherwise>
995
+ <xsl:call-template name="getLang"/>
996
+ </xsl:otherwise>
997
+ </xsl:choose>
960
998
  </xsl:variable>
961
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
999
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1000
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
962
1001
  <xsl:choose>
963
1002
  <xsl:when test="normalize-space($title_) != ''">
964
1003
  <xsl:value-of select="$title_"/>
@@ -967,7 +1006,9 @@
967
1006
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
968
1007
  </xsl:otherwise>
969
1008
  </xsl:choose>
970
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1009
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1010
+
1011
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
971
1012
 
972
1013
  <xsl:attribute name="color">blue</xsl:attribute>
973
1014
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1106,6 +1147,7 @@
1106
1147
 
1107
1148
 
1108
1149
 
1150
+
1109
1151
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1110
1152
 
1111
1153
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1151,6 +1193,7 @@
1151
1193
 
1152
1194
 
1153
1195
 
1196
+
1154
1197
  </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">
1155
1198
 
1156
1199
 
@@ -1222,6 +1265,7 @@
1222
1265
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1223
1266
 
1224
1267
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1268
+
1225
1269
 
1226
1270
 
1227
1271
 
@@ -1346,6 +1390,10 @@
1346
1390
 
1347
1391
 
1348
1392
 
1393
+ <!-- <xsl:if test="$namespace = 'bipm'">
1394
+ <fo:block>&#xA0;</fo:block>
1395
+ </xsl:if> -->
1396
+
1349
1397
  <!-- $namespace = 'iso' or -->
1350
1398
 
1351
1399
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1383,6 +1431,7 @@
1383
1431
  <xsl:with-param name="table" select="$simple-table"/>
1384
1432
  </xsl:call-template>
1385
1433
  </xsl:variable>
1434
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1386
1435
 
1387
1436
  <!-- <xsl:variable name="colwidths2">
1388
1437
  <xsl:call-template name="calculate-column-widths">
@@ -1404,27 +1453,49 @@
1404
1453
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1405
1454
 
1406
1455
 
1456
+
1457
+
1458
+
1407
1459
 
1408
1460
 
1461
+
1409
1462
 
1410
-
1411
1463
 
1412
1464
 
1413
1465
 
1414
- <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">
1415
-
1416
-
1417
-
1418
-
1419
-
1466
+
1467
+
1468
+
1469
+ <xsl:variable name="table_attributes">
1470
+ <attribute name="table-layout">fixed</attribute>
1471
+ <attribute name="width">100%</attribute>
1472
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1473
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1420
1474
 
1421
1475
 
1422
1476
 
1423
1477
 
1478
+
1479
+
1480
+
1424
1481
 
1482
+
1425
1483
 
1484
+ </xsl:variable>
1485
+
1486
+
1487
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1426
1488
 
1489
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1490
+ <xsl:attribute name="{@name}">
1491
+ <xsl:value-of select="."/>
1492
+ </xsl:attribute>
1493
+ </xsl:for-each>
1427
1494
 
1495
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1496
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1497
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1498
+ </xsl:if>
1428
1499
 
1429
1500
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1430
1501
  <xsl:choose>
@@ -1448,6 +1519,33 @@
1448
1519
 
1449
1520
  </fo:table>
1450
1521
 
1522
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1523
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1524
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1525
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1526
+ </xsl:call-template>
1527
+ </xsl:for-each>
1528
+
1529
+ <!-- insert footer as table -->
1530
+ <!-- <fo:table>
1531
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1532
+ <xsl:attribute name="{@name}">
1533
+ <xsl:value-of select="."/>
1534
+ </xsl:attribute>
1535
+ </xsl:for-each>
1536
+
1537
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1538
+ <xsl:choose>
1539
+ <xsl:when test=". = 1 or . = 0">
1540
+ <fo:table-column column-width="proportional-column-width(2)"/>
1541
+ </xsl:when>
1542
+ <xsl:otherwise>
1543
+ <fo:table-column column-width="proportional-column-width({.})"/>
1544
+ </xsl:otherwise>
1545
+ </xsl:choose>
1546
+ </xsl:for-each>
1547
+ </fo:table>-->
1548
+
1451
1549
 
1452
1550
 
1453
1551
 
@@ -1457,6 +1555,7 @@
1457
1555
  <xsl:if test="normalize-space() != ''">
1458
1556
  <fo:block xsl:use-attribute-sets="table-name-style">
1459
1557
 
1558
+
1460
1559
  <xsl:apply-templates/>
1461
1560
  </fo:block>
1462
1561
  </xsl:if>
@@ -1512,6 +1611,13 @@
1512
1611
  <xsl:for-each select="xalan:nodeset($table)//tr">
1513
1612
  <xsl:variable name="td_text">
1514
1613
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1614
+
1615
+ <!-- <xsl:if test="$namespace = 'bipm'">
1616
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1617
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1618
+ </xsl:for-each>
1619
+ </xsl:if> -->
1620
+
1515
1621
  </xsl:variable>
1516
1622
  <xsl:variable name="words">
1517
1623
  <xsl:variable name="string_with_added_zerospaces">
@@ -1571,11 +1677,14 @@
1571
1677
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1572
1678
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1573
1679
  <xsl:value-of select="@target"/>
1680
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1681
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1682
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1574
1683
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1575
1684
  <xsl:param name="cols-count"/>
1576
1685
  <!-- font-weight="bold" -->
1577
1686
  <fo:table-header>
1578
-
1687
+
1579
1688
  <xsl:apply-templates/>
1580
1689
  </fo:table-header>
1581
1690
  </xsl:template><xsl:template name="table-header-title">
@@ -1600,6 +1709,13 @@
1600
1709
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1601
1710
  <xsl:apply-templates/>
1602
1711
  </xsl:template><xsl:template name="insertTableFooter">
1712
+ <xsl:param name="cols-count"/>
1713
+ <xsl:if test="../*[local-name()='tfoot']">
1714
+ <fo:table-footer>
1715
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1716
+ </fo:table-footer>
1717
+ </xsl:if>
1718
+ </xsl:template><xsl:template name="insertTableFooter2">
1603
1719
  <xsl:param name="cols-count"/>
1604
1720
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1605
1721
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1621,11 +1737,29 @@
1621
1737
  <!-- fn will be processed inside 'note' processing -->
1622
1738
 
1623
1739
 
1740
+
1741
+
1742
+
1743
+
1624
1744
  <!-- except gb -->
1625
1745
 
1626
1746
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1627
1747
 
1628
1748
 
1749
+ <!-- show Note under table in preface (ex. abstract) sections -->
1750
+ <!-- empty, because notes show at page side in main sections -->
1751
+ <!-- <xsl:if test="$namespace = 'bipm'">
1752
+ <xsl:choose>
1753
+ <xsl:when test="ancestor::*[local-name()='preface']">
1754
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1755
+ </xsl:when>
1756
+ <xsl:otherwise>
1757
+ <fo:block/>
1758
+ </xsl:otherwise>
1759
+ </xsl:choose>
1760
+ </xsl:if> -->
1761
+
1762
+
1629
1763
  <!-- horizontal row separator -->
1630
1764
 
1631
1765
 
@@ -1639,6 +1773,88 @@
1639
1773
  </fo:table-footer>
1640
1774
 
1641
1775
  </xsl:if>
1776
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1777
+ <xsl:param name="table_attributes"/>
1778
+ <xsl:param name="colwidths"/>
1779
+
1780
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1781
+
1782
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1783
+
1784
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1785
+
1786
+ <fo:table keep-with-previous="always">
1787
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1788
+ <xsl:choose>
1789
+ <xsl:when test="@name = 'border-top'">
1790
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1791
+ </xsl:when>
1792
+ <xsl:when test="@name = 'border'">
1793
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1794
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1795
+ </xsl:when>
1796
+ <xsl:otherwise>
1797
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1798
+ </xsl:otherwise>
1799
+ </xsl:choose>
1800
+ </xsl:for-each>
1801
+
1802
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1803
+ <xsl:choose>
1804
+ <xsl:when test=". = 1 or . = 0">
1805
+ <fo:table-column column-width="proportional-column-width(2)"/>
1806
+ </xsl:when>
1807
+ <xsl:otherwise>
1808
+ <fo:table-column column-width="proportional-column-width({.})"/>
1809
+ </xsl:otherwise>
1810
+ </xsl:choose>
1811
+ </xsl:for-each>
1812
+
1813
+ <fo:table-body>
1814
+ <fo:table-row>
1815
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1816
+
1817
+
1818
+
1819
+ <!-- fn will be processed inside 'note' processing -->
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+
1827
+ <!-- except gb -->
1828
+
1829
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1830
+
1831
+
1832
+ <!-- <xsl:if test="$namespace = 'bipm'">
1833
+ <xsl:choose>
1834
+ <xsl:when test="ancestor::*[local-name()='preface']">
1835
+ show Note under table in preface (ex. abstract) sections
1836
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ empty, because notes show at page side in main sections
1840
+ <fo:block/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:if> -->
1844
+
1845
+
1846
+ <!-- horizontal row separator -->
1847
+
1848
+
1849
+ <!-- fn processing -->
1850
+ <xsl:call-template name="fn_display"/>
1851
+
1852
+ </fo:table-cell>
1853
+ </fo:table-row>
1854
+ </fo:table-body>
1855
+
1856
+ </fo:table>
1857
+ </xsl:if>
1642
1858
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1643
1859
 
1644
1860
  <xsl:variable name="cols-count">
@@ -1691,8 +1907,12 @@
1691
1907
 
1692
1908
  </xsl:if>
1693
1909
 
1694
-
1695
-
1910
+
1911
+
1912
+
1913
+ <!-- <xsl:if test="$namespace = 'bipm'">
1914
+ <xsl:attribute name="height">8mm</xsl:attribute>
1915
+ </xsl:if> -->
1696
1916
 
1697
1917
  <xsl:apply-templates/>
1698
1918
  </fo:table-row>
@@ -1716,6 +1936,7 @@
1716
1936
 
1717
1937
 
1718
1938
 
1939
+
1719
1940
  <xsl:if test="@colspan">
1720
1941
  <xsl:attribute name="number-columns-spanned">
1721
1942
  <xsl:value-of select="@colspan"/>
@@ -1755,7 +1976,8 @@
1755
1976
 
1756
1977
 
1757
1978
 
1758
-
1979
+
1980
+
1759
1981
 
1760
1982
 
1761
1983
 
@@ -1773,7 +1995,8 @@
1773
1995
  </xsl:attribute>
1774
1996
  </xsl:if>
1775
1997
  <xsl:call-template name="display-align"/>
1776
- <fo:block>
1998
+ <fo:block>
1999
+
1777
2000
  <xsl:apply-templates/>
1778
2001
  </fo:block>
1779
2002
  </fo:table-cell>
@@ -1785,14 +2008,17 @@
1785
2008
 
1786
2009
 
1787
2010
 
2011
+
2012
+
1788
2013
  <fo:inline padding-right="2mm">
1789
2014
 
1790
2015
 
1791
2016
 
1792
-
2017
+
1793
2018
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1794
2019
 
1795
2020
  </fo:inline>
2021
+
1796
2022
  <xsl:apply-templates mode="process"/>
1797
2023
  </fo:block>
1798
2024
 
@@ -1816,6 +2042,7 @@
1816
2042
 
1817
2043
 
1818
2044
 
2045
+
1819
2046
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1820
2047
 
1821
2048
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1825,12 +2052,15 @@
1825
2052
 
1826
2053
 
1827
2054
 
2055
+
1828
2056
  <xsl:value-of select="@reference"/>
1829
2057
 
2058
+
1830
2059
  </fo:inline>
1831
2060
  <fo:inline>
1832
2061
 
1833
- <xsl:apply-templates/>
2062
+ <!-- <xsl:apply-templates /> -->
2063
+ <xsl:copy-of select="./node()"/>
1834
2064
  </fo:inline>
1835
2065
  </fo:block>
1836
2066
  </xsl:if>
@@ -1867,7 +2097,20 @@
1867
2097
  <xsl:variable name="following_dl_colwidths">
1868
2098
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1869
2099
  <xsl:variable name="html-table">
1870
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2100
+ <xsl:variable name="doc_ns">
2101
+
2102
+ </xsl:variable>
2103
+ <xsl:variable name="ns">
2104
+ <xsl:choose>
2105
+ <xsl:when test="normalize-space($doc_ns) != ''">
2106
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2107
+ </xsl:when>
2108
+ <xsl:otherwise>
2109
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2110
+ </xsl:otherwise>
2111
+ </xsl:choose>
2112
+ </xsl:variable>
2113
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1871
2114
  <xsl:element name="{$ns}:table">
1872
2115
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1873
2116
  <tbody>
@@ -1932,7 +2175,8 @@
1932
2175
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1933
2176
  </xsl:if>
1934
2177
 
1935
- <xsl:apply-templates/>
2178
+ <!-- <xsl:apply-templates /> -->
2179
+ <xsl:copy-of select="./node()"/>
1936
2180
  </fo:block>
1937
2181
  </fo:table-cell>
1938
2182
  </fo:table-row>
@@ -1951,9 +2195,12 @@
1951
2195
 
1952
2196
 
1953
2197
 
2198
+
1954
2199
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1955
2200
 
2201
+
1956
2202
  <xsl:value-of select="@reference"/>
2203
+
1957
2204
  </fo:basic-link>
1958
2205
  </fo:inline>
1959
2206
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1961,7 +2208,11 @@
1961
2208
  <xsl:apply-templates/>
1962
2209
  </fo:inline>
1963
2210
  </xsl:template><xsl:template match="*[local-name()='dl']">
1964
- <fo:block-container margin-left="0mm">
2211
+ <fo:block-container>
2212
+
2213
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2214
+
2215
+
1965
2216
  <xsl:if test="parent::*[local-name() = 'note']">
1966
2217
  <xsl:attribute name="margin-left">
1967
2218
  <xsl:choose>
@@ -1971,8 +2222,11 @@
1971
2222
  </xsl:attribute>
1972
2223
 
1973
2224
  </xsl:if>
1974
- <fo:block-container margin-left="0mm">
1975
-
2225
+ <fo:block-container>
2226
+
2227
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2228
+
2229
+
1976
2230
  <xsl:variable name="parent" select="local-name(..)"/>
1977
2231
 
1978
2232
  <xsl:variable name="key_iso">
@@ -1986,9 +2240,12 @@
1986
2240
  <fo:block margin-bottom="12pt" text-align="left">
1987
2241
 
1988
2242
  <xsl:variable name="title-where">
1989
- <xsl:call-template name="getTitle">
1990
- <xsl:with-param name="name" select="'title-where'"/>
1991
- </xsl:call-template>
2243
+
2244
+
2245
+ <xsl:call-template name="getTitle">
2246
+ <xsl:with-param name="name" select="'title-where'"/>
2247
+ </xsl:call-template>
2248
+
1992
2249
  </xsl:variable>
1993
2250
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1994
2251
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2004,9 +2261,12 @@
2004
2261
 
2005
2262
 
2006
2263
  <xsl:variable name="title-where">
2007
- <xsl:call-template name="getTitle">
2008
- <xsl:with-param name="name" select="'title-where'"/>
2009
- </xsl:call-template>
2264
+
2265
+
2266
+ <xsl:call-template name="getTitle">
2267
+ <xsl:with-param name="name" select="'title-where'"/>
2268
+ </xsl:call-template>
2269
+
2010
2270
  </xsl:variable>
2011
2271
  <xsl:value-of select="$title-where"/>
2012
2272
  </fo:block>
@@ -2017,9 +2277,12 @@
2017
2277
 
2018
2278
 
2019
2279
  <xsl:variable name="title-key">
2020
- <xsl:call-template name="getTitle">
2021
- <xsl:with-param name="name" select="'title-key'"/>
2022
- </xsl:call-template>
2280
+
2281
+
2282
+ <xsl:call-template name="getTitle">
2283
+ <xsl:with-param name="name" select="'title-key'"/>
2284
+ </xsl:call-template>
2285
+
2023
2286
  </xsl:variable>
2024
2287
  <xsl:value-of select="$title-key"/>
2025
2288
  </fo:block>
@@ -2051,7 +2314,20 @@
2051
2314
  </xsl:choose>
2052
2315
  <!-- create virtual html table for dl/[dt and dd] -->
2053
2316
  <xsl:variable name="html-table">
2054
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2317
+ <xsl:variable name="doc_ns">
2318
+
2319
+ </xsl:variable>
2320
+ <xsl:variable name="ns">
2321
+ <xsl:choose>
2322
+ <xsl:when test="normalize-space($doc_ns) != ''">
2323
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2324
+ </xsl:when>
2325
+ <xsl:otherwise>
2326
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2327
+ </xsl:otherwise>
2328
+ </xsl:choose>
2329
+ </xsl:variable>
2330
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2055
2331
  <xsl:element name="{$ns}:table">
2056
2332
  <tbody>
2057
2333
  <xsl:apply-templates mode="dl"/>
@@ -2195,6 +2471,7 @@
2195
2471
 
2196
2472
 
2197
2473
 
2474
+
2198
2475
  <xsl:apply-templates/>
2199
2476
  <!-- <xsl:if test="$namespace = 'gb'">
2200
2477
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2248,6 +2525,7 @@
2248
2525
  </fo:inline>
2249
2526
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2250
2527
  <fo:inline font-weight="bold">
2528
+
2251
2529
  <xsl:apply-templates/>
2252
2530
  </fo:inline>
2253
2531
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2261,9 +2539,9 @@
2261
2539
  </xsl:template><xsl:template match="*[local-name()='tt']">
2262
2540
  <fo:inline xsl:use-attribute-sets="tt-style">
2263
2541
  <xsl:variable name="_font-size">
2264
-
2265
-
2266
-
2542
+
2543
+
2544
+
2267
2545
 
2268
2546
 
2269
2547
 
@@ -2275,9 +2553,9 @@
2275
2553
  </xsl:choose>
2276
2554
 
2277
2555
 
2278
-
2279
2556
 
2280
-
2557
+
2558
+
2281
2559
 
2282
2560
 
2283
2561
  </xsl:variable>
@@ -2581,7 +2859,18 @@
2581
2859
  <xsl:with-param name="previousRow" select="$newRow"/>
2582
2860
  </xsl:apply-templates>
2583
2861
  </xsl:template><xsl:template name="getLang">
2584
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2862
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2863
+ <xsl:variable name="language">
2864
+ <xsl:choose>
2865
+ <xsl:when test="$language_current != ''">
2866
+ <xsl:value-of select="$language_current"/>
2867
+ </xsl:when>
2868
+ <xsl:otherwise>
2869
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2870
+ </xsl:otherwise>
2871
+ </xsl:choose>
2872
+ </xsl:variable>
2873
+
2585
2874
  <xsl:choose>
2586
2875
  <xsl:when test="$language = 'English'">en</xsl:when>
2587
2876
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2615,7 +2904,8 @@
2615
2904
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2616
2905
  <xsl:value-of select="substring($str, 2)"/>
2617
2906
  </xsl:template><xsl:template match="mathml:math">
2618
- <fo:inline font-family="STIX2Math">
2907
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2908
+
2619
2909
  <xsl:variable name="mathml">
2620
2910
  <xsl:apply-templates select="." mode="mathml"/>
2621
2911
  </xsl:variable>
@@ -2645,6 +2935,7 @@
2645
2935
  </xsl:choose>
2646
2936
  </xsl:variable>
2647
2937
  <fo:inline xsl:use-attribute-sets="link-style">
2938
+
2648
2939
  <xsl:choose>
2649
2940
  <xsl:when test="$target = ''">
2650
2941
  <xsl:apply-templates/>
@@ -2698,10 +2989,14 @@
2698
2989
  </fo:inline>
2699
2990
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2700
2991
  <xsl:variable name="title-modified">
2701
- <xsl:call-template name="getTitle">
2702
- <xsl:with-param name="name" select="'title-modified'"/>
2703
- </xsl:call-template>
2992
+
2993
+
2994
+ <xsl:call-template name="getTitle">
2995
+ <xsl:with-param name="name" select="'title-modified'"/>
2996
+ </xsl:call-template>
2997
+
2704
2998
  </xsl:variable>
2999
+
2705
3000
  <xsl:choose>
2706
3001
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2707
3002
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2709,7 +3004,7 @@
2709
3004
  <xsl:apply-templates/>
2710
3005
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2711
3006
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2712
-
3007
+
2713
3008
  <xsl:apply-templates/>
2714
3009
  </fo:basic-link>
2715
3010
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -2762,6 +3057,8 @@
2762
3057
 
2763
3058
 
2764
3059
 
3060
+
3061
+
2765
3062
  <fo:inline xsl:use-attribute-sets="note-name-style">
2766
3063
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2767
3064
  </fo:inline>
@@ -2856,7 +3153,8 @@
2856
3153
  </fo:inline>
2857
3154
  </xsl:if>
2858
3155
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
2859
- <fo:block-container id="{@id}">
3156
+ <fo:block-container id="{@id}">
3157
+
2860
3158
  <fo:block>
2861
3159
  <xsl:apply-templates/>
2862
3160
  </fo:block>
@@ -2891,15 +3189,109 @@
2891
3189
 
2892
3190
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2893
3191
  </fo:block>
2894
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3192
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2895
3193
  <xsl:apply-templates mode="contents"/>
2896
3194
  <xsl:text> </xsl:text>
2897
- </xsl:template><xsl:template match="text()" mode="contents">
3195
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
3196
+ <xsl:apply-templates mode="bookmarks"/>
3197
+ <xsl:text> </xsl:text>
3198
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3199
+ <xsl:value-of select="."/>
3200
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2898
3201
  <xsl:value-of select="."/>
2899
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3202
+ </xsl:template><xsl:template match="node()" mode="contents">
3203
+ <xsl:apply-templates mode="contents"/>
3204
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3205
+ <xsl:apply-templates mode="bookmarks"/>
3206
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3207
+ <xsl:apply-templates select="."/>
3208
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3209
+ <xsl:apply-templates mode="bookmarks"/>
3210
+ </xsl:template><xsl:template name="addBookmarks">
3211
+ <xsl:param name="contents"/>
3212
+ <xsl:if test="xalan:nodeset($contents)//item">
3213
+ <fo:bookmark-tree>
3214
+ <xsl:choose>
3215
+ <xsl:when test="xalan:nodeset($contents)/doc">
3216
+ <xsl:choose>
3217
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3218
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3219
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3220
+ <fo:bookmark-title>
3221
+ <xsl:variable name="bookmark-title_">
3222
+ <xsl:call-template name="getLangVersion">
3223
+ <xsl:with-param name="lang" select="@lang"/>
3224
+ </xsl:call-template>
3225
+ </xsl:variable>
3226
+ <xsl:choose>
3227
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3228
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3229
+ </xsl:when>
3230
+ <xsl:otherwise>
3231
+ <xsl:choose>
3232
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3233
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3234
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3235
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3236
+ </xsl:choose>
3237
+ </xsl:otherwise>
3238
+ </xsl:choose>
3239
+ </fo:bookmark-title>
3240
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3241
+ </fo:bookmark>
3242
+
3243
+ </xsl:for-each>
3244
+ </xsl:when>
3245
+ <xsl:otherwise>
3246
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3247
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3248
+ </xsl:for-each>
3249
+ </xsl:otherwise>
3250
+ </xsl:choose>
3251
+ </xsl:when>
3252
+ <xsl:otherwise>
3253
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3254
+ </xsl:otherwise>
3255
+ </xsl:choose>
3256
+
3257
+
3258
+
3259
+
3260
+
3261
+
3262
+
3263
+
3264
+ </fo:bookmark-tree>
3265
+ </xsl:if>
3266
+ </xsl:template><xsl:template name="getLangVersion">
3267
+ <xsl:param name="lang"/>
3268
+ <xsl:choose>
3269
+ <xsl:when test="$lang = 'en'">
3270
+
3271
+
3272
+ </xsl:when>
3273
+ <xsl:when test="$lang = 'fr'">
3274
+
3275
+
3276
+ </xsl:when>
3277
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3278
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3279
+ </xsl:choose>
3280
+ </xsl:template><xsl:template match="item" mode="bookmark">
3281
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3282
+ <fo:bookmark-title>
3283
+ <xsl:if test="@section != ''">
3284
+ <xsl:value-of select="@section"/>
3285
+ <xsl:text> </xsl:text>
3286
+ </xsl:if>
3287
+ <xsl:value-of select="normalize-space(title)"/>
3288
+ </fo:bookmark-title>
3289
+ <xsl:apply-templates mode="bookmark"/>
3290
+ </fo:bookmark>
3291
+ </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">
2900
3292
  <xsl:if test="normalize-space() != ''">
2901
3293
  <fo:block xsl:use-attribute-sets="figure-name-style">
2902
-
3294
+
2903
3295
  <xsl:apply-templates/>
2904
3296
  </fo:block>
2905
3297
  </xsl:if>
@@ -2954,7 +3346,7 @@
2954
3346
  <xsl:apply-templates/>
2955
3347
  </xsl:otherwise>
2956
3348
  </xsl:choose>
2957
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3349
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2958
3350
  <xsl:text> </xsl:text>
2959
3351
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2960
3352
  <xsl:copy>
@@ -3482,9 +3874,12 @@
3482
3874
  </fo:block>
3483
3875
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3484
3876
  <xsl:variable name="title-deprecated">
3485
- <xsl:call-template name="getTitle">
3486
- <xsl:with-param name="name" select="'title-deprecated'"/>
3487
- </xsl:call-template>
3877
+
3878
+
3879
+ <xsl:call-template name="getTitle">
3880
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3881
+ </xsl:call-template>
3882
+
3488
3883
  </xsl:variable>
3489
3884
  <fo:block xsl:use-attribute-sets="deprecates-style">
3490
3885
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3533,13 +3928,14 @@
3533
3928
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3534
3929
  <fo:block>
3535
3930
  <xsl:call-template name="setId"/>
3931
+
3536
3932
  <xsl:apply-templates/>
3537
3933
  </fo:block>
3538
3934
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3539
3935
  <fo:block id="{@id}">
3540
3936
  <xsl:apply-templates/>
3541
3937
  </fo:block>
3542
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3938
+ </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']">
3543
3939
 
3544
3940
  <fo:block id="{@id}">
3545
3941
  <xsl:apply-templates/>
@@ -3558,20 +3954,30 @@
3558
3954
  <!-- 0xA0 to space replacement -->
3559
3955
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3560
3956
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3561
- <fo:block-container margin-left="0mm">
3562
- <xsl:if test="parent::*[local-name() = 'note']">
3563
- <xsl:attribute name="margin-left">
3564
- <xsl:choose>
3565
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3566
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3567
- </xsl:choose>
3568
- </xsl:attribute>
3569
-
3570
- </xsl:if>
3571
- <fo:block-container margin-left="0mm">
3572
- <xsl:apply-templates select="." mode="ul_ol"/>
3573
- </fo:block-container>
3574
- </fo:block-container>
3957
+ <xsl:choose>
3958
+ <xsl:when test="parent::*[local-name() = 'note']">
3959
+ <fo:block-container>
3960
+ <xsl:attribute name="margin-left">
3961
+ <xsl:choose>
3962
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3963
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3964
+ </xsl:choose>
3965
+ </xsl:attribute>
3966
+
3967
+
3968
+ <fo:block-container margin-left="0mm">
3969
+ <fo:block>
3970
+ <xsl:apply-templates select="." mode="ul_ol"/>
3971
+ </fo:block>
3972
+ </fo:block-container>
3973
+ </fo:block-container>
3974
+ </xsl:when>
3975
+ <xsl:otherwise>
3976
+ <fo:block>
3977
+ <xsl:apply-templates select="." mode="ul_ol"/>
3978
+ </fo:block>
3979
+ </xsl:otherwise>
3980
+ </xsl:choose>
3575
3981
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3576
3982
  <!-- <row>
3577
3983
  <date>05-07-2013</date>
@@ -3742,6 +4148,7 @@
3742
4148
 
3743
4149
 
3744
4150
 
4151
+
3745
4152
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title']"/>
3746
4153
 
3747
4154
 
@@ -3760,6 +4167,7 @@
3760
4167
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
3761
4168
 
3762
4169
 
4170
+
3763
4171
  </dc:creator>
3764
4172
  <dc:description>
3765
4173
  <xsl:variable name="abstract">
@@ -3767,6 +4175,7 @@
3767
4175
 
3768
4176
 
3769
4177
 
4178
+
3770
4179
  </xsl:variable>
3771
4180
  <xsl:value-of select="normalize-space($abstract)"/>
3772
4181
  </dc:description>
@@ -3838,13 +4247,22 @@
3838
4247
  </xsl:template><xsl:template name="split">
3839
4248
  <xsl:param name="pText" select="."/>
3840
4249
  <xsl:param name="sep" select="','"/>
4250
+ <xsl:param name="normalize-space" select="'true'"/>
3841
4251
  <xsl:if test="string-length($pText) &gt;0">
3842
4252
  <item>
3843
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4253
+ <xsl:choose>
4254
+ <xsl:when test="$normalize-space = 'true'">
4255
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4256
+ </xsl:when>
4257
+ <xsl:otherwise>
4258
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4259
+ </xsl:otherwise>
4260
+ </xsl:choose>
3844
4261
  </item>
3845
4262
  <xsl:call-template name="split">
3846
4263
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3847
4264
  <xsl:with-param name="sep" select="$sep"/>
4265
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3848
4266
  </xsl:call-template>
3849
4267
  </xsl:if>
3850
4268
  </xsl:template><xsl:template name="getDocumentId">
@@ -3867,6 +4285,7 @@
3867
4285
 
3868
4286
 
3869
4287
 
4288
+
3870
4289
  </xsl:variable>
3871
4290
  <xsl:if test="$documentNS != $XSLNS">
3872
4291
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3892,4 +4311,40 @@
3892
4311
  </xsl:otherwise>
3893
4312
  </xsl:choose>
3894
4313
  </xsl:attribute>
4314
+ </xsl:template><xsl:template name="add-letter-spacing">
4315
+ <xsl:param name="text"/>
4316
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4317
+ <xsl:if test="string-length($text) &gt; 0">
4318
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4319
+ <fo:inline padding-right="{$letter-spacing}mm">
4320
+ <xsl:if test="$char = '®'">
4321
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4322
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4323
+ </xsl:if>
4324
+ <xsl:value-of select="$char"/>
4325
+ </fo:inline>
4326
+ <xsl:call-template name="add-letter-spacing">
4327
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4328
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4329
+ </xsl:call-template>
4330
+ </xsl:if>
4331
+ </xsl:template><xsl:template name="repeat">
4332
+ <xsl:param name="char" select="'*'"/>
4333
+ <xsl:param name="count"/>
4334
+ <xsl:if test="$count &gt; 0">
4335
+ <xsl:value-of select="$char"/>
4336
+ <xsl:call-template name="repeat">
4337
+ <xsl:with-param name="char" select="$char"/>
4338
+ <xsl:with-param name="count" select="$count - 1"/>
4339
+ </xsl:call-template>
4340
+ </xsl:if>
4341
+ </xsl:template><xsl:template name="getLocalizedString">
4342
+ <xsl:param name="key"/>
4343
+
4344
+ <xsl:variable name="curr_lang">
4345
+ <xsl:call-template name="getLang"/>
4346
+ </xsl:variable>
4347
+
4348
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4349
+
3895
4350
  </xsl:template></xsl:stylesheet>