metanorma-iso 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,12 +38,12 @@ module IsoDoc
38
38
  set(:statusabbr, status_abbrev(docstatus["abbreviation"] || "??",
39
39
  isoxml&.at(ns("//bibdata/status/substage"))&.text,
40
40
  isoxml&.at(ns("//bibdata/status/iteration"))&.text,
41
- isoxml&.at(ns("//version/draft"))&.text,
41
+ isoxml&.at(ns("//bibdata/version/draft"))&.text,
42
42
  isoxml&.at(ns("//bibdata/ext/doctype"))&.text))
43
43
  unpublished(docstatus.text) and
44
44
  set(:stageabbr, docstatus["abbreviation"])
45
45
  end
46
- revdate = isoxml.at(ns("//version/revision-date"))
46
+ revdate = isoxml.at(ns("//bibdata/version/revision-date"))
47
47
  set(:revdate, revdate&.text)
48
48
  end
49
49
 
@@ -14,34 +14,34 @@ module IsoDoc
14
14
  @htmlToClevels = 3 if @htmlToClevels.zero?
15
15
  end
16
16
 
17
+ def font_choice(options)
18
+ if options[:script] == "Hans" then '"Source Han Sans",serif'
19
+ else '"Cambria",serif'
20
+ end
21
+ end
22
+
17
23
  def default_fonts(options)
18
- {
19
- bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' :
20
- '"Cambria",serif'),
21
- headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' :
22
- '"Cambria",serif'),
23
- monospacefont: '"Courier New",monospace',
24
- normalfontsize: "11.0pt",
25
- monospacefontsize: "9.0pt",
26
- smallerfontsize: "10.0pt",
27
- footnotefontsize: "10.0pt",
28
- }
24
+ { bodyfont: font_choice(options),
25
+ headerfont: font_choice(options),
26
+ monospacefont: '"Courier New",monospace',
27
+ normalfontsize: "11.0pt",
28
+ monospacefontsize: "9.0pt",
29
+ smallerfontsize: "10.0pt",
30
+ footnotefontsize: "10.0pt" }
29
31
  end
30
32
 
31
33
  def default_file_locations(options)
32
- {
33
- htmlstylesheet: (options[:alt] ? html_doc_path("style-human.scss") :
34
- html_doc_path("style-iso.scss")),
35
- htmlcoverpage: html_doc_path("html_iso_titlepage.html"),
36
- htmlintropage: html_doc_path("html_iso_intro.html"),
37
- wordstylesheet: html_doc_path("wordstyle.scss"),
38
- standardstylesheet: html_doc_path("isodoc.scss"),
39
- header: html_doc_path("header.html"),
40
- wordcoverpage: html_doc_path("word_iso_titlepage.html"),
41
- wordintropage: html_doc_path("word_iso_intro.html"),
42
- ulstyle: "l3",
43
- olstyle: "l2",
44
- }
34
+ a = options[:alt] ? "style-human.scss" : "style-iso.scss"
35
+ { htmlstylesheet: html_doc_path(a),
36
+ htmlcoverpage: html_doc_path("html_iso_titlepage.html"),
37
+ htmlintropage: html_doc_path("html_iso_intro.html"),
38
+ wordstylesheet: html_doc_path("wordstyle.scss"),
39
+ standardstylesheet: html_doc_path("isodoc.scss"),
40
+ header: html_doc_path("header.html"),
41
+ wordcoverpage: html_doc_path("word_iso_titlepage.html"),
42
+ wordintropage: html_doc_path("word_iso_intro.html"),
43
+ ulstyle: "l3",
44
+ olstyle: "l2" }
45
45
  end
46
46
 
47
47
  def make_body(xml, docxml)
@@ -54,9 +54,10 @@ module IsoDoc
54
54
  end
55
55
  end
56
56
 
57
- def colophon(body, docxml)
58
- stage = @meta.get[:stage_int]
57
+ def colophon(body, _docxml)
58
+ stage = @meta.get[:stage_int]
59
59
  return if !stage.nil? && stage < 60
60
+
60
61
  body.br **{ clear: "all", style: "page-break-before:left;"\
61
62
  "mso-break-type:section-break" }
62
63
  body.div **{ class: "colophon" } do |div|
@@ -67,35 +68,55 @@ module IsoDoc
67
68
  super
68
69
  xml.xpath("//div[@class = 'figure']//table[@class = 'dl']").each do |t|
69
70
  t["class"] = "figdl"
70
- d = t.add_previous_sibling("<div class='figdl'/>")
71
+ d = t.add_previous_sibling("<div class='figdl' "\
72
+ "style='page-break-after:avoid;'/>")
71
73
  t.parent = d.first
72
74
  end
73
75
  end
74
76
 
75
77
  # force Annex h2 down to be p.h2Annex, so it is not picked up by ToC
76
- def word_annex_cleanup1(docxml, i)
77
- docxml.xpath("//h#{i}[ancestor::*[@class = 'Section3']]").each do |h2|
78
+ def word_annex_cleanup1(docxml, lvl)
79
+ docxml.xpath("//h#{lvl}[ancestor::*[@class = 'Section3']]").each do |h2|
78
80
  h2.name = "p"
79
- h2["class"] = "h#{i}Annex"
81
+ h2["class"] = "h#{lvl}Annex"
80
82
  end
81
83
  end
82
84
 
83
85
  def word_annex_cleanup(docxml)
84
- word_annex_cleanup1(docxml, 2)
85
- word_annex_cleanup1(docxml, 3)
86
- word_annex_cleanup1(docxml, 4)
87
- word_annex_cleanup1(docxml, 5)
88
- word_annex_cleanup1(docxml, 6)
86
+ (2..6).each { |i| word_annex_cleanup1(docxml, i) }
87
+ end
88
+
89
+ def word_annex_cleanup_h1(docxml)
90
+ docxml.xpath("//h1[@class = 'Annex']").each do |h|
91
+ h.name = "p"
92
+ h["class"] = "ANNEX"
93
+ end
94
+ %w(BiblioTitle ForewordTitle IntroTitle).each do |s|
95
+ docxml.xpath("//*[@class = '#{s}']").each do |h|
96
+ h.name = "p"
97
+ end
98
+ end
99
+ end
100
+
101
+ def style_cleanup(docxml)
102
+ word_annex_cleanup_h1(docxml)
103
+ style_cleanup1(docxml)
104
+ end
105
+
106
+ def style_cleanup1(docxml)
107
+ docxml.xpath("//*[@class = 'example']").each do |p|
108
+ p["class"] = "Example"
109
+ end
89
110
  end
90
111
 
91
112
  def authority_hdr_cleanup(docxml)
92
- docxml&.xpath("//div[@class = 'boilerplate-license']").each do |d|
113
+ docxml&.xpath("//div[@class = 'boilerplate-license']")&.each do |d|
93
114
  d.xpath(".//h1").each do |p|
94
115
  p.name = "p"
95
116
  p["class"] = "zzWarningHdr"
96
117
  end
97
118
  end
98
- docxml&.xpath("//div[@class = 'boilerplate-copyright']").each do |d|
119
+ docxml&.xpath("//div[@class = 'boilerplate-copyright']")&.each do |d|
99
120
  d.xpath(".//h1").each do |p|
100
121
  p.name = "p"
101
122
  p["class"] = "zzCopyrightHdr"
@@ -120,11 +141,104 @@ module IsoDoc
120
141
  def word_cleanup(docxml)
121
142
  authority_hdr_cleanup(docxml)
122
143
  super
144
+ style_cleanup(docxml)
123
145
  docxml
124
146
  end
125
147
 
126
- def footnote_reference_format(a)
127
- a.children = "<span class='MsoFootnoteReference'>#{a.children.to_xml}</span>)"
148
+ def word_toc_preface(level)
149
+ <<~TOC.freeze
150
+ <span lang="EN-GB"><span
151
+ style='mso-element:field-begin'></span><span
152
+ style='mso-spacerun:yes'>&#xA0;</span>TOC
153
+ \\o &quot;1-#{level}&quot; \\h \\z \\t &quot;Heading
154
+ 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1&quot; <span
155
+ style='mso-element:field-separator'></span></span>
156
+ TOC
157
+ end
158
+
159
+ def footnote_reference_format(link)
160
+ link.children =
161
+ "<span class='MsoFootnoteReference'>#{link.children.to_xml}</span>)"
162
+ end
163
+
164
+ def bibliography_attrs
165
+ { class: "BiblioTitle" }
166
+ end
167
+
168
+ def bibliography(xml, out)
169
+ f = xml.at(ns(bibliography_xpath)) and f["hidden"] != "true" or return
170
+ page_break(out)
171
+ out.div do |div|
172
+ div.h1 **bibliography_attrs do |h1|
173
+ f&.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
174
+ end
175
+ biblio_list(f, div, true)
176
+ end
177
+ end
178
+
179
+ def bibliography_parse(node, out)
180
+ node["hidden"] != true or return
181
+ out.div do |div|
182
+ clause_parse_title(node, div, node.at(ns("./title")), out,
183
+ bibliography_attrs)
184
+ biblio_list(node, div, true)
185
+ end
186
+ end
187
+
188
+ def para_class(node)
189
+ if !node.ancestors("definition").empty? && !@in_footnote
190
+ "Definition"
191
+ elsif !node.ancestors("foreword").empty? && !@in_footnote
192
+ "ForewordText"
193
+ else
194
+ super
195
+ end
196
+ end
197
+
198
+ def termref_attrs
199
+ { class: "Source" }
200
+ end
201
+
202
+ def termref_parse(node, out)
203
+ out.p **termref_attrs do |p|
204
+ p << "[TERMREF]"
205
+ node.children.each { |n| parse(n, p) }
206
+ p << "[/TERMREF]"
207
+ end
208
+ end
209
+
210
+ def figure_name_attrs(node)
211
+ s = node.ancestors("annex").empty? ? "FigureTitle" : "AnnexFigureTitle"
212
+ { class: s, style: "text-align:center;" }
213
+ end
214
+
215
+ def figure_name_parse(node, div, name)
216
+ return if name.nil?
217
+
218
+ div.p **figure_name_attrs(node) do |p|
219
+ name.children.each { |n| parse(n, p) }
220
+ end
221
+ end
222
+
223
+ def table_title_attrs(node)
224
+ s = node.ancestors("annex").empty? ? "Tabletitle" : "AnnexTableTitle"
225
+ { class: s, style: "text-align:center;" }
226
+ end
227
+
228
+ def table_title_parse(node, out)
229
+ name = node.at(ns("./name")) or return
230
+ out.p **table_title_attrs(node) do |p|
231
+ name&.children&.each { |n| parse(n, p) }
232
+ end
233
+ end
234
+
235
+ def annex_name(_annex, name, div)
236
+ return if name.nil?
237
+
238
+ name&.at(ns("./strong"))&.remove # supplied by CSS list numbering
239
+ div.h1 **{ class: "Annex" } do |t|
240
+ name.children.each { |c2| parse(c2, t) }
241
+ end
128
242
  end
129
243
 
130
244
  include BaseConvert
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.8.4".freeze
3
+ VERSION = "1.8.5".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.files = `git ls-files`.split("\n")
29
29
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
30
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
31
31
 
32
32
  spec.add_dependency "isodoc", "~> 1.6.2"
33
33
  spec.add_dependency "metanorma-standoc", "~> 1.9.0"
@@ -75,7 +75,7 @@ RSpec.describe IsoDoc do
75
75
  </ext>
76
76
  </bibdata>
77
77
  <preface>
78
- <foreword>
78
+ <foreword displayorder="1">
79
79
  <p>
80
80
  <xref target="N">Scope, Note</xref>
81
81
  <xref target="note1">Widgets, 1, Note 1</xref>
@@ -87,7 +87,7 @@ RSpec.describe IsoDoc do
87
87
  </foreword>
88
88
  </preface>
89
89
  <sections>
90
- <clause id="scope">
90
+ <clause id="scope" displayorder="3">
91
91
  <title depth="1">Scope</title>
92
92
  <note id="N">
93
93
  <name>NOTE</name>
@@ -99,8 +99,8 @@ RSpec.describe IsoDoc do
99
99
  <xref target="N">Note</xref>
100
100
  </p>
101
101
  </clause>
102
- <terms id="terms"/>
103
- <clause id="widgets">
102
+ <terms id="terms" displayorder="2"/>
103
+ <clause id="widgets" displayorder="4">
104
104
  <title depth="1">Widgets</title>
105
105
  <clause id="widgets1" inline-header="true">
106
106
  <note id="note1">
@@ -122,7 +122,7 @@ RSpec.describe IsoDoc do
122
122
  </clause>
123
123
  </clause>
124
124
  </sections>
125
- <annex id="annex1">
125
+ <annex id="annex1" displayorder="5">
126
126
  <title>
127
127
  <strong>Annex A</strong>
128
128
  <br/>(informative)</title>
@@ -235,97 +235,102 @@ RSpec.describe IsoDoc do
235
235
  INPUT
236
236
  expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
237
237
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
238
- <?xml version='1.0'?>
239
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
240
- <bibdata>
241
- <ext>
242
- <doctype language="">amendment</doctype>
243
- </ext>
244
- </bibdata>
245
- <preface>
246
- <foreword obligation="informative">
247
- <title>Foreword</title>
248
- <p id="A">This is a preamble
249
-
250
- <xref target="C">0.1</xref>
251
- <xref target="C1">0.2</xref>
252
- <xref target="D">Scope</xref>
253
- <xref target="H">[H]</xref>
254
- <xref target="I">[I]</xref>
255
- <xref target="J">[J]</xref>
256
- <xref target="K">[K]</xref>
257
- <xref target="L">[L]</xref>
258
- <xref target="M">Clause 4</xref>
259
- <xref target="N">Introduction</xref>
260
- <xref target="O">Clause 4.2</xref>
261
- <xref target="P">Annex A</xref>
262
- <xref target="Q">A.1</xref>
263
- <xref target="Q1">A.1.1</xref>
264
- <xref target="Q2">Annex A, Appendix 1</xref>
265
- <xref target="R">[R]</xref></p>
266
- </foreword>
267
- <introduction id="B" obligation="informative">
268
- <title depth="1">Introduction</title>
269
- <clause id="C" inline-header="false" obligation="informative">
270
- <title depth="2">Introduction Subsection</title>
271
- </clause>
272
- <clause id="C1" inline-header="true" obligation="informative">Text</clause>
273
- </introduction>
274
- </preface>
275
- <sections>
276
- <clause id="D" obligation="normative" type="scope">
277
- <title depth="1">Scope</title>
278
- <p id="E">Text</p>
279
- </clause>
280
- <clause id="M" inline-header="false" obligation="normative">
281
- <title depth="1">Clause 4</title>
282
- <clause id="N" inline-header="false" obligation="normative">
283
- <title depth="2">Introduction</title>
284
- </clause>
285
- <clause id="O" inline-header="false" obligation="normative">
286
- <title depth="2">Clause 4.2</title>
287
- </clause>
288
- </clause>
289
- </sections>
290
- <annex id="P" inline-header="false" obligation="normative">
291
- <title>
292
- <strong>Annex A</strong>
293
- <br/>(normative)
294
-
295
- <br/>
296
- <br/>
297
- <strong>Annex</strong></title>
298
- <clause id="Q" inline-header="false" obligation="normative">
299
- <title depth="2">A.1
300
-
301
- <tab/>
302
- Annex A.1</title>
303
- <clause id="Q1" inline-header="false" obligation="normative">
304
- <title depth="3">A.1.1
305
-
306
- <tab/>
307
- Annex A.1a</title>
308
- </clause>
309
- </clause>
310
- <appendix id="Q2" inline-header="false" obligation="normative">
311
- <title depth="2">Appendix 1
312
-
313
- <tab/>
314
- An Appendix</title>
315
- </appendix>
316
- </annex>
317
- <bibliography>
318
- <references id="R" normative="true" obligation="informative">
319
- <title depth="1">Normative References</title>
320
- </references>
321
- <clause id="S" obligation="informative">
322
- <title depth="1">Bibliography</title>
323
- <references id="T" normative="false" obligation="informative">
324
- <title depth="2">Bibliography Subsection</title>
325
- </references>
326
- </clause>
327
- </bibliography>
328
- </iso-standard>
238
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
239
+ <bibdata>
240
+ <ext>
241
+ <doctype language=''>amendment</doctype>
242
+ </ext>
243
+ </bibdata>
244
+
245
+ <preface>
246
+ <foreword obligation='informative' displayorder='1'>
247
+ <title>Foreword</title>
248
+ <p id='A'>
249
+ This is a preamble
250
+ <xref target='C'>0.1</xref>
251
+ <xref target='C1'>0.2</xref>
252
+ <xref target='D'>Scope</xref>
253
+ <xref target='H'>[H]</xref>
254
+ <xref target='I'>[I]</xref>
255
+ <xref target='J'>[J]</xref>
256
+ <xref target='K'>[K]</xref>
257
+ <xref target='L'>[L]</xref>
258
+ <xref target='M'>Clause 4</xref>
259
+ <xref target='N'>Introduction</xref>
260
+ <xref target='O'>Clause 4.2</xref>
261
+ <xref target='P'>Annex A</xref>
262
+ <xref target='Q'>A.1</xref>
263
+ <xref target='Q1'>A.1.1</xref>
264
+ <xref target='Q2'>Annex A, Appendix 1</xref>
265
+ <xref target='R'>[R]</xref>
266
+ </p>
267
+ </foreword>
268
+ <introduction id='B' obligation='informative' displayorder='2'>
269
+ <title depth='1'>Introduction</title>
270
+ <clause id='C' inline-header='false' obligation='informative'>
271
+ <title depth='2'>Introduction Subsection</title>
272
+ </clause>
273
+ <clause id='C1' inline-header='true' obligation='informative'>Text</clause>
274
+ </introduction>
275
+ </preface>
276
+ <sections>
277
+ <clause id='D' obligation='normative' type='scope' displayorder='3'>
278
+ <title depth='1'>Scope</title>
279
+ <p id='E'>Text</p>
280
+ </clause>
281
+ <clause id='M' inline-header='false' obligation='normative' displayorder='5'>
282
+ <title depth='1'>Clause 4</title>
283
+ <clause id='N' inline-header='false' obligation='normative'>
284
+ <title depth='2'>Introduction</title>
285
+ </clause>
286
+ <clause id='O' inline-header='false' obligation='normative'>
287
+ <title depth='2'>Clause 4.2</title>
288
+ </clause>
289
+ </clause>
290
+ </sections>
291
+ <annex id='P' inline-header='false' obligation='normative' displayorder='6'>
292
+ <title>
293
+ <strong>Annex A</strong>
294
+ <br/>
295
+ (normative)
296
+ <br/>
297
+ <br/>
298
+ <strong>Annex</strong>
299
+ </title>
300
+ <clause id='Q' inline-header='false' obligation='normative'>
301
+ <title depth='2'>
302
+ A.1
303
+ <tab/>
304
+ Annex A.1
305
+ </title>
306
+ <clause id='Q1' inline-header='false' obligation='normative'>
307
+ <title depth='3'>
308
+ A.1.1
309
+ <tab/>
310
+ Annex A.1a
311
+ </title>
312
+ </clause>
313
+ </clause>
314
+ <appendix id='Q2' inline-header='false' obligation='normative'>
315
+ <title depth='2'>
316
+ Appendix 1
317
+ <tab/>
318
+ An Appendix
319
+ </title>
320
+ </appendix>
321
+ </annex>
322
+ <bibliography>
323
+ <references id='R' normative='true' obligation='informative' displayorder='4'>
324
+ <title depth='1'>Normative References</title>
325
+ </references>
326
+ <clause id='S' obligation='informative' displayorder='7'>
327
+ <title depth='1'>Bibliography</title>
328
+ <references id='T' normative='false' obligation='informative'>
329
+ <title depth='2'>Bibliography Subsection</title>
330
+ </references>
331
+ </clause>
332
+ </bibliography>
333
+ </iso-standard>
329
334
  OUTPUT
330
335
  end
331
336
 
@@ -423,109 +428,96 @@ RSpec.describe IsoDoc do
423
428
  </iso-standard>
424
429
  INPUT
425
430
  presxml = <<~OUTPUT
426
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
427
- <bibdata>
428
- <ext>
429
- <doctype language="">amendment</doctype>
430
- </ext>
431
- </bibdata>
432
- <boilerplate>
433
- <copyright-statement>
434
- <clause>
435
- <title depth="1">Copyright</title>
436
- </clause>
437
- </copyright-statement>
438
- <license-statement>
439
- <clause>
440
- <title depth="1">License</title>
441
- </clause>
442
- </license-statement>
443
- <legal-statement>
444
- <clause>
445
- <title depth="1">Legal</title>
446
- </clause>
447
- </legal-statement>
448
- <feedback-statement>
449
- <clause>
450
- <title depth="1">Feedback</title>
451
- </clause>
452
- </feedback-statement>
453
- </boilerplate>
454
- <preface>
455
- <abstract obligation="informative">
456
- <title>Abstract</title>
457
- </abstract>
458
- <foreword obligation="informative">
459
- <title>Foreword</title>
460
- <p id="A">This is a preamble</p>
461
- </foreword>
462
- <introduction id="B" obligation="informative">
463
- <title depth="1">Introduction</title>
464
- <clause id="C" inline-header="false" obligation="informative">
465
- <title depth="2">Introduction Subsection</title>
466
- </clause>
467
- </introduction>
468
- <clause id="B1">
469
- <title depth="1">Dedication</title>
470
- </clause>
471
- <clause id="B2">
472
- <title depth="1">Note to reader</title>
473
- </clause>
474
- <acknowledgements obligation="informative">
475
- <title>Acknowledgements</title>
476
- </acknowledgements>
477
- </preface>
478
- <sections>
479
- <clause id="M" inline-header="false" obligation="normative">
480
- <title depth="1">Clause 4</title>
481
- <clause id="N" inline-header="false" obligation="normative">
482
- <title depth="2">Introduction</title>
483
- </clause>
484
- <clause id="O" inline-header="false" obligation="normative">
485
- <title depth="2">Clause 4.2</title>
486
- </clause>
487
- <clause id="O1" inline-header="true" obligation="normative"/>
488
- </clause>
489
- <clause id="D" obligation="normative">
490
- <title depth="1">Scope</title>
491
- <p id="E">Text</p>
492
- </clause>
493
- </sections>
494
- <annex id="P" inline-header="false" obligation="normative">
495
- <title>
496
- <strong>Annex A</strong>
497
- <br/>(normative)
498
- <br/>
499
- <br/>
500
- <strong>Annex</strong></title>
501
- <clause id="Q" inline-header="false" obligation="normative">
502
- <title depth="2">A.1
503
- <tab/>
504
- Annex A.1</title>
505
- <clause id="Q1" inline-header="false" obligation="normative">
506
- <title depth="3">A.1.1
507
- <tab/>
508
- Annex A.1a</title>
509
- </clause>
510
- </clause>
511
- </annex>
512
- <annex id="P1" inline-header="false" obligation="normative">
513
- <title>
514
- <strong>Annex B</strong>
515
- <br/>(normative)</title>
516
- </annex>
517
- <bibliography>
518
- <references id="R" normative="true" obligation="informative">
519
- <title depth="1">Normative References</title>
520
- </references>
521
- <clause id="S" obligation="informative">
522
- <title depth="1">Bibliography</title>
523
- <references id="T" normative="false" obligation="informative">
524
- <title depth="2">Bibliography Subsection</title>
525
- </references>
526
- </clause>
527
- </bibliography>
528
- </iso-standard>
431
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
432
+ <bibdata>
433
+ <ext>
434
+ <doctype language="">amendment</doctype>
435
+ </ext>
436
+ </bibdata>
437
+ <boilerplate>
438
+ <copyright-statement>
439
+ <clause>
440
+ <title depth="1">Copyright</title>
441
+ </clause>
442
+ </copyright-statement>
443
+ <license-statement>
444
+ <clause>
445
+ <title depth="1">License</title>
446
+ </clause>
447
+ </license-statement>
448
+ <legal-statement>
449
+ <clause>
450
+ <title depth="1">Legal</title>
451
+ </clause>
452
+ </legal-statement>
453
+ <feedback-statement>
454
+ <clause>
455
+ <title depth="1">Feedback</title>
456
+ </clause>
457
+ </feedback-statement>
458
+ </boilerplate>
459
+ <preface>
460
+ <abstract obligation="informative" displayorder="1">
461
+ <title>Abstract</title>
462
+ </abstract>
463
+ <foreword obligation="informative" displayorder="2">
464
+ <title>Foreword</title>
465
+ <p id="A">This is a preamble</p>
466
+ </foreword>
467
+ <introduction id="B" obligation="informative" displayorder="3">
468
+ <title depth="1">Introduction</title>
469
+ <clause id="C" inline-header="false" obligation="informative">
470
+ <title depth="2">Introduction Subsection</title>
471
+ </clause>
472
+ </introduction>
473
+ <clause id="B1" displayorder="4">
474
+ <title depth="1">Dedication</title>
475
+ </clause>
476
+ <clause id="B2" displayorder="5">
477
+ <title depth="1">Note to reader</title>
478
+ </clause>
479
+ <acknowledgements obligation="informative" displayorder="6">
480
+ <title>Acknowledgements</title>
481
+ </acknowledgements>
482
+ </preface>
483
+ <sections>
484
+ <clause id="M" inline-header="false" obligation="normative" displayorder="8">
485
+ <title depth="1">Clause 4</title>
486
+ <clause id="N" inline-header="false" obligation="normative">
487
+ <title depth="2">Introduction</title>
488
+ </clause>
489
+ <clause id="O" inline-header="false" obligation="normative">
490
+ <title depth="2">Clause 4.2</title>
491
+ </clause>
492
+ <clause id="O1" inline-header="true" obligation="normative"/>
493
+ </clause>
494
+ <clause id="D" obligation="normative" displayorder="9">
495
+ <title depth="1">Scope</title>
496
+ <p id="E">Text</p>
497
+ </clause>
498
+ </sections>
499
+ <annex id="P" inline-header="false" obligation="normative" displayorder="10">
500
+ <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
501
+ <clause id="Q" inline-header="false" obligation="normative">
502
+ <title depth="2">A.1<tab/>Annex A.1</title>
503
+ <clause id="Q1" inline-header="false" obligation="normative">
504
+ <title depth="3">A.1.1<tab/>Annex A.1a</title>
505
+ </clause>
506
+ </clause>
507
+ </annex>
508
+ <annex id="P1" inline-header="false" obligation="normative" displayorder="11"><title><strong>Annex B</strong><br/>(normative)</title></annex>
509
+ <bibliography>
510
+ <references id="R" normative="true" obligation="informative" displayorder="7">
511
+ <title depth="1">Normative References</title>
512
+ </references>
513
+ <clause id="S" obligation="informative" displayorder="12">
514
+ <title depth="1">Bibliography</title>
515
+ <references id="T" normative="false" obligation="informative">
516
+ <title depth="2">Bibliography Subsection</title>
517
+ </references>
518
+ </clause>
519
+ </bibliography>
520
+ </iso-standard>
529
521
  OUTPUT
530
522
  html = <<~OUTPUT
531
523
  <html lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
@@ -617,9 +609,9 @@ RSpec.describe IsoDoc do
617
609
  <br/>
618
610
  <b>Annex</b></h1>
619
611
  <div id="Q">
620
- <h2>A.1 &#160; Annex A.1</h2>
612
+ <h2>A.1&#160; Annex A.1</h2>
621
613
  <div id="Q1">
622
- <h3>A.1.1 &#160; Annex A.1a</h3>
614
+ <h3>A.1.1&#160; Annex A.1a</h3>
623
615
  </div>
624
616
  </div>
625
617
  </div>