isodoc 1.1.4 → 1.2.0

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 (45) 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/common.rb +0 -2
  7. data/lib/isodoc/convert.rb +33 -27
  8. data/lib/isodoc/function/blocks.rb +10 -22
  9. data/lib/isodoc/function/blocks_example_note.rb +14 -15
  10. data/lib/isodoc/function/cleanup.rb +5 -4
  11. data/lib/isodoc/function/inline.rb +6 -76
  12. data/lib/isodoc/function/references.rb +10 -9
  13. data/lib/isodoc/function/reqt.rb +12 -11
  14. data/lib/isodoc/function/section.rb +39 -54
  15. data/lib/isodoc/function/table.rb +1 -6
  16. data/lib/isodoc/function/terms.rb +13 -6
  17. data/lib/isodoc/function/to_word_html.rb +1 -0
  18. data/lib/isodoc/function/utils.rb +4 -3
  19. data/lib/isodoc/html_function/html.rb +0 -1
  20. data/lib/isodoc/{function/i18n.rb → i18n.rb} +37 -36
  21. data/lib/isodoc/metadata.rb +4 -3
  22. data/lib/isodoc/metadata_date.rb +1 -1
  23. data/lib/isodoc/presentation_function/block.rb +138 -0
  24. data/lib/isodoc/presentation_function/inline.rb +131 -0
  25. data/lib/isodoc/presentation_function/section.rb +46 -0
  26. data/lib/isodoc/presentation_xml_convert.rb +38 -5
  27. data/lib/isodoc/version.rb +1 -1
  28. data/lib/isodoc/word_function/body.rb +12 -8
  29. data/lib/isodoc/word_function/inline.rb +3 -1
  30. data/lib/isodoc/xref.rb +5 -3
  31. data/lib/isodoc/xref/xref_sect_gen.rb +3 -3
  32. data/spec/assets/i18n.yaml +12 -1
  33. data/spec/isodoc/blocks_spec.rb +1101 -147
  34. data/spec/isodoc/cleanup_spec.rb +2 -2
  35. data/spec/isodoc/footnotes_spec.rb +2 -2
  36. data/spec/isodoc/i18n_spec.rb +679 -110
  37. data/spec/isodoc/inline_spec.rb +323 -142
  38. data/spec/isodoc/lists_spec.rb +2 -2
  39. data/spec/isodoc/postproc_spec.rb +1311 -1333
  40. data/spec/isodoc/ref_spec.rb +181 -3
  41. data/spec/isodoc/section_spec.rb +508 -680
  42. data/spec/isodoc/table_spec.rb +155 -4
  43. data/spec/isodoc/terms_spec.rb +111 -79
  44. data/spec/isodoc/xref_spec.rb +1569 -1186
  45. metadata +6 -3
@@ -1,13 +1,163 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
+ it "processes IsoXML tables (Presentation XML)" do
5
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
8
+ <foreword>
9
+ <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
10
+ <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
11
+ <thead>
12
+ <tr>
13
+ <td rowspan="2" align="left">Description</td>
14
+ <td colspan="4" align="center">Rice sample</td>
15
+ </tr>
16
+ <tr>
17
+ <td align="left">Arborio</td>
18
+ <td align="center">Drago<fn reference="a">
19
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
20
+ </fn></td>
21
+ <td align="center">Balilla<fn reference="a">
22
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
23
+ </fn></td>
24
+ <td align="center">Thaibonnet</td>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <tr>
29
+ <th align="left">Number of laboratories retained after eliminating outliers</th>
30
+ <td align="center">13</td>
31
+ <td align="center">11</td>
32
+ <td align="center">13</td>
33
+ <td align="center">13</td>
34
+ </tr>
35
+ <tr>
36
+ <td align="left">Mean value, g/100 g</td>
37
+ <td align="center">81,2</td>
38
+ <td align="center">82,0</td>
39
+ <td align="center">81,8</td>
40
+ <td align="center">77,7</td>
41
+ </tr>
42
+ </tbody>
43
+ <tfoot>
44
+ <tr>
45
+ <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
46
+ <td align="center">2,89</td>
47
+ <td align="center">0,57</td>
48
+ <td align="center">2,26</td>
49
+ <td align="center">6,06</td>
50
+ </tr>
51
+ </tfoot>
52
+ <dl>
53
+ <dt>Drago</dt>
54
+ <dd>A type of rice</dd>
55
+ </dl>
56
+ <note><name>NOTE</name><p>This is a table about rice</p></note>
57
+ </table>
58
+
59
+ <table id="tableD-2" unnumbered="true">
60
+ <tbody><tr><td>A</td></tr></tbody>
61
+ </table>
62
+ </foreword>
63
+ </preface>
64
+ </iso-standard>
65
+ INPUT
66
+ <?xml version='1.0'?>
67
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
68
+ <preface>
69
+ <foreword>
70
+ <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
71
+ <name>
72
+ Table 1&#xA0;&#x2014; Repeatability and reproducibility of
73
+ <em>husked</em>
74
+ rice yield
75
+ <fn reference='1'>
76
+ <p>X</p>
77
+ </fn>
78
+ </name>
79
+ <thead>
80
+ <tr>
81
+ <td rowspan='2' align='left'>Description</td>
82
+ <td colspan='4' align='center'>Rice sample</td>
83
+ </tr>
84
+ <tr>
85
+ <td align='left'>Arborio</td>
86
+ <td align='center'>
87
+ Drago
88
+ <fn reference='a'>
89
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
90
+ </fn>
91
+ </td>
92
+ <td align='center'>
93
+ Balilla
94
+ <fn reference='a'>
95
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
96
+ </fn>
97
+ </td>
98
+ <td align='center'>Thaibonnet</td>
99
+ </tr>
100
+ </thead>
101
+ <tbody>
102
+ <tr>
103
+ <th align='left'>Number of laboratories retained after eliminating outliers</th>
104
+ <td align='center'>13</td>
105
+ <td align='center'>11</td>
106
+ <td align='center'>13</td>
107
+ <td align='center'>13</td>
108
+ </tr>
109
+ <tr>
110
+ <td align='left'>Mean value, g/100 g</td>
111
+ <td align='center'>81,2</td>
112
+ <td align='center'>82,0</td>
113
+ <td align='center'>81,8</td>
114
+ <td align='center'>77,7</td>
115
+ </tr>
116
+ </tbody>
117
+ <tfoot>
118
+ <tr>
119
+ <td align='left'>
120
+ Reproducibility limit,
121
+ <stem type='AsciiMath'>R</stem>
122
+ (= 2,83
123
+ <stem type='AsciiMath'>s_R</stem>
124
+ )
125
+ </td>
126
+ <td align='center'>2,89</td>
127
+ <td align='center'>0,57</td>
128
+ <td align='center'>2,26</td>
129
+ <td align='center'>6,06</td>
130
+ </tr>
131
+ </tfoot>
132
+ <dl>
133
+ <dt>Drago</dt>
134
+ <dd>A type of rice</dd>
135
+ </dl>
136
+ <note>
137
+ <name>NOTENOTE</name>
138
+ <p>This is a table about rice</p>
139
+ </note>
140
+ </table>
141
+ <table id='tableD-2' unnumbered='true'>
142
+ <tbody>
143
+ <tr>
144
+ <td>A</td>
145
+ </tr>
146
+ </tbody>
147
+ </table>
148
+ </foreword>
149
+ </preface>
150
+ </iso-standard>
151
+ OUTPUT
152
+ end
153
+
4
154
  it "processes IsoXML tables" do
5
155
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
156
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
157
  <preface>
8
158
  <foreword>
9
159
  <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
10
- <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
160
+ <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
11
161
  <thead>
12
162
  <tr>
13
163
  <td rowspan="2" align="left">Description</td>
@@ -53,7 +203,7 @@ RSpec.describe IsoDoc do
53
203
  <dt>Drago</dt>
54
204
  <dd>A type of rice</dd>
55
205
  </dl>
56
- <note><p>This is a table about rice</p></note>
206
+ <note><name>NOTE</name><p>This is a table about rice</p></note>
57
207
  </table>
58
208
 
59
209
  <table id="tableD-2" unnumbered="true">
@@ -149,10 +299,11 @@ RSpec.describe IsoDoc do
149
299
  <preface>
150
300
  <foreword>
151
301
  <table id="tableD-0">
302
+ <name>Table 1</name>
152
303
  <tbody><tr><td>A</td></tr></tbody>
153
304
  </table>
154
305
  <table id="tableD-1" alt="tool tip" summary="long desc" width="70%">
155
- <name>Repeatability and reproducibility of husked rice yield<fn reference="1"><p>X</p></fn></name>
306
+ <name>Table 2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield<fn reference="1"><p>X</p></fn></name>
156
307
  <thead>
157
308
  <tr>
158
309
  <td rowspan="2" align="left">Description</td>
@@ -198,7 +349,7 @@ RSpec.describe IsoDoc do
198
349
  <dt>Drago</dt>
199
350
  <dd>A type of rice</dd>
200
351
  </dl>
201
- <note><p>This is a table about rice</p></note>
352
+ <note><name>NOTE</name><p>This is a table about rice</p></note>
202
353
  </table>
203
354
  </foreword>
204
355
  </preface>
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "processes IsoXML terms" do
5
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ input = <<~"INPUT"
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <sections>
8
8
  <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
@@ -72,9 +72,109 @@ RSpec.describe IsoDoc do
72
72
  </sections>
73
73
  </iso-standard>
74
74
  INPUT
75
+
76
+ presxml = <<~"PRESXML"
77
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
78
+ <sections>
79
+ <terms id='_terms_and_definitions' obligation='normative'>
80
+ <title depth='1'>
81
+ 1.
82
+ <tab/>
83
+ Terms and Definitions
84
+ </title>
85
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
86
+ <term id='paddy1'><name>1.1.</name>
87
+ <preferred>paddy</preferred>
88
+ <domain>rice</domain>
89
+ <definition>
90
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
91
+ </definition>
92
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
93
+ <name>EXAMPLE 1</name>
94
+ <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
95
+ <ul>
96
+ <li>A</li>
97
+ </ul>
98
+ </termexample>
99
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
100
+ <name>EXAMPLE 2</name>
101
+ <ul>
102
+ <li>A</li>
103
+ </ul>
104
+ </termexample>
105
+ <termsource status='modified'>
106
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
107
+ <referenceFrom>3.1</referenceFrom>
108
+ </locality>ISO 7301:2011, Clause 3.1</origin>
109
+ <modification>
110
+ <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
111
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry
112
+ is not included here
113
+ </p>
114
+ </modification>
115
+ </termsource>
116
+ <termsource status='identical'>
117
+ <origin citeas=''>
118
+ <termref base='IEV' target='xyz'>t1</termref>
119
+ </origin>
120
+ </termsource>
121
+ <termsource status='modified'>
122
+ <origin citeas=''>
123
+ <termref base='IEV' target='xyz'/>
124
+ </origin>
125
+ <modification>
126
+ <p id='_'>with adjustments</p>
127
+ </modification>
128
+ </termsource>
129
+ </term>
130
+ <term id='paddy'><name>1.2.</name>
131
+ <preferred>paddy</preferred>
132
+ <admitted>paddy rice</admitted>
133
+ <admitted>rough rice</admitted>
134
+ <deprecates>cargo rice</deprecates>
135
+ <definition>
136
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
137
+ </definition>
138
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f893'>
139
+ <name>EXAMPLE</name>
140
+ <ul>
141
+ <li>A</li>
142
+ </ul>
143
+ </termexample>
144
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e' keep-with-next='true' keep-lines-together='true'>
145
+ <name>Note 1 to entry</name>
146
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
147
+ The starch of waxy rice consists almost entirely of amylopectin. The
148
+ kernels have a tendency to stick together after cooking.
149
+ </p>
150
+ </termnote>
151
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
152
+ <name>Note 2 to entry</name>
153
+ <ul>
154
+ <li>A</li>
155
+ </ul>
156
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
157
+ The starch of waxy rice consists almost entirely of amylopectin. The
158
+ kernels have a tendency to stick together after cooking.
159
+ </p>
160
+ </termnote>
161
+ <termsource status='identical'>
162
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
163
+ <referenceFrom>3.1</referenceFrom>
164
+ </locality>ISO 7301:2011, Clause 3.1</origin>
165
+ </termsource>
166
+ </term>
167
+ </terms>
168
+ </sections>
169
+ </iso-standard>
170
+ PRESXML
171
+
172
+ html = <<~"OUTPUT"
75
173
  #{HTML_HDR}
76
174
  <p class="zzSTDTitle1"/>
77
- <div id="_terms_and_definitions"><h1>1.&#160; Terms and Definitions</h1><p>For the purposes of this document,
175
+ <div id="_terms_and_definitions">
176
+ <h1> 1. &#160; Terms and Definitions </h1>
177
+ <p>For the purposes of this document,
78
178
  the following terms and definitions apply.</p>
79
179
  <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
80
180
 
@@ -93,7 +193,7 @@ RSpec.describe IsoDoc do
93
193
 
94
194
  <p>[TERMREF]
95
195
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
96
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
196
+ [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
97
197
  [/TERMREF]</p>
98
198
  <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
99
199
  <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
@@ -115,79 +215,8 @@ RSpec.describe IsoDoc do
115
215
  </body>
116
216
  </html>
117
217
  OUTPUT
118
- end
119
218
 
120
- it "processes IsoXML terms (Word)" do
121
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
122
- <iso-standard xmlns="http://riboseinc.com/isoxml">
123
- <sections>
124
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
125
- <p>For the purposes of this document, the following terms and definitions apply.</p>
126
-
127
- <term id="paddy1"><preferred>paddy</preferred>
128
- <domain>rice</domain>
129
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
130
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
131
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
132
- <ul>
133
- <li>A</li>
134
- </ul>
135
- </termexample>
136
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
137
- <ul>
138
- <li>A</li>
139
- </ul>
140
- </termexample>
141
-
142
- <termsource status="modified">
143
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
144
- <modification>
145
- <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
146
- </modification>
147
- </termsource>
148
-
149
- <termsource status='identical'>
150
- <origin citeas=''>
151
- <termref base='IEV' target='xyz'>t1</termref>
152
- </origin>
153
- </termsource>
154
-
155
- <termsource status='modified'>
156
- <origin citeas=''>
157
- <termref base='IEV' target='xyz'/>
158
- </origin>
159
- <modification>
160
- <p id='_'>with adjustments</p>
161
- </modification>
162
- </termsource>
163
-
164
-
165
-
166
- </term>
167
-
168
- <term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
169
- <admitted>rough rice</admitted>
170
- <deprecates>cargo rice</deprecates>
171
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
172
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
173
- <ul>
174
- <li>A</li>
175
- </ul>
176
- </termexample>
177
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
178
- <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
179
- </termnote>
180
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
181
- <ul><li>A</li></ul>
182
- <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
183
- </termnote>
184
- <termsource status="identical">
185
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
186
- </termsource></term>
187
- </terms>
188
- </sections>
189
- </iso-standard>
190
- INPUT
219
+ word = <<~"WORD"
191
220
  #{WORD_HDR}
192
221
  <p class="zzSTDTitle1"/>
193
222
  <div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">&#160; </span>Terms and Definitions</h1><p>For the purposes of this document,
@@ -195,7 +224,7 @@ OUTPUT
195
224
  <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
196
225
 
197
226
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
198
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
227
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
199
228
  <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
200
229
  <ul>
201
230
  <li>A</li>
@@ -209,7 +238,7 @@ OUTPUT
209
238
 
210
239
  <p>[TERMREF]
211
240
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
212
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
241
+ [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
213
242
  [/TERMREF]</p>
214
243
  <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
215
244
  <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
@@ -222,7 +251,7 @@ OUTPUT
222
251
  <li>A</li>
223
252
  </ul>
224
253
  </div>
225
- <div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
254
+ <div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note" style='page-break-after: avoid;page-break-inside: avoid;'><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
226
255
  <div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
227
256
  <p>[TERMREF]
228
257
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
@@ -231,6 +260,9 @@ OUTPUT
231
260
  </body>
232
261
  </html>
233
262
 
234
- OUTPUT
263
+ WORD
264
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
265
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
266
+ expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
235
267
  end
236
268
  end
@@ -1,13 +1,38 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
+ it "cross-references external documents in Presentation XML" do
5
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
8
+ <foreword>
9
+ <p>
10
+ <xref target="a#b"/>
11
+ </p>
12
+ </foreword>
13
+ </preface>
14
+ </iso-standard
15
+ INPUT
16
+ <?xml version='1.0'?>
17
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
18
+ <preface>
19
+ <foreword>
20
+ <p>
21
+ <xref target='a#b'>a#b</xref>
22
+ </p>
23
+ </foreword>
24
+ </preface>
25
+ </iso-standard>
26
+ OUTPUT
27
+ end
28
+
4
29
  it "cross-references external documents in HTML" do
5
30
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
31
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
32
  <preface>
8
33
  <foreword>
9
34
  <p>
10
- <xref target="a#b"/>
35
+ <xref target='a#b'>a#b</xref>
11
36
  </p>
12
37
  </foreword>
13
38
  </preface>
@@ -34,7 +59,7 @@ RSpec.describe IsoDoc do
34
59
  <preface>
35
60
  <foreword>
36
61
  <p>
37
- <xref target="a#b"/>
62
+ <xref target='a#b'>a#b</xref>
38
63
  </p>
39
64
  </foreword>
40
65
  </preface>
@@ -52,7 +77,7 @@ RSpec.describe IsoDoc do
52
77
  end
53
78
 
54
79
  it "warns of missing crossreference" do
55
- expect { IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true) }.to output(/No label has been processed for ID N1/).to_stderr
80
+ expect { IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true) }.to output(/No label has been processed for ID N1/).to_stderr
56
81
  <iso-standard xmlns="http://riboseinc.com/isoxml">
57
82
  <preface>
58
83
  <foreword>
@@ -76,7 +101,7 @@ RSpec.describe IsoDoc do
76
101
  end
77
102
 
78
103
  it "cross-references notes" do
79
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
104
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
80
105
  <iso-standard xmlns="http://riboseinc.com/isoxml">
81
106
  <preface>
82
107
  <foreword>
@@ -103,7 +128,7 @@ RSpec.describe IsoDoc do
103
128
  </introduction>
104
129
  </preface>
105
130
  <sections>
106
- <clause id="scope"><title>Scope</title>
131
+ <clause id="scope" type="scope"><title>Scope</title>
107
132
  <note id="N">
108
133
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
109
134
  </note>
@@ -141,78 +166,128 @@ RSpec.describe IsoDoc do
141
166
  </annex>
142
167
  </iso-standard>
143
168
  INPUT
144
- #{HTML_HDR}
145
- <br/>
146
- <div>
147
- <h1 class="ForewordTitle">Foreword</h1>
148
- <p>
149
- <a href="#N1">Introduction, Note</a>
150
- <a href="#N2">Preparatory, Note</a>
151
- <a href="#N">Clause 1, Note</a>
152
- <a href="#note1">Clause 3.1, Note 1</a>
153
- <a href="#note2">Clause 3.1, Note 2</a>
154
- <a href="#AN">Annex A.1, Note</a>
155
- <a href="#Anote1">Annex A.2, Note 1</a>
156
- <a href="#Anote2">Annex A.2, Note 2</a>
157
- </p>
158
- </div>
159
- <br/>
160
- <div class="Section3" id="intro">
161
- <h1 class="IntroTitle">Introduction</h1>
162
- <div id="N1" class="Note">
163
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
164
- </div>
165
- <div id="xyz"><h2>Preparatory</h2>
166
- <div id="N2" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
167
- </div>
168
- </div>
169
- <p class="zzSTDTitle1"/>
170
- <div id="scope">
171
- <h1>1.&#160; Scope</h1>
172
- <div id="N" class="Note">
173
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
174
- </div>
175
- <p>
176
- <a href="#N">Note</a>
177
- </p>
178
- </div>
179
- <div id="terms"><h1>2.&#160; </h1>
180
- </div>
181
- <div id="widgets">
182
- <h1>3.&#160; Widgets</h1>
183
- <div id="widgets1"><h2>3.1.&#160;</h2>
184
- <div id="note1" class="Note"><p><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
185
- <div id="note2" class="Note"><p><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
186
- <p> <a href="#note1">Note 1</a> <a href="#note2">Note 2</a> </p>
187
-
188
- </div>
189
- </div>
190
- <br/>
191
- <div id="annex1" class="Section3">
192
- <h1 class='Annex'>
193
- <b>Annex A</b>
169
+ <?xml version='1.0'?>
170
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
171
+ <preface>
172
+ <foreword>
173
+ <p>
174
+ <xref target='N1'>Introduction, Note</xref>
175
+ <xref target='N2'>Preparatory, Note</xref>
176
+ <xref target='N'>Clause 1, Note</xref>
177
+ <xref target='note1'>Clause 3.1, Note 1</xref>
178
+ <xref target='note2'>Clause 3.1, Note 2</xref>
179
+ <xref target='AN'>Annex A.1, Note</xref>
180
+ <xref target='Anote1'>Annex A.2, Note 1</xref>
181
+ <xref target='Anote2'>Annex A.2, Note 2</xref>
182
+ </p>
183
+ </foreword>
184
+ <introduction id='intro'>
185
+ <note id='N1'>
186
+ <name>NOTE</name>
187
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83e'>
188
+ These results are based on a study carried out on three different
189
+ types of kernel.
190
+ </p>
191
+ </note>
192
+ <clause id='xyz'>
193
+ <title depth='2'>Preparatory</title>
194
+ <note id='N2'>
195
+ <name>NOTE</name>
196
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83d'>
197
+ These results are based on a study carried out on three different
198
+ types of kernel.
199
+ </p>
200
+ </note>
201
+ </clause>
202
+ </introduction>
203
+ </preface>
204
+ <sections>
205
+ <clause id='scope' type="scope">
206
+ <title depth='1'>
207
+ 1.
208
+ <tab/>
209
+ Scope
210
+ </title>
211
+ <note id='N'>
212
+ <name>NOTE</name>
213
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
214
+ These results are based on a study carried out on three different
215
+ types of kernel.
216
+ </p>
217
+ </note>
218
+ <p>
219
+ <xref target='N'>Note</xref>
220
+ </p>
221
+ </clause>
222
+ <terms id='terms'>
223
+ <title>2.</title>
224
+ </terms>
225
+ <clause id='widgets'>
226
+ <title depth='1'>
227
+ 3.
228
+ <tab/>
229
+ Widgets
230
+ </title>
231
+ <clause id='widgets1'><title>3.1.</title>
232
+ <note id='note1'>
233
+ <name>NOTE 1</name>
234
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
235
+ These results are based on a study carried out on three different
236
+ types of kernel.
237
+ </p>
238
+ </note>
239
+ <note id='note2'>
240
+ <name>NOTE 2</name>
241
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
242
+ These results are based on a study carried out on three different
243
+ types of kernel.
244
+ </p>
245
+ </note>
246
+ <p>
247
+ <xref target='note1'>Note 1</xref>
248
+ <xref target='note2'>Note 2</xref>
249
+ </p>
250
+ </clause>
251
+ </clause>
252
+ </sections>
253
+ <annex id='annex1'>
254
+ <title>
255
+ <strong>Annex A</strong>
194
256
  <br/>
195
257
  (informative)
196
- <br/>
197
- <br/>
198
- <b/>
199
- </h1>
200
- <div id="annex1a"><h2>A.1.&#160;</h2>
201
- <div id="AN" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
202
- </div>
203
- <div id="annex1b"><h2>A.2.&#160;</h2>
204
- <div id="Anote1" class="Note"><p><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
205
- <div id="Anote2" class="Note"><p><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
206
- </div>
207
- </div>
208
- </div>
209
- </body>
210
- </html>
258
+ </title>
259
+ <clause id='annex1a'><title>A.1.</title>
260
+ <note id='AN'>
261
+ <name>NOTE</name>
262
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
263
+ These results are based on a study carried out on three different
264
+ types of kernel.
265
+ </p>
266
+ </note>
267
+ </clause>
268
+ <clause id='annex1b'><title>A.2.</title>
269
+ <note id='Anote1'>
270
+ <name>NOTE 1</name>
271
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
272
+ These results are based on a study carried out on three different
273
+ types of kernel.
274
+ </p>
275
+ </note>
276
+ <note id='Anote2'>
277
+ <name>NOTE 2</name>
278
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
279
+ These results are based on a study carried out on three different
280
+ types of kernel.
281
+ </p>
282
+ </note>
283
+ </clause>
284
+ </annex>
285
+ </iso-standard>
211
286
  OUTPUT
212
287
  end
213
288
 
214
289
  it "cross-references figures" do
215
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
290
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
216
291
  <iso-standard xmlns="http://riboseinc.com/isoxml">
217
292
  <preface>
218
293
  <foreword id="fwd">
@@ -245,7 +320,7 @@ RSpec.describe IsoDoc do
245
320
  </introduction>
246
321
  </preface>
247
322
  <sections>
248
- <clause id="scope"><title>Scope</title>
323
+ <clause id="scope" type="scope"><title>Scope</title>
249
324
  <figure id="N">
250
325
  <name>Split-it-right sample divider</name>
251
326
  <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
@@ -301,129 +376,124 @@ RSpec.describe IsoDoc do
301
376
  </annex>
302
377
  </iso-standard>
303
378
  INPUT
304
- #{HTML_HDR}
305
- <br/>
306
- <div id="fwd">
307
- <h1 class="ForewordTitle">Foreword</h1>
308
- <p>
309
- <a href="#N1">Figure 1</a>
310
- <a href="#N2">Figure (??)</a>
311
- <a href="#N">Figure 2</a>
312
- <a href="#note1">Figure 3</a>
313
- <a href="#note3">Figure 4</a>
314
- <a href="#note4">Figure 5</a>
315
- <a href="#note2">Figure 6</a>
316
- <a href="#note51">[note51]</a>
317
- <a href="#AN">Figure A.1</a>
318
- <a href="#Anote1">Figure (??)</a>
319
- <a href="#Anote2">Figure A.2</a>
320
- <a href="#Anote3">Figure A.3</a>
321
- </p>
322
- </div>
323
- <br/>
324
- <div class="Section3" id="intro">
325
- <h1 class="IntroTitle">Introduction</h1>
326
- <div id="N1" class="figure">
327
-
328
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
329
- <p class="FigureTitle" style="text-align:center;">Figure 1&#160;&#8212; Split-it-right sample divider</p></div>
330
- <div id="xyz"><h2>Preparatory</h2>
331
- <div id="N2" class="figure">
332
-
333
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
334
- <p class="FigureTitle" style="text-align:center;">Split-it-right sample divider</p></div>
335
- </div>
336
- </div>
337
- <p class="zzSTDTitle1"/>
338
- <div id="scope">
339
- <h1>1.&#160; Scope</h1>
340
- <div id="N" class="figure">
341
-
342
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
343
- <p class="FigureTitle" style="text-align:center;">Figure 2&#160;&#8212; Split-it-right sample divider</p></div>
344
- <p>
345
- <a href="#N">Figure 2</a>
346
- </p>
347
- </div>
348
- <div id="terms"><h1>2.&#160; </h1>
349
- </div>
350
- <div id="widgets">
351
- <h1>3.&#160; Widgets</h1>
352
- <div id="widgets1"><h2>3.1.&#160; </h2>
353
- <div id="note1" class="figure">
354
-
355
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
356
- <p class="FigureTitle" style="text-align:center;">Figure 3&#160;&#8212; Split-it-right sample divider</p></div>
357
- <div id="note3" class="pseudocode">
358
- <p>pseudocode</p>
359
- <p class='SourceTitle' style='text-align:center;'>Figure 4</p>
360
- </div>
361
- <pre id='note4' class='prettyprint '>
362
- <br/>
363
- &#160; A B C
364
- <br/>
365
- &#160;
366
- </pre>
367
- <p class='SourceTitle' style='text-align:center;'>Figure 5&#160;&#8212; Source! Code!</p>
368
- <div id='note5' class='example'>
369
- <p class='example-title'>EXAMPLE</p>
370
- <pre id='note51' class='prettyprint '>
371
- <br/>
372
- &#160; A B C
373
- <br/>
374
- &#160;
375
- </pre>
376
- </div>
377
-
378
- <div id="note2" class="figure">
379
-
380
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
381
- <p class="FigureTitle" style="text-align:center;">Figure 6&#160;&#8212; Split-it-right sample divider</p></div>
382
- <p> <a href="#note1">Figure 3</a> <a href="#note2">Figure 6</a> </p>
383
- </div>
384
- </div>
385
- <br/>
386
- <div id="annex1" class="Section3">
387
- <h1 class='Annex'>
388
- <b>Annex A</b>
379
+ <?xml version='1.0'?>
380
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
381
+ <preface>
382
+ <foreword id='fwd'>
383
+ <p>
384
+ <xref target='N1'>Figure 1</xref>
385
+ <xref target='N2'>Figure (??)</xref>
386
+ <xref target='N'>Figure 2</xref>
387
+ <xref target='note1'>Figure 3</xref>
388
+ <xref target='note3'>Figure 4</xref>
389
+ <xref target='note4'>Figure 5</xref>
390
+ <xref target='note2'>Figure 6</xref>
391
+ <xref target='note51'>[note51]</xref>
392
+ <xref target='AN'>Figure A.1</xref>
393
+ <xref target='Anote1'>Figure (??)</xref>
394
+ <xref target='Anote2'>Figure A.2</xref>
395
+ <xref target='Anote3'>Figure A.3</xref>
396
+ </p>
397
+ </foreword>
398
+ <introduction id='intro'>
399
+ <figure id='N1'>
400
+ <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
401
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
402
+ </figure>
403
+ <clause id='xyz'>
404
+ <title depth='2'>Preparatory</title>
405
+ <figure id='N2' unnumbered='true'>
406
+ <name>Split-it-right sample divider</name>
407
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
408
+ </figure>
409
+ </clause>
410
+ </introduction>
411
+ </preface>
412
+ <sections>
413
+ <clause id='scope' type="scope">
414
+ <title depth='1'>
415
+ 1.
416
+ <tab/>
417
+ Scope
418
+ </title>
419
+ <figure id='N'>
420
+ <name>Figure 2&#xA0;&#x2014; Split-it-right sample divider</name>
421
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
422
+ </figure>
423
+ <p>
424
+ <xref target='N'>Figure 2</xref>
425
+ </p>
426
+ </clause>
427
+ <terms id='terms'>
428
+ <title>2.</title>
429
+ </terms>
430
+ <clause id='widgets'>
431
+ <title depth='1'>
432
+ 3.
433
+ <tab/>
434
+ Widgets
435
+ </title>
436
+ <clause id='widgets1'><title>3.1.</title>
437
+ <figure id='note1'>
438
+ <name>Figure 3&#xA0;&#x2014; Split-it-right sample divider</name>
439
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
440
+ </figure>
441
+ <figure id='note3' class='pseudocode'>
442
+ <name>Figure 4</name>
443
+ <p>pseudocode</p>
444
+ </figure>
445
+ <sourcecode id='note4'>
446
+ <name>Figure 5&#xA0;&#x2014; Source! Code!</name>
447
+ A B C
448
+ </sourcecode>
449
+ <example id='note5'>
450
+ <name>EXAMPLE</name>
451
+ <sourcecode id='note51'> A B C </sourcecode>
452
+ </example>
453
+ <figure id='note2'>
454
+ <name>Figure 6&#xA0;&#x2014; Split-it-right sample divider</name>
455
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
456
+ </figure>
457
+ <p>
458
+ <xref target='note1'>Figure 3</xref>
459
+ <xref target='note2'>Figure 6</xref>
460
+ </p>
461
+ </clause>
462
+ </clause>
463
+ </sections>
464
+ <annex id='annex1'>
465
+ <title>
466
+ <strong>Annex A</strong>
389
467
  <br/>
390
468
  (informative)
391
- <br/>
392
- <br/>
393
- <b/>
394
- </h1>
395
- <div id="annex1a"><h2>A.1.&#160; </h2>
396
- <div id="AN" class="figure">
397
-
398
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
399
- <p class="FigureTitle" style="text-align:center;">Figure A.1&#160;&#8212; Split-it-right sample divider</p></div>
400
- </div>
401
- <div id="annex1b"><h2>A.2.&#160; </h2>
402
- <div id="Anote1" class="figure">
403
-
404
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
405
- <p class="FigureTitle" style="text-align:center;">Split-it-right sample divider</p></div>
406
- <div id="Anote2" class="figure">
407
-
408
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
409
- <p class="FigureTitle" style="text-align:center;">Figure A.2&#160;&#8212; Split-it-right sample divider</p></div>
410
- <pre id='Anote3' class='prettyprint '>
411
- <br/>
412
- &#160; A B C
413
- <br/>
414
- &#160;
415
- </pre>
416
- <p class='SourceTitle' style='text-align:center;'>Figure A.3&#160;&#8212; Source! Code!</p>
417
- </div>
418
- </div>
419
- </div>
420
- </body>
421
- </html>
469
+ </title>
470
+ <clause id='annex1a'><title>A.1.</title>
471
+ <figure id='AN'>
472
+ <name>Figure A.1&#xA0;&#x2014; Split-it-right sample divider</name>
473
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
474
+ </figure>
475
+ </clause>
476
+ <clause id='annex1b'><title>A.2.</title>
477
+ <figure id='Anote1' unnumbered='true'>
478
+ <name>Split-it-right sample divider</name>
479
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
480
+ </figure>
481
+ <figure id='Anote2'>
482
+ <name>Figure A.2&#xA0;&#x2014; Split-it-right sample divider</name>
483
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
484
+ </figure>
485
+ <sourcecode id='Anote3'>
486
+ <name>Figure A.3&#xA0;&#x2014; Source! Code!</name>
487
+ A B C
488
+ </sourcecode>
489
+ </clause>
490
+ </annex>
491
+ </iso-standard>
422
492
  OUTPUT
423
493
  end
424
494
 
425
495
  it "cross-references subfigures" do
426
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
496
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
427
497
  <iso-standard xmlns="http://riboseinc.com/isoxml">
428
498
  <preface>
429
499
  <foreword id="fwd">
@@ -438,7 +508,7 @@ RSpec.describe IsoDoc do
438
508
  </foreword>
439
509
  </preface>
440
510
  <sections>
441
- <clause id="scope"><title>Scope</title>
511
+ <clause id="scope" type="scope"><title>Scope</title>
442
512
  </clause>
443
513
  <terms id="terms"/>
444
514
  <clause id="widgets"><title>Widgets</title>
@@ -475,74 +545,82 @@ RSpec.describe IsoDoc do
475
545
  </annex>
476
546
  </iso-standard>
477
547
  INPUT
478
- #{HTML_HDR}
479
- <br/>
480
- <div id="fwd">
481
- <h1 class="ForewordTitle">Foreword</h1>
482
- <p>
483
- <a href="#N">Figure 1</a>
484
- <a href="#note1">Figure 1-1</a>
485
- <a href="#note2">Figure 1-2</a>
486
- <a href="#AN">Figure A.1</a>
487
- <a href="#Anote1">Figure A.1-1</a>
488
- <a href="#Anote2">Figure A.1-2</a>
489
- </p>
490
- </div>
491
- <p class="zzSTDTitle1"/>
492
- <div id="scope">
493
- <h1>1.&#160; Scope</h1>
494
- </div>
495
- <div id="terms"><h1>2.&#160; </h1>
496
- </div>
497
- <div id="widgets">
498
- <h1>3.&#160; Widgets</h1>
499
- <div id="widgets1"><h2>3.1.&#160;</h2>
500
- <div id="N" class="figure">
501
- <div id="note1" class="figure">
502
-
503
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
504
- <p class="FigureTitle" style="text-align:center;">Figure 1-1&#160;&#8212; Split-it-right sample divider</p></div>
505
- <div id="note2" class="figure">
506
-
507
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
508
- <p class="FigureTitle" style="text-align:center;">Figure 1-2&#160;&#8212; Split-it-right sample divider</p></div>
509
- </div>
510
- <p> <a href="#note1">Figure 1-1</a> <a href="#note2">Figure 1-2</a> </p>
511
- </div>
512
- </div>
513
- <br/>
514
- <div id="annex1" class="Section3">
515
- <h1 class='Annex'>
516
- <b>Annex A</b>
548
+ <?xml version='1.0'?>
549
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
550
+ <preface>
551
+ <foreword id='fwd'>
552
+ <p>
553
+ <xref target='N'>Figure 1</xref>
554
+ <xref target='note1'>Figure 1-1</xref>
555
+ <xref target='note2'>Figure 1-2</xref>
556
+ <xref target='AN'>Figure A.1</xref>
557
+ <xref target='Anote1'>Figure A.1-1</xref>
558
+ <xref target='Anote2'>Figure A.1-2</xref>
559
+ </p>
560
+ </foreword>
561
+ </preface>
562
+ <sections>
563
+ <clause id='scope' type="scope">
564
+ <title depth='1'>
565
+ 1.
566
+ <tab/>
567
+ Scope
568
+ </title>
569
+ </clause>
570
+ <terms id='terms'>
571
+ <title>2.</title>
572
+ </terms>
573
+ <clause id='widgets'>
574
+ <title depth='1'>
575
+ 3.
576
+ <tab/>
577
+ Widgets
578
+ </title>
579
+ <clause id='widgets1'><title>3.1.</title>
580
+ <figure id='N'>
581
+ <figure id='note1'>
582
+ <name>Figure 1-1&#xA0;&#x2014; Split-it-right sample divider</name>
583
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
584
+ </figure>
585
+ <figure id='note2'>
586
+ <name>Figure 1-2&#xA0;&#x2014; Split-it-right sample divider</name>
587
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
588
+ </figure>
589
+ </figure>
590
+ <p>
591
+ <xref target='note1'>Figure 1-1</xref>
592
+ <xref target='note2'>Figure 1-2</xref>
593
+ </p>
594
+ </clause>
595
+ </clause>
596
+ </sections>
597
+ <annex id='annex1'>
598
+ <title>
599
+ <strong>Annex A</strong>
517
600
  <br/>
518
601
  (informative)
519
- <br/>
520
- <br/>
521
- <b/>
522
- </h1>
523
- <div id="annex1a"><h2>A.1.&#160;</h2>
524
- </div>
525
- <div id="annex1b"><h2>A.2.&#160;</h2>
526
- <div id="AN" class="figure">
527
- <div id="Anote1" class="figure">
528
-
529
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
530
- <p class="FigureTitle" style="text-align:center;">Figure A.1-1&#160;&#8212; Split-it-right sample divider</p></div>
531
- <div id="Anote2" class="figure">
532
-
533
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
534
- <p class="FigureTitle" style="text-align:center;">Figure A.1-2&#160;&#8212; Split-it-right sample divider</p></div>
535
- </div>
536
- </div>
537
- </div>
538
- </div>
539
- </body>
540
- </html>
602
+ </title>
603
+ <clause id='annex1a'> <title>A.1.</title>
604
+ </clause>
605
+ <clause id='annex1b'><title>A.2.</title>
606
+ <figure id='AN'>
607
+ <figure id='Anote1'>
608
+ <name>Figure A.1-1&#xA0;&#x2014; Split-it-right sample divider</name>
609
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
610
+ </figure>
611
+ <figure id='Anote2'>
612
+ <name>Figure A.1-2&#xA0;&#x2014; Split-it-right sample divider</name>
613
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
614
+ </figure>
615
+ </figure>
616
+ </clause>
617
+ </annex>
618
+ </iso-standard>
541
619
  OUTPUT
542
620
  end
543
621
 
544
622
  it "cross-references examples" do
545
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
623
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
546
624
  <iso-standard xmlns="http://riboseinc.com/isoxml">
547
625
  <preface>
548
626
  <foreword>
@@ -569,7 +647,7 @@ RSpec.describe IsoDoc do
569
647
  </introduction>
570
648
  </preface>
571
649
  <sections>
572
- <clause id="scope"><title>Scope</title>
650
+ <clause id="scope" type="scope"><title>Scope</title>
573
651
  <example id="N">
574
652
  <p>Hello</p>
575
653
  </example>
@@ -605,89 +683,104 @@ RSpec.describe IsoDoc do
605
683
  </annex>
606
684
  </iso-standard>
607
685
  INPUT
608
- #{HTML_HDR}
609
- <br/>
610
- <div>
611
- <h1 class="ForewordTitle">Foreword</h1>
612
- <p>
613
- <a href="#N1">Introduction, Example</a>
614
- <a href="#N2">Preparatory, Example (??)</a>
615
- <a href="#N">Clause 1, Example</a>
616
- <a href="#note1">Clause 3.1, Example 1</a>
617
- <a href="#note2">Clause 3.1, Example (??)</a>
618
- <a href="#AN">Annex A.1, Example</a>
619
- <a href="#Anote1">Annex A.2, Example (??)</a>
620
- <a href="#Anote2">Annex A.2, Example 1</a>
621
- </p>
622
- </div>
623
- <br/>
624
- <div class="Section3" id="intro">
625
- <h1 class="IntroTitle">Introduction</h1>
626
- <div id="N1" class="example"><p class="example-title">EXAMPLE</p>
627
- <p>Hello</p>
628
- </div>
629
- <div id="xyz"><h2>Preparatory</h2>
630
- <div id="N2" class="example"><p class="example-title">EXAMPLE</p>
631
- <p>Hello</p>
632
- </div>
633
- </div>
634
- </div>
635
- <p class="zzSTDTitle1"/>
636
- <div id="scope">
637
- <h1>1.&#160; Scope</h1>
638
- <div id="N" class="example"><p class="example-title">EXAMPLE</p>
639
- <p>Hello</p>
640
- </div>
641
- <p>
642
- <a href="#N">Example</a>
643
- </p>
644
- </div>
645
- <div id="terms"><h1>2.&#160; </h1>
646
- </div>
647
- <div id="widgets">
648
- <h1>3.&#160; Widgets</h1>
649
- <div id="widgets1"><h2>3.1.&#160;</h2>
650
- <div id="note1" class="example"><p class="example-title">EXAMPLE 1</p>
651
- <p>Hello</p>
652
- </div>
653
- <div id="note2" class="example"><p class="example-title">EXAMPLE</p>
654
- <p>Hello</p>
655
- </div>
656
- <p> <a href="#note1">Example 1</a> <a href="#note2">Example (??)</a> </p>
657
- </div>
658
- </div>
659
- <br/>
660
- <div id="annex1" class="Section3">
661
- <h1 class='Annex'>
662
- <b>Annex A</b>
686
+ <?xml version='1.0'?>
687
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
688
+ <preface>
689
+ <foreword>
690
+ <p>
691
+ <xref target='N1'>Introduction, Example</xref>
692
+ <xref target='N2'>Preparatory, Example (??)</xref>
693
+ <xref target='N'>Clause 1, Example</xref>
694
+ <xref target='note1'>Clause 3.1, Example 1</xref>
695
+ <xref target='note2'>Clause 3.1, Example (??)</xref>
696
+ <xref target='AN'>Annex A.1, Example</xref>
697
+ <xref target='Anote1'>Annex A.2, Example (??)</xref>
698
+ <xref target='Anote2'>Annex A.2, Example 1</xref>
699
+ </p>
700
+ </foreword>
701
+ <introduction id='intro'>
702
+ <example id='N1'>
703
+ <name>EXAMPLE</name>
704
+ <p>Hello</p>
705
+ </example>
706
+ <clause id='xyz'>
707
+ <title depth='2'>Preparatory</title>
708
+ <example id='N2' unnumbered='true'>
709
+ <name>EXAMPLE</name>
710
+ <p>Hello</p>
711
+ </example>
712
+ </clause>
713
+ </introduction>
714
+ </preface>
715
+ <sections>
716
+ <clause id='scope' type="scope">
717
+ <title depth='1'>
718
+ 1.
719
+ <tab/>
720
+ Scope
721
+ </title>
722
+ <example id='N'>
723
+ <name>EXAMPLE</name>
724
+ <p>Hello</p>
725
+ </example>
726
+ <p>
727
+ <xref target='N'>Example</xref>
728
+ </p>
729
+ </clause>
730
+ <terms id='terms'>
731
+ <title>2.</title>
732
+ </terms>
733
+ <clause id='widgets'>
734
+ <title depth='1'>
735
+ 3.
736
+ <tab/>
737
+ Widgets
738
+ </title>
739
+ <clause id='widgets1'><title>3.1.</title>
740
+ <example id='note1'>
741
+ <name>EXAMPLE 1</name>
742
+ <p>Hello</p>
743
+ </example>
744
+ <example id='note2' unnumbered='true'>
745
+ <name>EXAMPLE</name>
746
+ <p>Hello</p>
747
+ </example>
748
+ <p>
749
+ <xref target='note1'>Example 1</xref>
750
+ <xref target='note2'>Example (??)</xref>
751
+ </p>
752
+ </clause>
753
+ </clause>
754
+ </sections>
755
+ <annex id='annex1'>
756
+ <title>
757
+ <strong>Annex A</strong>
663
758
  <br/>
664
759
  (informative)
665
- <br/>
666
- <br/>
667
- <b/>
668
- </h1>
669
- <div id="annex1a"><h2>A.1.&#160;</h2>
670
- <div id="AN" class="example"><p class="example-title">EXAMPLE</p>
671
- <p>Hello</p>
672
- </div>
673
- </div>
674
- <div id="annex1b"><h2>A.2.&#160;</h2>
675
- <div id="Anote1" class="example"><p class="example-title">EXAMPLE</p>
676
- <p>Hello</p>
677
- </div>
678
- <div id="Anote2" class="example"><p class="example-title">EXAMPLE 1</p>
679
- <p>Hello</p>
680
- </div>
681
- </div>
682
- </div>
683
- </div>
684
- </body>
685
- </html>
760
+ </title>
761
+ <clause id='annex1a'><title>A.1.</title>
762
+ <example id='AN'>
763
+ <name>EXAMPLE</name>
764
+ <p>Hello</p>
765
+ </example>
766
+ </clause>
767
+ <clause id='annex1b'><title>A.2.</title>
768
+ <example id='Anote1' unnumbered='true'>
769
+ <name>EXAMPLE</name>
770
+ <p>Hello</p>
771
+ </example>
772
+ <example id='Anote2'>
773
+ <name>EXAMPLE 1</name>
774
+ <p>Hello</p>
775
+ </example>
776
+ </clause>
777
+ </annex>
778
+ </iso-standard>
686
779
  OUTPUT
687
780
  end
688
781
 
689
782
  it "cross-references formulae" do
690
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
783
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
691
784
  <iso-standard xmlns="http://riboseinc.com/isoxml">
692
785
  <preface>
693
786
  <foreword>
@@ -714,7 +807,7 @@ RSpec.describe IsoDoc do
714
807
  </introduction>
715
808
  </preface>
716
809
  <sections>
717
- <clause id="scope"><title>Scope</title>
810
+ <clause id="scope" type="scope"><title>Scope</title>
718
811
  <formula id="N">
719
812
  <stem type="AsciiMath">r = 1 %</stem>
720
813
  </formula>
@@ -750,73 +843,102 @@ RSpec.describe IsoDoc do
750
843
  </annex>
751
844
  </iso-standard>
752
845
  INPUT
753
- #{HTML_HDR}
754
- <br/>
755
- <div>
756
- <h1 class="ForewordTitle">Foreword</h1>
757
- <p>
758
- <a href="#N1">Introduction, Formula (1)</a>
759
- <a href="#N2">Preparatory, Formula ((??))</a>
760
- <a href="#N">Clause 1, Formula (2)</a>
761
- <a href="#note1">Clause 3.1, Formula (3)</a>
762
- <a href="#note2">Clause 3.1, Formula (4)</a>
763
- <a href="#AN">Formula (A.1)</a>
764
- <a href="#Anote1">Formula ((??))</a>
765
- <a href="#Anote2">Formula (A.2)</a>
766
- </p>
767
- </div>
768
- <br/>
769
- <div class="Section3" id="intro">
770
- <h1 class="IntroTitle">Introduction</h1>
771
- <div id="N1"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (1)</p></div></div>
772
- <div id="xyz"><h2>Preparatory</h2>
773
- <div id="N2"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span></p></div></div>
774
- </div>
775
- </div>
776
- <p class="zzSTDTitle1"/>
777
- <div id="scope">
778
- <h1>1.&#160; Scope</h1>
779
- <div id="N"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (2)</p></div></div>
780
- <p>
781
- <a href="#N">Formula (2)</a>
782
- </p>
783
- </div>
784
- <div id="terms"><h1>2.&#160; </h1>
785
- </div>
786
- <div id="widgets">
787
- <h1>3.&#160; Widgets</h1>
788
- <div id="widgets1"><h2>3.1.&#160;</h2>
789
- <div id="note1"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (3)</p></div></div>
790
- <div id="note2"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (4)</p></div></div>
791
- <p> <a href="#note1">Formula (3)</a> <a href="#note2">Formula (4)</a> </p>
792
- </div>
793
- </div>
794
- <br/>
795
- <div id="annex1" class="Section3">
796
- <h1 class='Annex'>
797
- <b>Annex A</b>
846
+ <?xml version='1.0'?>
847
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
848
+ <preface>
849
+ <foreword>
850
+ <p>
851
+ <xref target='N1'>Introduction, Formula (1)</xref>
852
+ <xref target='N2'>Preparatory, Formula ((??))</xref>
853
+ <xref target='N'>Clause 1, Formula (2)</xref>
854
+ <xref target='note1'>Clause 3.1, Formula (3)</xref>
855
+ <xref target='note2'>Clause 3.1, Formula (4)</xref>
856
+ <xref target='AN'>Formula (A.1)</xref>
857
+ <xref target='Anote1'>Formula ((??))</xref>
858
+ <xref target='Anote2'>Formula (A.2)</xref>
859
+ </p>
860
+ </foreword>
861
+ <introduction id='intro'>
862
+ <formula id='N1'>
863
+ <name>1</name>
864
+ <stem type='AsciiMath'>r = 1 %</stem>
865
+ </formula>
866
+ <clause id='xyz'>
867
+ <title depth='2'>Preparatory</title>
868
+ <formula id='N2' unnumbered='true'>
869
+ <stem type='AsciiMath'>r = 1 %</stem>
870
+ </formula>
871
+ </clause>
872
+ </introduction>
873
+ </preface>
874
+ <sections>
875
+ <clause id='scope' type="scope">
876
+ <title depth='1'>
877
+ 1.
878
+ <tab/>
879
+ Scope
880
+ </title>
881
+ <formula id='N'>
882
+ <name>2</name>
883
+ <stem type='AsciiMath'>r = 1 %</stem>
884
+ </formula>
885
+ <p>
886
+ <xref target='N'>Formula (2)</xref>
887
+ </p>
888
+ </clause>
889
+ <terms id='terms'>
890
+ <title>2.</title>
891
+ </terms>
892
+ <clause id='widgets'>
893
+ <title depth='1'>
894
+ 3.
895
+ <tab/>
896
+ Widgets
897
+ </title>
898
+ <clause id='widgets1'><title>3.1.</title>
899
+ <formula id='note1'>
900
+ <name>3</name>
901
+ <stem type='AsciiMath'>r = 1 %</stem>
902
+ </formula>
903
+ <formula id='note2'>
904
+ <name>4</name>
905
+ <stem type='AsciiMath'>r = 1 %</stem>
906
+ </formula>
907
+ <p>
908
+ <xref target='note1'>Formula (3)</xref>
909
+ <xref target='note2'>Formula (4)</xref>
910
+ </p>
911
+ </clause>
912
+ </clause>
913
+ </sections>
914
+ <annex id='annex1'>
915
+ <title>
916
+ <strong>Annex A</strong>
798
917
  <br/>
799
918
  (informative)
800
- <br/>
801
- <br/>
802
- <b/>
803
- </h1>
804
- <div id="annex1a"><h2>A.1.&#160;</h2>
805
- <div id="AN"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (A.1)</p></div></div>
806
- </div>
807
- <div id="annex1b"><h2>A.2.&#160;</h2>
808
- <div id="Anote1"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span></p></div></div>
809
- <div id="Anote2"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (A.2)</p></div></div>
810
- </div>
811
- </div>
812
- </div>
813
- </body>
814
- </html>
919
+ </title>
920
+ <clause id='annex1a'><title>A.1.</title>
921
+ <formula id='AN'>
922
+ <name>A.1</name>
923
+ <stem type='AsciiMath'>r = 1 %</stem>
924
+ </formula>
925
+ </clause>
926
+ <clause id='annex1b'><title>A.2.</title>
927
+ <formula id='Anote1' unnumbered='true'>
928
+ <stem type='AsciiMath'>r = 1 %</stem>
929
+ </formula>
930
+ <formula id='Anote2'>
931
+ <name>A.2</name>
932
+ <stem type='AsciiMath'>r = 1 %</stem>
933
+ </formula>
934
+ </clause>
935
+ </annex>
936
+ </iso-standard>
815
937
  OUTPUT
816
938
  end
817
939
 
818
940
  it "cross-references requirements" do
819
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
941
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
820
942
  <iso-standard xmlns="http://riboseinc.com/isoxml">
821
943
  <preface>
822
944
  <foreword>
@@ -843,7 +965,7 @@ RSpec.describe IsoDoc do
843
965
  </introduction>
844
966
  </preface>
845
967
  <sections>
846
- <clause id="scope"><title>Scope</title>
968
+ <clause id="scope" type="scope"><title>Scope</title>
847
969
  <requirement id="N">
848
970
  <stem type="AsciiMath">r = 1 %</stem>
849
971
  </requirement>
@@ -879,89 +1001,104 @@ RSpec.describe IsoDoc do
879
1001
  </annex>
880
1002
  </iso-standard>
881
1003
  INPUT
882
- #{HTML_HDR}
883
- <br/>
884
- <div>
885
- <h1 class="ForewordTitle">Foreword</h1>
886
- <p>
887
- <a href="#N1">Introduction, Requirement 1</a>
888
- <a href="#N2">Preparatory, Requirement (??)</a>
889
- <a href="#N">Clause 1, Requirement 2</a>
890
- <a href="#note1">Clause 3.1, Requirement 3</a>
891
- <a href="#note2">Clause 3.1, Requirement 4</a>
892
- <a href="#AN">Requirement A.1</a>
893
- <a href="#Anote1">Requirement (??)</a>
894
- <a href="#Anote2">Requirement A.2</a>
895
- </p>
896
- </div>
897
- <br/>
898
- <div class="Section3" id="intro">
899
- <h1 class="IntroTitle">Introduction</h1>
900
- <div class="require" id="N1"><p class="RecommendationTitle">Requirement 1:</p>
901
- <span class="stem">(#(r = 1 %)#)</span>
902
- </div>
903
- <div id="xyz"><h2>Preparatory</h2>
904
- <div class="require" id="N2"><p class="RecommendationTitle">Requirement:</p>
905
- <span class="stem">(#(r = 1 %)#)</span>
906
- </div>
907
- </div>
908
- </div>
909
- <p class="zzSTDTitle1"/>
910
- <div id="scope">
911
- <h1>1.&#160; Scope</h1>
912
- <div class="require" id="N"><p class="RecommendationTitle">Requirement 2:</p>
913
- <span class="stem">(#(r = 1 %)#)</span>
914
- </div>
1004
+ <?xml version='1.0'?>
1005
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1006
+ <preface>
1007
+ <foreword>
1008
+ <p>
1009
+ <xref target='N1'>Introduction, Requirement 1</xref>
1010
+ <xref target='N2'>Preparatory, Requirement (??)</xref>
1011
+ <xref target='N'>Clause 1, Requirement 2</xref>
1012
+ <xref target='note1'>Clause 3.1, Requirement 3</xref>
1013
+ <xref target='note2'>Clause 3.1, Requirement 4</xref>
1014
+ <xref target='AN'>Requirement A.1</xref>
1015
+ <xref target='Anote1'>Requirement (??)</xref>
1016
+ <xref target='Anote2'>Requirement A.2</xref>
1017
+ </p>
1018
+ </foreword>
1019
+ <introduction id='intro'>
1020
+ <requirement id='N1'>
1021
+ <name>Requirement 1</name>
1022
+ <stem type='AsciiMath'>r = 1 %</stem>
1023
+ </requirement>
1024
+ <clause id='xyz'>
1025
+ <title depth='2'>Preparatory</title>
1026
+ <requirement id='N2' unnumbered='true'>
1027
+ <name>Requirement</name>
1028
+ <stem type='AsciiMath'>r = 1 %</stem>
1029
+ </requirement>
1030
+ </clause>
1031
+ </introduction>
1032
+ </preface>
1033
+ <sections>
1034
+ <clause id='scope' type="scope">
1035
+ <title depth='1'>
1036
+ 1.
1037
+ <tab/>
1038
+ Scope
1039
+ </title>
1040
+ <requirement id='N'>
1041
+ <name>Requirement 2</name>
1042
+ <stem type='AsciiMath'>r = 1 %</stem>
1043
+ </requirement>
1044
+ <p>
1045
+ <xref target='N'>Requirement 2</xref>
1046
+ </p>
1047
+ </clause>
1048
+ <terms id='terms'>
1049
+ <title>2.</title>
1050
+ </terms>
1051
+ <clause id='widgets'>
1052
+ <title depth='1'>
1053
+ 3.
1054
+ <tab/>
1055
+ Widgets
1056
+ </title>
1057
+ <clause id='widgets1'><title>3.1.</title>
1058
+ <requirement id='note1'>
1059
+ <name>Requirement 3</name>
1060
+ <stem type='AsciiMath'>r = 1 %</stem>
1061
+ </requirement>
1062
+ <requirement id='note2'>
1063
+ <name>Requirement 4</name>
1064
+ <stem type='AsciiMath'>r = 1 %</stem>
1065
+ </requirement>
915
1066
  <p>
916
- <a href="#N">Requirement 2</a>
1067
+ <xref target='note1'>Requirement 3</xref>
1068
+ <xref target='note2'>Requirement 4</xref>
917
1069
  </p>
918
- </div>
919
- <div id="terms"><h1>2.&#160; </h1>
920
- </div>
921
- <div id="widgets">
922
- <h1>3.&#160; Widgets</h1>
923
- <div id="widgets1"><h2>3.1.&#160;</h2>
924
- <div class="require" id="note1"><p class="RecommendationTitle">Requirement 3:</p>
925
- <span class="stem">(#(r = 1 %)#)</span>
926
- </div>
927
- <div class="require" id="note2"><p class="RecommendationTitle">Requirement 4:</p>
928
- <span class="stem">(#(r = 1 %)#)</span>
929
- </div>
930
- <p> <a href="#note1">Requirement 3</a> <a href="#note2">Requirement 4</a> </p>
931
- </div>
932
- </div>
933
- <br/>
934
- <div id="annex1" class="Section3">
935
- <h1 class='Annex'>
936
- <b>Annex A</b>
1070
+ </clause>
1071
+ </clause>
1072
+ </sections>
1073
+ <annex id='annex1'>
1074
+ <title>
1075
+ <strong>Annex A</strong>
937
1076
  <br/>
938
1077
  (informative)
939
- <br/>
940
- <br/>
941
- <b/>
942
- </h1>
943
- <div id="annex1a"><h2>A.1.&#160;</h2>
944
- <div class="require" id="AN"><p class="RecommendationTitle">Requirement A.1:</p>
945
- <span class="stem">(#(r = 1 %)#)</span>
946
- </div>
947
- </div>
948
- <div id="annex1b"><h2>A.2.&#160;</h2>
949
- <div class="require" id="Anote1"><p class="RecommendationTitle">Requirement:</p>
950
- <span class="stem">(#(r = 1 %)#)</span>
951
- </div>
952
- <div class="require" id="Anote2"><p class="RecommendationTitle">Requirement A.2:</p>
953
- <span class="stem">(#(r = 1 %)#)</span>
954
- </div>
955
- </div>
956
- </div>
957
- </div>
958
- </body>
959
- </html>
960
- OUTPUT
1078
+ </title>
1079
+ <clause id='annex1a'><title>A.1.</title>
1080
+ <requirement id='AN'>
1081
+ <name>Requirement A.1</name>
1082
+ <stem type='AsciiMath'>r = 1 %</stem>
1083
+ </requirement>
1084
+ </clause>
1085
+ <clause id='annex1b'><title>A.2.</title>
1086
+ <requirement id='Anote1' unnumbered='true'>
1087
+ <name>Requirement</name>
1088
+ <stem type='AsciiMath'>r = 1 %</stem>
1089
+ </requirement>
1090
+ <requirement id='Anote2'>
1091
+ <name>Requirement A.2</name>
1092
+ <stem type='AsciiMath'>r = 1 %</stem>
1093
+ </requirement>
1094
+ </clause>
1095
+ </annex>
1096
+ </iso-standard>
1097
+ OUTPUT
961
1098
  end
962
1099
 
963
1100
  it "cross-references recommendations" do
964
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1101
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
965
1102
  <iso-standard xmlns="http://riboseinc.com/isoxml">
966
1103
  <preface>
967
1104
  <foreword>
@@ -988,7 +1125,7 @@ OUTPUT
988
1125
  </introduction>
989
1126
  </preface>
990
1127
  <sections>
991
- <clause id="scope"><title>Scope</title>
1128
+ <clause id="scope" type="scope"><title>Scope</title>
992
1129
  <recommendation id="N">
993
1130
  <stem type="AsciiMath">r = 1 %</stem>
994
1131
  </recommendation>
@@ -1024,89 +1161,104 @@ OUTPUT
1024
1161
  </annex>
1025
1162
  </iso-standard>
1026
1163
  INPUT
1027
- #{HTML_HDR}
1028
- <br/>
1029
- <div>
1030
- <h1 class="ForewordTitle">Foreword</h1>
1031
- <p>
1032
- <a href="#N1">Introduction, Recommendation 1</a>
1033
- <a href="#N2">Preparatory, Recommendation (??)</a>
1034
- <a href="#N">Clause 1, Recommendation 2</a>
1035
- <a href="#note1">Clause 3.1, Recommendation 3</a>
1036
- <a href="#note2">Clause 3.1, Recommendation 4</a>
1037
- <a href="#AN">Recommendation A.1</a>
1038
- <a href="#Anote1">Recommendation (??)</a>
1039
- <a href="#Anote2">Recommendation A.2</a>
1040
- </p>
1041
- </div>
1042
- <br/>
1043
- <div class="Section3" id="intro">
1044
- <h1 class="IntroTitle">Introduction</h1>
1045
- <div class="recommend" id="N1"><p class="RecommendationTitle">Recommendation 1:</p>
1046
- <span class="stem">(#(r = 1 %)#)</span>
1047
- </div>
1048
- <div id="xyz"><h2>Preparatory</h2>
1049
- <div class="recommend" id="N2"><p class="RecommendationTitle">Recommendation:</p>
1050
- <span class="stem">(#(r = 1 %)#)</span>
1051
- </div>
1052
- </div>
1053
- </div>
1054
- <p class="zzSTDTitle1"/>
1055
- <div id="scope">
1056
- <h1>1.&#160; Scope</h1>
1057
- <div class="recommend" id="N"><p class="RecommendationTitle">Recommendation 2:</p>
1058
- <span class="stem">(#(r = 1 %)#)</span>
1059
- </div>
1164
+ <?xml version='1.0'?>
1165
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1166
+ <preface>
1167
+ <foreword>
1168
+ <p>
1169
+ <xref target='N1'>Introduction, Recommendation 1</xref>
1170
+ <xref target='N2'>Preparatory, Recommendation (??)</xref>
1171
+ <xref target='N'>Clause 1, Recommendation 2</xref>
1172
+ <xref target='note1'>Clause 3.1, Recommendation 3</xref>
1173
+ <xref target='note2'>Clause 3.1, Recommendation 4</xref>
1174
+ <xref target='AN'>Recommendation A.1</xref>
1175
+ <xref target='Anote1'>Recommendation (??)</xref>
1176
+ <xref target='Anote2'>Recommendation A.2</xref>
1177
+ </p>
1178
+ </foreword>
1179
+ <introduction id='intro'>
1180
+ <recommendation id='N1'>
1181
+ <name>Recommendation 1</name>
1182
+ <stem type='AsciiMath'>r = 1 %</stem>
1183
+ </recommendation>
1184
+ <clause id='xyz'>
1185
+ <title depth='2'>Preparatory</title>
1186
+ <recommendation id='N2' unnumbered='true'>
1187
+ <name>Recommendation</name>
1188
+ <stem type='AsciiMath'>r = 1 %</stem>
1189
+ </recommendation>
1190
+ </clause>
1191
+ </introduction>
1192
+ </preface>
1193
+ <sections>
1194
+ <clause id='scope' type="scope">
1195
+ <title depth='1'>
1196
+ 1.
1197
+ <tab/>
1198
+ Scope
1199
+ </title>
1200
+ <recommendation id='N'>
1201
+ <name>Recommendation 2</name>
1202
+ <stem type='AsciiMath'>r = 1 %</stem>
1203
+ </recommendation>
1204
+ <p>
1205
+ <xref target='N'>Recommendation 2</xref>
1206
+ </p>
1207
+ </clause>
1208
+ <terms id='terms'>
1209
+ <title>2.</title>
1210
+ </terms>
1211
+ <clause id='widgets'>
1212
+ <title depth='1'>
1213
+ 3.
1214
+ <tab/>
1215
+ Widgets
1216
+ </title>
1217
+ <clause id='widgets1'><title>3.1.</title>
1218
+ <recommendation id='note1'>
1219
+ <name>Recommendation 3</name>
1220
+ <stem type='AsciiMath'>r = 1 %</stem>
1221
+ </recommendation>
1222
+ <recommendation id='note2'>
1223
+ <name>Recommendation 4</name>
1224
+ <stem type='AsciiMath'>r = 1 %</stem>
1225
+ </recommendation>
1060
1226
  <p>
1061
- <a href="#N">Recommendation 2</a>
1227
+ <xref target='note1'>Recommendation 3</xref>
1228
+ <xref target='note2'>Recommendation 4</xref>
1062
1229
  </p>
1063
- </div>
1064
- <div id="terms"><h1>2.&#160; </h1>
1065
- </div>
1066
- <div id="widgets">
1067
- <h1>3.&#160; Widgets</h1>
1068
- <div id="widgets1"><h2>3.1.&#160;</h2>
1069
- <div class="recommend" id="note1"><p class="RecommendationTitle">Recommendation 3:</p>
1070
- <span class="stem">(#(r = 1 %)#)</span>
1071
- </div>
1072
- <div class="recommend" id="note2"><p class="RecommendationTitle">Recommendation 4:</p>
1073
- <span class="stem">(#(r = 1 %)#)</span>
1074
- </div>
1075
- <p> <a href="#note1">Recommendation 3</a> <a href="#note2">Recommendation 4</a> </p>
1076
- </div>
1077
- </div>
1078
- <br/>
1079
- <div id="annex1" class="Section3">
1080
- <h1 class='Annex'>
1081
- <b>Annex A</b>
1230
+ </clause>
1231
+ </clause>
1232
+ </sections>
1233
+ <annex id='annex1'>
1234
+ <title>
1235
+ <strong>Annex A</strong>
1082
1236
  <br/>
1083
1237
  (informative)
1084
- <br/>
1085
- <br/>
1086
- <b/>
1087
- </h1>
1088
- <div id="annex1a"><h2>A.1.&#160;</h2>
1089
- <div class="recommend" id="AN"><p class="RecommendationTitle">Recommendation A.1:</p>
1090
- <span class="stem">(#(r = 1 %)#)</span>
1091
- </div>
1092
- </div>
1093
- <div id="annex1b"><h2>A.2.&#160;</h2>
1094
- <div class="recommend" id="Anote1"><p class="RecommendationTitle">Recommendation:</p>
1095
- <span class="stem">(#(r = 1 %)#)</span>
1096
- </div>
1097
- <div class="recommend" id="Anote2"><p class="RecommendationTitle">Recommendation A.2:</p>
1098
- <span class="stem">(#(r = 1 %)#)</span>
1099
- </div>
1100
- </div>
1101
- </div>
1102
- </div>
1103
- </body>
1104
- </html>
1105
- OUTPUT
1238
+ </title>
1239
+ <clause id='annex1a'><title>A.1.</title>
1240
+ <recommendation id='AN'>
1241
+ <name>Recommendation A.1</name>
1242
+ <stem type='AsciiMath'>r = 1 %</stem>
1243
+ </recommendation>
1244
+ </clause>
1245
+ <clause id='annex1b'><title>A.2.</title>
1246
+ <recommendation id='Anote1' unnumbered='true'>
1247
+ <name>Recommendation</name>
1248
+ <stem type='AsciiMath'>r = 1 %</stem>
1249
+ </recommendation>
1250
+ <recommendation id='Anote2'>
1251
+ <name>Recommendation A.2</name>
1252
+ <stem type='AsciiMath'>r = 1 %</stem>
1253
+ </recommendation>
1254
+ </clause>
1255
+ </annex>
1256
+ </iso-standard>
1257
+ OUTPUT
1106
1258
  end
1107
1259
 
1108
1260
  it "cross-references permissions" do
1109
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1261
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1110
1262
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1111
1263
  <preface>
1112
1264
  <foreword>
@@ -1133,7 +1285,7 @@ OUTPUT
1133
1285
  </introduction>
1134
1286
  </preface>
1135
1287
  <sections>
1136
- <clause id="scope"><title>Scope</title>
1288
+ <clause id="scope" type="scope"><title>Scope</title>
1137
1289
  <permission id="N">
1138
1290
  <stem type="AsciiMath">r = 1 %</stem>
1139
1291
  </permission>
@@ -1169,89 +1321,104 @@ OUTPUT
1169
1321
  </annex>
1170
1322
  </iso-standard>
1171
1323
  INPUT
1172
- #{HTML_HDR}
1173
- <br/>
1174
- <div>
1175
- <h1 class="ForewordTitle">Foreword</h1>
1176
- <p>
1177
- <a href="#N1">Introduction, Permission 1</a>
1178
- <a href="#N2">Preparatory, Permission (??)</a>
1179
- <a href="#N">Clause 1, Permission 2</a>
1180
- <a href="#note1">Clause 3.1, Permission 3</a>
1181
- <a href="#note2">Clause 3.1, Permission 4</a>
1182
- <a href="#AN">Permission A.1</a>
1183
- <a href="#Anote1">Permission (??)</a>
1184
- <a href="#Anote2">Permission A.2</a>
1185
- </p>
1186
- </div>
1187
- <br/>
1188
- <div class="Section3" id="intro">
1189
- <h1 class="IntroTitle">Introduction</h1>
1190
- <div class="permission" id="N1"><p class="RecommendationTitle">Permission 1:</p>
1191
- <span class="stem">(#(r = 1 %)#)</span>
1192
- </div>
1193
- <div id="xyz"><h2>Preparatory</h2>
1194
- <div class="permission" id="N2"><p class="RecommendationTitle">Permission:</p>
1195
- <span class="stem">(#(r = 1 %)#)</span>
1196
- </div>
1197
- </div>
1198
- </div>
1199
- <p class="zzSTDTitle1"/>
1200
- <div id="scope">
1201
- <h1>1.&#160; Scope</h1>
1202
- <div class="permission" id="N"><p class="RecommendationTitle">Permission 2:</p>
1203
- <span class="stem">(#(r = 1 %)#)</span>
1204
- </div>
1205
- <p>
1206
- <a href="#N">Permission 2</a>
1207
- </p>
1208
- </div>
1209
- <div id="terms"><h1>2.&#160; </h1>
1210
- </div>
1211
- <div id="widgets">
1212
- <h1>3.&#160; Widgets</h1>
1213
- <div id="widgets1"><h2>3.1.&#160;</h2>
1214
- <div class="permission" id="note1"><p class="RecommendationTitle">Permission 3:</p>
1215
- <span class="stem">(#(r = 1 %)#)</span>
1216
- </div>
1217
- <div class="permission" id="note2"><p class="RecommendationTitle">Permission 4:</p>
1218
- <span class="stem">(#(r = 1 %)#)</span>
1219
- </div>
1220
- <p> <a href="#note1">Permission 3</a> <a href="#note2">Permission 4</a> </p>
1221
- </div>
1222
- </div>
1223
- <br/>
1224
- <div id="annex1" class="Section3">
1225
- <h1 class='Annex'>
1226
- <b>Annex A</b>
1324
+ <?xml version='1.0'?>
1325
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1326
+ <preface>
1327
+ <foreword>
1328
+ <p>
1329
+ <xref target='N1'>Introduction, Permission 1</xref>
1330
+ <xref target='N2'>Preparatory, Permission (??)</xref>
1331
+ <xref target='N'>Clause 1, Permission 2</xref>
1332
+ <xref target='note1'>Clause 3.1, Permission 3</xref>
1333
+ <xref target='note2'>Clause 3.1, Permission 4</xref>
1334
+ <xref target='AN'>Permission A.1</xref>
1335
+ <xref target='Anote1'>Permission (??)</xref>
1336
+ <xref target='Anote2'>Permission A.2</xref>
1337
+ </p>
1338
+ </foreword>
1339
+ <introduction id='intro'>
1340
+ <permission id='N1'>
1341
+ <name>Permission 1</name>
1342
+ <stem type='AsciiMath'>r = 1 %</stem>
1343
+ </permission>
1344
+ <clause id='xyz'>
1345
+ <title depth='2'>Preparatory</title>
1346
+ <permission id='N2' unnumbered='true'>
1347
+ <name>Permission</name>
1348
+ <stem type='AsciiMath'>r = 1 %</stem>
1349
+ </permission>
1350
+ </clause>
1351
+ </introduction>
1352
+ </preface>
1353
+ <sections>
1354
+ <clause id='scope' type="scope">
1355
+ <title depth='1'>
1356
+ 1.
1357
+ <tab/>
1358
+ Scope
1359
+ </title>
1360
+ <permission id='N'>
1361
+ <name>Permission 2</name>
1362
+ <stem type='AsciiMath'>r = 1 %</stem>
1363
+ </permission>
1364
+ <p>
1365
+ <xref target='N'>Permission 2</xref>
1366
+ </p>
1367
+ </clause>
1368
+ <terms id='terms'>
1369
+ <title>2.</title>
1370
+ </terms>
1371
+ <clause id='widgets'>
1372
+ <title depth='1'>
1373
+ 3.
1374
+ <tab/>
1375
+ Widgets
1376
+ </title>
1377
+ <clause id='widgets1'><title>3.1.</title>
1378
+ <permission id='note1'>
1379
+ <name>Permission 3</name>
1380
+ <stem type='AsciiMath'>r = 1 %</stem>
1381
+ </permission>
1382
+ <permission id='note2'>
1383
+ <name>Permission 4</name>
1384
+ <stem type='AsciiMath'>r = 1 %</stem>
1385
+ </permission>
1386
+ <p>
1387
+ <xref target='note1'>Permission 3</xref>
1388
+ <xref target='note2'>Permission 4</xref>
1389
+ </p>
1390
+ </clause>
1391
+ </clause>
1392
+ </sections>
1393
+ <annex id='annex1'>
1394
+ <title>
1395
+ <strong>Annex A</strong>
1227
1396
  <br/>
1228
1397
  (informative)
1229
- <br/>
1230
- <br/>
1231
- <b/>
1232
- </h1>
1233
- <div id="annex1a"><h2>A.1.&#160;</h2>
1234
- <div class="permission" id="AN"><p class="RecommendationTitle">Permission A.1:</p>
1235
- <span class="stem">(#(r = 1 %)#)</span>
1236
- </div>
1237
- </div>
1238
- <div id="annex1b"><h2>A.2.&#160;</h2>
1239
- <div class="permission" id="Anote1"><p class="RecommendationTitle">Permission:</p>
1240
- <span class="stem">(#(r = 1 %)#)</span>
1241
- </div>
1242
- <div class="permission" id="Anote2"><p class="RecommendationTitle">Permission A.2:</p>
1243
- <span class="stem">(#(r = 1 %)#)</span>
1244
- </div>
1245
- </div>
1246
- </div>
1247
- </div>
1248
- </body>
1249
- </html>
1398
+ </title>
1399
+ <clause id='annex1a'><title>A.1.</title>
1400
+ <permission id='AN'>
1401
+ <name>Permission A.1</name>
1402
+ <stem type='AsciiMath'>r = 1 %</stem>
1403
+ </permission>
1404
+ </clause>
1405
+ <clause id='annex1b'><title>A.2.</title>
1406
+ <permission id='Anote1' unnumbered='true'>
1407
+ <name>Permission</name>
1408
+ <stem type='AsciiMath'>r = 1 %</stem>
1409
+ </permission>
1410
+ <permission id='Anote2'>
1411
+ <name>Permission A.2</name>
1412
+ <stem type='AsciiMath'>r = 1 %</stem>
1413
+ </permission>
1414
+ </clause>
1415
+ </annex>
1416
+ </iso-standard>
1250
1417
  OUTPUT
1251
1418
  end
1252
1419
 
1253
1420
  it "labels and cross-references nested requirements" do
1254
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1421
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1255
1422
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1256
1423
  <preface>
1257
1424
  <foreword>
@@ -1297,60 +1464,79 @@ OUTPUT
1297
1464
  </annex>
1298
1465
  </iso-standard>
1299
1466
  INPUT
1300
- #{HTML_HDR}
1301
- <br/>
1302
- <div>
1303
- <h1 class="ForewordTitle">Foreword</h1>
1304
- <p>
1305
- <a href="#N1">Clause 1, Permission 1</a>
1306
- <a href="#N2">Clause 1, Permission 1-1</a>
1307
- <a href="#N">Clause 1, Permission 1-1-1</a>
1308
- <a href="#Q1">Clause 1, Requirement 1-1</a>
1309
- <a href="#R1">Clause 1, Recommendation 1-1</a>
1310
- <a href="#AN1">Permission A.1</a>
1311
- <a href="#AN2">Permission A.1-1</a>
1312
- <a href="#AN">Permission A.1-1-1</a>
1313
- <a href="#AQ1">Requirement A.1-1</a>
1314
- <a href="#AR1">Recommendation A.1-1</a>
1315
- </p>
1316
- </div>
1317
- <p class="zzSTDTitle1"/>
1318
- <div id="xyz">
1319
- <h1>1.&#160; Preparatory</h1>
1320
- <div class="permission" id="N1"><p class="RecommendationTitle">Permission 1:</p>
1321
- <div class="permission" id="N2"><p class="RecommendationTitle">Permission 1-1:</p>
1322
- <div class="permission" id="N"><p class="RecommendationTitle">Permission 1-1-1:</p>
1323
- </div>
1324
- </div>
1325
- <div class="require" id="Q1"><p class="RecommendationTitle">Requirement 1-1:</p>
1326
- </div>
1327
- <div class="recommend" id="R1"><p class="RecommendationTitle">Recommendation 1-1:</p>
1328
- </div>
1329
- </div>
1330
- </div>
1331
- <br/>
1332
- <div id="Axyz" class="Section3">
1333
- <h1 class="Annex"><b>Annex A</b><br/>(informative)<br/><br/><b>Preparatory</b></h1>
1334
- <div class="permission" id="AN1"><p class="RecommendationTitle">Permission A.1:</p>
1335
- <div class="permission" id='AN2'><p class="RecommendationTitle">Permission A.1-1:</p>
1336
- <div class="permission" id="AN"><p class="RecommendationTitle">Permission A.1-1-1:</p>
1337
- </div>
1338
- </div>
1339
- <div class="require" id="AQ1"><p class="RecommendationTitle">Requirement A.1-1:</p>
1340
- </div>
1341
- <div class="recommend" id='AR1'><p class="RecommendationTitle">Recommendation A.1-1:</p>
1342
- </div>
1343
- </div>
1344
- </div>
1345
- </div>
1346
- </body>
1347
- </html>
1467
+ <?xml version='1.0'?>
1468
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1469
+ <preface>
1470
+ <foreword>
1471
+ <p>
1472
+ <xref target='N1'>Clause 1, Permission 1</xref>
1473
+ <xref target='N2'>Clause 1, Permission 1-1</xref>
1474
+ <xref target='N'>Clause 1, Permission 1-1-1</xref>
1475
+ <xref target='Q1'>Clause 1, Requirement 1-1</xref>
1476
+ <xref target='R1'>Clause 1, Recommendation 1-1</xref>
1477
+ <xref target='AN1'>Permission A.1</xref>
1478
+ <xref target='AN2'>Permission A.1-1</xref>
1479
+ <xref target='AN'>Permission A.1-1-1</xref>
1480
+ <xref target='AQ1'>Requirement A.1-1</xref>
1481
+ <xref target='AR1'>Recommendation A.1-1</xref>
1482
+ </p>
1483
+ </foreword>
1484
+ </preface>
1485
+ <sections>
1486
+ <clause id='xyz'>
1487
+ <title depth='1'>
1488
+ 1.
1489
+ <tab/>
1490
+ Preparatory
1491
+ </title>
1492
+ <permission id='N1'>
1493
+ <name>Permission 1</name>
1494
+ <permission id='N2'>
1495
+ <name>Permission 1-1</name>
1496
+ <permission id='N'>
1497
+ <name>Permission 1-1-1</name>
1498
+ </permission>
1499
+ </permission>
1500
+ <requirement id='Q1'>
1501
+ <name>Requirement 1-1</name>
1502
+ </requirement>
1503
+ <recommendation id='R1'>
1504
+ <name>Recommendation 1-1</name>
1505
+ </recommendation>
1506
+ </permission>
1507
+ </clause>
1508
+ </sections>
1509
+ <annex id='Axyz'>
1510
+ <title>
1511
+ <strong>Annex A</strong>
1512
+ <br/>
1513
+ (informative)
1514
+ <br/>
1515
+ <br/>
1516
+ <strong>Preparatory</strong></title>
1517
+ <permission id='AN1'>
1518
+ <name>Permission A.1</name>
1519
+ <permission id='AN2'>
1520
+ <name>Permission A.1-1</name>
1521
+ <permission id='AN'>
1522
+ <name>Permission A.1-1-1</name>
1523
+ </permission>
1524
+ </permission>
1525
+ <requirement id='AQ1'>
1526
+ <name>Requirement A.1-1</name>
1527
+ </requirement>
1528
+ <recommendation id='AR1'>
1529
+ <name>Recommendation A.1-1</name>
1530
+ </recommendation>
1531
+ </permission>
1532
+ </annex>
1533
+ </iso-standard>
1348
1534
  OUTPUT
1349
1535
  end
1350
1536
 
1351
1537
 
1352
1538
  it "cross-references tables" do
1353
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1539
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1354
1540
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1355
1541
  <preface>
1356
1542
  <foreword>
@@ -1391,7 +1577,7 @@ OUTPUT
1391
1577
  </introduction>
1392
1578
  </preface>
1393
1579
  <sections>
1394
- <clause id="scope"><title>Scope</title>
1580
+ <clause id="scope" type="scope"><title>Scope</title>
1395
1581
  <table id="N">
1396
1582
  <name>Repeatability and reproducibility of husked rice yield</name>
1397
1583
  <tbody>
@@ -1469,93 +1655,152 @@ OUTPUT
1469
1655
  </annex>
1470
1656
  </iso-standard>
1471
1657
  INPUT
1472
- #{HTML_HDR}
1473
- <br/>
1474
- <div>
1475
- <h1 class="ForewordTitle">Foreword</h1>
1476
- <p>
1477
- <a href="#N1">Table 1</a>
1478
- <a href="#N2">Table (??)</a>
1479
- <a href="#N">Table 2</a>
1480
- <a href="#note1">Table 3</a>
1481
- <a href="#note2">Table 4</a>
1482
- <a href="#AN">Table A.1</a>
1483
- <a href="#Anote1">Table (??)</a>
1484
- <a href="#Anote2">Table A.2</a>
1485
- </p>
1486
- </div>
1487
- <br/>
1488
- <div class="Section3" id="intro">
1489
- <h1 class="IntroTitle">Introduction</h1>
1490
- <p class="TableTitle" style="text-align:center;">Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield</p>
1491
- <table id="N1" class="MsoISOTable" style="border-width:1px;border-spacing:0;">
1492
- <tbody>
1493
- <tr>
1494
- <td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td>
1495
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td>
1496
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td>
1497
- </tr>
1498
- </tbody>
1499
- </table>
1500
- <div id="xyz"><h2>Preparatory</h2>
1501
- <p class="TableTitle" style="text-align:center;">Repeatability and reproducibility of husked rice yield</p><table id="N2" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1502
- </div>
1503
- </div>
1504
- <p class="zzSTDTitle1"/>
1505
- <div id="scope">
1506
- <h1>1.&#160; Scope</h1>
1507
- <p class="TableTitle" style="text-align:center;">
1508
- Table 2&#160;&#8212; Repeatability and reproducibility of husked rice yield
1509
- </p>
1510
- <table id="N" class="MsoISOTable" style="border-width:1px;border-spacing:0;">
1511
- <tbody>
1512
- <tr>
1513
- <td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td>
1514
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td>
1515
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td>
1516
- </tr>
1517
- </tbody>
1518
- </table>
1519
- <p>
1520
- <a href="#N">Table 2</a>
1521
- </p>
1522
- </div>
1523
- <div id="terms"><h1>2.&#160; </h1>
1524
- </div>
1525
- <div id="widgets">
1526
- <h1>3.&#160; Widgets</h1>
1527
- <div id="widgets1"><h2>3.1.&#160;</h2>
1528
- <p class="TableTitle" style="text-align:center;">Table 3&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="note1" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1529
- <p class="TableTitle" style="text-align:center;">Table 4&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="note2" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1530
- <p> <a href="#note1">Table 3</a> <a href="#note2">Table 4</a> </p>
1531
- </div>
1532
- </div>
1533
- <br/>
1534
- <div id="annex1" class="Section3">
1535
- <h1 class='Annex'>
1536
- <b>Annex A</b>
1658
+ <?xml version='1.0'?>
1659
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1660
+ <preface>
1661
+ <foreword>
1662
+ <p>
1663
+ <xref target='N1'>Table 1</xref>
1664
+ <xref target='N2'>Table (??)</xref>
1665
+ <xref target='N'>Table 2</xref>
1666
+ <xref target='note1'>Table 3</xref>
1667
+ <xref target='note2'>Table 4</xref>
1668
+ <xref target='AN'>Table A.1</xref>
1669
+ <xref target='Anote1'>Table (??)</xref>
1670
+ <xref target='Anote2'>Table A.2</xref>
1671
+ </p>
1672
+ </foreword>
1673
+ <introduction id='intro'>
1674
+ <table id='N1'>
1675
+ <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1676
+ <tbody>
1677
+ <tr>
1678
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1679
+ <td align='center'>13</td>
1680
+ <td align='center'>11</td>
1681
+ </tr>
1682
+ </tbody>
1683
+ </table>
1684
+ <clause id='xyz'>
1685
+ <title depth='2'>Preparatory</title>
1686
+ <table id='N2' unnumbered='true'>
1687
+ <name>Table &#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1688
+ <tbody>
1689
+ <tr>
1690
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1691
+ <td align='center'>13</td>
1692
+ <td align='center'>11</td>
1693
+ </tr>
1694
+ </tbody>
1695
+ </table>
1696
+ </clause>
1697
+ </introduction>
1698
+ </preface>
1699
+ <sections>
1700
+ <clause id='scope' type="scope">
1701
+ <title depth='1'>
1702
+ 1.
1703
+ <tab/>
1704
+ Scope
1705
+ </title>
1706
+ <table id='N'>
1707
+ <name>Table 2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1708
+ <tbody>
1709
+ <tr>
1710
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1711
+ <td align='center'>13</td>
1712
+ <td align='center'>11</td>
1713
+ </tr>
1714
+ </tbody>
1715
+ </table>
1716
+ <p>
1717
+ <xref target='N'>Table 2</xref>
1718
+ </p>
1719
+ </clause>
1720
+ <terms id='terms'>
1721
+ <title>2.</title>
1722
+ </terms>
1723
+ <clause id='widgets'>
1724
+ <title depth='1'>
1725
+ 3.
1726
+ <tab/>
1727
+ Widgets
1728
+ </title>
1729
+ <clause id='widgets1'><title>3.1.</title>
1730
+ <table id='note1'>
1731
+ <name>Table 3&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1732
+ <tbody>
1733
+ <tr>
1734
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1735
+ <td align='center'>13</td>
1736
+ <td align='center'>11</td>
1737
+ </tr>
1738
+ </tbody>
1739
+ </table>
1740
+ <table id='note2'>
1741
+ <name>Table 4&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1742
+ <tbody>
1743
+ <tr>
1744
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1745
+ <td align='center'>13</td>
1746
+ <td align='center'>11</td>
1747
+ </tr>
1748
+ </tbody>
1749
+ </table>
1750
+ <p>
1751
+ <xref target='note1'>Table 3</xref>
1752
+ <xref target='note2'>Table 4</xref>
1753
+ </p>
1754
+ </clause>
1755
+ </clause>
1756
+ </sections>
1757
+ <annex id='annex1'>
1758
+ <title>
1759
+ <strong>Annex A</strong>
1537
1760
  <br/>
1538
1761
  (informative)
1539
- <br/>
1540
- <br/>
1541
- <b/>
1542
- </h1>
1543
- <div id="annex1a"><h2>A.1.&#160;</h2>
1544
- <p class="TableTitle" style="text-align:center;">Table A.1&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="AN" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1545
- </div>
1546
- <div id="annex1b"><h2>A.2.&#160;</h2>
1547
- <p class="TableTitle" style="text-align:center;">Repeatability and reproducibility of husked rice yield</p><table id="Anote1" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1548
- <p class="TableTitle" style="text-align:center;">Table A.2&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="Anote2" class="MsoISOTable" style="border-width:1px;border-spacing:0;"><tbody><tr><td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table>
1549
- </div>
1550
- </div>
1551
- </div>
1552
- </body>
1553
- </html>
1762
+ </title>
1763
+ <clause id='annex1a'><title>A.1.</title>
1764
+ <table id='AN'>
1765
+ <name>Table A.1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1766
+ <tbody>
1767
+ <tr>
1768
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1769
+ <td align='center'>13</td>
1770
+ <td align='center'>11</td>
1771
+ </tr>
1772
+ </tbody>
1773
+ </table>
1774
+ </clause>
1775
+ <clause id='annex1b'><title>A.2.</title>
1776
+ <table id='Anote1' unnumbered='true'>
1777
+ <name>Table &#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1778
+ <tbody>
1779
+ <tr>
1780
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1781
+ <td align='center'>13</td>
1782
+ <td align='center'>11</td>
1783
+ </tr>
1784
+ </tbody>
1785
+ </table>
1786
+ <table id='Anote2'>
1787
+ <name>Table A.2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1788
+ <tbody>
1789
+ <tr>
1790
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
1791
+ <td align='center'>13</td>
1792
+ <td align='center'>11</td>
1793
+ </tr>
1794
+ </tbody>
1795
+ </table>
1796
+ </clause>
1797
+ </annex>
1798
+ </iso-standard>
1554
1799
  OUTPUT
1555
1800
  end
1556
1801
 
1557
1802
  it "cross-references term notes" do
1558
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1803
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1559
1804
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1560
1805
  <preface>
1561
1806
  <foreword>
@@ -1567,7 +1812,7 @@ OUTPUT
1567
1812
  </foreword>
1568
1813
  </preface>
1569
1814
  <sections>
1570
- <clause id="scope"><title>Scope</title>
1815
+ <clause id="scope" type="scope"><title>Scope</title>
1571
1816
  </clause>
1572
1817
  <terms id="terms">
1573
1818
  <term id="_waxy_rice"><preferred>waxy rice</preferred>
@@ -1585,33 +1830,64 @@ OUTPUT
1585
1830
 
1586
1831
  </iso-standard>
1587
1832
  INPUT
1588
- #{HTML_HDR}
1589
- <br/>
1590
- <div>
1591
- <h1 class="ForewordTitle">Foreword</h1>
1592
- <p>
1593
- <a href="#note1">Clause 2.1, Note 1</a>
1594
- <a href="#note2">Clause 2.2, Note 1</a>
1595
- <a href="#note3">Clause 2.2, Note 2</a>
1596
- </p>
1597
- </div>
1598
- <p class="zzSTDTitle1"/>
1599
- <div id="scope">
1600
- <h1>1.&#160; Scope</h1>
1601
- </div>
1602
- <div id="terms"><h1>2.&#160; </h1>
1603
- <p class="TermNum" id="_waxy_rice">2.1.</p><p class="Terms" style="text-align:left;">waxy rice</p>
1604
- <div id="note1" class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2.</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
1605
- <div id="note2" class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
1606
- <div id="note3" class="Note"><p>Note 2 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div></div>
1607
- </div>
1608
- </body>
1609
- </html>
1833
+ <?xml version='1.0'?>
1834
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1835
+ <preface>
1836
+ <foreword>
1837
+ <p>
1838
+ <xref target='note1'>Clause 2.1, Note 1</xref>
1839
+ <xref target='note2'>Clause 2.2, Note 1</xref>
1840
+ <xref target='note3'>Clause 2.2, Note 2</xref>
1841
+ </p>
1842
+ </foreword>
1843
+ </preface>
1844
+ <sections>
1845
+ <clause id='scope' type="scope">
1846
+ <title depth='1'>
1847
+ 1.
1848
+ <tab/>
1849
+ Scope
1850
+ </title>
1851
+ </clause>
1852
+ <terms id='terms'>
1853
+ <title>2.</title>
1854
+ <term id='_waxy_rice'>
1855
+ <name>2.1.</name>
1856
+ <preferred>waxy rice</preferred>
1857
+ <termnote id='note1'>
1858
+ <name>Note 1 to entry</name>
1859
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1860
+ The starch of waxy rice consists almost entirely of amylopectin. The
1861
+ kernels have a tendency to stick together after cooking.
1862
+ </p>
1863
+ </termnote>
1864
+ </term>
1865
+ <term id='_nonwaxy_rice'>
1866
+ <name>2.2.</name>
1867
+ <preferred>nonwaxy rice</preferred>
1868
+ <termnote id='note2'>
1869
+ <name>Note 1 to entry</name>
1870
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1871
+ The starch of waxy rice consists almost entirely of amylopectin. The
1872
+ kernels have a tendency to stick together after cooking.
1873
+ </p>
1874
+ </termnote>
1875
+ <termnote id='note3'>
1876
+ <name>Note 2 to entry</name>
1877
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1878
+ The starch of waxy rice consists almost entirely of amylopectin. The
1879
+ kernels have a tendency to stick together after cooking.
1880
+ </p>
1881
+ </termnote>
1882
+ </term>
1883
+ </terms>
1884
+ </sections>
1885
+ </iso-standard>
1610
1886
  OUTPUT
1611
1887
  end
1612
1888
 
1613
1889
  it "cross-references sections" do
1614
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1890
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1615
1891
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1616
1892
  <preface>
1617
1893
  <foreword obligation="informative">
@@ -1643,7 +1919,7 @@ OUTPUT
1643
1919
  </clause>
1644
1920
  <clause id="C1" inline-header="false" obligation="informative">Text</clause>
1645
1921
  </introduction></preface><sections>
1646
- <clause id="D" obligation="normative">
1922
+ <clause id="D" obligation="normative" type="scope">
1647
1923
  <title>Scope</title>
1648
1924
  <p id="E">Text</p>
1649
1925
  </clause>
@@ -1699,115 +1975,161 @@ OUTPUT
1699
1975
  </bibliography>
1700
1976
  </iso-standard>
1701
1977
  INPUT
1702
- #{HTML_HDR}
1703
- <br/>
1704
- <div>
1705
- <h1 class="ForewordTitle">Foreword</h1>
1706
- <p id="A">This is a preamble
1707
- <a href="#C">Introduction Subsection</a>
1708
- <a href="#C1">Introduction, 2</a>
1709
- <a href="#D">Clause 1</a>
1710
- <a href="#H">Clause 3</a>
1711
- <a href="#I">Clause 3.1</a>
1712
- <a href="#J">Clause 3.1.1</a>
1713
- <a href="#K">Clause 3.2</a>
1714
- <a href="#L">Clause 4</a>
1715
- <a href="#M">Clause 5</a>
1716
- <a href="#N">Clause 5.1</a>
1717
- <a href="#O">Clause 5.2</a>
1718
- <a href="#P">Annex A</a>
1719
- <a href="#Q">Annex A.1</a>
1720
- <a href="#Q1">Annex A.1.1</a>
1721
- <a href='#QQ'>Annex B</a>
1722
- <a href='#QQ1'>Annex B</a>
1723
- <a href='#QQ2'>Annex B.1</a>
1724
- <a href="#R">Clause 2</a>
1725
- <a href="#S">Bibliography</a>
1726
- </p>
1727
- </div>
1728
- <br/>
1729
- <div class="Section3" id="B">
1730
- <h1 class="IntroTitle">Introduction</h1>
1731
- <div id="C">
1732
- <h2>Introduction Subsection</h2>
1733
- </div>
1734
- <div id="C1"><h2/>Text</div>
1735
- </div>
1736
- <p class="zzSTDTitle1"/>
1737
- <div id="D">
1738
- <h1>1.&#160; Scope</h1>
1739
- <p id="E">Text</p>
1740
- </div>
1741
- <div>
1742
- <h1>2.&#160; Normative references</h1>
1743
- </div>
1744
- <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
1745
- <div id="I">
1746
- <h2>3.1.&#160; Normal Terms</h2>
1747
- <p class="TermNum" id="J">3.1.1.</p>
1748
- <p class="Terms" style="text-align:left;">Term2</p>
1749
-
1750
- </div><div id="K"><h2>3.2.&#160; Symbols and abbreviated terms</h2>
1751
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
1752
- </div></div>
1753
- <div id="L" class="Symbols">
1754
- <h1>4.&#160; Symbols and abbreviated terms</h1>
1755
- <dl>
1756
- <dt>
1757
- <p>Symbol</p>
1758
- </dt>
1759
- <dd>Definition</dd>
1760
- </dl>
1761
- </div>
1762
- <div id="M">
1763
- <h1>5.&#160; Clause 4</h1>
1764
- <div id="N">
1765
- <h2>5.1.&#160; Introduction</h2>
1766
- </div>
1767
- <div id="O">
1768
- <h2>5.2.&#160; Clause 4.2</h2>
1769
- </div>
1770
- </div>
1771
- <br/>
1772
- <div id="P" class="Section3">
1773
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
1774
- <div id="Q">
1775
- <h2>A.1.&#160; Annex A.1</h2>
1776
- <div id="Q1">
1777
- <h3>A.1.1.&#160; Annex A.1a</h3>
1778
- </div>
1779
- </div>
1780
- </div>
1781
- <br/>
1782
- <div id='QQ' class='Section3'>
1783
- <h1 class='Annex'>
1784
- <b>Annex B</b>
1785
- <br/>
1786
- (informative)
1787
- <br/>
1788
- <br/>
1789
- <b/>
1790
- </h1>
1791
- <div id='QQ1'>
1792
- <h1>B.&#160; </h1>
1793
- <p class='TermNum' id='QQ2'>B.1.</p>
1794
- </div>
1795
- </div>
1796
- <br/>
1797
- <div>
1798
- <h1 class="Section3">Bibliography</h1>
1799
- <div>
1800
- <h2 class="Section3">Bibliography Subsection</h2>
1801
- </div>
1802
- </div>
1803
- </div>
1804
- </body>
1805
- </html>
1978
+ <?xml version='1.0'?>
1979
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1980
+ <preface>
1981
+ <foreword obligation='informative'>
1982
+ <title>Foreword</title>
1983
+ <p id='A'>
1984
+ This is a preamble
1985
+ <xref target='C'>Introduction Subsection</xref>
1986
+ <xref target='C1'>Introduction, 2</xref>
1987
+ <xref target='D'>Clause 1</xref>
1988
+ <xref target='H'>Clause 3</xref>
1989
+ <xref target='I'>Clause 3.1</xref>
1990
+ <xref target='J'>Clause 3.1.1</xref>
1991
+ <xref target='K'>Clause 3.2</xref>
1992
+ <xref target='L'>Clause 4</xref>
1993
+ <xref target='M'>Clause 5</xref>
1994
+ <xref target='N'>Clause 5.1</xref>
1995
+ <xref target='O'>Clause 5.2</xref>
1996
+ <xref target='P'>Annex A</xref>
1997
+ <xref target='Q'>Annex A.1</xref>
1998
+ <xref target='Q1'>Annex A.1.1</xref>
1999
+ <xref target='QQ'>Annex B</xref>
2000
+ <xref target='QQ1'>Annex B</xref>
2001
+ <xref target='QQ2'>Annex B.1</xref>
2002
+ <xref target='R'>Clause 2</xref>
2003
+ <xref target='S'>Bibliography</xref>
2004
+ </p>
2005
+ </foreword>
2006
+ <introduction id='B' obligation='informative'>
2007
+ <title>Introduction</title>
2008
+ <clause id='C' inline-header='false' obligation='informative'>
2009
+ <title depth="2">Introduction Subsection</title>
2010
+ </clause>
2011
+ <clause id='C1' inline-header='false' obligation='informative'>Text</clause>
2012
+ </introduction>
2013
+ </preface>
2014
+ <sections>
2015
+ <clause id='D' obligation='normative' type="scope">
2016
+ <title depth='1'>
2017
+ 1.
2018
+ <tab/>
2019
+ Scope
2020
+ </title>
2021
+ <p id='E'>Text</p>
2022
+ </clause>
2023
+ <terms id='H' obligation='normative'>
2024
+ <title depth='1'>
2025
+ 3.
2026
+ <tab/>
2027
+ Terms, definitions, symbols and abbreviated terms
2028
+ </title>
2029
+ <terms id='I' obligation='normative'>
2030
+ <title depth='2'>
2031
+ 3.1.
2032
+ <tab/>
2033
+ Normal Terms
2034
+ </title>
2035
+ <term id='J'><name>3.1.1.</name>
2036
+ <preferred>Term2</preferred>
2037
+ </term>
2038
+ </terms>
2039
+ <definitions id='K'>
2040
+ <title>3.2.</title>
2041
+ <dl>
2042
+ <dt>Symbol</dt>
2043
+ <dd>Definition</dd>
2044
+ </dl>
2045
+ </definitions>
2046
+ </terms>
2047
+ <definitions id='L'>
2048
+ <title>4.</title>
2049
+ <dl>
2050
+ <dt>Symbol</dt>
2051
+ <dd>Definition</dd>
2052
+ </dl>
2053
+ </definitions>
2054
+ <clause id='M' inline-header='false' obligation='normative'>
2055
+ <title depth='1'>
2056
+ 5.
2057
+ <tab/>
2058
+ Clause 4
2059
+ </title>
2060
+ <clause id='N' inline-header='false' obligation='normative'>
2061
+ <title depth='2'>
2062
+ 5.1.
2063
+ <tab/>
2064
+ Introduction
2065
+ </title>
2066
+ </clause>
2067
+ <clause id='O' inline-header='false' obligation='normative'>
2068
+ <title depth='2'>
2069
+ 5.2.
2070
+ <tab/>
2071
+ Clause 4.2
2072
+ </title>
2073
+ </clause>
2074
+ </clause>
2075
+ </sections>
2076
+ <annex id='P' inline-header='false' obligation='normative'>
2077
+ <title>
2078
+ <strong>Annex A</strong>
2079
+ <br/>
2080
+ (normative)
2081
+ <br/>
2082
+ <br/>
2083
+ <strong>Annex</strong></title>
2084
+ <clause id='Q' inline-header='false' obligation='normative'>
2085
+ <title depth='2'>
2086
+ A.1.
2087
+ <tab/>
2088
+ Annex A.1
2089
+ </title>
2090
+ <clause id='Q1' inline-header='false' obligation='normative'>
2091
+ <title depth='3'>
2092
+ A.1.1.
2093
+ <tab/>
2094
+ Annex A.1a
2095
+ </title>
2096
+ </clause>
2097
+ </clause>
2098
+ </annex>
2099
+ <annex id='QQ'>
2100
+ <title>
2101
+ <strong>Annex B</strong>
2102
+ <br/>
2103
+ (informative)
2104
+ </title>
2105
+ <terms id='QQ1'>
2106
+ <title>B.</title>
2107
+ <term id='QQ2'>
2108
+ <name>B.1.</name>
2109
+ </term>
2110
+ </terms>
2111
+ </annex>
2112
+ <bibliography>
2113
+ <references id='R' obligation='informative' normative='true'>
2114
+ <title depth='1'>
2115
+ 2.
2116
+ <tab/>
2117
+ Normative References
2118
+ </title>
2119
+ </references>
2120
+ <clause id='S' obligation='informative'>
2121
+ <title depth="1">Bibliography</title>
2122
+ <references id='T' obligation='informative' normative='false'>
2123
+ <title depth="2">Bibliography Subsection</title>
2124
+ </references>
2125
+ </clause>
2126
+ </bibliography>
2127
+ </iso-standard>
1806
2128
  OUTPUT
1807
2129
  end
1808
2130
 
1809
2131
  it "cross-references lists" do
1810
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2132
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1811
2133
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1812
2134
  <preface>
1813
2135
  <foreword>
@@ -1834,7 +2156,7 @@ OUTPUT
1834
2156
  </introduction>
1835
2157
  </preface>
1836
2158
  <sections>
1837
- <clause id="scope"><title>Scope</title>
2159
+ <clause id="scope" type="scope"><title>Scope</title>
1838
2160
  <ol id="N">
1839
2161
  <li><p>A</p></li>
1840
2162
  </ol>
@@ -1868,85 +2190,110 @@ OUTPUT
1868
2190
  </annex>
1869
2191
  </iso-standard>
1870
2192
  INPUT
1871
- #{HTML_HDR}
1872
- <br/>
1873
- <div>
1874
- <h1 class="ForewordTitle">Foreword</h1>
1875
- <p>
1876
- <a href="#N1">Introduction, List</a>
1877
- <a href="#N2">Preparatory, List</a>
1878
- <a href="#N">Clause 1, List</a>
1879
- <a href="#note1">Clause 3.1, List 1</a>
1880
- <a href="#note2">Clause 3.1, List 2</a>
1881
- <a href="#AN">Annex A.1, List</a>
1882
- <a href="#Anote1">Annex A.2, List 1</a>
1883
- <a href="#Anote2">Annex A.2, List 2</a>
1884
- </p>
1885
- </div>
1886
- <br/>
1887
- <div class="Section3" id="intro">
1888
- <h1 class="IntroTitle">Introduction</h1>
1889
- <ol type="a" id="N1">
1890
- <li><p>A</p></li>
1891
- </ol>
1892
- <div id="xyz"><h2>Preparatory</h2>
1893
- <ol type="a" id="N2">
1894
- <li><p>A</p></li>
1895
- </ol>
1896
- </div>
1897
- </div>
1898
- <p class="zzSTDTitle1"/>
1899
- <div id="scope">
1900
- <h1>1.&#160; Scope</h1>
1901
- <ol type="a" id="N">
1902
- <li><p>A</p></li>
1903
- </ol>
1904
- </div>
1905
- <div id="terms"><h1>2.&#160; </h1>
1906
- </div>
1907
- <div id="widgets">
1908
- <h1>3.&#160; Widgets</h1>
1909
- <div id="widgets1"><h2>3.1.&#160;</h2>
1910
- <ol type="a" id="note1">
1911
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1912
- </ol>
1913
- <ol type="a" id="note2">
1914
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1915
- </ol>
1916
- </div>
1917
- </div>
1918
- <br/>
1919
- <div id="annex1" class="Section3">
1920
- <h1 class='Annex'>
1921
- <b>Annex A</b>
2193
+ <?xml version='1.0'?>
2194
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2195
+ <preface>
2196
+ <foreword>
2197
+ <p>
2198
+ <xref target='N1'>Introduction, List</xref>
2199
+ <xref target='N2'>Preparatory, List</xref>
2200
+ <xref target='N'>Clause 1, List</xref>
2201
+ <xref target='note1'>Clause 3.1, List 1</xref>
2202
+ <xref target='note2'>Clause 3.1, List 2</xref>
2203
+ <xref target='AN'>Annex A.1, List</xref>
2204
+ <xref target='Anote1'>Annex A.2, List 1</xref>
2205
+ <xref target='Anote2'>Annex A.2, List 2</xref>
2206
+ </p>
2207
+ </foreword>
2208
+ <introduction id='intro'>
2209
+ <ol id='N1'>
2210
+ <li>
2211
+ <p>A</p>
2212
+ </li>
2213
+ </ol>
2214
+ <clause id='xyz'>
2215
+ <title depth='2'>Preparatory</title>
2216
+ <ol id='N2'>
2217
+ <li>
2218
+ <p>A</p>
2219
+ </li>
2220
+ </ol>
2221
+ </clause>
2222
+ </introduction>
2223
+ </preface>
2224
+ <sections>
2225
+ <clause id='scope' type="scope">
2226
+ <title depth='1'>
2227
+ 1.
2228
+ <tab/>
2229
+ Scope
2230
+ </title>
2231
+ <ol id='N'>
2232
+ <li>
2233
+ <p>A</p>
2234
+ </li>
2235
+ </ol>
2236
+ </clause>
2237
+ <terms id='terms'>
2238
+ <title>2.</title>
2239
+ </terms>
2240
+ <clause id='widgets'>
2241
+ <title depth='1'>
2242
+ 3.
2243
+ <tab/>
2244
+ Widgets
2245
+ </title>
2246
+ <clause id='widgets1'><title>3.1.</title>
2247
+ <ol id='note1'>
2248
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2249
+ These results are based on a study carried out on three different
2250
+ types of kernel.
2251
+ </p>
2252
+ </ol>
2253
+ <ol id='note2'>
2254
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
2255
+ These results are based on a study carried out on three different
2256
+ types of kernel.
2257
+ </p>
2258
+ </ol>
2259
+ </clause>
2260
+ </clause>
2261
+ </sections>
2262
+ <annex id='annex1'>
2263
+ <title>
2264
+ <strong>Annex A</strong>
1922
2265
  <br/>
1923
2266
  (informative)
1924
- <br/>
1925
- <br/>
1926
- <b/>
1927
- </h1>
1928
- <div id="annex1a"><h2>A.1.&#160;</h2>
1929
- <ol type="a" id="AN">
1930
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1931
- </ol>
1932
- </div>
1933
- <div id="annex1b"><h2>A.2.&#160;</h2>
1934
- <ol type="a" id="Anote1">
1935
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1936
- </ol>
1937
- <ol type="a" id="Anote2">
1938
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1939
- </ol>
1940
- </div>
1941
- </div>
1942
- </div>
1943
- </body>
1944
- </html>
2267
+ </title>
2268
+ <clause id='annex1a'><title>A.1.</title>
2269
+ <ol id='AN'>
2270
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2271
+ These results are based on a study carried out on three different
2272
+ types of kernel.
2273
+ </p>
2274
+ </ol>
2275
+ </clause>
2276
+ <clause id='annex1b'><title>A.2.</title>
2277
+ <ol id='Anote1'>
2278
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2279
+ These results are based on a study carried out on three different
2280
+ types of kernel.
2281
+ </p>
2282
+ </ol>
2283
+ <ol id='Anote2'>
2284
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
2285
+ These results are based on a study carried out on three different
2286
+ types of kernel.
2287
+ </p>
2288
+ </ol>
2289
+ </clause>
2290
+ </annex>
2291
+ </iso-standard>
1945
2292
  OUTPUT
1946
2293
  end
1947
2294
 
1948
2295
  it "cross-references list items" do
1949
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2296
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1950
2297
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1951
2298
  <preface>
1952
2299
  <foreword>
@@ -1973,7 +2320,7 @@ OUTPUT
1973
2320
  </introduction>
1974
2321
  </preface>
1975
2322
  <sections>
1976
- <clause id="scope"><title>Scope</title>
2323
+ <clause id="scope" type="scope"><title>Scope</title>
1977
2324
  <ol id="N0">
1978
2325
  <li id="N"><p>A</p></li>
1979
2326
  </ol>
@@ -2007,85 +2354,105 @@ OUTPUT
2007
2354
  </annex>
2008
2355
  </iso-standard>
2009
2356
  INPUT
2010
- #{HTML_HDR}
2011
- <br/>
2012
- <div>
2013
- <h1 class="ForewordTitle">Foreword</h1>
2014
- <p>
2015
- <a href="#N1">Introduction, a)</a>
2016
- <a href="#N2">Preparatory, a)</a>
2017
- <a href="#N">Clause 1, a)</a>
2018
- <a href="#note1">Clause 3.1, List 1 a)</a>
2019
- <a href="#note2">Clause 3.1, List 2 a)</a>
2020
- <a href="#AN">Annex A.1, a)</a>
2021
- <a href="#Anote1">Annex A.2, List 1 a)</a>
2022
- <a href="#Anote2">Annex A.2, List 2 a)</a>
2023
- </p>
2024
- </div>
2025
- <br/>
2026
- <div class="Section3" id="intro">
2027
- <h1 class="IntroTitle">Introduction</h1>
2028
- <ol type="a" id="N01">
2029
- <li id="N1"><p>A</p></li>
2030
- </ol>
2031
- <div id="xyz"><h2>Preparatory</h2>
2032
- <ol type="a" id="N02">
2033
- <li id="N2"><p>A</p></li>
2034
- </ol>
2035
- </div>
2036
- </div>
2037
- <p class="zzSTDTitle1"/>
2038
- <div id="scope">
2039
- <h1>1.&#160; Scope</h1>
2040
- <ol type="a" id="N0">
2041
- <li id="N"><p>A</p></li>
2042
- </ol>
2043
- </div>
2044
- <div id="terms"><h1>2.&#160; </h1>
2045
- </div>
2046
- <div id="widgets">
2047
- <h1>3.&#160; Widgets</h1>
2048
- <div id="widgets1"><h2>3.1.&#160;</h2>
2049
- <ol type="a" id="note1l">
2050
- <li id="note1"><p>A</p></li>
2051
- </ol>
2052
- <ol type="a" id="note2l">
2053
- <li id="note2"><p>A</p></li>
2054
- </ol>
2055
- </div>
2056
- </div>
2057
- <br/>
2058
- <div id="annex1" class="Section3">
2059
- <h1 class='Annex'>
2060
- <b>Annex A</b>
2357
+ <?xml version='1.0'?>
2358
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2359
+ <preface>
2360
+ <foreword>
2361
+ <p>
2362
+ <xref target='N1'>Introduction, a)</xref>
2363
+ <xref target='N2'>Preparatory, a)</xref>
2364
+ <xref target='N'>Clause 1, a)</xref>
2365
+ <xref target='note1'>Clause 3.1, List 1 a)</xref>
2366
+ <xref target='note2'>Clause 3.1, List 2 a)</xref>
2367
+ <xref target='AN'>Annex A.1, a)</xref>
2368
+ <xref target='Anote1'>Annex A.2, List 1 a)</xref>
2369
+ <xref target='Anote2'>Annex A.2, List 2 a)</xref>
2370
+ </p>
2371
+ </foreword>
2372
+ <introduction id='intro'>
2373
+ <ol id='N01'>
2374
+ <li id='N1'>
2375
+ <p>A</p>
2376
+ </li>
2377
+ </ol>
2378
+ <clause id='xyz'>
2379
+ <title depth='2'>Preparatory</title>
2380
+ <ol id='N02'>
2381
+ <li id='N2'>
2382
+ <p>A</p>
2383
+ </li>
2384
+ </ol>
2385
+ </clause>
2386
+ </introduction>
2387
+ </preface>
2388
+ <sections>
2389
+ <clause id='scope' type="scope">
2390
+ <title depth='1'>
2391
+ 1.
2392
+ <tab/>
2393
+ Scope
2394
+ </title>
2395
+ <ol id='N0'>
2396
+ <li id='N'>
2397
+ <p>A</p>
2398
+ </li>
2399
+ </ol>
2400
+ </clause>
2401
+ <terms id='terms'>
2402
+ <title>2.</title>
2403
+ </terms>
2404
+ <clause id='widgets'>
2405
+ <title depth='1'>
2406
+ 3.
2407
+ <tab/>
2408
+ Widgets
2409
+ </title>
2410
+ <clause id='widgets1'><title>3.1.</title>
2411
+ <ol id='note1l'>
2412
+ <li id='note1'>
2413
+ <p>A</p>
2414
+ </li>
2415
+ </ol>
2416
+ <ol id='note2l'>
2417
+ <li id='note2'>
2418
+ <p>A</p>
2419
+ </li>
2420
+ </ol>
2421
+ </clause>
2422
+ </clause>
2423
+ </sections>
2424
+ <annex id='annex1'>
2425
+ <title>
2426
+ <strong>Annex A</strong>
2061
2427
  <br/>
2062
2428
  (informative)
2063
- <br/>
2064
- <br/>
2065
- <b/>
2066
- </h1>
2067
- <div id="annex1a"><h2>A.1.&#160;</h2>
2068
- <ol type="a" id="ANl">
2069
- <li id="AN"><p>A</p></li>
2070
- </ol>
2071
- </div>
2072
- <div id="annex1b"><h2>A.2.&#160;</h2>
2073
- <ol type="a" id="Anote1l">
2074
- <li id="Anote1"><p>A</p></li>
2075
- </ol>
2076
- <ol type="a" id="Anote2l">
2077
- <li id="Anote2"><p>A</p></li>
2078
- </ol>
2079
- </div>
2080
- </div>
2081
- </div>
2082
- </body>
2083
- </html>
2429
+ </title>
2430
+ <clause id='annex1a'><title>A.1.</title>
2431
+ <ol id='ANl'>
2432
+ <li id='AN'>
2433
+ <p>A</p>
2434
+ </li>
2435
+ </ol>
2436
+ </clause>
2437
+ <clause id='annex1b'><title>A.2.</title>
2438
+ <ol id='Anote1l'>
2439
+ <li id='Anote1'>
2440
+ <p>A</p>
2441
+ </li>
2442
+ </ol>
2443
+ <ol id='Anote2l'>
2444
+ <li id='Anote2'>
2445
+ <p>A</p>
2446
+ </li>
2447
+ </ol>
2448
+ </clause>
2449
+ </annex>
2450
+ </iso-standard>
2084
2451
  OUTPUT
2085
2452
  end
2086
2453
 
2087
2454
  it "cross-references nested list items" do
2088
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2455
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2089
2456
  <iso-standard xmlns="http://riboseinc.com/isoxml">
2090
2457
  <preface>
2091
2458
  <foreword>
@@ -2100,7 +2467,7 @@ OUTPUT
2100
2467
  </foreword>
2101
2468
  </preface>
2102
2469
  <sections>
2103
- <clause id="scope"><title>Scope</title>
2470
+ <clause id="scope" type="scope"><title>Scope</title>
2104
2471
  <ol id="N1">
2105
2472
  <li id="N"><p>A</p>
2106
2473
  <ol>
@@ -2123,49 +2490,65 @@ OUTPUT
2123
2490
  </sections>
2124
2491
  </iso-standard>
2125
2492
  INPUT
2126
- #{HTML_HDR}
2127
- <br/>
2128
- <div>
2129
- <h1 class="ForewordTitle">Foreword</h1>
2130
- <p>
2131
- <a href="#N">Clause 1, a)</a>
2132
- <a href="#note1">Clause 1, a.1)</a>
2133
- <a href="#note2">Clause 1, a.1.i)</a>
2134
- <a href="#AN">Clause 1, a.1.i.A)</a>
2135
- <a href="#Anote1">Clause 1, a.1.i.A.I)</a>
2136
- <a href="#Anote2">Clause 1, a.1.i.A.I.a)</a>
2137
- </p>
2138
- </div>
2139
- <p class="zzSTDTitle1"/>
2140
- <div id="scope">
2141
- <h1>1.&#160; Scope</h1>
2142
- <ol type="a" id="N1">
2143
- <li id="N"><p>A</p>
2144
- <ol type="1">
2145
- <li id="note1"><p>A</p>
2146
- <ol type="i">
2147
- <li id="note2"><p>A</p>
2148
- <ol type="A">
2149
- <li id="AN"><p>A</p>
2150
- <ol type="I">
2151
- <li id="Anote1"><p>A</p>
2152
- <ol type="a">
2153
- <li id="Anote2"><p>A</p></li>
2154
- </ol></li>
2155
- </ol></li>
2156
- </ol></li>
2157
- </ol></li>
2158
- </ol></li>
2159
- </ol>
2160
- </div>
2161
- </div>
2162
- </body>
2163
- </html>
2493
+ <?xml version='1.0'?>
2494
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2495
+ <preface>
2496
+ <foreword>
2497
+ <p>
2498
+ <xref target='N'>Clause 1, a)</xref>
2499
+ <xref target='note1'>Clause 1, a.1)</xref>
2500
+ <xref target='note2'>Clause 1, a.1.i)</xref>
2501
+ <xref target='AN'>Clause 1, a.1.i.A)</xref>
2502
+ <xref target='Anote1'>Clause 1, a.1.i.A.I)</xref>
2503
+ <xref target='Anote2'>Clause 1, a.1.i.A.I.a)</xref>
2504
+ </p>
2505
+ </foreword>
2506
+ </preface>
2507
+ <sections>
2508
+ <clause id='scope' type="scope">
2509
+ <title depth='1'>
2510
+ 1.
2511
+ <tab/>
2512
+ Scope
2513
+ </title>
2514
+ <ol id='N1'>
2515
+ <li id='N'>
2516
+ <p>A</p>
2517
+ <ol>
2518
+ <li id='note1'>
2519
+ <p>A</p>
2520
+ <ol>
2521
+ <li id='note2'>
2522
+ <p>A</p>
2523
+ <ol>
2524
+ <li id='AN'>
2525
+ <p>A</p>
2526
+ <ol>
2527
+ <li id='Anote1'>
2528
+ <p>A</p>
2529
+ <ol>
2530
+ <li id='Anote2'>
2531
+ <p>A</p>
2532
+ </li>
2533
+ </ol>
2534
+ </li>
2535
+ </ol>
2536
+ </li>
2537
+ </ol>
2538
+ </li>
2539
+ </ol>
2540
+ </li>
2541
+ </ol>
2542
+ </li>
2543
+ </ol>
2544
+ </clause>
2545
+ </sections>
2546
+ </iso-standard>
2164
2547
  OUTPUT
2165
2548
  end
2166
2549
 
2167
2550
  it "realises subsequences" do
2168
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2551
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2169
2552
  <iso-standard xmlns="http://riboseinc.com/isoxml">
2170
2553
  <preface>
2171
2554
  <foreword id="fwd">
@@ -2208,58 +2591,62 @@ OUTPUT
2208
2591
  </introduction>
2209
2592
  </iso-standard>
2210
2593
  INPUT
2211
- #{HTML_HDR}
2212
- <br/>
2213
- <div id="fwd">
2214
- <h1 class="ForewordTitle">Foreword</h1>
2215
- <p>
2216
- <a href="#N1">Figure 1</a>
2217
- <a href="#N2">Figure 2a</a>
2218
- <a href="#N3">Figure 2b</a>
2219
- <a href="#N4">Figure 3a</a>
2220
- <a href="#N5">Figure 3b</a>
2221
- <a href="#N6">Figure 3c</a>
2222
- <a href="#N7">Figure 4</a>
2223
- <a href="#N8">Figure 5</a>
2224
- </p>
2225
- </div>
2226
- <br/>
2227
- <div class="Section3" id="intro">
2228
- <h1 class="IntroTitle">Introduction</h1>
2229
- <div id="N1" class="figure">
2230
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2231
- <p class="FigureTitle" style="text-align:center;">Figure 1&#160;&#8212; Split-it-right sample divider</p></div>
2232
- <div id="N2" class="figure">
2233
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2234
- <p class="FigureTitle" style="text-align:center;">Figure 2a&#160;&#8212; Split-it-right sample divider</p></div>
2235
- <div id="N3" class="figure">
2236
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2237
- <p class="FigureTitle" style="text-align:center;">Figure 2b&#160;&#8212; Split-it-right sample divider</p></div>
2238
- <div id="N4" class="figure">
2239
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2240
- <p class="FigureTitle" style="text-align:center;">Figure 3a&#160;&#8212; Split-it-right sample divider</p></div>
2241
- <div id="N5" class="figure">
2242
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2243
- <p class="FigureTitle" style="text-align:center;">Figure 3b&#160;&#8212; Split-it-right sample divider</p></div>
2244
- <div id="N6" class="figure">
2245
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2246
- <p class="FigureTitle" style="text-align:center;">Figure 3c&#160;&#8212; Split-it-right sample divider</p></div>
2247
- <div id="N7" class="figure">
2248
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2249
- <p class="FigureTitle" style="text-align:center;">Figure 4&#160;&#8212; Split-it-right sample divider</p></div>
2250
- <div id="N8" class="figure">
2251
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
2252
- <p class="FigureTitle" style="text-align:center;">Figure 5&#160;&#8212; Split-it-right sample divider</p></div>
2253
- </div>
2254
- <p class="zzSTDTitle1"/>
2255
- </div>
2256
- </body>
2257
- </html>
2594
+ <?xml version='1.0'?>
2595
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2596
+ <preface>
2597
+ <foreword id='fwd'>
2598
+ <p>
2599
+ <xref target='N1'>Figure 1</xref>
2600
+ <xref target='N2'>Figure 2a</xref>
2601
+ <xref target='N3'>Figure 2b</xref>
2602
+ <xref target='N4'>Figure 3a</xref>
2603
+ <xref target='N5'>Figure 3b</xref>
2604
+ <xref target='N6'>Figure 3c</xref>
2605
+ <xref target='N7'>Figure 4</xref>
2606
+ <xref target='N8'>Figure 5</xref>
2607
+ </p>
2608
+ </foreword>
2609
+ <introduction id='intro'>
2610
+ <figure id='N1'>
2611
+ <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
2612
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2613
+ </figure>
2614
+ <figure id='N2' subsequence='A'>
2615
+ <name>Figure 2a&#xA0;&#x2014; Split-it-right sample divider</name>
2616
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2617
+ </figure>
2618
+ <figure id='N3' subsequence='A'>
2619
+ <name>Figure 2b&#xA0;&#x2014; Split-it-right sample divider</name>
2620
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2621
+ </figure>
2622
+ <figure id='N4' subsequence='B'>
2623
+ <name>Figure 3a&#xA0;&#x2014; Split-it-right sample divider</name>
2624
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2625
+ </figure>
2626
+ <figure id='N5' subsequence='B'>
2627
+ <name>Figure 3b&#xA0;&#x2014; Split-it-right sample divider</name>
2628
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2629
+ </figure>
2630
+ <figure id='N6' subsequence='B'>
2631
+ <name>Figure 3c&#xA0;&#x2014; Split-it-right sample divider</name>
2632
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2633
+ </figure>
2634
+ <figure id='N7'>
2635
+ <name>Figure 4&#xA0;&#x2014; Split-it-right sample divider</name>
2636
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2637
+ </figure>
2638
+ <figure id='N8'>
2639
+ <name>Figure 5&#xA0;&#x2014; Split-it-right sample divider</name>
2640
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2641
+ </figure>
2642
+ </introduction>
2643
+ </preface>
2644
+ </iso-standard>
2258
2645
  OUTPUT
2259
2646
  end
2260
2647
 
2261
2648
  it "realises numbering overrides" do
2262
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2649
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2263
2650
  <iso-standard xmlns="http://riboseinc.com/isoxml">
2264
2651
  <preface>
2265
2652
  <foreword id="fwd">
@@ -2310,71 +2697,67 @@ INPUT
2310
2697
  </introduction>
2311
2698
  </iso-standard>
2312
2699
  INPUT
2313
- #{HTML_HDR}
2314
- <br/>
2315
- <div id='fwd'>
2316
- <h1 class='ForewordTitle'>Foreword</h1>
2317
- <p>
2318
- <a href='#N1'>Figure 1</a>
2319
- <a href='#N2'>Figure A</a>
2320
- <a href='#N3'>Figure 2</a>
2321
- <a href='#N4'>Figure 7</a>
2322
- <a href='#N5'>Figure 8</a>
2323
- <a href='#N6'>Figure 9a</a>
2324
- <a href='#N7'>Figure 9c</a>
2325
- <a href='#N8'>Figure 9d</a>
2326
- <a href='#N9'>Figure 20f</a>
2327
- <a href='#N10'>Figure 20g</a>
2328
- </p>
2329
- </div>
2330
- <br/>
2331
- <div class='Section3' id='intro'>
2332
- <h1 class='IntroTitle'>Introduction</h1>
2333
- <div id='N1' class='figure'>
2334
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2335
- <p class='FigureTitle' style='text-align:center;'>Figure 1&#160;&#8212; Split-it-right sample divider</p>
2336
- </div>
2337
- <div id='N2' class='figure'>
2338
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2339
- <p class='FigureTitle' style='text-align:center;'>Figure A&#160;&#8212; Split-it-right sample divider</p>
2340
- </div>
2341
- <div id='N3' class='figure'>
2342
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2343
- <p class='FigureTitle' style='text-align:center;'>Figure 2&#160;&#8212; Split-it-right sample divider</p>
2344
- </div>
2345
- <div id='N4' class='figure'>
2346
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2347
- <p class='FigureTitle' style='text-align:center;'>Figure 7&#160;&#8212; Split-it-right sample divider</p>
2348
- </div>
2349
- <div id='N5' class='figure'>
2350
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2351
- <p class='FigureTitle' style='text-align:center;'>Figure 8&#160;&#8212; Split-it-right sample divider</p>
2352
- </div>
2353
- <div id='N6' class='figure'>
2354
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2355
- <p class='FigureTitle' style='text-align:center;'>Figure 9a&#160;&#8212; Split-it-right sample divider</p>
2356
- </div>
2357
- <div id='N7' class='figure'>
2358
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2359
- <p class='FigureTitle' style='text-align:center;'>Figure 9c&#160;&#8212; Split-it-right sample divider</p>
2360
- </div>
2361
- <div id='N8' class='figure'>
2362
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2363
- <p class='FigureTitle' style='text-align:center;'>Figure 9d&#160;&#8212; Split-it-right sample divider</p>
2364
- </div>
2365
- <div id='N9' class='figure'>
2366
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2367
- <p class='FigureTitle' style='text-align:center;'>Figure 20f&#160;&#8212; Split-it-right sample divider</p>
2368
- </div>
2369
- <div id='N10' class='figure'>
2370
- <img src='rice_images/rice_image1.png' height='auto' width='auto'/>
2371
- <p class='FigureTitle' style='text-align:center;'>Figure 20g&#160;&#8212; Split-it-right sample divider</p>
2372
- </div>
2373
- </div>
2374
- <p class='zzSTDTitle1'/>
2375
- </div>
2376
- </body>
2377
- </html>
2700
+ <?xml version='1.0'?>
2701
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
2702
+ <preface>
2703
+ <foreword id='fwd'>
2704
+ <p>
2705
+ <xref target='N1'>Figure 1</xref>
2706
+ <xref target='N2'>Figure A</xref>
2707
+ <xref target='N3'>Figure 2</xref>
2708
+ <xref target='N4'>Figure 7</xref>
2709
+ <xref target='N5'>Figure 8</xref>
2710
+ <xref target='N6'>Figure 9a</xref>
2711
+ <xref target='N7'>Figure 9c</xref>
2712
+ <xref target='N8'>Figure 9d</xref>
2713
+ <xref target='N9'>Figure 20f</xref>
2714
+ <xref target='N10'>Figure 20g</xref>
2715
+ </p>
2716
+ </foreword>
2717
+ <introduction id='intro'>
2718
+ <figure id='N1'>
2719
+ <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
2720
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2721
+ </figure>
2722
+ <figure id='N2' number='A'>
2723
+ <name>Figure A&#xA0;&#x2014; Split-it-right sample divider</name>
2724
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2725
+ </figure>
2726
+ <figure id='N3'>
2727
+ <name>Figure 2&#xA0;&#x2014; Split-it-right sample divider</name>
2728
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2729
+ </figure>
2730
+ <figure id='N4' number='7'>
2731
+ <name>Figure 7&#xA0;&#x2014; Split-it-right sample divider</name>
2732
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2733
+ </figure>
2734
+ <figure id='N5'>
2735
+ <name>Figure 8&#xA0;&#x2014; Split-it-right sample divider</name>
2736
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2737
+ </figure>
2738
+ <figure id='N6' subsequence='B'>
2739
+ <name>Figure 9a&#xA0;&#x2014; Split-it-right sample divider</name>
2740
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2741
+ </figure>
2742
+ <figure id='N7' subsequence='B' number='c'>
2743
+ <name>Figure 9c&#xA0;&#x2014; Split-it-right sample divider</name>
2744
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2745
+ </figure>
2746
+ <figure id='N8' subsequence='B'>
2747
+ <name>Figure 9d&#xA0;&#x2014; Split-it-right sample divider</name>
2748
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2749
+ </figure>
2750
+ <figure id='N9' subsequence='C' number='20f'>
2751
+ <name>Figure 20f&#xA0;&#x2014; Split-it-right sample divider</name>
2752
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2753
+ </figure>
2754
+ <figure id='N10' subsequence='C'>
2755
+ <name>Figure 20g&#xA0;&#x2014; Split-it-right sample divider</name>
2756
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2757
+ </figure>
2758
+ </introduction>
2759
+ </preface>
2760
+ </iso-standard>
2378
2761
  OUTPUT
2379
2762
  end
2380
2763