isodoc 1.1.4 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc-yaml/i18n-en.yaml +4 -1
  3. data/lib/isodoc-yaml/i18n-fr.yaml +4 -1
  4. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +4 -1
  5. data/lib/isodoc.rb +1 -0
  6. data/lib/isodoc/base_style/metanorma_word.css +6 -0
  7. data/lib/isodoc/base_style/metanorma_word.scss +6 -0
  8. data/lib/isodoc/common.rb +0 -2
  9. data/lib/isodoc/convert.rb +34 -28
  10. data/lib/isodoc/function/blocks.rb +11 -22
  11. data/lib/isodoc/function/blocks_example_note.rb +14 -15
  12. data/lib/isodoc/function/cleanup.rb +5 -4
  13. data/lib/isodoc/function/inline.rb +6 -76
  14. data/lib/isodoc/function/references.rb +13 -10
  15. data/lib/isodoc/function/reqt.rb +12 -11
  16. data/lib/isodoc/function/section.rb +51 -54
  17. data/lib/isodoc/function/table.rb +2 -6
  18. data/lib/isodoc/function/terms.rb +13 -6
  19. data/lib/isodoc/function/to_word_html.rb +3 -0
  20. data/lib/isodoc/function/utils.rb +6 -5
  21. data/lib/isodoc/html_function/html.rb +1 -1
  22. data/lib/isodoc/{function/i18n.rb → i18n.rb} +37 -37
  23. data/lib/isodoc/metadata.rb +4 -3
  24. data/lib/isodoc/metadata_date.rb +1 -1
  25. data/lib/isodoc/presentation_function/block.rb +152 -0
  26. data/lib/isodoc/presentation_function/inline.rb +131 -0
  27. data/lib/isodoc/presentation_function/section.rb +46 -0
  28. data/lib/isodoc/presentation_xml_convert.rb +39 -5
  29. data/lib/isodoc/version.rb +1 -1
  30. data/lib/isodoc/word_function/body.rb +13 -8
  31. data/lib/isodoc/word_function/inline.rb +3 -1
  32. data/lib/isodoc/word_function/postprocess.rb +1 -1
  33. data/lib/isodoc/word_function/table.rb +3 -2
  34. data/lib/isodoc/xref.rb +6 -3
  35. data/lib/isodoc/xref/xref_counter.rb +21 -7
  36. data/lib/isodoc/xref/xref_gen.rb +27 -4
  37. data/lib/isodoc/xref/xref_sect_gen.rb +3 -3
  38. data/spec/assets/i18n.yaml +12 -1
  39. data/spec/isodoc/blocks_spec.rb +1338 -147
  40. data/spec/isodoc/cleanup_spec.rb +5 -3
  41. data/spec/isodoc/footnotes_spec.rb +2 -2
  42. data/spec/isodoc/i18n_spec.rb +679 -110
  43. data/spec/isodoc/inline_spec.rb +323 -142
  44. data/spec/isodoc/lists_spec.rb +2 -2
  45. data/spec/isodoc/postproc_spec.rb +1347 -1333
  46. data/spec/isodoc/ref_spec.rb +181 -3
  47. data/spec/isodoc/section_spec.rb +633 -681
  48. data/spec/isodoc/table_spec.rb +386 -136
  49. data/spec/isodoc/terms_spec.rb +111 -79
  50. data/spec/isodoc/xref_spec.rb +1597 -1186
  51. metadata +6 -3
@@ -1,3 +1,7 @@
1
+ require_relative "presentation_function/block"
2
+ require_relative "presentation_function/inline"
3
+ require_relative "presentation_function/section"
4
+
1
5
  module IsoDoc
2
6
  class PresentationXMLConvert < ::IsoDoc::Convert
3
7
  def initialize(options)
@@ -9,21 +13,51 @@ module IsoDoc
9
13
  def convert1(docxml, filename, dir)
10
14
  @xrefs.parse docxml
11
15
  info docxml, nil
16
+ conversions(docxml)
12
17
  docxml.to_xml
13
18
  end
14
19
 
20
+ def conversions(docxml)
21
+ section docxml
22
+ block docxml
23
+ inline docxml
24
+ end
25
+
26
+ def section(docxml)
27
+ clause docxml
28
+ annex docxml
29
+ term docxml
30
+ end
31
+
32
+ def block(docxml)
33
+ amend docxml
34
+ table docxml
35
+ figure docxml
36
+ sourcecode docxml
37
+ formula docxml
38
+ example docxml
39
+ termexample docxml
40
+ note docxml
41
+ termnote docxml
42
+ permission docxml
43
+ requirement docxml
44
+ recommendation docxml
45
+ end
46
+
47
+ def inline(docxml)
48
+ xref docxml
49
+ eref docxml
50
+ origin docxml
51
+ quotesource docxml
52
+ end
53
+
15
54
  def postprocess(result, filename, dir)
16
- #result = from_xhtml(cleanup(to_xhtml(textcleanup(result))))
17
55
  toXML(result, filename)
18
56
  @files_to_delete.each { |f| FileUtils.rm_rf f }
19
57
  end
20
58
 
21
59
  def toXML(result, filename)
22
- #result = (from_xhtml(html_cleanup(to_xhtml(result))))
23
- #result = from_xhtml(move_images(to_xhtml(result)))
24
- #result = html5(script_cdata(inject_script(result)))
25
60
  File.open(filename, "w:UTF-8") { |f| f.write(result) }
26
61
  end
27
62
  end
28
63
  end
29
-
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.1.4".freeze
2
+ VERSION = "1.2.4".freeze
3
3
  end
@@ -27,6 +27,7 @@ module IsoDoc::WordFunction
27
27
  def make_body2(body, docxml)
28
28
  body.div **{ class: "WordSection2" } do |div2|
29
29
  boilerplate docxml, div2
30
+ preface_block docxml, div2
30
31
  abstract docxml, div2
31
32
  foreword docxml, div2
32
33
  introduction docxml, div2
@@ -111,7 +112,7 @@ module IsoDoc::WordFunction
111
112
  def figure_get_or_make_dl(t)
112
113
  dl = t.at(".//table[@class = 'dl']")
113
114
  if dl.nil?
114
- t.add_child("<p><b>#{@key_lbl}</b></p><table class='dl'></table>")
115
+ t.add_child("<p><b>#{@i18n.key}</b></p><table class='dl'></table>")
115
116
  dl = t.at(".//table[@class = 'dl']")
116
117
  end
117
118
  dl
@@ -132,9 +133,10 @@ module IsoDoc::WordFunction
132
133
  end
133
134
 
134
135
  def note_p_parse(node, div)
136
+ name = node&.at(ns("./name"))&.remove
135
137
  div.p **{ class: "Note" } do |p|
136
138
  p.span **{ class: "note_label" } do |s|
137
- s << note_label(node)
139
+ name and name.children.each { |n| parse(n, s) }
138
140
  end
139
141
  insert_tab(p, 1)
140
142
  node.first_element_child.children.each { |n| parse(n, p) }
@@ -143,9 +145,10 @@ module IsoDoc::WordFunction
143
145
  end
144
146
 
145
147
  def note_parse1(node, div)
148
+ name = node&.at(ns("./name"))&.remove
146
149
  div.p **{ class: "Note" } do |p|
147
150
  p.span **{ class: "note_label" } do |s|
148
- s << note_label(node)
151
+ name and name.children.each { |n| parse(n, s) }
149
152
  end
150
153
  insert_tab(p, 1)
151
154
  end
@@ -153,12 +156,14 @@ module IsoDoc::WordFunction
153
156
  end
154
157
 
155
158
  def termnote_parse(node, out)
159
+ name = node&.at(ns("./name"))&.remove
156
160
  out.div **note_attrs(node) do |div|
157
- first = node.first_element_child
158
161
  div.p **{ class: "Note" } do |p|
159
- anchor = @xrefs.get[node['id']]
160
- p << "#{anchor&.dig(:label) || '???'}: "
161
- para_then_remainder(first, node, p, div)
162
+ if name
163
+ name.children.each { |n| parse(n, p) }
164
+ p << l10n(": ")
165
+ end
166
+ para_then_remainder(node.first_element_child, node, p, div)
162
167
  end
163
168
  end
164
169
  end
@@ -186,7 +191,7 @@ module IsoDoc::WordFunction
186
191
 
187
192
  def formula_where(dl, out)
188
193
  return unless dl
189
- out.p { |p| p << @where_lbl }
194
+ out.p { |p| p << @i18n.where }
190
195
  parse(dl, out)
191
196
  out.parent.at("./table")["class"] = "formula_dl"
192
197
  end
@@ -69,7 +69,9 @@ module IsoDoc::WordFunction
69
69
  def xref_parse(node, out)
70
70
  target = /#/.match(node["target"]) ? node["target"].sub(/#/, ".doc#") :
71
71
  "##{node["target"]}"
72
- out.a(**{ "href": target }) { |l| l << get_linkend(node) }
72
+ out.a(**{ "href": target }) do |l|
73
+ node.children.each { |n| parse(n, l) }
74
+ end
73
75
  end
74
76
  end
75
77
  end
@@ -127,7 +127,7 @@ xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
127
127
  def list_add(xpath, lvl)
128
128
  xpath.each do |list|
129
129
  (list.xpath(".//li") - list.xpath(".//ol//li | .//ul//li")).each do |l|
130
- l.xpath("./p | ./div").each_with_index do |p, i|
130
+ l.xpath("./p | ./div | ./table").each_with_index do |p, i|
131
131
  next if i == 0
132
132
  p.wrap(%{<div class="ListContLevel#{lvl}"/>})
133
133
  end
@@ -29,7 +29,7 @@ module IsoDoc::WordFunction
29
29
  border-bottom:#{SW1} #{rowmax == totalrows ? '1.5' : '1.0'}pt;
30
30
  mso-border-bottom-alt:#{SW1} #{rowmax == totalrows ? '1.5' : '1.0'}pt;
31
31
  STYLE
32
- { rowspan: td["rowspan"], colspan: td["colspan"],
32
+ { rowspan: td["rowspan"], colspan: td["colspan"], valign: td["valign"],
33
33
  align: td["align"], style: style.gsub(/\n/, "") }
34
34
  end
35
35
 
@@ -38,7 +38,8 @@ module IsoDoc::WordFunction
38
38
  summary: node["summary"],
39
39
  width: node["width"],
40
40
  style: "mso-table-anchor-horizontal:column;"\
41
- "mso-table-overlap:never;border-spacing:0;border-width:1px;#{keep_style(node)}"
41
+ "mso-table-overlap:never;border-spacing:0;border-width:1px;#{keep_style(node)}",
42
+ class: (node.text.length > 4000 ? "MsoISOTableBig" : "MsoISOTable")
42
43
  }))
43
44
  end
44
45
 
@@ -11,13 +11,15 @@ module IsoDoc
11
11
  include XrefGen::Blocks
12
12
  include XrefGen::Sections
13
13
 
14
- def initialize(lang, script, klass, labels, options = {})
14
+ def initialize(lang, script, klass, i18n, options = {})
15
15
  @anchors = {}
16
16
  @lang = lang
17
17
  @script = script
18
18
  @klass = klass
19
- @labels = labels
20
19
  @options = options
20
+ @i18n = i18n
21
+ @labels = @i18n.get
22
+ @klass.i18n = @i18n
21
23
  end
22
24
 
23
25
  def get
@@ -39,6 +41,7 @@ module IsoDoc
39
41
 
40
42
  # extract names for all anchors, xref and label
41
43
  def parse(docxml)
44
+ amend_preprocess(docxml)
42
45
  initial_anchor_names(docxml)
43
46
  back_anchor_names(docxml)
44
47
  # preempt clause notes with all other types of note (ISO default)
@@ -53,7 +56,7 @@ module IsoDoc
53
56
  end
54
57
 
55
58
  def l10n(a, lang = @lang, script = @script)
56
- IsoDoc::Function::I18n::l10n(a, lang, script)
59
+ @i18n.l10n(a, lang, script)
57
60
  end
58
61
  end
59
62
  end
@@ -8,17 +8,20 @@ module IsoDoc::XrefGen
8
8
  @subseq = ""
9
9
  @letter_override = nil
10
10
  @number_override = nil
11
+ @base = ""
11
12
  end
12
13
 
13
14
  def new_subseq_increment(node)
14
15
  @subseq = node["subsequence"]
15
16
  @num += 1
16
17
  @letter = node["subsequence"] ? "a" : ""
18
+ @base = ""
17
19
  if node["number"]
18
- /^(?<n>\d*)(?<a>[a-z]*)$/ =~ node["number"]
19
- if n || a
20
- @letter_override = @letter = a if a
21
- @number_override = @num = n.to_i if n
20
+ /^(?<b>.*?)(?<n>\d*)(?<a>[a-z]*)$/ =~ node["number"]
21
+ if !n.empty? || !a.empty?
22
+ @letter_override = @letter = a unless a.empty?
23
+ @number_override = @num = n.to_i unless n.empty?
24
+ @base = b
22
25
  else
23
26
  @letter_override = node["number"]
24
27
  @letter = @letter_override if /^[a-z]$/.match(@letter_override)
@@ -28,8 +31,13 @@ module IsoDoc::XrefGen
28
31
 
29
32
  def sequence_increment(node)
30
33
  if node["number"]
34
+ @base = ""
31
35
  @number_override = node["number"]
32
- @num = @number_override.to_i if /^\d+$/.match(@number_override)
36
+ /^(?<b>.*?)(?<n>\d+)$/ =~ node["number"]
37
+ unless n.nil? || n.empty?
38
+ @num = n.to_i
39
+ @base = b
40
+ end
33
41
  else
34
42
  @num += 1
35
43
  end
@@ -37,8 +45,14 @@ module IsoDoc::XrefGen
37
45
 
38
46
  def subsequence_increment(node)
39
47
  if node["number"]
48
+ @base = ""
40
49
  @letter_override = node["number"]
41
- @letter = @letter_override if /^[a-z]$/.match(@letter_override)
50
+ /^(?<b>.*?)(?<n>\d*)(?<a>[a-z]+)$/ =~ node["number"]
51
+ unless a.empty?
52
+ @letter = a
53
+ @base = b
54
+ @number_override = @num = n.to_i unless n.empty?
55
+ end
42
56
  else
43
57
  @letter = (@letter.ord + 1).chr.to_s
44
58
  end
@@ -59,7 +73,7 @@ module IsoDoc::XrefGen
59
73
  end
60
74
 
61
75
  def print
62
- "#{@number_override || @num}#{@letter_override || @letter}"
76
+ "#{@base}#{@number_override || @num}#{@letter_override || @letter}"
63
77
  end
64
78
 
65
79
  def listlabel(depth)
@@ -2,6 +2,29 @@ require_relative "xref_gen_seq.rb"
2
2
 
3
3
  module IsoDoc::XrefGen
4
4
  module Blocks
5
+ NUMBERED_BLOCKS = %w(termnote termexample note example requirement
6
+ recommendation permission figure table formula admonition sourcecode).freeze
7
+
8
+ def amend_preprocess(xmldoc)
9
+ xmldoc.xpath(ns("//amend[newcontent]")).each do |a|
10
+ autonum = amend_autonums(a)
11
+ NUMBERED_BLOCKS.each do |b|
12
+ a.xpath(ns("./newcontent//#{b}")).each_with_index do |e, i|
13
+ autonum[b] and i == 0 and e["number"] = autonum[b]
14
+ !autonum[b] and e["unnumbered"] = "true"
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ def amend_autonums(a)
21
+ autonum = {}
22
+ a.xpath(ns("./autonumber")).each do |n|
23
+ autonum[n["type"]] = n.text
24
+ end
25
+ autonum
26
+ end
27
+
5
28
  def termnote_label(n)
6
29
  @labels["termnote"].gsub(/%/, n.to_s)
7
30
  end
@@ -27,7 +50,7 @@ module IsoDoc::XrefGen
27
50
  examples.each do |n|
28
51
  return if n["id"].nil? || n["id"].empty?
29
52
  c.increment(n)
30
- idx = examples.size == 1 ? "" : c.print
53
+ idx = examples.size == 1 && !n["number"] ? "" : c.print
31
54
  @anchors[n["id"]] = {
32
55
  type: "termexample", label: idx,
33
56
  xref: l10n("#{anchor(t['id'], :xref)}, "\
@@ -54,7 +77,7 @@ module IsoDoc::XrefGen
54
77
  c = Counter.new
55
78
  notes.each do |n|
56
79
  next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
57
- idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
80
+ idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
58
81
  @anchors[n["id"]] = anchor_struct(idx, n, @labels["note_xref"],
59
82
  "note", false)
60
83
  end
@@ -76,7 +99,7 @@ module IsoDoc::XrefGen
76
99
  notes.each do |n|
77
100
  next if @anchors[n["id"]]
78
101
  next if n["id"].nil? || n["id"].empty?
79
- idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
102
+ idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
80
103
  @anchors[n["id"]] = anchor_struct(idx, n, @labels["example_xref"],
81
104
  "example", n["unnumbered"])
82
105
  end
@@ -91,7 +114,7 @@ module IsoDoc::XrefGen
91
114
  c = Counter.new
92
115
  notes.each do |n|
93
116
  next if n["id"].nil? || n["id"].empty?
94
- idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
117
+ idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
95
118
  @anchors[n["id"]] = anchor_struct(idx, n, @labels["list"], "list", false)
96
119
  list_item_anchor_names(n, @anchors[n["id"]], 1, "", notes.size != 1)
97
120
  end
@@ -17,7 +17,7 @@ module IsoDoc::XrefGen
17
17
  d.xpath(ns("//preface/*")).each { |c| c.element? and preface_names(c) }
18
18
  # potentially overridden in middle_section_asset_names()
19
19
  sequential_asset_names(d.xpath(ns("//preface/*")))
20
- n = section_names(d.at(ns("//clause[title = 'Scope']")), 0, 1)
20
+ n = section_names(d.at(ns("//clause[@type = 'scope']")), 0, 1)
21
21
  n = section_names(d.at(ns(@klass.norm_ref_xpath)), n, 1)
22
22
  n = section_names(d.at(ns("//sections/terms | "\
23
23
  "//sections/clause[descendant::terms]")), n, 1)
@@ -60,7 +60,7 @@ module IsoDoc::XrefGen
60
60
  end
61
61
 
62
62
  def middle_section_asset_names(d)
63
- middle_sections = "//clause[title = 'Scope'] | "\
63
+ middle_sections = "//clause[@type = 'scope'] | "\
64
64
  "#{@klass.norm_ref_xpath} | "\
65
65
  "//sections/terms | //preface/* | "\
66
66
  "//sections/definitions | //clause[parent::sections]"
@@ -99,7 +99,7 @@ module IsoDoc::XrefGen
99
99
  def annex_name_lbl(clause, num)
100
100
  obl = l10n("(#{@labels["inform_annex"]})")
101
101
  obl = l10n("(#{@labels["norm_annex"]})") if clause["obligation"] == "normative"
102
- l10n("<b>#{@labels["annex"]} #{num}</b><br/>#{obl}")
102
+ l10n("<strong>#{@labels["annex"]} #{num}</strong><br/>#{obl}")
103
103
  end
104
104
 
105
105
  def single_annex_special_section(clause)
@@ -1,5 +1,16 @@
1
- foreword: Enkonduko
1
+ foreword: Antaŭparolo
2
+ introduction: Enkonduko
2
3
  clause: klaŭzo
3
4
  table: Tabelo
4
5
  source: SOURCE
5
6
  modified: modified
7
+ scope: Amplekso
8
+ symbols: Simboloj kai mallongigitaj terminoj
9
+ annex: Aldono
10
+ normref: Normaj citaĵoj
11
+ bibliography: Bibliografio
12
+ inform_annex: informa
13
+ all_parts: ĉiuj partoj
14
+ locality: {
15
+ table: Tabelo
16
+ }
@@ -1,8 +1,245 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes unlabelled notes" do
5
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
4
+ it "processes amend blocks" do
5
+ input = <<~INPUT
6
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
7
+ <bibdata type='standard'>
8
+ <title language='en' format='text/plain'>Document title</title>
9
+ <language>en</language>
10
+ <script>Latn</script>
11
+ <status>
12
+ <stage>published</stage>
13
+ </status>
14
+ <copyright>
15
+ <from>2020</from>
16
+ </copyright>
17
+ <ext>
18
+ <doctype>article</doctype>
19
+ </ext>
20
+ </bibdata>
21
+ <sections>
22
+ <clause id='A' inline-header='false' obligation='normative'>
23
+ <title>Change Clause</title>
24
+ <amend id='B' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
25
+ <autonumber type='table'>2</autonumber>
26
+ <autonumber type='example'>7</autonumber>
27
+ <description>
28
+ <p id='C'>
29
+ <em>
30
+ This table contains information on polygon cells which are not
31
+ included in ISO 10303-52. Remove table 2 completely and replace
32
+ with:
33
+ </em>
34
+ </p>
35
+ </description>
36
+ <newcontent id='D'>
37
+ <table id='E'>
38
+ <name>Edges of triangle and quadrilateral cells</name>
39
+ <tbody>
40
+ <tr>
41
+ <th colspan='2' valign='middle' align='center'>triangle</th>
42
+ <th colspan='2' valign='middle' align='center'>quadrilateral</th>
43
+ </tr>
44
+ <tr>
45
+ <td valign='middle' align='center'>edge</td>
46
+ <td valign='middle' align='center'>vertices</td>
47
+ <td valign='middle' align='center'>edge</td>
48
+ <td valign='middle' align='center'>vertices</td>
49
+ </tr>
50
+ <tr>
51
+ <td valign='middle' align='center'>1</td>
52
+ <td valign='middle' align='center'>1, 2</td>
53
+ <td valign='middle' align='center'>1</td>
54
+ <td valign='middle' align='center'>1, 2</td>
55
+ </tr>
56
+ <tr>
57
+ <td valign='middle' align='center'>2</td>
58
+ <td valign='middle' align='center'>2, 3</td>
59
+ <td valign='middle' align='center'>2</td>
60
+ <td valign='middle' align='center'>2, 3</td>
61
+ </tr>
62
+ <tr>
63
+ <td valign='middle' align='center'>3</td>
64
+ <td valign='middle' align='center'>3, 1</td>
65
+ <td valign='middle' align='center'>3</td>
66
+ <td valign='middle' align='center'>3, 4</td>
67
+ </tr>
68
+ <tr>
69
+ <td valign='top' align='left'/>
70
+ <td valign='top' align='left'/>
71
+ <td valign='middle' align='center'>4</td>
72
+ <td valign='middle' align='center'>4, 1</td>
73
+ </tr>
74
+ </tbody>
75
+ </table>
76
+ <figure id="H"><name>Figure</name></figure>
77
+ <example id='F'>
78
+ <p id='G'>This is not generalised further.</p>
79
+ </example>
80
+ </newcontent>
81
+ </amend>
82
+ </clause>
83
+ </sections>
84
+ </standard-document>
85
+ INPUT
86
+ presxml = <<~OUTPUT
87
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc">
88
+ <bibdata type="standard">
89
+ <title language="en" format="text/plain">Document title</title>
90
+ <language>en</language>
91
+ <script>Latn</script>
92
+ <status>
93
+ <stage>published</stage>
94
+ </status>
95
+ <copyright>
96
+ <from>2020</from>
97
+ </copyright>
98
+ <ext>
99
+ <doctype>article</doctype>
100
+ </ext>
101
+ </bibdata>
102
+ <sections>
103
+ <clause id="A" inline-header="false" obligation="normative">
104
+ <title depth="1">1.<tab/>Change Clause</title>
105
+ <p id="C">
106
+ <em>
107
+ This table contains information on polygon cells which are not
108
+ included in ISO 10303-52. Remove table 2 completely and replace
109
+ with:
110
+ </em>
111
+ </p>
112
+ <quote id="D">
113
+ <table id="E" number="2">
114
+ <name>Table 2&#xA0;&#x2014; Edges of triangle and quadrilateral cells</name>
115
+ <tbody>
116
+ <tr>
117
+ <th colspan="2" valign="middle" align="center">triangle</th>
118
+ <th colspan="2" valign="middle" align="center">quadrilateral</th>
119
+ </tr>
120
+ <tr>
121
+ <td valign="middle" align="center">edge</td>
122
+ <td valign="middle" align="center">vertices</td>
123
+ <td valign="middle" align="center">edge</td>
124
+ <td valign="middle" align="center">vertices</td>
125
+ </tr>
126
+ <tr>
127
+ <td valign="middle" align="center">1</td>
128
+ <td valign="middle" align="center">1, 2</td>
129
+ <td valign="middle" align="center">1</td>
130
+ <td valign="middle" align="center">1, 2</td>
131
+ </tr>
132
+ <tr>
133
+ <td valign="middle" align="center">2</td>
134
+ <td valign="middle" align="center">2, 3</td>
135
+ <td valign="middle" align="center">2</td>
136
+ <td valign="middle" align="center">2, 3</td>
137
+ </tr>
138
+ <tr>
139
+ <td valign="middle" align="center">3</td>
140
+ <td valign="middle" align="center">3, 1</td>
141
+ <td valign="middle" align="center">3</td>
142
+ <td valign="middle" align="center">3, 4</td>
143
+ </tr>
144
+ <tr>
145
+ <td valign="top" align="left"/>
146
+ <td valign="top" align="left"/>
147
+ <td valign="middle" align="center">4</td>
148
+ <td valign="middle" align="center">4, 1</td>
149
+ </tr>
150
+ </tbody>
151
+ </table>
152
+ <figure id="H" unnumbered="true"><name>Figure</name></figure>
153
+ <example id="F" number="7"><name>EXAMPLE 7</name>
154
+ <p id="G">This is not generalised further.</p>
155
+ </example>
156
+ </quote>
157
+ </clause>
158
+ </sections>
159
+ </standard-document>
160
+ OUTPUT
161
+ html = <<~OUTPUT
162
+ <html lang='en'>
163
+ <head/>
164
+ <body lang='en'>
165
+ <div class='title-section'>
166
+ <p>&#160;</p>
167
+ </div>
168
+ <br/>
169
+ <div class='prefatory-section'>
170
+ <p>&#160;</p>
171
+ </div>
172
+ <br/>
173
+ <div class='main-section'>
174
+ <p class='zzSTDTitle1'>Document title</p>
175
+ <div id='A'>
176
+ <h1>1.&#160; Change Clause</h1>
177
+ <p id='C'>
178
+ <i>
179
+ This table contains information on polygon cells which are not
180
+ included in ISO 10303-52. Remove table 2 completely and replace
181
+ with:
182
+ </i>
183
+ </p>
184
+ <div class='Quote' id="D">
185
+ <p class='TableTitle' style='text-align:center;'>Table 2&#160;&#8212; Edges of triangle and quadrilateral cells</p>
186
+ <table id='E' class='MsoISOTable' style='border-width:1px;border-spacing:0;'>
187
+ <tbody>
188
+ <tr>
189
+ <th colspan='2' style='font-weight:bold;text-align:center;vertical-align:middle;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>triangle</th>
190
+ <th colspan='2' style='font-weight:bold;text-align:center;vertical-align:middle;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>quadrilateral</th>
191
+ </tr>
192
+ <tr>
193
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>edge</td>
194
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>vertices</td>
195
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>edge</td>
196
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>vertices</td>
197
+ </tr>
198
+ <tr>
199
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1</td>
200
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1, 2</td>
201
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1</td>
202
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1, 2</td>
203
+ </tr>
204
+ <tr>
205
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2</td>
206
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2, 3</td>
207
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2</td>
208
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2, 3</td>
209
+ </tr>
210
+ <tr>
211
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3</td>
212
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3, 1</td>
213
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3</td>
214
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3, 4</td>
215
+ </tr>
216
+ <tr>
217
+ <td style='text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;'/>
218
+ <td style='text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;'/>
219
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.5pt;'>4</td>
220
+ <td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.5pt;'>4, 1</td>
221
+ </tr>
222
+ </tbody>
223
+ </table>
224
+ <div id='H' class='figure'>
225
+ <p class='FigureTitle' style='text-align:center;'>Figure</p>
226
+ </div>
227
+ <div id='F' class='example'>
228
+ <p class='example-title'>EXAMPLE 7</p>
229
+ <p id='G'>This is not generalised further.</p>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ </div>
234
+ </body>
235
+ </html>
236
+ OUTPUT
237
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
238
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
239
+ end
240
+
241
+ it "processes unlabelled notes (Presentation XML)" do
242
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
243
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
244
  <preface><foreword>
8
245
  <note id="A" keep-with-next="true" keep-lines-together="true">
@@ -10,6 +247,39 @@ RSpec.describe IsoDoc do
10
247
  </note>
11
248
  </foreword></preface>
12
249
  </iso-standard>
250
+ INPUT
251
+ <?xml version='1.0'?>
252
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
253
+ <preface>
254
+ <foreword>
255
+ <note id='A' keep-with-next='true' keep-lines-together='true'>
256
+ <name>NOTE</name>
257
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
258
+ These results are based on a study carried out on three different
259
+ types of kernel.
260
+ </p>
261
+ </note>
262
+ </foreword>
263
+ </preface>
264
+ </iso-standard>
265
+ OUTPUT
266
+ end
267
+
268
+ it "processes unlabelled notes (HTML)" do
269
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
270
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
271
+ <preface>
272
+ <foreword>
273
+ <note id='A' keep-with-next='true' keep-lines-together='true'>
274
+ <name>NOTE</name>
275
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
276
+ These results are based on a study carried out on three different
277
+ types of kernel.
278
+ </p>
279
+ </note>
280
+ </foreword>
281
+ </preface>
282
+ </iso-standard>
13
283
  INPUT
14
284
  #{HTML_HDR}
15
285
  <br/>
@@ -28,13 +298,19 @@ RSpec.describe IsoDoc do
28
298
 
29
299
  it "processes unlabelled notes (Word)" do
30
300
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
31
- <iso-standard xmlns="http://riboseinc.com/isoxml">
32
- <preface><foreword>
33
- <note id="A">
34
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
35
- </note>
36
- </foreword></preface>
37
- </iso-standard>
301
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
302
+ <preface>
303
+ <foreword>
304
+ <note id='A' keep-with-next='true' keep-lines-together='true'>
305
+ <name>NOTE</name>
306
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
307
+ These results are based on a study carried out on three different
308
+ types of kernel.
309
+ </p>
310
+ </note>
311
+ </foreword>
312
+ </preface>
313
+ </iso-standard>
38
314
  INPUT
39
315
  <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
40
316
  <head><style/></head>
@@ -47,7 +323,7 @@ RSpec.describe IsoDoc do
47
323
  <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
48
324
  <div>
49
325
  <h1 class="ForewordTitle">Foreword</h1>
50
- <div id="A" class="Note">
326
+ <div id="A" class="Note" style='page-break-after: avoid;page-break-inside: avoid;'>
51
327
  <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span>These results are based on a study carried out on three different types of kernel.</p>
52
328
  </div>
53
329
  </div>
@@ -62,44 +338,65 @@ RSpec.describe IsoDoc do
62
338
  OUTPUT
63
339
  end
64
340
 
65
-
66
- it "processes labelled notes" do
67
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
341
+ it "processes sequences of notes (Presentation XML)" do
342
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
68
343
  <iso-standard xmlns="http://riboseinc.com/isoxml">
69
344
  <preface><foreword>
70
345
  <note id="note1">
71
346
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
347
+ </note>
348
+ <note id="note2">
349
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
72
350
  </note>
73
351
  </foreword></preface>
74
352
  </iso-standard>
75
353
  INPUT
76
- #{HTML_HDR}
77
- <br/>
78
- <div>
79
- <h1 class="ForewordTitle">Foreword</h1>
80
- <div id="note1" class="Note">
81
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
82
- </div>
83
- </div>
84
- <p class="zzSTDTitle1"/>
85
- </div>
86
- </body>
87
- </html>
88
- OUTPUT
354
+ <?xml version='1.0'?>
355
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
356
+ <preface>
357
+ <foreword>
358
+ <note id='note1'>
359
+ <name>NOTE 1</name>
360
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
361
+ These results are based on a study carried out on three different
362
+ types of kernel.
363
+ </p>
364
+ </note>
365
+ <note id='note2'>
366
+ <name>NOTE 2</name>
367
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
368
+ These results are based on a study carried out on three different
369
+ types of kernel.
370
+ </p>
371
+ </note>
372
+ </foreword>
373
+ </preface>
374
+ </iso-standard>
375
+ OUTPUT
89
376
  end
90
377
 
91
- it "processes sequences of notes" do
378
+ it "processes sequences of notes (HTML)" do
92
379
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
93
- <iso-standard xmlns="http://riboseinc.com/isoxml">
94
- <preface><foreword>
95
- <note id="note1">
96
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
97
- </note>
98
- <note id="note2">
99
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
100
- </note>
101
- </foreword></preface>
102
- </iso-standard>
380
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
381
+ <preface>
382
+ <foreword>
383
+ <note id='note1'>
384
+ <name>NOTE 1</name>
385
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
386
+ These results are based on a study carried out on three different
387
+ types of kernel.
388
+ </p>
389
+ </note>
390
+ <note id='note2'>
391
+ <name>NOTE 2</name>
392
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
393
+ These results are based on a study carried out on three different
394
+ types of kernel.
395
+ </p>
396
+ </note>
397
+ </foreword>
398
+ </preface>
399
+ </iso-standard>
103
400
  INPUT
104
401
  #{HTML_HDR}
105
402
  <br/>
@@ -124,6 +421,7 @@ INPUT
124
421
  <iso-standard xmlns="http://riboseinc.com/isoxml">
125
422
  <preface><foreword>
126
423
  <note>
424
+ <name>NOTE</name>
127
425
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
128
426
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
129
427
  </note>
@@ -150,7 +448,7 @@ INPUT
150
448
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
151
449
  <iso-standard xmlns="http://riboseinc.com/isoxml">
152
450
  <preface><foreword>
153
- <note id="A">
451
+ <note id="A"><name>NOTE</name>
154
452
  <dl>
155
453
  <dt>A</dt>
156
454
  <dd><p>B</p></dd>
@@ -183,7 +481,7 @@ INPUT
183
481
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
184
482
  <iso-standard xmlns="http://riboseinc.com/isoxml">
185
483
  <preface><foreword>
186
- <note id="A">
484
+ <note id="A"><name>NOTE</name>
187
485
  <dl>
188
486
  <dt>A</dt>
189
487
  <dd><p>B</p></dd>
@@ -226,8 +524,8 @@ INPUT
226
524
  expect(xmlpp(strip_guid(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
227
525
  <iso-standard xmlns="http://riboseinc.com/isoxml">
228
526
  <preface><foreword>
229
- <p id="A">ABC <note id="B"><p id="C">XYZ</p></note>
230
- <note id="B1"><p id="C1">XYZ1</p></note></p>
527
+ <p id="A">ABC <note id="B"><name>NOTE 1</name><p id="C">XYZ</p></note>
528
+ <note id="B1"><name>NOTE 2</name><p id="C1">XYZ1</p></note></p>
231
529
  </foreword></preface>
232
530
  </iso-standard>
233
531
  INPUT
@@ -262,8 +560,8 @@ OUTPUT
262
560
  expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
263
561
  <iso-standard xmlns="http://riboseinc.com/isoxml">
264
562
  <preface><foreword>
265
- <p id="A">ABC <note id="B"><p id="C">XYZ</p></note>
266
- <note id="B1"><p id="C1">XYZ1</p></note></p>
563
+ <p id="A">ABC <note id="B"><name>NOTE 1</name><p id="C">XYZ</p></note>
564
+ <note id="B1"><name>NOTE 2</name><p id="C1">XYZ1</p></note></p>
267
565
  </foreword></preface>
268
566
  </iso-standard>
269
567
  INPUT
@@ -313,8 +611,8 @@ INPUT
313
611
  OUTPUT
314
612
  end
315
613
 
316
- it "processes figures" do
317
- expect(xmlpp(strip_guid(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
614
+ it "processes figures (Presentation XML)" do
615
+ expect(xmlpp((IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
318
616
  <iso-standard xmlns="http://riboseinc.com/isoxml">
319
617
  <preface><foreword>
320
618
  <figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
@@ -337,6 +635,65 @@ B</pre>
337
635
  <figure id="figure-C" unnumbered="true">
338
636
  <pre>A &lt;
339
637
  B</pre>
638
+ </figure>
639
+ </foreword></preface>
640
+ </iso-standard>
641
+ INPUT
642
+ <?xml version='1.0'?>
643
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
644
+ <preface><foreword>
645
+ <figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
646
+ <name>Figure 1&#xA0;&#x2014; Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
647
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
648
+ <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f1" mimetype="image/png"/>
649
+ <image src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f2" mimetype="image/png"/>
650
+ <fn reference="a">
651
+ <p id="_ef2c85b8-5a5a-4ecd-a1e6-92acefaaa852">The time <stem type="AsciiMath">t_90</stem> was estimated to be 18,2 min for this example.</p>
652
+ </fn>
653
+ <dl>
654
+ <dt>A</dt>
655
+ <dd><p>B</p></dd>
656
+ </dl>
657
+ </figure>
658
+ <figure id="figure-B">
659
+ <name>Figure 2</name>
660
+ <pre alt="A B">A &lt;
661
+ B</pre>
662
+ </figure>
663
+ <figure id="figure-C" unnumbered="true">
664
+ <pre>A &lt;
665
+ B</pre>
666
+ </figure>
667
+ </foreword></preface>
668
+ </iso-standard>
669
+ OUTPUT
670
+ end
671
+
672
+ it "processes figures (HTML)" do
673
+ expect(xmlpp(strip_guid(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
674
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
675
+ <preface><foreword>
676
+ <figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
677
+ <name>Figure 1&#xA0;&#x2014; Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
678
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
679
+ <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f1" mimetype="image/png"/>
680
+ <image src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f2" mimetype="image/png"/>
681
+ <fn reference="a">
682
+ <p id="_ef2c85b8-5a5a-4ecd-a1e6-92acefaaa852">The time <stem type="AsciiMath">t_90</stem> was estimated to be 18,2 min for this example.</p>
683
+ </fn>
684
+ <dl>
685
+ <dt>A</dt>
686
+ <dd><p>B</p></dd>
687
+ </dl>
688
+ </figure>
689
+ <figure id="figure-B">
690
+ <name>Figure 2</name>
691
+ <pre alt="A B">A &lt;
692
+ B</pre>
693
+ </figure>
694
+ <figure id="figure-C" unnumbered="true">
695
+ <pre>A &lt;
696
+ B</pre>
340
697
  </figure>
341
698
  </foreword></preface>
342
699
  </iso-standard>
@@ -382,13 +739,13 @@ B</pre>
382
739
  it "processes figures (Word)" do
383
740
  FileUtils.rm_rf "spec/assets/odf1.emf"
384
741
  expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/['"][^'".]+\.gif['"]/, "'_.gif'").gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")))).to be_equivalent_to xmlpp(<<~"OUTPUT")
385
- <iso-standard xmlns="http://riboseinc.com/isoxml">
742
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
386
743
  <preface><foreword>
387
- <figure id="figureA-1">
388
- <name>Split-it-right sample divider<fn reference="1"><p>X</p></fn></name>
389
- <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletext"/>
390
- <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
391
- <image src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
744
+ <figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
745
+ <name>Figure 1&#xA0;&#x2014; Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
746
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
747
+ <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f1" mimetype="image/png"/>
748
+ <image src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f2" mimetype="image/png"/>
392
749
  <fn reference="a">
393
750
  <p id="_ef2c85b8-5a5a-4ecd-a1e6-92acefaaa852">The time <stem type="AsciiMath">t_90</stem> was estimated to be 18,2 min for this example.</p>
394
751
  </fn>
@@ -398,6 +755,11 @@ B</pre>
398
755
  </dl>
399
756
  </figure>
400
757
  <figure id="figure-B">
758
+ <name>Figure 2</name>
759
+ <pre alt="A B">A &lt;
760
+ B</pre>
761
+ </figure>
762
+ <figure id="figure-C" unnumbered="true">
401
763
  <pre>A &lt;
402
764
  B</pre>
403
765
  </figure>
@@ -415,9 +777,8 @@ B</pre>
415
777
  <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
416
778
  <div>
417
779
  <h1 class="ForewordTitle">Foreword</h1>
418
- <div id="figureA-1" class="figure">
419
-
420
- <img src="rice_images/rice_image1.png" height="20" width="30" alt="alttext" title="titletext"/>
780
+ <div id="figureA-1" class="figure" style='page-break-after: avoid;page-break-inside: avoid;'>
781
+ <img src="rice_images/rice_image1.png" height="20" width="30" alt="alttext" title="titletxt"/>
421
782
  <img src="rice_images/rice_image1.png" height='20' width='auto'/>
422
783
  <img src='_.gif' height='20' width='auto'/>
423
784
  <a href="#_" class="TableFootnoteRef">a</a><aside><div id="ftn_"><span><span id="_" class="TableFootnoteRef">a</span><span style="mso-tab-count:1">&#160; </span></span>
@@ -425,7 +786,7 @@ B</pre>
425
786
  </div></aside>
426
787
  <p style='page-break-after:avoid;'><b>Key</b></p><table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">A</p></td><td valign="top"><p>B</p></td></tr></table>
427
788
  <p class='FigureTitle' style='text-align:center;'>
428
- Figure 1&#160;&#8212; Split-it-right sample divider
789
+ Figure 1&#160;&#8212; Split-it-right <i>sample</i> divider
429
790
  <span style='mso-bookmark:_Ref'>
430
791
  <a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
431
792
  <sup>1</sup>
@@ -437,6 +798,9 @@ B</pre>
437
798
  <pre>A &lt;
438
799
  B</pre>
439
800
  <p class="FigureTitle" style="text-align:center;">Figure 2</p>
801
+ </div>
802
+ <div id='figure-C' class='figure'>
803
+ <pre>A &lt; B</pre>
440
804
  </div>
441
805
  </div>
442
806
  <p>&#160;</p>
@@ -488,7 +852,6 @@ B</pre>
488
852
  <img src='spec/assets/odf.emf'/>
489
853
  <img src='spec/assets/odf1.emf'/>
490
854
  <img src='_.emf' height='auto' width='auto'/>
491
- <p class='FigureTitle' style='text-align:center;'>Figure 1</p>
492
855
  </div>
493
856
  </div>
494
857
  <p>&#160;</p>
@@ -545,7 +908,6 @@ context "disable inkscape" do
545
908
  <img src='spec/assets/odf.emf'/>
546
909
  <img src='spec/assets/odf1.svg'/>
547
910
  <img src='_.svg' height='auto' width='auto'/>
548
- <p class='FigureTitle' style='text-align:center;'>Figure 1</p>
549
911
  </div>
550
912
  </div>
551
913
  <p>&#160;</p>
@@ -563,9 +925,8 @@ OUTPUT
563
925
  end
564
926
  end
565
927
 
566
-
567
- it "processes examples" do
568
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
928
+ it "processes examples (Presentation XML)" do
929
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
569
930
  <iso-standard xmlns="http://riboseinc.com/isoxml">
570
931
  <preface><foreword>
571
932
  <example id="samplecode" keep-with-next="true" keep-lines-together="true">
@@ -577,6 +938,37 @@ OUTPUT
577
938
  </example>
578
939
  </foreword></preface>
579
940
  </iso-standard>
941
+ INPUT
942
+ <?xml version='1.0'?>
943
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
944
+ <preface>
945
+ <foreword>
946
+ <example id='samplecode' keep-with-next='true' keep-lines-together='true'>
947
+ <name>EXAMPLE&#xA0;&#x2014; Title</name>
948
+ <p>Hello</p>
949
+ <sourcecode id='X'>
950
+ <name>Sample</name>
951
+ </sourcecode>
952
+ </example>
953
+ </foreword>
954
+ </preface>
955
+ </iso-standard>
956
+ OUTPUT
957
+ end
958
+
959
+ it "processes examples (HTML)" do
960
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
961
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
962
+ <preface>
963
+ <foreword>
964
+ <example id='samplecode' keep-with-next='true' keep-lines-together='true'>
965
+ <name>EXAMPLE&#xA0;&#x2014; Title</name>
966
+ <p>Hello</p>
967
+ <sourcecode id='X'><name>Sample</name></sourcecode>
968
+ </example>
969
+ </foreword>
970
+ </preface>
971
+ </iso-standard>
580
972
  INPUT
581
973
  #{HTML_HDR}
582
974
  <br/>
@@ -585,12 +977,7 @@ OUTPUT
585
977
  <div id="samplecode" class="example" style="page-break-after: avoid;page-break-inside: avoid;">
586
978
  <p class="example-title">EXAMPLE&#160;&#8212; Title</p>
587
979
  <p>Hello</p>
588
- <pre id='X' class='prettyprint '>
589
- <br/>
590
- &#160;
591
- <br/>
592
- &#160;
593
- </pre>
980
+ <pre id='X' class='prettyprint '/>
594
981
  <p class='SourceTitle' style='text-align:center;'>Sample</p>
595
982
  </div>
596
983
  </div>
@@ -603,17 +990,17 @@ OUTPUT
603
990
 
604
991
  it "processes examples (Word)" do
605
992
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
606
- <iso-standard xmlns="http://riboseinc.com/isoxml">
607
- <preface><foreword>
608
- <example id="samplecode" keep-with-next="true" keep-lines-together="true">
609
- <name>Title</name>
610
- <p>Hello</p>
611
- <sourcecode id="X">
612
- <name>Sample</name>
613
- </sourcecode>
614
- </example>
615
- </foreword></preface>
616
- </iso-standard>
993
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
994
+ <preface>
995
+ <foreword>
996
+ <example id='samplecode' keep-with-next='true' keep-lines-together='true'>
997
+ <name>EXAMPLE&#xA0;&#x2014; Title</name>
998
+ <p>Hello</p>
999
+ <sourcecode id='X'><name>Sample</name></sourcecode>
1000
+ </example>
1001
+ </foreword>
1002
+ </preface>
1003
+ </iso-standard>
617
1004
  INPUT
618
1005
  <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'><head><style>
619
1006
  </style>
@@ -634,12 +1021,7 @@ OUTPUT
634
1021
  <div id='samplecode' class='example' style='page-break-after: avoid;page-break-inside: avoid;'>
635
1022
  <p class='example-title'>EXAMPLE&#160;&#8212; Title</p>
636
1023
  <p>Hello</p>
637
- <p id='X' class='Sourcecode'>
638
- <br/>
639
- &#160;
640
- <br/>
641
- &#160;
642
- </p>
1024
+ <p id='X' class='Sourcecode'/>
643
1025
  <p class='SourceTitle' style='text-align:center;'>Sample</p>
644
1026
  </div>
645
1027
  </div>
@@ -657,7 +1039,7 @@ OUTPUT
657
1039
  end
658
1040
 
659
1041
  it "processes sequences of examples" do
660
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1042
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
661
1043
  <iso-standard xmlns="http://riboseinc.com/isoxml">
662
1044
  <preface><foreword>
663
1045
  <example id="samplecode">
@@ -673,32 +1055,30 @@ OUTPUT
673
1055
  </foreword></preface>
674
1056
  </iso-standard>
675
1057
  INPUT
676
- #{HTML_HDR}
677
- <br/>
678
- <div>
679
- <h1 class="ForewordTitle">Foreword</h1>
680
- <div id="samplecode" class="example">
681
- <p class="example-title">EXAMPLE 1</p>
682
- <p>Hello</p>
683
- </div>
684
- <div id="samplecode2" class="example">
685
- <p class="example-title">EXAMPLE 2&#160;&#8212; Title</p>
686
- <p>Hello</p>
687
- </div>
688
- <div id="samplecode3" class="example">
689
- <p class="example-title">EXAMPLE</p>
690
- <p>Hello</p>
691
- </div>
692
- </div>
693
- <p class="zzSTDTitle1"/>
694
- </div>
695
- </body>
696
- </html>
1058
+ <?xml version='1.0'?>
1059
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1060
+ <preface>
1061
+ <foreword>
1062
+ <example id='samplecode'>
1063
+ <name>EXAMPLE 1</name>
1064
+ <p>Hello</p>
1065
+ </example>
1066
+ <example id='samplecode2'>
1067
+ <name>EXAMPLE 2&#xA0;&#x2014; Title</name>
1068
+ <p>Hello</p>
1069
+ </example>
1070
+ <example id='samplecode3' unnumbered='true'>
1071
+ <name>EXAMPLE</name>
1072
+ <p>Hello</p>
1073
+ </example>
1074
+ </foreword>
1075
+ </preface>
1076
+ </iso-standard>
697
1077
  OUTPUT
698
1078
  end
699
1079
 
700
- it "processes sourcecode" do
701
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1080
+ it "processes sourcecode (Presentation XML)" do
1081
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
702
1082
  <iso-standard xmlns="http://riboseinc.com/isoxml">
703
1083
  <preface><foreword>
704
1084
  <sourcecode lang="ruby" id="samplecode">
@@ -710,12 +1090,49 @@ Que?
710
1090
  </sourcecode>
711
1091
  </foreword></preface>
712
1092
  </iso-standard>
1093
+ INPUT
1094
+ <?xml version='1.0'?>
1095
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1096
+ <preface>
1097
+ <foreword>
1098
+ <sourcecode lang='ruby' id='samplecode'>
1099
+ <name>
1100
+ Figure 1&#xA0;&#x2014; Ruby
1101
+ <em>code</em>
1102
+ </name>
1103
+ puts x
1104
+ </sourcecode>
1105
+ <sourcecode unnumbered='true'> Que? </sourcecode>
1106
+ </foreword>
1107
+ </preface>
1108
+ </iso-standard>
1109
+ OUTPUT
1110
+ end
1111
+
1112
+ it "processes sourcecode (HTML)" do
1113
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1114
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1115
+ <preface>
1116
+ <foreword>
1117
+ <sourcecode lang='ruby' id='samplecode'>
1118
+ <name>
1119
+ Figure 1&#xA0;&#x2014; Ruby
1120
+ <em>code</em>
1121
+ </name>
1122
+ puts x
1123
+ </sourcecode>
1124
+ <sourcecode unnumbered='true'>
1125
+ Que?
1126
+ </sourcecode>
1127
+ </foreword>
1128
+ </preface>
1129
+ </iso-standard>
713
1130
  INPUT
714
1131
  #{HTML_HDR}
715
1132
  <br/>
716
1133
  <div>
717
1134
  <h1 class="ForewordTitle">Foreword</h1>
718
- <pre id="samplecode" class="prettyprint lang-rb"><br/>&#160;&#160;&#160; <br/>&#160; puts x<br/></pre>
1135
+ <pre id="samplecode" class="prettyprint lang-rb"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160; puts x<br/></pre>
719
1136
  <p class="SourceTitle" style="text-align:center;">Figure 1&#160;&#8212; Ruby <i>code</i></p>
720
1137
  <pre class='prettyprint '>
721
1138
  <br/>
@@ -732,17 +1149,22 @@ Que?
732
1149
 
733
1150
  it "processes sourcecode (Word)" do
734
1151
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
735
- <iso-standard xmlns="http://riboseinc.com/isoxml">
736
- <preface><foreword>
737
- <sourcecode lang="ruby" id="samplecode">
738
- <name>Ruby <em>code</em></name>
1152
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1153
+ <preface>
1154
+ <foreword>
1155
+ <sourcecode lang='ruby' id='samplecode'>
1156
+ <name>
1157
+ Figure 1&#xA0;&#x2014; Ruby
1158
+ <em>code</em>
1159
+ </name>
739
1160
  puts x
740
1161
  </sourcecode>
741
- <sourcecode unnumbered="true">
1162
+ <sourcecode unnumbered='true'>
742
1163
  Que?
743
1164
  </sourcecode>
744
- </foreword></preface>
745
- </iso-standard>
1165
+ </foreword>
1166
+ </preface>
1167
+ </iso-standard>
746
1168
  INPUT
747
1169
  <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
748
1170
  <head><style/></head>
@@ -759,7 +1181,7 @@ Que?
759
1181
  </p>
760
1182
  <div>
761
1183
  <h1 class="ForewordTitle">Foreword</h1>
762
- <p id="samplecode" class="Sourcecode"><br/>&#160;&#160;&#160; <br/>&#160; puts x<br/></p><p class="SourceTitle" style="text-align:center;">Figure 1&#160;&#8212; Ruby <i>code</i></p>
1184
+ <p id="samplecode" class="Sourcecode"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160; puts x<br/></p><p class="SourceTitle" style="text-align:center;">Figure 1&#160;&#8212; Ruby <i>code</i></p>
763
1185
  <p class='Sourcecode'>
764
1186
  <br/>
765
1187
  Que?
@@ -795,7 +1217,7 @@ Que?
795
1217
  <div>
796
1218
  <h1 class="ForewordTitle">Foreword</h1>
797
1219
  <pre id="samplecode" class="prettyprint "><br/>&#160;&#160;&#160; <br/>&#160; &lt;xml&gt;<br/></pre>
798
- <p class="SourceTitle" style="text-align:center;">Figure 1&#160;&#8212; XML code</p>
1220
+ <p class="SourceTitle" style="text-align:center;">XML code</p>
799
1221
  </div>
800
1222
  <p class="zzSTDTitle1"/>
801
1223
  </div>
@@ -824,7 +1246,6 @@ Que?
824
1246
  <div>
825
1247
  <h1 class="ForewordTitle">Foreword</h1>
826
1248
  <pre id="_" class="prettyprint ">puts "Hello, world." &lt;1&gt;<br/>&#160;&#160; %w{a b c}.each do |x|<br/>&#160;&#160;&#160;&#160; puts x &lt;2&gt;<br/>&#160;&#160; end<br/><br/>&lt;1&gt; This is one callout<br/>&lt;2&gt; This is another callout</pre>
827
- <p class='SourceTitle' style='text-align:center;'>Figure 1</p>
828
1249
  </div>
829
1250
  <p class="zzSTDTitle1"/>
830
1251
  </div>
@@ -884,8 +1305,64 @@ Que?
884
1305
  OUTPUT
885
1306
  end
886
1307
 
1308
+ it "processes formulae (PresentationXML)" do
1309
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1310
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1311
+ <preface><foreword>
1312
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true" keep-with-next="true" keep-lines-together="true">
1313
+ <stem type="AsciiMath">r = 1 %</stem>
1314
+ <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
1315
+ <dt>
1316
+ <stem type="AsciiMath">r</stem>
1317
+ </dt>
1318
+ <dd>
1319
+ <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
1320
+ </dd>
1321
+ </dl>
1322
+ <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
1323
+ <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
1324
+ </note>
1325
+ </formula>
1326
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
1327
+ <stem type="AsciiMath">r = 1 %</stem>
1328
+ </formula>
1329
+ </foreword></preface>
1330
+ </iso-standard>
1331
+ INPUT
1332
+ <?xml version='1.0'?>
1333
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1334
+ <preface>
1335
+ <foreword>
1336
+ <formula id='_be9158af-7e93-4ee2-90c5-26d31c181934' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
1337
+ <stem type='AsciiMath'>r = 1 %</stem>
1338
+ <dl id='_e4fe94fe-1cde-49d9-b1ad-743293b7e21d'>
1339
+ <dt>
1340
+ <stem type='AsciiMath'>r</stem>
1341
+ </dt>
1342
+ <dd>
1343
+ <p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
1344
+ </dd>
1345
+ </dl>
1346
+ <note id='_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0'>
1347
+ <name>NOTE</name>
1348
+ <p id='_511aaa98-4116-42af-8e5b-c87cdf5bfdc8'>
1349
+ [durationUnits] is essentially a duration statement without the "P"
1350
+ prefix. "P" is unnecessary because between "G" and "U" duration is
1351
+ always expressed.
1352
+ </p>
1353
+ </note>
1354
+ </formula>
1355
+ <formula id='_be9158af-7e93-4ee2-90c5-26d31c181935'>
1356
+ <name>1</name>
1357
+ <stem type='AsciiMath'>r = 1 %</stem>
1358
+ </formula>
1359
+ </foreword>
1360
+ </preface>
1361
+ </iso-standard>
1362
+ OUTPUT
1363
+ end
887
1364
 
888
- it "processes formulae" do
1365
+ it "processes formulae (HTML)" do
889
1366
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
890
1367
  <iso-standard xmlns="http://riboseinc.com/isoxml">
891
1368
  <preface><foreword>
@@ -900,10 +1377,11 @@ Que?
900
1377
  </dd>
901
1378
  </dl>
902
1379
  <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
1380
+ <name>NOTE</name>
903
1381
  <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
904
1382
  </note>
905
1383
  </formula>
906
- <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
1384
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935"><name>1</name>
907
1385
  <stem type="AsciiMath">r = 1 %</stem>
908
1386
  </formula>
909
1387
  </foreword></preface>
@@ -946,10 +1424,11 @@ Que?
946
1424
  </dd>
947
1425
  </dl>
948
1426
  <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
1427
+ <name>NOTE</name>
949
1428
  <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
950
1429
  </note>
951
1430
  </formula>
952
- <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
1431
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935"><name>1</name>
953
1432
  <stem type="AsciiMath">r = 1 %</stem>
954
1433
  </formula>
955
1434
  </foreword></preface>
@@ -1090,14 +1569,52 @@ World</p>
1090
1569
  OUTPUT
1091
1570
  end
1092
1571
 
1572
+ it "processes blockquotes (Presentation XML)" do
1573
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1574
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1575
+ <preface><foreword>
1576
+ <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1577
+ <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
1578
+ <author>ISO</author>
1579
+ <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1580
+ </quote>
1093
1581
 
1582
+ </foreword></preface>
1583
+ </iso-standard>
1584
+ INPUT
1585
+ <?xml version='1.0'?>
1586
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1587
+ <preface>
1588
+ <foreword>
1589
+ <quote id='_044bd364-c832-4b78-8fea-92242402a1d1'>
1590
+ <source type='inline' bibitemid='ISO7301' citeas='ISO 7301:2011'>
1591
+ <locality type='clause'>
1592
+ <referenceFrom>1</referenceFrom>
1593
+ </locality>ISO 7301:2011, Clause 1
1594
+ </source>
1595
+ <author>ISO</author>
1596
+ <p id='_d4fd0a61-f300-4285-abe6-602707590e53'>
1597
+ This International Standard gives the minimum specifications for rice
1598
+ (
1599
+ <em>Oryza sativa</em>
1600
+ L.) which is subject to international trade. It is applicable to the
1601
+ following types: husked rice and milled rice, parboiled or not,
1602
+ intended for direct human consumption. It is neither applicable to
1603
+ other products derived from rice, nor to waxy rice (glutinous rice).
1604
+ </p>
1605
+ </quote>
1606
+ </foreword>
1607
+ </preface>
1608
+ </iso-standard>
1609
+ OUTPUT
1610
+ end
1094
1611
 
1095
- it "processes blockquotes" do
1612
+ it "processes blockquotes (HTML)" do
1096
1613
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1097
1614
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1098
1615
  <preface><foreword>
1099
1616
  <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1100
- <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
1617
+ <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 7301:2011, Clause 1</source>
1101
1618
  <author>ISO</author>
1102
1619
  <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1103
1620
  </quote>
@@ -1127,7 +1644,7 @@ World</p>
1127
1644
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1128
1645
  <sections>
1129
1646
  <terms>
1130
- <term id="_extraneous_matter"><preferred>extraneous matter</preferred><admitted>EM</admitted>
1647
+ <term id="_extraneous_matter"><name>1.1.</name><preferred>extraneous matter</preferred><admitted>EM</admitted>
1131
1648
  <domain>rice</domain>
1132
1649
  <definition><p id="_318b3939-be09-46c4-a284-93f9826b981e">organic and inorganic components other than whole or broken kernels</p></definition>
1133
1650
  </term>
@@ -1137,7 +1654,7 @@ World</p>
1137
1654
  INPUT
1138
1655
  #{HTML_HDR}
1139
1656
  <p class="zzSTDTitle1"/>
1140
- <div><h1>1.&#160; </h1>
1657
+ <div><h1/>
1141
1658
  <p class="TermNum" id="_extraneous_matter">1.1.</p><p class="Terms" style="text-align:left;">extraneous matter</p><p class="AltTerms" style="text-align:left;">EM</p>
1142
1659
 
1143
1660
  <p id="_318b3939-be09-46c4-a284-93f9826b981e">&lt;rice&gt; organic and inorganic components other than whole or broken kernels</p>
@@ -1148,8 +1665,8 @@ World</p>
1148
1665
  OUTPUT
1149
1666
  end
1150
1667
 
1151
- it "processes permissions" do
1152
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1668
+ it "processes permissions (Presentation XML)" do
1669
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1153
1670
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1154
1671
  <preface><foreword>
1155
1672
  <permission id="_" keep-with-next="true" keep-lines-together="true">
@@ -1201,8 +1718,268 @@ World</p>
1201
1718
  <bibliography><references id="_bibliography" obligation="informative" normative="false">
1202
1719
  <title>Bibliography</title>
1203
1720
  <bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">RFC 2616</docidentifier> <docidentifier type="rfc-anchor">RFC2616</docidentifier> <docidentifier type="DOI">10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
1721
+ </references></bibliography>
1722
+ </iso-standard>
1723
+ INPUT
1724
+ <?xml version='1.0'?>
1725
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1726
+ <preface>
1727
+ <foreword>
1728
+ <permission id='_' keep-with-next='true' keep-lines-together='true'>
1729
+ <name>Permission 1</name>
1730
+ <label>/ogc/recommendation/wfs/2</label>
1731
+ <inherit>/ss/584/2015/level/1</inherit>
1732
+ <inherit>
1733
+ <eref type='inline' bibitemid='rfc2616' citeas='RFC 2616'>RFC 2616 (HTTP/1.1)</eref>
1734
+ </inherit>
1735
+ <subject>user</subject>
1736
+ <classification>
1737
+ <tag>control-class</tag>
1738
+ <value>Technical</value>
1739
+ </classification>
1740
+ <classification>
1741
+ <tag>priority</tag>
1742
+ <value>P0</value>
1743
+ </classification>
1744
+ <classification>
1745
+ <tag>family</tag>
1746
+ <value>System and Communications Protection</value>
1747
+ </classification>
1748
+ <classification>
1749
+ <tag>family</tag>
1750
+ <value>System and Communications Protocols</value>
1751
+ </classification>
1752
+ <description>
1753
+ <p id='_'>
1754
+ I recommend
1755
+ <em>this</em>
1756
+ .
1757
+ </p>
1758
+ </description>
1759
+ <specification exclude='true' type='tabular'>
1760
+ <p id='_'>This is the object of the recommendation:</p>
1761
+ <table id='_'>
1762
+ <tbody>
1763
+ <tr>
1764
+ <td style='text-align:left;'>Object</td>
1765
+ <td style='text-align:left;'>Value</td>
1766
+ </tr>
1767
+ <tr>
1768
+ <td style='text-align:left;'>Mission</td>
1769
+ <td style='text-align:left;'>Accomplished</td>
1770
+ </tr>
1771
+ </tbody>
1772
+ </table>
1773
+ </specification>
1774
+ <description>
1775
+ <p id='_'>As for the measurement targets,</p>
1776
+ </description>
1777
+ <measurement-target exclude='false'>
1778
+ <p id='_'>The measurement target shall be measured as:</p>
1779
+ <formula id='_'>
1780
+ <name>1</name>
1781
+ <stem type='AsciiMath'>r/1 = 0</stem>
1782
+ </formula>
1783
+ </measurement-target>
1784
+ <verification exclude='false'>
1785
+ <p id='_'>The following code will be run for verification:</p>
1786
+ <sourcecode id='_'>
1787
+ CoreRoot(success): HttpResponse if (success) recommendation(label:
1788
+ success-response) end
1789
+ </sourcecode>
1790
+ </verification>
1791
+ <import exclude='true'>
1792
+ <sourcecode id='_'>success-response()</sourcecode>
1793
+ </import>
1794
+ </permission>
1795
+ </foreword>
1796
+ </preface>
1797
+ <bibliography>
1798
+ <references id='_bibliography' obligation='informative' normative='false'>
1799
+ <title depth="1">Bibliography</title>
1800
+ <bibitem id='rfc2616' type='standard'>
1801
+ <fetched>2020-03-27</fetched>
1802
+ <title format='text/plain' language='en' script='Latn'>Hypertext Transfer Protocol&#x2009;&#x2014;&#x2009;HTTP/1.1</title>
1803
+ <uri type='xml'>https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri>
1804
+ <uri type='src'>https://www.rfc-editor.org/info/rfc2616</uri>
1805
+ <docidentifier type='IETF'>RFC 2616</docidentifier>
1806
+ <docidentifier type='rfc-anchor'>RFC2616</docidentifier>
1807
+ <docidentifier type='DOI'>10.17487/RFC2616</docidentifier>
1808
+ <date type='published'>
1809
+ <on>1999-06</on>
1810
+ </date>
1811
+ <contributor>
1812
+ <role type='author'/>
1813
+ <person>
1814
+ <name>
1815
+ <completename language='en'>R. Fielding</completename>
1816
+ </name>
1817
+ <affiliation>
1818
+ <organization>
1819
+ <name>IETF</name>
1820
+ <abbreviation>IETF</abbreviation>
1821
+ </organization>
1822
+ </affiliation>
1823
+ </person>
1824
+ </contributor>
1825
+ <contributor>
1826
+ <role type='author'/>
1827
+ <person>
1828
+ <name>
1829
+ <completename language='en'>J. Gettys</completename>
1830
+ </name>
1831
+ <affiliation>
1832
+ <organization>
1833
+ <name>IETF</name>
1834
+ <abbreviation>IETF</abbreviation>
1835
+ </organization>
1836
+ </affiliation>
1837
+ </person>
1838
+ </contributor>
1839
+ <contributor>
1840
+ <role type='author'/>
1841
+ <person>
1842
+ <name>
1843
+ <completename language='en'>J. Mogul</completename>
1844
+ </name>
1845
+ <affiliation>
1846
+ <organization>
1847
+ <name>IETF</name>
1848
+ <abbreviation>IETF</abbreviation>
1849
+ </organization>
1850
+ </affiliation>
1851
+ </person>
1852
+ </contributor>
1853
+ <contributor>
1854
+ <role type='author'/>
1855
+ <person>
1856
+ <name>
1857
+ <completename language='en'>H. Frystyk</completename>
1858
+ </name>
1859
+ <affiliation>
1860
+ <organization>
1861
+ <name>IETF</name>
1862
+ <abbreviation>IETF</abbreviation>
1863
+ </organization>
1864
+ </affiliation>
1865
+ </person>
1866
+ </contributor>
1867
+ <contributor>
1868
+ <role type='author'/>
1869
+ <person>
1870
+ <name>
1871
+ <completename language='en'>L. Masinter</completename>
1872
+ </name>
1873
+ <affiliation>
1874
+ <organization>
1875
+ <name>IETF</name>
1876
+ <abbreviation>IETF</abbreviation>
1877
+ </organization>
1878
+ </affiliation>
1879
+ </person>
1880
+ </contributor>
1881
+ <contributor>
1882
+ <role type='author'/>
1883
+ <person>
1884
+ <name>
1885
+ <completename language='en'>P. Leach</completename>
1886
+ </name>
1887
+ <affiliation>
1888
+ <organization>
1889
+ <name>IETF</name>
1890
+ <abbreviation>IETF</abbreviation>
1891
+ </organization>
1892
+ </affiliation>
1893
+ </person>
1894
+ </contributor>
1895
+ <contributor>
1896
+ <role type='author'/>
1897
+ <person>
1898
+ <name>
1899
+ <completename language='en'>T. Berners-Lee</completename>
1900
+ </name>
1901
+ <affiliation>
1902
+ <organization>
1903
+ <name>IETF</name>
1904
+ <abbreviation>IETF</abbreviation>
1905
+ </organization>
1906
+ </affiliation>
1907
+ </person>
1908
+ </contributor>
1909
+ <language>en</language>
1910
+ <script>Latn</script>
1911
+ <abstract format='text/plain' language='en' script='Latn'>
1912
+ HTTP has been in use by the World-Wide Web global information
1913
+ initiative since 1990. This specification defines the protocol
1914
+ referred to as &#x201C;HTTP/1.1&#x201D;, and is an update to RFC 2068.
1915
+ [STANDARDS-TRACK]
1916
+ </abstract>
1917
+ <series type='main'>
1918
+ <title format='text/plain' language='en' script='Latn'>RFC</title>
1919
+ <number>2616</number>
1920
+ </series>
1921
+ <place>Fremont, CA</place>
1922
+ </bibitem>
1923
+ </references>
1924
+ </bibliography>
1925
+ </iso-standard>
1926
+ OUTPUT
1927
+ end
1204
1928
 
1205
-
1929
+ it "processes permissions (HTML)" do
1930
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1931
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1932
+ <preface><foreword>
1933
+ <permission id="_" keep-with-next="true" keep-lines-together="true">
1934
+ <name>Permission 1</name>
1935
+ <label>/ogc/recommendation/wfs/2</label>
1936
+ <inherit>/ss/584/2015/level/1</inherit>
1937
+ <inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
1938
+ <subject>user</subject>
1939
+ <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
1940
+ <description>
1941
+ <p id="_">I recommend <em>this</em>.</p>
1942
+ </description>
1943
+ <specification exclude="true" type="tabular">
1944
+ <p id="_">This is the object of the recommendation:</p>
1945
+ <table id="_">
1946
+ <tbody>
1947
+ <tr>
1948
+ <td style="text-align:left;">Object</td>
1949
+ <td style="text-align:left;">Value</td>
1950
+ </tr>
1951
+ <tr>
1952
+ <td style="text-align:left;">Mission</td>
1953
+ <td style="text-align:left;">Accomplished</td>
1954
+ </tr>
1955
+ </tbody>
1956
+ </table>
1957
+ </specification>
1958
+ <description>
1959
+ <p id="_">As for the measurement targets,</p>
1960
+ </description>
1961
+ <measurement-target exclude="false">
1962
+ <p id="_">The measurement target shall be measured as:</p>
1963
+ <formula id="_">
1964
+ <stem type="AsciiMath">r/1 = 0</stem>
1965
+ </formula>
1966
+ </measurement-target>
1967
+ <verification exclude="false">
1968
+ <p id="_">The following code will be run for verification:</p>
1969
+ <sourcecode id="_">CoreRoot(success): HttpResponse
1970
+ if (success)
1971
+ recommendation(label: success-response)
1972
+ end
1973
+ </sourcecode>
1974
+ </verification>
1975
+ <import exclude="true">
1976
+ <sourcecode id="_">success-response()</sourcecode>
1977
+ </import>
1978
+ </permission>
1979
+ </foreword></preface>
1980
+ <bibliography><references id="_bibliography" obligation="informative" normative="false">
1981
+ <title>Bibliography</title>
1982
+ <bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">RFC 2616</docidentifier> <docidentifier type="rfc-anchor">RFC2616</docidentifier> <docidentifier type="DOI">10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
1206
1983
  </references></bibliography>
1207
1984
  </iso-standard>
1208
1985
  INPUT
@@ -1227,7 +2004,7 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1227
2004
  </div>
1228
2005
  <div class="requirement-measurement-target">
1229
2006
  <p id="_">The measurement target shall be measured as:</p>
1230
- <div id="_"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div></div>
2007
+ <div id="_"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span></p></div></div>
1231
2008
 
1232
2009
 
1233
2010
  </div>
@@ -1253,11 +2030,122 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1253
2030
  OUTPUT
1254
2031
  end
1255
2032
 
1256
- it "processes requirements" do
2033
+ it "processes requirements (Presentation XML)" do
2034
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2035
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2036
+ <preface><foreword>
2037
+ <requirement id="A" unnumbered="true" keep-with-next="true" keep-lines-together="true">
2038
+ <title>A New Requirement</title>
2039
+ <label>/ogc/recommendation/wfs/2</label>
2040
+ <inherit>/ss/584/2015/level/1</inherit>
2041
+ <subject>user</subject>
2042
+ <description>
2043
+ <p id="_">I recommend <em>this</em>.</p>
2044
+ </description>
2045
+ <specification exclude="true" type="tabular">
2046
+ <p id="_">This is the object of the recommendation:</p>
2047
+ <table id="_">
2048
+ <tbody>
2049
+ <tr>
2050
+ <td style="text-align:left;">Object</td>
2051
+ <td style="text-align:left;">Value</td>
2052
+ </tr>
2053
+ <tr>
2054
+ <td style="text-align:left;">Mission</td>
2055
+ <td style="text-align:left;">Accomplished</td>
2056
+ </tr>
2057
+ </tbody>
2058
+ </table>
2059
+ </specification>
2060
+ <description>
2061
+ <p id="_">As for the measurement targets,</p>
2062
+ </description>
2063
+ <measurement-target exclude="false" keep-with-next="true" keep-lines-together="true">
2064
+ <p id="_">The measurement target shall be measured as:</p>
2065
+ <formula id="B">
2066
+ <stem type="AsciiMath">r/1 = 0</stem>
2067
+ </formula>
2068
+ </measurement-target>
2069
+ <verification exclude="false">
2070
+ <p id="_">The following code will be run for verification:</p>
2071
+ <sourcecode id="_">CoreRoot(success): HttpResponse
2072
+ if (success)
2073
+ recommendation(label: success-response)
2074
+ end
2075
+ </sourcecode>
2076
+ </verification>
2077
+ <import exclude="true">
2078
+ <sourcecode id="_">success-response()</sourcecode>
2079
+ </import>
2080
+ </requirement>
2081
+ </foreword></preface>
2082
+ </iso-standard>
2083
+ INPUT
2084
+ <?xml version='1.0'?>
2085
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2086
+ <preface>
2087
+ <foreword>
2088
+ <requirement id='A' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
2089
+ <name>Requirement</name>
2090
+ <title>A New Requirement</title>
2091
+ <label>/ogc/recommendation/wfs/2</label>
2092
+ <inherit>/ss/584/2015/level/1</inherit>
2093
+ <subject>user</subject>
2094
+ <description>
2095
+ <p id='_'>
2096
+ I recommend
2097
+ <em>this</em>
2098
+ .
2099
+ </p>
2100
+ </description>
2101
+ <specification exclude='true' type='tabular'>
2102
+ <p id='_'>This is the object of the recommendation:</p>
2103
+ <table id='_'>
2104
+ <tbody>
2105
+ <tr>
2106
+ <td style='text-align:left;'>Object</td>
2107
+ <td style='text-align:left;'>Value</td>
2108
+ </tr>
2109
+ <tr>
2110
+ <td style='text-align:left;'>Mission</td>
2111
+ <td style='text-align:left;'>Accomplished</td>
2112
+ </tr>
2113
+ </tbody>
2114
+ </table>
2115
+ </specification>
2116
+ <description>
2117
+ <p id='_'>As for the measurement targets,</p>
2118
+ </description>
2119
+ <measurement-target exclude='false' keep-with-next='true' keep-lines-together='true'>
2120
+ <p id='_'>The measurement target shall be measured as:</p>
2121
+ <formula id='B'>
2122
+ <name>1</name>
2123
+ <stem type='AsciiMath'>r/1 = 0</stem>
2124
+ </formula>
2125
+ </measurement-target>
2126
+ <verification exclude='false'>
2127
+ <p id='_'>The following code will be run for verification:</p>
2128
+ <sourcecode id='_'>
2129
+ CoreRoot(success): HttpResponse if (success) recommendation(label:
2130
+ success-response) end
2131
+ </sourcecode>
2132
+ </verification>
2133
+ <import exclude='true'>
2134
+ <sourcecode id='_'>success-response()</sourcecode>
2135
+ </import>
2136
+ </requirement>
2137
+ </foreword>
2138
+ </preface>
2139
+ </iso-standard>
2140
+ OUTPUT
2141
+ end
2142
+
2143
+ it "processes requirements (HTML)" do
1257
2144
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1258
2145
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1259
2146
  <preface><foreword>
1260
2147
  <requirement id="A" unnumbered="true" keep-with-next="true" keep-lines-together="true">
2148
+ <name>Requirement</name>
1261
2149
  <title>A New Requirement</title>
1262
2150
  <label>/ogc/recommendation/wfs/2</label>
1263
2151
  <inherit>/ss/584/2015/level/1</inherit>
@@ -1320,7 +2208,7 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1320
2208
  </div>
1321
2209
  <div class="requirement-measurement-target" style='page-break-after: avoid;page-break-inside: avoid;'>
1322
2210
  <p id="_">The measurement target shall be measured as:</p>
1323
- <div id="B"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div></div>
2211
+ <div id="B"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span></p></div></div>
1324
2212
 
1325
2213
 
1326
2214
  </div>
@@ -1338,7 +2226,125 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1338
2226
  OUTPUT
1339
2227
  end
1340
2228
 
1341
- it "processes requirements in French" do
2229
+ it "processes requirements in French (Presentation XML)" do
2230
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2231
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2232
+ <bibdata>
2233
+ <language>fr</language>
2234
+ <script>Latn</script>
2235
+ </bibdata>
2236
+ <preface><foreword>
2237
+ <requirement id="A" unnumbered="true">
2238
+ <title>A New Requirement</title>
2239
+ <label>/ogc/recommendation/wfs/2</label>
2240
+ <inherit>/ss/584/2015/level/1</inherit>
2241
+ <subject>user</subject>
2242
+ <description>
2243
+ <p id="_">I recommend <em>this</em>.</p>
2244
+ </description>
2245
+ <specification exclude="true" type="tabular">
2246
+ <p id="_">This is the object of the recommendation:</p>
2247
+ <table id="_">
2248
+ <tbody>
2249
+ <tr>
2250
+ <td style="text-align:left;">Object</td>
2251
+ <td style="text-align:left;">Value</td>
2252
+ </tr>
2253
+ <tr>
2254
+ <td style="text-align:left;">Mission</td>
2255
+ <td style="text-align:left;">Accomplished</td>
2256
+ </tr>
2257
+ </tbody>
2258
+ </table>
2259
+ </specification>
2260
+ <description>
2261
+ <p id="_">As for the measurement targets,</p>
2262
+ </description>
2263
+ <measurement-target exclude="false">
2264
+ <p id="_">The measurement target shall be measured as:</p>
2265
+ <formula id="B">
2266
+ <stem type="AsciiMath">r/1 = 0</stem>
2267
+ </formula>
2268
+ </measurement-target>
2269
+ <verification exclude="false">
2270
+ <p id="_">The following code will be run for verification:</p>
2271
+ <sourcecode id="_">CoreRoot(success): HttpResponse
2272
+ if (success)
2273
+ recommendation(label: success-response)
2274
+ end
2275
+ </sourcecode>
2276
+ </verification>
2277
+ <import exclude="true">
2278
+ <sourcecode id="_">success-response()</sourcecode>
2279
+ </import>
2280
+ </requirement>
2281
+ </foreword></preface>
2282
+ </iso-standard>
2283
+ INPUT
2284
+ <?xml version='1.0'?>
2285
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2286
+ <bibdata>
2287
+ <language>fr</language>
2288
+ <script>Latn</script>
2289
+ </bibdata>
2290
+ <preface>
2291
+ <foreword>
2292
+ <requirement id='A' unnumbered='true'>
2293
+ <name>Exigence</name>
2294
+ <title>A New Requirement</title>
2295
+ <label>/ogc/recommendation/wfs/2</label>
2296
+ <inherit>/ss/584/2015/level/1</inherit>
2297
+ <subject>user</subject>
2298
+ <description>
2299
+ <p id='_'>
2300
+ I recommend
2301
+ <em>this</em>
2302
+ .
2303
+ </p>
2304
+ </description>
2305
+ <specification exclude='true' type='tabular'>
2306
+ <p id='_'>This is the object of the recommendation:</p>
2307
+ <table id='_'>
2308
+ <tbody>
2309
+ <tr>
2310
+ <td style='text-align:left;'>Object</td>
2311
+ <td style='text-align:left;'>Value</td>
2312
+ </tr>
2313
+ <tr>
2314
+ <td style='text-align:left;'>Mission</td>
2315
+ <td style='text-align:left;'>Accomplished</td>
2316
+ </tr>
2317
+ </tbody>
2318
+ </table>
2319
+ </specification>
2320
+ <description>
2321
+ <p id='_'>As for the measurement targets,</p>
2322
+ </description>
2323
+ <measurement-target exclude='false'>
2324
+ <p id='_'>The measurement target shall be measured as:</p>
2325
+ <formula id='B'>
2326
+ <name>1</name>
2327
+ <stem type='AsciiMath'>r/1 = 0</stem>
2328
+ </formula>
2329
+ </measurement-target>
2330
+ <verification exclude='false'>
2331
+ <p id='_'>The following code will be run for verification:</p>
2332
+ <sourcecode id='_'>
2333
+ CoreRoot(success): HttpResponse if (success) recommendation(label:
2334
+ success-response) end
2335
+ </sourcecode>
2336
+ </verification>
2337
+ <import exclude='true'>
2338
+ <sourcecode id='_'>success-response()</sourcecode>
2339
+ </import>
2340
+ </requirement>
2341
+ </foreword>
2342
+ </preface>
2343
+ </iso-standard>
2344
+ OUTPUT
2345
+ end
2346
+
2347
+ it "processes requirements in French (HTML)" do
1342
2348
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1343
2349
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1344
2350
  <bibdata>
@@ -1347,6 +2353,7 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1347
2353
  </bibdata>
1348
2354
  <preface><foreword>
1349
2355
  <requirement id="A" unnumbered="true">
2356
+ <name>Exigence</name>
1350
2357
  <title>A New Requirement</title>
1351
2358
  <label>/ogc/recommendation/wfs/2</label>
1352
2359
  <inherit>/ss/584/2015/level/1</inherit>
@@ -1425,7 +2432,6 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1425
2432
  <div id='B'><div class='formula'>
1426
2433
  <p>
1427
2434
  <span class='stem'>(#(r/1 = 0)#)</span>
1428
- &#160; (1)
1429
2435
  </p>
1430
2436
  </div>
1431
2437
  </div>
@@ -1454,11 +2460,130 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
1454
2460
  OUTPUT
1455
2461
  end
1456
2462
 
1457
- it "processes recommendation" do
2463
+ it "processes recommendation (Presentation XML)" do
2464
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2465
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2466
+ <preface><foreword>
2467
+ <recommendation id="_" obligation="shall,could" keep-with-next="true" keep-lines-together="true">
2468
+ <label>/ogc/recommendation/wfs/2</label>
2469
+ <inherit>/ss/584/2015/level/1</inherit>
2470
+ <classification><tag>type</tag><value>text</value></classification>
2471
+ <classification><tag>language</tag><value>BASIC</value></classification>
2472
+ <subject>user</subject>
2473
+ <description>
2474
+ <p id="_">I recommend <em>this</em>.</p>
2475
+ </description>
2476
+ <specification exclude="true" type="tabular">
2477
+ <p id="_">This is the object of the recommendation:</p>
2478
+ <table id="_">
2479
+ <tbody>
2480
+ <tr>
2481
+ <td style="text-align:left;">Object</td>
2482
+ <td style="text-align:left;">Value</td>
2483
+ </tr>
2484
+ <tr>
2485
+ <td style="text-align:left;">Mission</td>
2486
+ <td style="text-align:left;">Accomplished</td>
2487
+ </tr>
2488
+ </tbody>
2489
+ </table>
2490
+ </specification>
2491
+ <description>
2492
+ <p id="_">As for the measurement targets,</p>
2493
+ </description>
2494
+ <measurement-target exclude="false">
2495
+ <p id="_">The measurement target shall be measured as:</p>
2496
+ <formula id="_">
2497
+ <stem type="AsciiMath">r/1 = 0</stem>
2498
+ </formula>
2499
+ </measurement-target>
2500
+ <verification exclude="false">
2501
+ <p id="_">The following code will be run for verification:</p>
2502
+ <sourcecode id="_">CoreRoot(success): HttpResponse
2503
+ if (success)
2504
+ recommendation(label: success-response)
2505
+ end
2506
+ </sourcecode>
2507
+ </verification>
2508
+ <import exclude="true">
2509
+ <sourcecode id="_">success-response()</sourcecode>
2510
+ </import>
2511
+ </recommendation>
2512
+ </foreword></preface>
2513
+ </iso-standard>
2514
+ INPUT
2515
+ <?xml version='1.0'?>
2516
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2517
+ <preface>
2518
+ <foreword>
2519
+ <recommendation id='_' obligation='shall,could' keep-with-next='true' keep-lines-together='true'>
2520
+ <name>Recommendation 1</name>
2521
+ <label>/ogc/recommendation/wfs/2</label>
2522
+ <inherit>/ss/584/2015/level/1</inherit>
2523
+ <classification>
2524
+ <tag>type</tag>
2525
+ <value>text</value>
2526
+ </classification>
2527
+ <classification>
2528
+ <tag>language</tag>
2529
+ <value>BASIC</value>
2530
+ </classification>
2531
+ <subject>user</subject>
2532
+ <description>
2533
+ <p id='_'>
2534
+ I recommend
2535
+ <em>this</em>
2536
+ .
2537
+ </p>
2538
+ </description>
2539
+ <specification exclude='true' type='tabular'>
2540
+ <p id='_'>This is the object of the recommendation:</p>
2541
+ <table id='_'>
2542
+ <tbody>
2543
+ <tr>
2544
+ <td style='text-align:left;'>Object</td>
2545
+ <td style='text-align:left;'>Value</td>
2546
+ </tr>
2547
+ <tr>
2548
+ <td style='text-align:left;'>Mission</td>
2549
+ <td style='text-align:left;'>Accomplished</td>
2550
+ </tr>
2551
+ </tbody>
2552
+ </table>
2553
+ </specification>
2554
+ <description>
2555
+ <p id='_'>As for the measurement targets,</p>
2556
+ </description>
2557
+ <measurement-target exclude='false'>
2558
+ <p id='_'>The measurement target shall be measured as:</p>
2559
+ <formula id='_'>
2560
+ <name>1</name>
2561
+ <stem type='AsciiMath'>r/1 = 0</stem>
2562
+ </formula>
2563
+ </measurement-target>
2564
+ <verification exclude='false'>
2565
+ <p id='_'>The following code will be run for verification:</p>
2566
+ <sourcecode id='_'>
2567
+ CoreRoot(success): HttpResponse if (success) recommendation(label:
2568
+ success-response) end
2569
+ </sourcecode>
2570
+ </verification>
2571
+ <import exclude='true'>
2572
+ <sourcecode id='_'>success-response()</sourcecode>
2573
+ </import>
2574
+ </recommendation>
2575
+ </foreword>
2576
+ </preface>
2577
+ </iso-standard>
2578
+ OUTPUT
2579
+ end
2580
+
2581
+ it "processes recommendation (HTML)" do
1458
2582
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1459
2583
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1460
2584
  <preface><foreword>
1461
2585
  <recommendation id="_" obligation="shall,could" keep-with-next="true" keep-lines-together="true">
2586
+ <name>Recommendation 1</name>
1462
2587
  <label>/ogc/recommendation/wfs/2</label>
1463
2588
  <inherit>/ss/584/2015/level/1</inherit>
1464
2589
  <classification><tag>type</tag><value>text</value></classification>
@@ -1521,7 +2646,7 @@ end
1521
2646
  </div>
1522
2647
  <div class="requirement-measurement-target">
1523
2648
  <p id="_">The measurement target shall be measured as:</p>
1524
- <div id="_"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div></div>
2649
+ <div id="_"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span></p></div></div>
1525
2650
 
1526
2651
 
1527
2652
  </div>
@@ -1539,8 +2664,8 @@ end
1539
2664
  OUTPUT
1540
2665
  end
1541
2666
 
1542
- it "processes pseudocode" do
1543
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2667
+ it "processes pseudocode (Presentation XML)" do
2668
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1544
2669
  <itu-standard xmlns="http://riboseinc.com/isoxml">
1545
2670
  <bibdata>
1546
2671
  <language>en</language>
@@ -1550,6 +2675,59 @@ end
1550
2675
          <smallcap>B</smallcap></p>
1551
2676
  <p id="_">  <em>C</em></p></figure>
1552
2677
  </preface></itu-standard>
2678
+ INPUT
2679
+ <?xml version='1.0'?>
2680
+ <itu-standard xmlns='http://riboseinc.com/isoxml'>
2681
+ <bibdata>
2682
+ <language>en</language>
2683
+ </bibdata>
2684
+ <preface>
2685
+ <foreword>
2686
+ <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
2687
+ <name>Figure 1&#xA0;&#x2014; Label</name>
2688
+ <p id='_'>
2689
+ &#xA0;&#xA0;
2690
+ <strong>A</strong>
2691
+ <br/>
2692
+ &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;
2693
+ <smallcap>B</smallcap>
2694
+ </p>
2695
+ <p id='_'>
2696
+ &#xA0;&#xA0;
2697
+ <em>C</em>
2698
+ </p>
2699
+ </figure>
2700
+ </foreword>
2701
+ </preface>
2702
+ </itu-standard>
2703
+ OUTPUT
2704
+ end
2705
+
2706
+ it "processes pseudocode (HTML)" do
2707
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2708
+ <itu-standard xmlns='http://riboseinc.com/isoxml'>
2709
+ <bibdata>
2710
+ <language>en</language>
2711
+ </bibdata>
2712
+ <preface>
2713
+ <foreword>
2714
+ <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
2715
+ <name>Figure 1&#xA0;&#x2014; Label</name>
2716
+ <p id='_'>
2717
+ &#xA0;&#xA0;
2718
+ <strong>A</strong>
2719
+ <br/>
2720
+ &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;
2721
+ <smallcap>B</smallcap>
2722
+ </p>
2723
+ <p id='_'>
2724
+ &#xA0;&#xA0;
2725
+ <em>C</em>
2726
+ </p>
2727
+ </figure>
2728
+ </foreword>
2729
+ </preface>
2730
+ </itu-standard>
1553
2731
  INPUT
1554
2732
  #{HTML_HDR}
1555
2733
  <br/>
@@ -1569,18 +2747,32 @@ OUTPUT
1569
2747
  it "processes pseudocode (Word)" do
1570
2748
  FileUtils.rm_f "test.doc"
1571
2749
  IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", false)
1572
- <itu-standard xmlns="http://riboseinc.com/isoxml">
1573
- <bibdata>
2750
+ <itu-standard xmlns='http://riboseinc.com/isoxml'>
2751
+ <bibdata>
1574
2752
  <language>en</language>
1575
- </bibdata>
1576
- <preface><foreword>
1577
- <figure id="_" class="pseudocode"><name>Label</name><p id="_">  <strong>A</strong><br/>
1578
-         <smallcap>B</smallcap></p>
1579
- <p id="_">  <em>C</em></p></figure>
1580
- </preface></itu-standard>
2753
+ </bibdata>
2754
+ <preface>
2755
+ <foreword>
2756
+ <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
2757
+ <name>Figure 1&#xA0;&#x2014; Label</name>
2758
+ <p id='_'>
2759
+ &#xA0;&#xA0;
2760
+ <strong>A</strong>
2761
+ <br/>
2762
+ &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;
2763
+ <smallcap>B</smallcap>
2764
+ </p>
2765
+ <p id='_'>
2766
+ &#xA0;&#xA0;
2767
+ <em>C</em>
2768
+ </p>
2769
+ </figure>
2770
+ </foreword>
2771
+ </preface>
2772
+ </itu-standard>
1581
2773
  INPUT
1582
2774
  expect(xmlpp( File.read("test.doc").gsub(%r{^.*<h1 class="ForewordTitle">Foreword</h1>}m, "").gsub(%r{</div>.*}m, "</div>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1583
- <div class="pseudocode"><a name="_" id="_"></a><p class="pseudocode"><a name="_" id="_"></a>&#xA0;&#xA0;<b>A</b><br/>
2775
+ <div class="pseudocode" style='page-break-after: avoid;page-break-inside: avoid;'><a name="_" id="_"></a><p class="pseudocode"><a name="_" id="_"></a>&#xA0;&#xA0;<b>A</b><br/>
1584
2776
  &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;<span style="font-variant:small-caps;">B</span></p>
1585
2777
  <p class="pseudocode" style="page-break-after:avoid;"><a name="_" id="_"></a>&#xA0;&#xA0;<i>C</i></p><p class="SourceTitle" style="text-align:center;">Figure 1&#xA0;&#x2014; Label</p></div>
1586
2778
  OUTPUT
@@ -1606,7 +2798,6 @@ INPUT
1606
2798
  <div>
1607
2799
  <h1 class='ForewordTitle'>Foreword</h1>
1608
2800
  <div class='example'>
1609
- <p class='example-title'>EXAMPLE</p>
1610
2801
  <pre id='B' class='prettyprint '>
1611
2802
  A B C
1612
2803
  </pre>