metanorma-m3aawg 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +63 -0
  3. data/README.adoc +2 -4
  4. data/lib/asciidoctor/m3aawg/basicdoc.rng +23 -0
  5. data/lib/asciidoctor/m3aawg/converter.rb +4 -49
  6. data/lib/asciidoctor/m3aawg/isodoc.rng +135 -58
  7. data/lib/asciidoctor/m3aawg/m3d.rng +7 -0
  8. data/lib/isodoc/m3aawg/base_convert.rb +2 -12
  9. data/lib/isodoc/m3aawg/html/header.html +5 -4
  10. data/lib/isodoc/m3aawg/html/html_m3d_intro.html +2 -1
  11. data/lib/isodoc/m3aawg/html/html_m3d_titlepage.html +3 -4
  12. data/lib/isodoc/m3aawg/html/htmlstyle.css +8 -1
  13. data/lib/isodoc/m3aawg/html/htmlstyle.scss +3 -0
  14. data/lib/isodoc/m3aawg/html/m3d.css +16 -4
  15. data/lib/isodoc/m3aawg/html/m3d.scss +18 -4
  16. data/lib/isodoc/m3aawg/html/word_m3d_intro.html +3 -1
  17. data/lib/isodoc/m3aawg/html/word_m3d_titlepage.html +6 -0
  18. data/lib/isodoc/m3aawg/html_convert.rb +15 -33
  19. data/lib/isodoc/m3aawg/i18n.rb +3 -4
  20. data/lib/isodoc/m3aawg/init.rb +2 -5
  21. data/lib/isodoc/m3aawg/m3d.report.xsl +919 -206
  22. data/lib/isodoc/m3aawg/metadata.rb +5 -17
  23. data/lib/isodoc/m3aawg/presentation_xml_convert.rb +11 -6
  24. data/lib/isodoc/m3aawg/word_convert.rb +4 -35
  25. data/lib/isodoc/m3aawg/xref.rb +5 -0
  26. data/lib/metanorma/m3aawg.rb +28 -2
  27. data/lib/metanorma/m3aawg/processor.rb +4 -1
  28. data/lib/metanorma/m3aawg/version.rb +1 -1
  29. data/metanorma-m3d.gemspec +1 -1
  30. data/metanorma.yml +45 -0
  31. metadata +7 -9
  32. data/.github/workflows/macos.yml +0 -38
  33. data/.github/workflows/ubuntu.yml +0 -56
  34. data/.github/workflows/windows.yml +0 -40
  35. data/lib/asciidoctor/m3aawg/validate.rb +0 -22
@@ -89,6 +89,13 @@
89
89
  </define>
90
90
  <define name="m3d-standard">
91
91
  <element name="m3d-standard">
92
+ <attribute name="version"/>
93
+ <attribute name="type">
94
+ <choice>
95
+ <value>semantic</value>
96
+ <value>presentation</value>
97
+ </choice>
98
+ </attribute>
92
99
  <ref name="bibdata"/>
93
100
  <zeroOrMore>
94
101
  <ref name="termdocsource"/>
@@ -3,18 +3,8 @@ require "fileutils"
3
3
  module IsoDoc
4
4
  module M3AAWG
5
5
  module BaseRender
6
- def cleanup(docxml)
7
- super
8
- term_cleanup(docxml)
9
- end
10
-
11
- def term_cleanup(docxml)
12
- docxml.xpath("//p[@class = 'Terms']").each do |d|
13
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
14
- h2.add_child("&nbsp;")
15
- h2.add_child(d.remove)
16
- end
17
- docxml
6
+ def configuration
7
+ Metanorma::M3AAWG.configuration
18
8
  end
19
9
  end
20
10
  end
@@ -144,7 +144,7 @@ mso-element-top:.05pt;mso-height-rule:exactly'>
144
144
  </table>
145
145
  </div>
146
146
  <p class=MsoFooter><b style='mso-bidi-font-weight:normal'><span lang=EN-US
147
- style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
147
+ style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}{% if edition %}, Version {{edition}}{% endif %}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
148
148
  <p class=MsoFooter style='margin-right:18.0pt;tab-stops:center 181.5pt right 432.0pt'><span
149
149
  lang=EN-US style='mso-bidi-font-size:12.0pt;mso-bidi-font-family:Arial;
150
150
  background:#E0E0E0'><o:p>&nbsp;</o:p></span></p>
@@ -173,7 +173,7 @@ mso-element-top:.05pt;mso-height-rule:exactly'>
173
173
  </table>
174
174
  </div>
175
175
  <p class=MsoFooterLandscape><b style='mso-bidi-font-weight:normal'><span lang=EN-US
176
- style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
176
+ style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}{% if edition %}, Version {{edition}}{% endif %}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
177
177
  <p class=MsoFooterLandscape style='margin-right:18.0pt;tab-stops:center 181.5pt right 432.0pt'><span
178
178
  lang=EN-US style='mso-bidi-font-size:12.0pt;mso-bidi-font-family:Arial;
179
179
  background:#E0E0E0'><o:p>&nbsp;</o:p></span></p>
@@ -255,7 +255,7 @@ lang=EN-US style='font-size:8.0pt;mso-bidi-font-family:Arial'><o:p></o:p></span>
255
255
  </div>
256
256
 
257
257
  <p class=MsoFooter><b style='mso-bidi-font-weight:normal'><span lang=EN-US
258
- style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
258
+ style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}{% if edition %}, Version {{edition}}{% endif %}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
259
259
 
260
260
  </div>
261
261
 
@@ -313,7 +313,7 @@ lang=EN-US style='font-size:8.0pt;mso-bidi-font-family:Arial'><o:p></o:p></span>
313
313
  </div>
314
314
 
315
315
  <p class=MsoFooterLandscape><b style='mso-bidi-font-weight:normal'><span lang=EN-US
316
- style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
316
+ style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>{{doctitle}}{% if edition %}, Version {{edition}}{% endif %}<span style='mso-tab-count:2'>                                                                                                                                                                         </span><o:p></o:p></span></b></p>
317
317
 
318
318
  </div>
319
319
 
@@ -321,6 +321,7 @@ style='font-size:8.0pt;font-family:"Garamond",serif;mso-bidi-font-family:Arial'>
321
321
 
322
322
  <p class=MsoFooter>As with all M3AAWG documents that we publish, please check the M3AAWG website (<a href="http://www.m3aawg.org">www.m3aawg.org</a>) for updates to this paper.</p>
323
323
  <p class=MsoFooter>&copy; {{docyear}} copyright by the Messaging, Malware and Mobile Anti-Abuse Working Group (M3AAWG)</p>
324
+ <p class=MsoFooter style="font-size:9pt;">{{docnumber}}</p>
324
325
  </div>
325
326
 
326
327
  </body>
@@ -1,7 +1,8 @@
1
1
  <div class="coverpage">
2
2
  <p class="coverpage-title">Messaging, Malware and Mobile Anti-Abuse Working Group</p>
3
3
  <p class="coverpage-doc-identity">{{doctitle}}</p>
4
- <p class="coverpage-date">{{revdate_monthyear}}</p>
4
+ {% if edition %}<p class="coverpage-date">{{edition}}</p>{% endif %}
5
+ {% if revdate_monthyear %}<p class="coverpage-date">{{revdate_monthyear}}</p>{% endif %}
5
6
  </div>
6
7
 
7
8
  <nav>
@@ -3,7 +3,7 @@
3
3
  </div>
4
4
 
5
5
  <div class="document-type-band" id="standard-band">
6
- <p class="document-type">Ribose {{ doctype }}</p>
6
+ <p class="document-type">M3AAWG {{ doctype }}</p>
7
7
  </div>
8
8
 
9
9
 
@@ -31,11 +31,10 @@
31
31
  </div>
32
32
 
33
33
  <div class="docinfo">
34
+ {% if edition %}Version {{edition}}<br/>{% endif %}
34
35
  {% if revdate_monthyear -%}Updated <span class="date">{{ revdate_monthyear }}</span>{%- endif -%}{%- if revdate_monthyear and draft -%},{%- endif -%}{%- if draft -%}Version <span class="version">{{ draft }}</span>{%- endif -%}
35
36
  <br/>
36
- {% if url %}
37
- Shortened URL to this document: <a href="{{ url }}">{{ url }}</a>
38
- {% endif %}
37
+ {% if url %}Shortened URL to this document: <a href="{{ url }}">{{ url }}</a>{% endif %}
39
38
  </div>
40
39
 
41
40
  {% if tc %}
@@ -23,7 +23,7 @@ fieldset, form, label, legend,
23
23
  table, caption, tbody, tfoot, thead, tr, th, td,
24
24
  article, aside, canvas, details, embed,
25
25
  figure, figcaption, footer, header, hgroup,
26
- menu, nav, output, ruby, section, summary,
26
+ menu, output, ruby, section, summary,
27
27
  time, mark, audio, video {
28
28
  margin: 0;
29
29
  padding: 0; }
@@ -118,6 +118,10 @@ b, strong {
118
118
  div.document-stage-band, div.document-type-band {
119
119
  background-color: #333333; }
120
120
 
121
+ a.FootnoteRef + a.FootnoteRef:before {
122
+ content: ", ";
123
+ vertical-align: super; }
124
+
121
125
  #standard-band {
122
126
  background-color: #0AC442; }
123
127
 
@@ -238,6 +242,9 @@ body {
238
242
  main {
239
243
  margin: 0 3em 0 6em; }
240
244
 
245
+ div.colophon {
246
+ margin: 0 3em 0 6em; }
247
+
241
248
  #toc {
242
249
  font-family: {{bodyfont}};
243
250
  font-weight: 400; }
@@ -28,6 +28,9 @@ body {
28
28
  main {
29
29
  margin: 0 3em 0 6em;
30
30
  }
31
+ div.colophon {
32
+ margin: 0 3em 0 6em;
33
+ }
31
34
 
32
35
  #toc {
33
36
  @include toc(#69C5DC, #69C5DC, #69C5DC);
@@ -562,7 +562,7 @@ table.dl {
562
562
  margin-bottom: 11.0pt;
563
563
  margin-left: 20.15pt; }
564
564
 
565
- table.MsoISOTable {
565
+ table.MsoISOTable, table.MsoISOTableBig {
566
566
  mso-style-name: "Table ISO";
567
567
  mso-tstyle-rowband-size: 0;
568
568
  mso-tstyle-colband-size: 0;
@@ -583,17 +583,17 @@ table.MsoISOTable {
583
583
  font-size: 10.0pt;
584
584
  font-family: {{bodyfont}}; }
585
585
 
586
- table.MsoISOTable th {
586
+ table.MsoISOTable th, table.MsoISOTableBig th {
587
587
  border: solid windowtext 1pt;
588
588
  mso-border-alt: solid windowtext 1pt;
589
589
  padding: 0cm 2.85pt 0cm 2.85pt; }
590
590
 
591
- table.MsoISOTable td {
591
+ table.MsoISOTable td, table.MsoISOTableBig td {
592
592
  border: solid windowtext 1pt;
593
593
  mso-border-alt: solid windowtext 1pt;
594
594
  padding: 0cm 2.85pt 0cm 2.85pt; }
595
595
 
596
- table.MsoISOTable p {
596
+ table.MsoISOTable p, table.MsoISOTableBig p {
597
597
  font-size: 10.0pt; }
598
598
 
599
599
  table.MsoTableGrid {
@@ -751,8 +751,20 @@ div.example p.MsoListParagraph {
751
751
  font-size: 10.0pt; }
752
752
 
753
753
  div.Note p.MsoListParagraph {
754
+ font-size: 10.0pt;
755
+ margin-left: 1.0cm; }
756
+
757
+ div.Note span.stem {
754
758
  font-size: 10.0pt; }
755
759
 
760
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
761
+ font-size: 8.0pt;
762
+ margin-left: 1.0cm; }
763
+
764
+ div.Note table.dl {
765
+ font-size: 10.0pt;
766
+ margin-left: 1.0cm; }
767
+
756
768
  span.note_label, span.example_label, td.example_label, td.note_label {
757
769
  font-size: 10.0pt;
758
770
  font-family: {{bodyfont}}; }
@@ -534,7 +534,7 @@ table.dl
534
534
  margin-right:0cm;
535
535
  margin-bottom:11.0pt;
536
536
  margin-left:20.15pt;}
537
- table.MsoISOTable
537
+ table.MsoISOTable, table.MsoISOTableBig
538
538
  {mso-style-name:"Table ISO";
539
539
  mso-tstyle-rowband-size:0;
540
540
  mso-tstyle-colband-size:0;
@@ -554,15 +554,15 @@ table.MsoISOTable
554
554
  mso-border-insidev:.75pt solid windowtext;
555
555
  font-size:10.0pt;
556
556
  font-family:$bodyfont;}
557
- table.MsoISOTable th
557
+ table.MsoISOTable th, table.MsoISOTableBig th
558
558
  {border:solid windowtext 1pt;
559
559
  mso-border-alt:solid windowtext 1pt;
560
560
  padding:0cm 2.85pt 0cm 2.85pt;}
561
- table.MsoISOTable td
561
+ table.MsoISOTable td, table.MsoISOTableBig td
562
562
  {border:solid windowtext 1pt;
563
563
  mso-border-alt:solid windowtext 1pt;
564
564
  padding:0cm 2.85pt 0cm 2.85pt;}
565
- table.MsoISOTable p
565
+ table.MsoISOTable p, table.MsoISOTableBig p
566
566
  {font-size:10.0pt; }
567
567
  table.MsoTableGrid
568
568
  {mso-style-name:"Table Grid";
@@ -733,6 +733,20 @@ div.example p.MsoListParagraph {
733
733
 
734
734
  div.Note p.MsoListParagraph {
735
735
  font-size: 10.0pt;
736
+ margin-left: 1.0cm;
737
+ }
738
+
739
+ div.Note span.stem {
740
+ font-size: 10.0pt; }
741
+
742
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
743
+ font-size: 8.0pt;
744
+ margin-left: 1.0cm;
745
+ }
746
+
747
+ div.Note table.dl {
748
+ font-size: 10.0pt;
749
+ margin-left: 1.0cm;
736
750
  }
737
751
 
738
752
  span.note_label, span.example_label, td.example_label, td.note_label
@@ -1,7 +1,9 @@
1
1
  <div class="coverpage">
2
2
  <p class="zzSTDPreTitle">Messaging, Malware and Mobile Anti-Abuse Working Group</p>
3
3
  <p class="zzSTDTitle1">{{doctitle}}</p>
4
- <p><b>{{revdate_monthyear}}</b></p>
4
+ {% if edition %}<p><b>Version {{edition}}</b></p>{% endif %}
5
+ {% if revdate_monthyear %}<p><b>{{revdate_monthyear}}</b></p>{% endif %}
6
+ {% if url %}<p align='center' style="margin-top:12pt;">The direct URL to this paper is: <a href="{{url}}">{{url}}</a></p>{% endif %}
5
7
  </div>
6
8
 
7
9
 
@@ -26,6 +26,12 @@ lang="EN-GB" style='font-size:40.0pt'>{% if unpublished %}{{ stage }}{% endif %}
26
26
 
27
27
  </div>
28
28
 
29
+ {% if url %}
30
+ <p class="MsoNormal" align="center" style='text-align:center'><span
31
+ lang="EN-GB" style='font-size:12.0pt'>The direct URL to this paper is: <a href='{{url}}'>{{url}}</a></span></p>
32
+ {% endif %}
33
+
34
+
29
35
  <p class="MsoNormal" style='margin-bottom:6.0pt'><span lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
30
36
 
31
37
  {% if unpublished %}
@@ -1,54 +1,36 @@
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' : '"Overpass",sans-serif'),
18
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
19
- monospacefont: '"Space Mono",monospace'
20
- }
8
+ class HtmlConvert < IsoDoc::Generic::HtmlConvert
9
+ def configuration
10
+ Metanorma::M3AAWG.configuration
21
11
  end
22
12
 
23
- def default_file_locations(_options)
24
- {
25
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
26
- htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
27
- htmlintropage: html_doc_path("html_m3d_intro.html"),
28
- standardstylesheet: nil,
29
- scripts: html_doc_path("scripts.html"),
30
- }
13
+ def initialize(options)
14
+ #require "byebug"; byebug
15
+ super
31
16
  end
32
17
 
33
18
  def colophon(body, docxml)
34
19
  body.div **{ class: "colophon" } do |div|
35
20
  div << <<~"COLOPHON"
36
- <p>As with all M3AAWG documents that we publish, please check the M3AAWG website
37
- (<a href="http://www.m3aawg.org">www.m3aawg.org</a>) for updates to this paper.</p>
38
- <p>&copy; {{ docyear }} copyright by the Messaging, Malware and Mobile Anti-Abuse Working Group (M3AAWG)</p>
21
+ <p>As with all M<sup>3</sup>AAWG documents that we publish,
22
+ please check the M<sup>3</sup>AAWG website
23
+ (<a href="http://www.m3aawg.org">www.m3aawg.org</a>) for updates to
24
+ this paper.</p>
25
+ <p>&copy; #{@meta.get[:docyear]} copyright by the Messaging, Malware
26
+ and Mobile Anti-Abuse Working Group (M<sup>3</sup>AAWG)</p>
39
27
  COLOPHON
40
28
  end
41
29
  end
42
30
 
43
- def googlefonts()
44
- <<~HEAD.freeze
45
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
46
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
47
- HEAD
48
- end
49
-
50
31
  def make_body(xml, docxml)
51
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
32
+ body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72",
33
+ "xml:lang": "EN-US", class: "container" }
52
34
  xml.body **body_attr do |body|
53
35
  make_body1(body, docxml)
54
36
  make_body2(body, docxml)
@@ -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
 
@@ -635,7 +645,7 @@
635
645
 
636
646
 
637
647
 
638
- <xsl:template match="m3d:ul | m3d:ol">
648
+ <xsl:template match="m3d:ul | m3d:ol" mode="ul_ol">
639
649
  <fo:block-container margin-left="6mm">
640
650
  <fo:block-container margin-left="0mm">
641
651
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="6mm"> <!-- margin-bottom="8pt" -->
@@ -673,7 +683,9 @@
673
683
  </fo:list-item>
674
684
  </xsl:template>
675
685
 
676
-
686
+ <xsl:template match="m3d:note" mode="process">
687
+ <xsl:call-template name="note"/>
688
+ </xsl:template>
677
689
 
678
690
  <xsl:template match="m3d:preferred">
679
691
 
@@ -777,8 +789,12 @@
777
789
 
778
790
  <xsl:template match="mathml:math" priority="2">
779
791
  <fo:inline font-family="Cambria Math">
792
+ <xsl:variable name="mathml">
793
+ <xsl:apply-templates select="." mode="mathml"/>
794
+ </xsl:variable>
780
795
  <fo:instream-foreign-object fox:alt-text="Math">
781
- <xsl:copy-of select="."/>
796
+ <!-- <xsl:copy-of select="."/> -->
797
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
782
798
  </fo:instream-foreign-object>
783
799
  </fo:inline>
784
800
  </xsl:template>
@@ -811,9 +827,9 @@
811
827
 
812
828
  <xsl:template match="m3d:formula/m3d:stem">
813
829
  <fo:block margin-top="14pt" margin-bottom="14pt">
814
- <fo:table table-layout="fixed" width="170mm">
815
- <fo:table-column column-width="165mm"/>
816
- <fo:table-column column-width="5mm"/>
830
+ <fo:table table-layout="fixed" width="100%"> <!-- 170mm -->
831
+ <fo:table-column column-width="95%"/> <!-- 165mm -->
832
+ <fo:table-column column-width="5%"/> <!-- 5mm -->
817
833
  <fo:table-body>
818
834
  <fo:table-row>
819
835
  <fo:table-cell display-align="center">
@@ -853,6 +869,12 @@
853
869
 
854
870
  </title-edition>
855
871
 
872
+ <title-edition lang="fr">
873
+
874
+ <xsl:text>Édition </xsl:text>
875
+
876
+ </title-edition>
877
+
856
878
 
857
879
  <title-toc lang="en">
858
880
 
@@ -861,7 +883,12 @@
861
883
 
862
884
 
863
885
  </title-toc>
864
- <title-toc lang="fr">Sommaire</title-toc>
886
+ <title-toc lang="fr">
887
+
888
+ <xsl:text>Sommaire</xsl:text>
889
+
890
+
891
+ </title-toc>
865
892
 
866
893
  <title-toc lang="zh">Contents</title-toc>
867
894
 
@@ -881,13 +908,22 @@
881
908
  <title-part lang="en">
882
909
 
883
910
 
911
+
884
912
  </title-part>
885
913
  <title-part lang="fr">
886
914
 
887
915
 
916
+
888
917
  </title-part>
889
918
  <title-part lang="zh">第 # 部分:</title-part>
890
919
 
920
+ <title-subpart lang="en">
921
+
922
+ </title-subpart>
923
+ <title-subpart lang="fr">
924
+
925
+ </title-subpart>
926
+
891
927
  <title-modified lang="en">modified</title-modified>
892
928
  <title-modified lang="fr">modifiée</title-modified>
893
929
 
@@ -895,7 +931,12 @@
895
931
 
896
932
 
897
933
 
898
- <title-source lang="en">SOURCE</title-source>
934
+ <title-source lang="en">
935
+
936
+ <xsl:text>SOURCE</xsl:text>
937
+
938
+
939
+ </title-source>
899
940
 
900
941
  <title-keywords lang="en">Keywords</title-keywords>
901
942
 
@@ -938,12 +979,25 @@
938
979
  <title-warning lang="zh">警告</title-warning>
939
980
 
940
981
  <title-amendment lang="en">AMENDMENT</title-amendment>
982
+
983
+ <title-continued lang="en">(continued)</title-continued>
984
+ <title-continued lang="fr">(continué)</title-continued>
985
+
941
986
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
942
987
  <xsl:param name="name"/>
943
- <xsl:variable name="lang">
944
- <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>
945
998
  </xsl:variable>
946
- <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]"/>
947
1001
  <xsl:choose>
948
1002
  <xsl:when test="normalize-space($title_) != ''">
949
1003
  <xsl:value-of select="$title_"/>
@@ -952,12 +1006,15 @@
952
1006
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
953
1007
  </xsl:otherwise>
954
1008
  </xsl:choose>
955
- </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">
956
1012
 
957
1013
  <xsl:attribute name="color">blue</xsl:attribute>
958
1014
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
959
1015
 
960
1016
 
1017
+
961
1018
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
962
1019
  <xsl:attribute name="white-space">pre</xsl:attribute>
963
1020
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -972,6 +1029,7 @@
972
1029
 
973
1030
 
974
1031
 
1032
+
975
1033
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
976
1034
 
977
1035
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1020,6 +1078,7 @@
1020
1078
 
1021
1079
 
1022
1080
 
1081
+
1023
1082
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1024
1083
 
1025
1084
 
@@ -1041,6 +1100,7 @@
1041
1100
 
1042
1101
 
1043
1102
 
1103
+
1044
1104
 
1045
1105
 
1046
1106
 
@@ -1087,6 +1147,7 @@
1087
1147
 
1088
1148
 
1089
1149
 
1150
+
1090
1151
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1091
1152
 
1092
1153
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1106,11 +1167,13 @@
1106
1167
 
1107
1168
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1108
1169
 
1109
-
1170
+
1171
+
1110
1172
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1111
1173
 
1112
1174
 
1113
1175
 
1176
+
1114
1177
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1115
1178
 
1116
1179
 
@@ -1131,8 +1194,7 @@
1131
1194
 
1132
1195
 
1133
1196
 
1134
-
1135
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
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">
1136
1198
 
1137
1199
 
1138
1200
 
@@ -1144,7 +1206,9 @@
1144
1206
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1145
1207
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1146
1208
 
1147
-
1209
+
1210
+
1211
+
1148
1212
 
1149
1213
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1150
1214
 
@@ -1169,6 +1233,8 @@
1169
1233
 
1170
1234
 
1171
1235
 
1236
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1237
+
1172
1238
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1173
1239
 
1174
1240
 
@@ -1195,6 +1261,7 @@
1195
1261
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1196
1262
 
1197
1263
 
1264
+
1198
1265
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1199
1266
 
1200
1267
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1206,6 +1273,7 @@
1206
1273
 
1207
1274
 
1208
1275
 
1276
+
1209
1277
 
1210
1278
  <xsl:attribute name="text-align">center</xsl:attribute>
1211
1279
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1244,14 +1312,16 @@
1244
1312
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1245
1313
 
1246
1314
 
1247
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1248
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1315
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1316
+
1249
1317
 
1250
1318
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1251
1319
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1252
1320
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1253
1321
  <xsl:attribute name="text-align">center</xsl:attribute>
1254
1322
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1323
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1324
+
1255
1325
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1256
1326
 
1257
1327
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1319,6 +1389,12 @@
1319
1389
 
1320
1390
 
1321
1391
 
1392
+ <!-- <xsl:if test="$namespace = 'bipm'">
1393
+ <fo:block>&#xA0;</fo:block>
1394
+ </xsl:if> -->
1395
+
1396
+ <!-- $namespace = 'iso' or -->
1397
+
1322
1398
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1323
1399
 
1324
1400
 
@@ -1354,6 +1430,7 @@
1354
1430
  <xsl:with-param name="table" select="$simple-table"/>
1355
1431
  </xsl:call-template>
1356
1432
  </xsl:variable>
1433
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1357
1434
 
1358
1435
  <!-- <xsl:variable name="colwidths2">
1359
1436
  <xsl:call-template name="calculate-column-widths">
@@ -1375,25 +1452,49 @@
1375
1452
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1376
1453
 
1377
1454
 
1455
+
1456
+
1457
+
1378
1458
 
1379
1459
 
1460
+
1380
1461
 
1381
1462
 
1382
1463
 
1383
1464
 
1384
1465
 
1385
- <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">
1386
-
1387
-
1388
-
1466
+
1467
+
1468
+ <xsl:variable name="table_attributes">
1469
+ <attribute name="table-layout">fixed</attribute>
1470
+ <attribute name="width">100%</attribute>
1471
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1472
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1389
1473
 
1390
1474
 
1391
1475
 
1392
1476
 
1477
+
1478
+
1479
+
1393
1480
 
1481
+
1394
1482
 
1483
+ </xsl:variable>
1484
+
1485
+
1486
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1395
1487
 
1488
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1489
+ <xsl:attribute name="{@name}">
1490
+ <xsl:value-of select="."/>
1491
+ </xsl:attribute>
1492
+ </xsl:for-each>
1396
1493
 
1494
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1495
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1496
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1497
+ </xsl:if>
1397
1498
 
1398
1499
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1399
1500
  <xsl:choose>
@@ -1417,6 +1518,33 @@
1417
1518
 
1418
1519
  </fo:table>
1419
1520
 
1521
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1522
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1523
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1524
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1525
+ </xsl:call-template>
1526
+ </xsl:for-each>
1527
+
1528
+ <!-- insert footer as table -->
1529
+ <!-- <fo:table>
1530
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1531
+ <xsl:attribute name="{@name}">
1532
+ <xsl:value-of select="."/>
1533
+ </xsl:attribute>
1534
+ </xsl:for-each>
1535
+
1536
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1537
+ <xsl:choose>
1538
+ <xsl:when test=". = 1 or . = 0">
1539
+ <fo:table-column column-width="proportional-column-width(2)"/>
1540
+ </xsl:when>
1541
+ <xsl:otherwise>
1542
+ <fo:table-column column-width="proportional-column-width({.})"/>
1543
+ </xsl:otherwise>
1544
+ </xsl:choose>
1545
+ </xsl:for-each>
1546
+ </fo:table>-->
1547
+
1420
1548
 
1421
1549
 
1422
1550
 
@@ -1425,8 +1553,10 @@
1425
1553
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1426
1554
  <xsl:if test="normalize-space() != ''">
1427
1555
  <fo:block xsl:use-attribute-sets="table-name-style">
1428
- <xsl:apply-templates/>
1429
- </fo:block>
1556
+
1557
+
1558
+ <xsl:apply-templates/>
1559
+ </fo:block>
1430
1560
  </xsl:if>
1431
1561
  </xsl:template><xsl:template name="calculate-columns-numbers">
1432
1562
  <xsl:param name="table-row"/>
@@ -1480,6 +1610,13 @@
1480
1610
  <xsl:for-each select="xalan:nodeset($table)//tr">
1481
1611
  <xsl:variable name="td_text">
1482
1612
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1613
+
1614
+ <!-- <xsl:if test="$namespace = 'bipm'">
1615
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1616
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1617
+ </xsl:for-each>
1618
+ </xsl:if> -->
1619
+
1483
1620
  </xsl:variable>
1484
1621
  <xsl:variable name="words">
1485
1622
  <xsl:variable name="string_with_added_zerospaces">
@@ -1539,13 +1676,31 @@
1539
1676
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1540
1677
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1541
1678
  <xsl:value-of select="@target"/>
1679
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1680
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1681
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1542
1682
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1543
1683
  <xsl:param name="cols-count"/>
1544
1684
  <!-- font-weight="bold" -->
1545
- <fo:table-header>
1685
+ <fo:table-header>
1546
1686
 
1547
1687
  <xsl:apply-templates/>
1548
1688
  </fo:table-header>
1689
+ </xsl:template><xsl:template name="table-header-title">
1690
+ <xsl:param name="cols-count"/>
1691
+ <!-- row for title -->
1692
+ <fo:table-row>
1693
+ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
1694
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1695
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1696
+ <xsl:call-template name="fn_name_display"/>
1697
+ </xsl:for-each>
1698
+ <fo:block text-align="right" font-style="italic">
1699
+ <xsl:text> </xsl:text>
1700
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1701
+ </fo:block>
1702
+ </fo:table-cell>
1703
+ </fo:table-row>
1549
1704
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1550
1705
  <fo:table-body>
1551
1706
  <xsl:apply-templates/>
@@ -1553,6 +1708,13 @@
1553
1708
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1554
1709
  <xsl:apply-templates/>
1555
1710
  </xsl:template><xsl:template name="insertTableFooter">
1711
+ <xsl:param name="cols-count"/>
1712
+ <xsl:if test="../*[local-name()='tfoot']">
1713
+ <fo:table-footer>
1714
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1715
+ </fo:table-footer>
1716
+ </xsl:if>
1717
+ </xsl:template><xsl:template name="insertTableFooter2">
1556
1718
  <xsl:param name="cols-count"/>
1557
1719
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1558
1720
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1574,11 +1736,29 @@
1574
1736
  <!-- fn will be processed inside 'note' processing -->
1575
1737
 
1576
1738
 
1739
+
1740
+
1741
+
1742
+
1577
1743
  <!-- except gb -->
1578
1744
 
1579
1745
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1580
1746
 
1581
1747
 
1748
+ <!-- show Note under table in preface (ex. abstract) sections -->
1749
+ <!-- empty, because notes show at page side in main sections -->
1750
+ <!-- <xsl:if test="$namespace = 'bipm'">
1751
+ <xsl:choose>
1752
+ <xsl:when test="ancestor::*[local-name()='preface']">
1753
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1754
+ </xsl:when>
1755
+ <xsl:otherwise>
1756
+ <fo:block/>
1757
+ </xsl:otherwise>
1758
+ </xsl:choose>
1759
+ </xsl:if> -->
1760
+
1761
+
1582
1762
  <!-- horizontal row separator -->
1583
1763
 
1584
1764
 
@@ -1592,6 +1772,88 @@
1592
1772
  </fo:table-footer>
1593
1773
 
1594
1774
  </xsl:if>
1775
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1776
+ <xsl:param name="table_attributes"/>
1777
+ <xsl:param name="colwidths"/>
1778
+
1779
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1780
+
1781
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1782
+
1783
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1784
+
1785
+ <fo:table keep-with-previous="always">
1786
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1787
+ <xsl:choose>
1788
+ <xsl:when test="@name = 'border-top'">
1789
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1790
+ </xsl:when>
1791
+ <xsl:when test="@name = 'border'">
1792
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1793
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1794
+ </xsl:when>
1795
+ <xsl:otherwise>
1796
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1797
+ </xsl:otherwise>
1798
+ </xsl:choose>
1799
+ </xsl:for-each>
1800
+
1801
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1802
+ <xsl:choose>
1803
+ <xsl:when test=". = 1 or . = 0">
1804
+ <fo:table-column column-width="proportional-column-width(2)"/>
1805
+ </xsl:when>
1806
+ <xsl:otherwise>
1807
+ <fo:table-column column-width="proportional-column-width({.})"/>
1808
+ </xsl:otherwise>
1809
+ </xsl:choose>
1810
+ </xsl:for-each>
1811
+
1812
+ <fo:table-body>
1813
+ <fo:table-row>
1814
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1815
+
1816
+
1817
+
1818
+ <!-- fn will be processed inside 'note' processing -->
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+ <!-- except gb -->
1827
+
1828
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1829
+
1830
+
1831
+ <!-- <xsl:if test="$namespace = 'bipm'">
1832
+ <xsl:choose>
1833
+ <xsl:when test="ancestor::*[local-name()='preface']">
1834
+ show Note under table in preface (ex. abstract) sections
1835
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1836
+ </xsl:when>
1837
+ <xsl:otherwise>
1838
+ empty, because notes show at page side in main sections
1839
+ <fo:block/>
1840
+ </xsl:otherwise>
1841
+ </xsl:choose>
1842
+ </xsl:if> -->
1843
+
1844
+
1845
+ <!-- horizontal row separator -->
1846
+
1847
+
1848
+ <!-- fn processing -->
1849
+ <xsl:call-template name="fn_display"/>
1850
+
1851
+ </fo:table-cell>
1852
+ </fo:table-row>
1853
+ </fo:table-body>
1854
+
1855
+ </fo:table>
1856
+ </xsl:if>
1595
1857
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1596
1858
 
1597
1859
  <xsl:variable name="cols-count">
@@ -1609,6 +1871,8 @@
1609
1871
  </xsl:choose>
1610
1872
  </xsl:variable>
1611
1873
 
1874
+
1875
+
1612
1876
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1613
1877
  <xsl:with-param name="cols-count" select="$cols-count"/>
1614
1878
  </xsl:apply-templates>
@@ -1618,6 +1882,8 @@
1618
1882
  </xsl:call-template>
1619
1883
 
1620
1884
  <fo:table-body>
1885
+
1886
+
1621
1887
  <xsl:apply-templates/>
1622
1888
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1623
1889
 
@@ -1641,6 +1907,12 @@
1641
1907
  </xsl:if>
1642
1908
 
1643
1909
 
1910
+
1911
+
1912
+ <!-- <xsl:if test="$namespace = 'bipm'">
1913
+ <xsl:attribute name="height">8mm</xsl:attribute>
1914
+ </xsl:if> -->
1915
+
1644
1916
  <xsl:apply-templates/>
1645
1917
  </fo:table-row>
1646
1918
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1662,6 +1934,8 @@
1662
1934
 
1663
1935
 
1664
1936
 
1937
+
1938
+
1665
1939
  <xsl:if test="@colspan">
1666
1940
  <xsl:attribute name="number-columns-spanned">
1667
1941
  <xsl:value-of select="@colspan"/>
@@ -1672,10 +1946,22 @@
1672
1946
  <xsl:value-of select="@rowspan"/>
1673
1947
  </xsl:attribute>
1674
1948
  </xsl:if>
1949
+ <xsl:call-template name="display-align"/>
1675
1950
  <fo:block>
1676
1951
  <xsl:apply-templates/>
1677
1952
  </fo:block>
1678
1953
  </fo:table-cell>
1954
+ </xsl:template><xsl:template name="display-align">
1955
+ <xsl:if test="@valign">
1956
+ <xsl:attribute name="display-align">
1957
+ <xsl:choose>
1958
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1959
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1960
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1961
+ <xsl:otherwise>before</xsl:otherwise>
1962
+ </xsl:choose>
1963
+ </xsl:attribute>
1964
+ </xsl:if>
1679
1965
  </xsl:template><xsl:template match="*[local-name()='td']">
1680
1966
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1681
1967
  <xsl:attribute name="text-align">
@@ -1689,7 +1975,9 @@
1689
1975
 
1690
1976
 
1691
1977
 
1692
-
1978
+
1979
+
1980
+
1693
1981
 
1694
1982
 
1695
1983
 
@@ -1705,6 +1993,7 @@
1705
1993
  <xsl:value-of select="@rowspan"/>
1706
1994
  </xsl:attribute>
1707
1995
  </xsl:if>
1996
+ <xsl:call-template name="display-align"/>
1708
1997
  <fo:block>
1709
1998
 
1710
1999
  <xsl:apply-templates/>
@@ -1718,14 +2007,17 @@
1718
2007
 
1719
2008
 
1720
2009
 
2010
+
2011
+
1721
2012
  <fo:inline padding-right="2mm">
1722
2013
 
1723
2014
 
1724
2015
 
1725
-
2016
+
1726
2017
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1727
2018
 
1728
2019
  </fo:inline>
2020
+
1729
2021
  <xsl:apply-templates mode="process"/>
1730
2022
  </fo:block>
1731
2023
 
@@ -1749,6 +2041,7 @@
1749
2041
 
1750
2042
 
1751
2043
 
2044
+
1752
2045
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1753
2046
 
1754
2047
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1758,12 +2051,15 @@
1758
2051
 
1759
2052
 
1760
2053
 
2054
+
1761
2055
  <xsl:value-of select="@reference"/>
1762
2056
 
2057
+
1763
2058
  </fo:inline>
1764
2059
  <fo:inline>
1765
2060
 
1766
- <xsl:apply-templates/>
2061
+ <!-- <xsl:apply-templates /> -->
2062
+ <xsl:copy-of select="./node()"/>
1767
2063
  </fo:inline>
1768
2064
  </fo:block>
1769
2065
  </xsl:if>
@@ -1800,7 +2096,20 @@
1800
2096
  <xsl:variable name="following_dl_colwidths">
1801
2097
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1802
2098
  <xsl:variable name="html-table">
1803
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2099
+ <xsl:variable name="doc_ns">
2100
+
2101
+ </xsl:variable>
2102
+ <xsl:variable name="ns">
2103
+ <xsl:choose>
2104
+ <xsl:when test="normalize-space($doc_ns) != ''">
2105
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2106
+ </xsl:when>
2107
+ <xsl:otherwise>
2108
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2109
+ </xsl:otherwise>
2110
+ </xsl:choose>
2111
+ </xsl:variable>
2112
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1804
2113
  <xsl:element name="{$ns}:table">
1805
2114
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1806
2115
  <tbody>
@@ -1865,7 +2174,8 @@
1865
2174
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1866
2175
  </xsl:if>
1867
2176
 
1868
- <xsl:apply-templates/>
2177
+ <!-- <xsl:apply-templates /> -->
2178
+ <xsl:copy-of select="./node()"/>
1869
2179
  </fo:block>
1870
2180
  </fo:table-cell>
1871
2181
  </fo:table-row>
@@ -1883,9 +2193,13 @@
1883
2193
 
1884
2194
 
1885
2195
 
2196
+
2197
+
1886
2198
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1887
2199
 
2200
+
1888
2201
  <xsl:value-of select="@reference"/>
2202
+
1889
2203
  </fo:basic-link>
1890
2204
  </fo:inline>
1891
2205
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1893,115 +2207,158 @@
1893
2207
  <xsl:apply-templates/>
1894
2208
  </fo:inline>
1895
2209
  </xsl:template><xsl:template match="*[local-name()='dl']">
1896
- <xsl:variable name="parent" select="local-name(..)"/>
1897
-
1898
- <xsl:variable name="key_iso">
1899
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1900
- </xsl:variable>
1901
-
1902
- <xsl:choose>
1903
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1904
-
2210
+ <fo:block-container>
2211
+
2212
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2213
+
2214
+
2215
+ <xsl:if test="parent::*[local-name() = 'note']">
2216
+ <xsl:attribute name="margin-left">
2217
+ <xsl:choose>
2218
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2219
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2220
+ </xsl:choose>
2221
+ </xsl:attribute>
1905
2222
 
1906
- <fo:block margin-bottom="12pt" text-align="left">
1907
-
1908
- <xsl:variable name="title-where">
1909
- <xsl:call-template name="getTitle">
1910
- <xsl:with-param name="name" select="'title-where'"/>
1911
- </xsl:call-template>
1912
- </xsl:variable>
1913
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1914
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
1915
- <xsl:text/>
1916
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1917
- </fo:block>
2223
+ </xsl:if>
2224
+ <fo:block-container>
1918
2225
 
1919
- </xsl:when>
1920
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1921
- <fo:block margin-bottom="12pt" text-align="left">
1922
-
1923
-
1924
-
1925
-
1926
- <xsl:variable name="title-where">
1927
- <xsl:call-template name="getTitle">
1928
- <xsl:with-param name="name" select="'title-where'"/>
1929
- </xsl:call-template>
1930
- </xsl:variable>
1931
- <xsl:value-of select="$title-where"/>
1932
- </fo:block>
1933
- </xsl:when>
1934
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1935
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1936
-
1937
-
1938
-
1939
- <xsl:variable name="title-key">
1940
- <xsl:call-template name="getTitle">
1941
- <xsl:with-param name="name" select="'title-key'"/>
1942
- </xsl:call-template>
1943
- </xsl:variable>
1944
- <xsl:value-of select="$title-key"/>
1945
- </fo:block>
1946
- </xsl:when>
1947
- </xsl:choose>
1948
-
1949
- <!-- a few components -->
1950
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1951
- <fo:block>
2226
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1952
2227
 
1953
2228
 
2229
+ <xsl:variable name="parent" select="local-name(..)"/>
1954
2230
 
2231
+ <xsl:variable name="key_iso">
2232
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2233
+ </xsl:variable>
1955
2234
 
1956
- <fo:block>
1957
-
1958
-
1959
-
1960
-
1961
- <fo:table width="95%" table-layout="fixed">
2235
+ <xsl:choose>
2236
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1962
2237
 
1963
- <xsl:choose>
1964
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1965
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1966
- </xsl:when>
1967
- <xsl:when test="normalize-space($key_iso) = 'true'">
1968
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2238
+
2239
+ <fo:block margin-bottom="12pt" text-align="left">
1969
2240
 
1970
- </xsl:when>
1971
- </xsl:choose>
1972
- <!-- create virtual html table for dl/[dt and dd] -->
1973
- <xsl:variable name="html-table">
1974
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1975
- <xsl:element name="{$ns}:table">
1976
- <tbody>
1977
- <xsl:apply-templates mode="dl"/>
1978
- </tbody>
1979
- </xsl:element>
1980
- </xsl:variable>
1981
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1982
- <xsl:variable name="colwidths">
1983
- <xsl:call-template name="calculate-column-widths">
1984
- <xsl:with-param name="cols-count" select="2"/>
1985
- <xsl:with-param name="table" select="$html-table"/>
1986
- </xsl:call-template>
1987
- </xsl:variable>
1988
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
1989
- <xsl:variable name="maxlength_dt">
1990
- <xsl:call-template name="getMaxLength_dt"/>
1991
- </xsl:variable>
1992
- <xsl:call-template name="setColumnWidth_dl">
1993
- <xsl:with-param name="colwidths" select="$colwidths"/>
1994
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
1995
- </xsl:call-template>
1996
- <fo:table-body>
1997
- <xsl:apply-templates>
1998
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
1999
- </xsl:apply-templates>
2000
- </fo:table-body>
2001
- </fo:table>
2002
- </fo:block>
2003
- </fo:block>
2004
- </xsl:if>
2241
+ <xsl:variable name="title-where">
2242
+
2243
+
2244
+ <xsl:call-template name="getTitle">
2245
+ <xsl:with-param name="name" select="'title-where'"/>
2246
+ </xsl:call-template>
2247
+
2248
+ </xsl:variable>
2249
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2250
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2251
+ <xsl:text/>
2252
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2253
+ </fo:block>
2254
+
2255
+ </xsl:when>
2256
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2257
+ <fo:block margin-bottom="12pt" text-align="left">
2258
+
2259
+
2260
+
2261
+
2262
+ <xsl:variable name="title-where">
2263
+
2264
+
2265
+ <xsl:call-template name="getTitle">
2266
+ <xsl:with-param name="name" select="'title-where'"/>
2267
+ </xsl:call-template>
2268
+
2269
+ </xsl:variable>
2270
+ <xsl:value-of select="$title-where"/>
2271
+ </fo:block>
2272
+ </xsl:when>
2273
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2274
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2275
+
2276
+
2277
+
2278
+ <xsl:variable name="title-key">
2279
+
2280
+
2281
+ <xsl:call-template name="getTitle">
2282
+ <xsl:with-param name="name" select="'title-key'"/>
2283
+ </xsl:call-template>
2284
+
2285
+ </xsl:variable>
2286
+ <xsl:value-of select="$title-key"/>
2287
+ </fo:block>
2288
+ </xsl:when>
2289
+ </xsl:choose>
2290
+
2291
+ <!-- a few components -->
2292
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2293
+ <fo:block>
2294
+
2295
+
2296
+
2297
+
2298
+ <fo:block>
2299
+
2300
+
2301
+
2302
+
2303
+ <fo:table width="95%" table-layout="fixed">
2304
+
2305
+ <xsl:choose>
2306
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2307
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2308
+ </xsl:when>
2309
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2310
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2311
+
2312
+ </xsl:when>
2313
+ </xsl:choose>
2314
+ <!-- create virtual html table for dl/[dt and dd] -->
2315
+ <xsl:variable name="html-table">
2316
+ <xsl:variable name="doc_ns">
2317
+
2318
+ </xsl:variable>
2319
+ <xsl:variable name="ns">
2320
+ <xsl:choose>
2321
+ <xsl:when test="normalize-space($doc_ns) != ''">
2322
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2323
+ </xsl:when>
2324
+ <xsl:otherwise>
2325
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2326
+ </xsl:otherwise>
2327
+ </xsl:choose>
2328
+ </xsl:variable>
2329
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2330
+ <xsl:element name="{$ns}:table">
2331
+ <tbody>
2332
+ <xsl:apply-templates mode="dl"/>
2333
+ </tbody>
2334
+ </xsl:element>
2335
+ </xsl:variable>
2336
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2337
+ <xsl:variable name="colwidths">
2338
+ <xsl:call-template name="calculate-column-widths">
2339
+ <xsl:with-param name="cols-count" select="2"/>
2340
+ <xsl:with-param name="table" select="$html-table"/>
2341
+ </xsl:call-template>
2342
+ </xsl:variable>
2343
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2344
+ <xsl:variable name="maxlength_dt">
2345
+ <xsl:call-template name="getMaxLength_dt"/>
2346
+ </xsl:variable>
2347
+ <xsl:call-template name="setColumnWidth_dl">
2348
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2349
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2350
+ </xsl:call-template>
2351
+ <fo:table-body>
2352
+ <xsl:apply-templates>
2353
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2354
+ </xsl:apply-templates>
2355
+ </fo:table-body>
2356
+ </fo:table>
2357
+ </fo:block>
2358
+ </fo:block>
2359
+ </xsl:if>
2360
+ </fo:block-container>
2361
+ </fo:block-container>
2005
2362
  </xsl:template><xsl:template name="setColumnWidth_dl">
2006
2363
  <xsl:param name="colwidths"/>
2007
2364
  <xsl:param name="maxlength_dt"/>
@@ -2098,6 +2455,7 @@
2098
2455
  <xsl:param name="key_iso"/>
2099
2456
 
2100
2457
  <fo:table-row>
2458
+
2101
2459
  <fo:table-cell>
2102
2460
 
2103
2461
  <fo:block margin-top="6pt">
@@ -2112,6 +2470,7 @@
2112
2470
 
2113
2471
 
2114
2472
 
2473
+
2115
2474
  <xsl:apply-templates/>
2116
2475
  <!-- <xsl:if test="$namespace = 'gb'">
2117
2476
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2177,6 +2536,36 @@
2177
2536
  </fo:inline>
2178
2537
  </xsl:template><xsl:template match="*[local-name()='tt']">
2179
2538
  <fo:inline xsl:use-attribute-sets="tt-style">
2539
+ <xsl:variable name="_font-size">
2540
+
2541
+
2542
+
2543
+
2544
+
2545
+
2546
+
2547
+
2548
+ <xsl:choose>
2549
+ <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2550
+ <xsl:otherwise>11</xsl:otherwise>
2551
+ </xsl:choose>
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+ </xsl:variable>
2560
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2561
+ <xsl:if test="$font-size != ''">
2562
+ <xsl:attribute name="font-size">
2563
+ <xsl:choose>
2564
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2565
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2566
+ </xsl:choose>
2567
+ </xsl:attribute>
2568
+ </xsl:if>
2180
2569
  <xsl:apply-templates/>
2181
2570
  </fo:inline>
2182
2571
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2468,7 +2857,18 @@
2468
2857
  <xsl:with-param name="previousRow" select="$newRow"/>
2469
2858
  </xsl:apply-templates>
2470
2859
  </xsl:template><xsl:template name="getLang">
2471
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2860
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2861
+ <xsl:variable name="language">
2862
+ <xsl:choose>
2863
+ <xsl:when test="$language_current != ''">
2864
+ <xsl:value-of select="$language_current"/>
2865
+ </xsl:when>
2866
+ <xsl:otherwise>
2867
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2868
+ </xsl:otherwise>
2869
+ </xsl:choose>
2870
+ </xsl:variable>
2871
+
2472
2872
  <xsl:choose>
2473
2873
  <xsl:when test="$language = 'English'">en</xsl:when>
2474
2874
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2502,11 +2902,25 @@
2502
2902
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2503
2903
  <xsl:value-of select="substring($str, 2)"/>
2504
2904
  </xsl:template><xsl:template match="mathml:math">
2505
- <fo:inline font-family="STIX2Math">
2506
- <fo:instream-foreign-object fox:alt-text="Math">
2507
- <xsl:copy-of select="."/>
2508
- </fo:instream-foreign-object>
2905
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2906
+
2907
+ <xsl:variable name="mathml">
2908
+ <xsl:apply-templates select="." mode="mathml"/>
2909
+ </xsl:variable>
2910
+ <fo:instream-foreign-object fox:alt-text="Math">
2911
+ <!-- <xsl:copy-of select="."/> -->
2912
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2913
+ </fo:instream-foreign-object>
2509
2914
  </fo:inline>
2915
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2916
+ <xsl:copy>
2917
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2918
+ </xsl:copy>
2919
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2920
+ <xsl:copy>
2921
+ <!-- replace start and end spaces to non-break space -->
2922
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2923
+ </xsl:copy>
2510
2924
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2511
2925
  <xsl:variable name="target">
2512
2926
  <xsl:choose>
@@ -2572,10 +2986,14 @@
2572
2986
  </fo:inline>
2573
2987
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2574
2988
  <xsl:variable name="title-modified">
2575
- <xsl:call-template name="getTitle">
2576
- <xsl:with-param name="name" select="'title-modified'"/>
2577
- </xsl:call-template>
2989
+
2990
+
2991
+ <xsl:call-template name="getTitle">
2992
+ <xsl:with-param name="name" select="'title-modified'"/>
2993
+ </xsl:call-template>
2994
+
2578
2995
  </xsl:variable>
2996
+
2579
2997
  <xsl:choose>
2580
2998
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2581
2999
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2583,13 +3001,26 @@
2583
3001
  <xsl:apply-templates/>
2584
3002
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2585
3003
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2586
-
3004
+
2587
3005
  <xsl:apply-templates/>
2588
3006
  </fo:basic-link>
2589
3007
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2590
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2591
- <xsl:apply-templates/>
2592
- </fo:block>
3008
+ <fo:block-container margin-left="0mm">
3009
+ <xsl:if test="parent::*[local-name() = 'note']">
3010
+ <xsl:attribute name="margin-left">
3011
+ <xsl:choose>
3012
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3013
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3014
+ </xsl:choose>
3015
+ </xsl:attribute>
3016
+
3017
+ </xsl:if>
3018
+ <fo:block-container margin-left="0mm">
3019
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3020
+ <xsl:apply-templates/>
3021
+ </fo:block>
3022
+ </fo:block-container>
3023
+ </fo:block-container>
2593
3024
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2594
3025
  <fo:inline>
2595
3026
  <xsl:apply-templates/>
@@ -2623,6 +3054,8 @@
2623
3054
 
2624
3055
 
2625
3056
 
3057
+
3058
+
2626
3059
  <fo:inline xsl:use-attribute-sets="note-name-style">
2627
3060
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2628
3061
  </fo:inline>
@@ -2649,7 +3082,9 @@
2649
3082
  </xsl:choose>
2650
3083
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2651
3084
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2652
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3085
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3086
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3087
+ </fo:inline>
2653
3088
  <xsl:apply-templates/>
2654
3089
  </fo:block>
2655
3090
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
@@ -2750,15 +3185,109 @@
2750
3185
 
2751
3186
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2752
3187
  </fo:block>
2753
- </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">
3188
+ </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">
2754
3189
  <xsl:apply-templates mode="contents"/>
2755
3190
  <xsl:text> </xsl:text>
2756
- </xsl:template><xsl:template match="text()" mode="contents">
3191
+ </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">
3192
+ <xsl:apply-templates mode="bookmarks"/>
3193
+ <xsl:text> </xsl:text>
3194
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2757
3195
  <xsl:value-of select="."/>
2758
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3196
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3197
+ <xsl:value-of select="."/>
3198
+ </xsl:template><xsl:template match="node()" mode="contents">
3199
+ <xsl:apply-templates mode="contents"/>
3200
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3201
+ <xsl:apply-templates mode="bookmarks"/>
3202
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3203
+ <xsl:apply-templates select="."/>
3204
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3205
+ <xsl:apply-templates mode="bookmarks"/>
3206
+ </xsl:template><xsl:template name="addBookmarks">
3207
+ <xsl:param name="contents"/>
3208
+ <xsl:if test="xalan:nodeset($contents)//item">
3209
+ <fo:bookmark-tree>
3210
+ <xsl:choose>
3211
+ <xsl:when test="xalan:nodeset($contents)/doc">
3212
+ <xsl:choose>
3213
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3214
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3215
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3216
+ <fo:bookmark-title>
3217
+ <xsl:variable name="bookmark-title_">
3218
+ <xsl:call-template name="getLangVersion">
3219
+ <xsl:with-param name="lang" select="@lang"/>
3220
+ </xsl:call-template>
3221
+ </xsl:variable>
3222
+ <xsl:choose>
3223
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3224
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3225
+ </xsl:when>
3226
+ <xsl:otherwise>
3227
+ <xsl:choose>
3228
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3229
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3230
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3231
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3232
+ </xsl:choose>
3233
+ </xsl:otherwise>
3234
+ </xsl:choose>
3235
+ </fo:bookmark-title>
3236
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3237
+ </fo:bookmark>
3238
+
3239
+ </xsl:for-each>
3240
+ </xsl:when>
3241
+ <xsl:otherwise>
3242
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3243
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3244
+ </xsl:for-each>
3245
+ </xsl:otherwise>
3246
+ </xsl:choose>
3247
+ </xsl:when>
3248
+ <xsl:otherwise>
3249
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3250
+ </xsl:otherwise>
3251
+ </xsl:choose>
3252
+
3253
+
3254
+
3255
+
3256
+
3257
+
3258
+
3259
+
3260
+ </fo:bookmark-tree>
3261
+ </xsl:if>
3262
+ </xsl:template><xsl:template name="getLangVersion">
3263
+ <xsl:param name="lang"/>
3264
+ <xsl:choose>
3265
+ <xsl:when test="$lang = 'en'">
3266
+
3267
+
3268
+ </xsl:when>
3269
+ <xsl:when test="$lang = 'fr'">
3270
+
3271
+
3272
+ </xsl:when>
3273
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3274
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3275
+ </xsl:choose>
3276
+ </xsl:template><xsl:template match="item" mode="bookmark">
3277
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3278
+ <fo:bookmark-title>
3279
+ <xsl:if test="@section != ''">
3280
+ <xsl:value-of select="@section"/>
3281
+ <xsl:text> </xsl:text>
3282
+ </xsl:if>
3283
+ <xsl:value-of select="normalize-space(title)"/>
3284
+ </fo:bookmark-title>
3285
+ <xsl:apply-templates mode="bookmark"/>
3286
+ </fo:bookmark>
3287
+ </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">
2759
3288
  <xsl:if test="normalize-space() != ''">
2760
3289
  <fo:block xsl:use-attribute-sets="figure-name-style">
2761
-
3290
+
2762
3291
  <xsl:apply-templates/>
2763
3292
  </fo:block>
2764
3293
  </xsl:if>
@@ -2813,7 +3342,7 @@
2813
3342
  <xsl:apply-templates/>
2814
3343
  </xsl:otherwise>
2815
3344
  </xsl:choose>
2816
- </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">
3345
+ </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">
2817
3346
  <xsl:text> </xsl:text>
2818
3347
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2819
3348
  <xsl:copy>
@@ -2822,21 +3351,61 @@
2822
3351
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2823
3352
  <xsl:text> </xsl:text>
2824
3353
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2825
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2826
- <xsl:apply-templates/>
2827
- </fo:block>
2828
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2829
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3354
+
3355
+ <fo:block-container margin-left="0mm">
3356
+ <xsl:if test="parent::*[local-name() = 'note']">
3357
+ <xsl:attribute name="margin-left">
3358
+ <xsl:choose>
3359
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3360
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3361
+ </xsl:choose>
3362
+ </xsl:attribute>
3363
+
3364
+ </xsl:if>
3365
+ <fo:block-container margin-left="0mm">
3366
+
3367
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3368
+ <xsl:variable name="_font-size">
3369
+
3370
+
3371
+
3372
+
3373
+
3374
+
3375
+
3376
+
3377
+
3378
+
3379
+
3380
+
3381
+
3382
+
3383
+ </xsl:variable>
3384
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3385
+ <xsl:if test="$font-size != ''">
3386
+ <xsl:attribute name="font-size">
3387
+ <xsl:choose>
3388
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3389
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3390
+ </xsl:choose>
3391
+ </xsl:attribute>
3392
+ </xsl:if>
3393
+ <xsl:apply-templates/>
3394
+ </fo:block>
3395
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3396
+
3397
+ </fo:block-container>
3398
+ </fo:block-container>
3399
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2830
3400
  <xsl:variable name="text">
2831
3401
  <xsl:call-template name="add-zero-spaces-equal"/>
2832
3402
  </xsl:variable>
2833
- <xsl:call-template name="add-zero-spaces">
3403
+ <xsl:call-template name="add-zero-spaces-java">
2834
3404
  <xsl:with-param name="text" select="$text"/>
2835
3405
  </xsl:call-template>
2836
3406
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2837
3407
  <xsl:if test="normalize-space() != ''">
2838
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2839
-
3408
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2840
3409
  <xsl:apply-templates/>
2841
3410
  </fo:block>
2842
3411
  </xsl:if>
@@ -2910,9 +3479,9 @@
2910
3479
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2911
3480
  </xsl:if>
2912
3481
  <fo:block-container margin-left="0mm" margin-right="0mm">
2913
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3482
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
2914
3483
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2915
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3484
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
2916
3485
  </xsl:if>
2917
3486
  <xsl:variable name="simple-table">
2918
3487
  <xsl:call-template name="getSimpleTable"/>
@@ -2921,8 +3490,8 @@
2921
3490
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2922
3491
  <!-- <fo:table-column column-width="35mm"/>
2923
3492
  <fo:table-column column-width="115mm"/> -->
2924
- <fo:table-column column-width="25%"/>
2925
- <fo:table-column column-width="75%"/>
3493
+ <fo:table-column column-width="30%"/>
3494
+ <fo:table-column column-width="70%"/>
2926
3495
  </xsl:if>
2927
3496
  <xsl:apply-templates mode="requirement"/>
2928
3497
  </fo:table>
@@ -2945,14 +3514,21 @@
2945
3514
  <xsl:apply-templates mode="requirement"/>
2946
3515
  </fo:table-body>
2947
3516
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2948
- <fo:table-row height="7mm">
2949
- <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
2950
- <xsl:attribute name="border">1pt solid black</xsl:attribute>
3517
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3518
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3519
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3520
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3521
+ </xsl:if>
3522
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3523
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3524
+ </xsl:if>
3525
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3526
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
2951
3527
  </xsl:if>
2952
3528
  <xsl:apply-templates mode="requirement"/>
2953
3529
  </fo:table-row>
2954
3530
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2955
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3531
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2956
3532
  <xsl:attribute name="text-align">
2957
3533
  <xsl:choose>
2958
3534
  <xsl:when test="@align">
@@ -2971,6 +3547,7 @@
2971
3547
  <xsl:value-of select="@rowspan"/>
2972
3548
  </xsl:attribute>
2973
3549
  </xsl:if>
3550
+ <xsl:call-template name="display-align"/>
2974
3551
 
2975
3552
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2976
3553
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -2986,7 +3563,7 @@
2986
3563
  </fo:block>
2987
3564
  </fo:table-cell>
2988
3565
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2989
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3566
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2990
3567
  <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2991
3568
  <xsl:attribute name="padding">0mm</xsl:attribute>
2992
3569
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -2999,6 +3576,9 @@
2999
3576
  <xsl:otherwise>left</xsl:otherwise>
3000
3577
  </xsl:choose>
3001
3578
  </xsl:attribute>
3579
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3580
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3581
+ </xsl:if>
3002
3582
  <xsl:if test="@colspan">
3003
3583
  <xsl:attribute name="number-columns-spanned">
3004
3584
  <xsl:value-of select="@colspan"/>
@@ -3009,6 +3589,7 @@
3009
3589
  <xsl:value-of select="@rowspan"/>
3010
3590
  </xsl:attribute>
3011
3591
  </xsl:if>
3592
+ <xsl:call-template name="display-align"/>
3012
3593
 
3013
3594
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3014
3595
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
@@ -3024,7 +3605,7 @@
3024
3605
  </fo:block>
3025
3606
  </fo:table-cell>
3026
3607
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3027
- <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3608
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3028
3609
  <xsl:apply-templates/>
3029
3610
  </fo:block>
3030
3611
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -3050,12 +3631,13 @@
3050
3631
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3051
3632
 
3052
3633
  <xsl:variable name="element">
3053
-
3634
+
3054
3635
  inline
3636
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3055
3637
  </xsl:variable>
3056
3638
 
3057
3639
  <xsl:choose>
3058
- <xsl:when test="normalize-space($element) = 'block'">
3640
+ <xsl:when test="contains(normalize-space($element), 'block')">
3059
3641
  <fo:block xsl:use-attribute-sets="example-body-style">
3060
3642
  <xsl:apply-templates/>
3061
3643
  </fo:block>
@@ -3092,25 +3674,44 @@
3092
3674
  </xsl:otherwise>
3093
3675
  </xsl:choose>
3094
3676
 
3095
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3096
- <fo:block xsl:use-attribute-sets="example-p-style">
3677
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3678
+
3679
+ <xsl:variable name="element">
3680
+ block
3097
3681
 
3098
- <xsl:apply-templates/>
3099
- </fo:block>
3682
+ </xsl:variable>
3683
+ <xsl:choose>
3684
+ <xsl:when test="normalize-space($element) = 'block'">
3685
+ <fo:block xsl:use-attribute-sets="example-p-style">
3686
+
3687
+ <xsl:apply-templates/>
3688
+ </fo:block>
3689
+ </xsl:when>
3690
+ <xsl:otherwise>
3691
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3692
+ <xsl:apply-templates/>
3693
+ </fo:inline>
3694
+ </xsl:otherwise>
3695
+ </xsl:choose>
3100
3696
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3101
3697
  <fo:block xsl:use-attribute-sets="termsource-style">
3102
3698
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3103
3699
  <xsl:variable name="termsource_text">
3104
3700
  <xsl:apply-templates/>
3105
3701
  </xsl:variable>
3702
+
3106
3703
  <xsl:choose>
3107
3704
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3108
3705
  <xsl:apply-templates/>
3109
3706
  </xsl:when>
3110
- <xsl:otherwise>
3111
- <xsl:text>[</xsl:text>
3112
- <xsl:apply-templates/>
3113
- <xsl:text>]</xsl:text>
3707
+ <xsl:otherwise>
3708
+
3709
+ <xsl:text>[</xsl:text>
3710
+
3711
+ <xsl:apply-templates/>
3712
+
3713
+ <xsl:text>]</xsl:text>
3714
+
3114
3715
  </xsl:otherwise>
3115
3716
  </xsl:choose>
3116
3717
  </fo:block>
@@ -3131,18 +3732,29 @@
3131
3732
  <xsl:if test="normalize-space() != ''">
3132
3733
  <xsl:value-of select="."/>
3133
3734
  </xsl:if>
3134
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3735
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3736
+ <fo:block-container margin-left="0mm">
3737
+ <xsl:if test="parent::*[local-name() = 'note']">
3738
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3739
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3740
+ </xsl:if>
3741
+ </xsl:if>
3742
+
3743
+ <fo:block-container margin-left="0mm">
3135
3744
 
3136
- <fo:block xsl:use-attribute-sets="quote-style">
3137
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3138
- </fo:block>
3139
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3140
- <fo:block xsl:use-attribute-sets="quote-source-style">
3141
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3142
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3143
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3144
- </fo:block>
3145
- </xsl:if>
3745
+ <fo:block xsl:use-attribute-sets="quote-style">
3746
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3747
+ </fo:block>
3748
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3749
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3750
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3751
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3752
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3753
+ </fo:block>
3754
+ </xsl:if>
3755
+
3756
+ </fo:block-container>
3757
+ </fo:block-container>
3146
3758
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3147
3759
  <xsl:if test="../*[local-name() = 'author']">
3148
3760
  <xsl:text>, </xsl:text>
@@ -3170,6 +3782,7 @@
3170
3782
  <xsl:if test="@type = 'inline'">
3171
3783
 
3172
3784
 
3785
+
3173
3786
  </xsl:if>
3174
3787
 
3175
3788
 
@@ -3210,6 +3823,7 @@
3210
3823
 
3211
3824
 
3212
3825
 
3826
+
3213
3827
  </xsl:variable>
3214
3828
 
3215
3829
  <xsl:variable name="padding-right">
@@ -3256,9 +3870,12 @@
3256
3870
  </fo:block>
3257
3871
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3258
3872
  <xsl:variable name="title-deprecated">
3259
- <xsl:call-template name="getTitle">
3260
- <xsl:with-param name="name" select="'title-deprecated'"/>
3261
- </xsl:call-template>
3873
+
3874
+
3875
+ <xsl:call-template name="getTitle">
3876
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3877
+ </xsl:call-template>
3878
+
3262
3879
  </xsl:variable>
3263
3880
  <fo:block xsl:use-attribute-sets="deprecates-style">
3264
3881
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3307,6 +3924,7 @@
3307
3924
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3308
3925
  <fo:block>
3309
3926
  <xsl:call-template name="setId"/>
3927
+
3310
3928
  <xsl:apply-templates/>
3311
3929
  </fo:block>
3312
3930
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3331,6 +3949,31 @@
3331
3949
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3332
3950
  <!-- 0xA0 to space replacement -->
3333
3951
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3952
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3953
+ <xsl:choose>
3954
+ <xsl:when test="parent::*[local-name() = 'note']">
3955
+ <fo:block-container>
3956
+ <xsl:attribute name="margin-left">
3957
+ <xsl:choose>
3958
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3959
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3960
+ </xsl:choose>
3961
+ </xsl:attribute>
3962
+
3963
+
3964
+ <fo:block-container margin-left="0mm">
3965
+ <fo:block>
3966
+ <xsl:apply-templates select="." mode="ul_ol"/>
3967
+ </fo:block>
3968
+ </fo:block-container>
3969
+ </fo:block-container>
3970
+ </xsl:when>
3971
+ <xsl:otherwise>
3972
+ <fo:block>
3973
+ <xsl:apply-templates select="." mode="ul_ol"/>
3974
+ </fo:block>
3975
+ </xsl:otherwise>
3976
+ </xsl:choose>
3334
3977
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3335
3978
  <!-- <row>
3336
3979
  <date>05-07-2013</date>
@@ -3363,7 +4006,28 @@
3363
4006
  <fo:block><xsl:apply-templates/></fo:block>
3364
4007
  </fo:table-cell>
3365
4008
  </xsl:template><xsl:template name="processBibitem">
4009
+
3366
4010
 
4011
+
4012
+
4013
+ </xsl:template><xsl:template name="processBibitemDocId">
4014
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4015
+ <xsl:choose>
4016
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4017
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4018
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4019
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4020
+ </xsl:if>
4021
+ <xsl:value-of select="$_doc_ident"/>
4022
+ </xsl:when>
4023
+ <xsl:otherwise>
4024
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4025
+ <xsl:if test="$type != ''">
4026
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4027
+ </xsl:if>
4028
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4029
+ </xsl:otherwise>
4030
+ </xsl:choose>
3367
4031
  </xsl:template><xsl:template name="processPersonalAuthor">
3368
4032
  <xsl:choose>
3369
4033
  <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
@@ -3480,6 +4144,7 @@
3480
4144
 
3481
4145
 
3482
4146
 
4147
+
3483
4148
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title']"/>
3484
4149
 
3485
4150
 
@@ -3498,6 +4163,7 @@
3498
4163
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
3499
4164
 
3500
4165
 
4166
+
3501
4167
  </dc:creator>
3502
4168
  <dc:description>
3503
4169
  <xsl:variable name="abstract">
@@ -3505,6 +4171,7 @@
3505
4171
 
3506
4172
 
3507
4173
 
4174
+
3508
4175
  </xsl:variable>
3509
4176
  <xsl:value-of select="normalize-space($abstract)"/>
3510
4177
  </dc:description>
@@ -3576,13 +4243,22 @@
3576
4243
  </xsl:template><xsl:template name="split">
3577
4244
  <xsl:param name="pText" select="."/>
3578
4245
  <xsl:param name="sep" select="','"/>
4246
+ <xsl:param name="normalize-space" select="'true'"/>
3579
4247
  <xsl:if test="string-length($pText) &gt;0">
3580
4248
  <item>
3581
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4249
+ <xsl:choose>
4250
+ <xsl:when test="$normalize-space = 'true'">
4251
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4252
+ </xsl:when>
4253
+ <xsl:otherwise>
4254
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4255
+ </xsl:otherwise>
4256
+ </xsl:choose>
3582
4257
  </item>
3583
4258
  <xsl:call-template name="split">
3584
4259
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3585
4260
  <xsl:with-param name="sep" select="$sep"/>
4261
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3586
4262
  </xsl:call-template>
3587
4263
  </xsl:if>
3588
4264
  </xsl:template><xsl:template name="getDocumentId">
@@ -3605,6 +4281,7 @@
3605
4281
 
3606
4282
 
3607
4283
 
4284
+
3608
4285
  </xsl:variable>
3609
4286
  <xsl:if test="$documentNS != $XSLNS">
3610
4287
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3630,4 +4307,40 @@
3630
4307
  </xsl:otherwise>
3631
4308
  </xsl:choose>
3632
4309
  </xsl:attribute>
4310
+ </xsl:template><xsl:template name="add-letter-spacing">
4311
+ <xsl:param name="text"/>
4312
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4313
+ <xsl:if test="string-length($text) &gt; 0">
4314
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4315
+ <fo:inline padding-right="{$letter-spacing}mm">
4316
+ <xsl:if test="$char = '®'">
4317
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4318
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4319
+ </xsl:if>
4320
+ <xsl:value-of select="$char"/>
4321
+ </fo:inline>
4322
+ <xsl:call-template name="add-letter-spacing">
4323
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4324
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4325
+ </xsl:call-template>
4326
+ </xsl:if>
4327
+ </xsl:template><xsl:template name="repeat">
4328
+ <xsl:param name="char" select="'*'"/>
4329
+ <xsl:param name="count"/>
4330
+ <xsl:if test="$count &gt; 0">
4331
+ <xsl:value-of select="$char"/>
4332
+ <xsl:call-template name="repeat">
4333
+ <xsl:with-param name="char" select="$char"/>
4334
+ <xsl:with-param name="count" select="$count - 1"/>
4335
+ </xsl:call-template>
4336
+ </xsl:if>
4337
+ </xsl:template><xsl:template name="getLocalizedString">
4338
+ <xsl:param name="key"/>
4339
+
4340
+ <xsl:variable name="curr_lang">
4341
+ <xsl:call-template name="getLang"/>
4342
+ </xsl:variable>
4343
+
4344
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4345
+
3633
4346
  </xsl:template></xsl:stylesheet>