metanorma-iso 1.4.3 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +8 -19
  3. data/lib/asciidoctor/iso/cleanup.rb +2 -3
  4. data/lib/asciidoctor/iso/front.rb +0 -1
  5. data/lib/asciidoctor/iso/front_id.rb +1 -1
  6. data/lib/asciidoctor/iso/isodoc.rng +12 -6
  7. data/lib/asciidoctor/iso/section.rb +5 -11
  8. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -1
  9. data/lib/asciidoctor/iso/validate_section.rb +30 -44
  10. data/lib/isodoc/iso/base_convert.rb +3 -64
  11. data/lib/isodoc/iso/html_convert.rb +2 -1
  12. data/lib/{asciidoctor → isodoc}/iso/i18n-en.yaml +0 -0
  13. data/lib/{asciidoctor → isodoc}/iso/i18n-fr.yaml +0 -0
  14. data/lib/{asciidoctor → isodoc}/iso/i18n-zh-Hans.yaml +0 -0
  15. data/lib/isodoc/iso/i18n.rb +19 -0
  16. data/lib/isodoc/iso/init.rb +33 -0
  17. data/lib/isodoc/iso/metadata.rb +1 -1
  18. data/lib/isodoc/iso/presentation_xml_convert.rb +99 -1
  19. data/lib/isodoc/iso/sections.rb +3 -8
  20. data/lib/isodoc/iso/word_convert.rb +2 -1
  21. data/lib/isodoc/iso/xref.rb +2 -0
  22. data/lib/metanorma/iso/version.rb +1 -1
  23. data/metanorma-iso.gemspec +2 -2
  24. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  25. data/spec/asciidoctor-iso/inline_spec.rb +1 -1
  26. data/spec/asciidoctor-iso/refs_spec.rb +3 -3
  27. data/spec/asciidoctor-iso/section_spec.rb +9 -6
  28. data/spec/asciidoctor-iso/validate_spec.rb +13 -21
  29. data/spec/isodoc/amd_spec.rb +309 -153
  30. data/spec/isodoc/blocks_spec.rb +362 -28
  31. data/spec/isodoc/i18n_spec.rb +468 -108
  32. data/spec/isodoc/inline_spec.rb +99 -31
  33. data/spec/isodoc/iso_spec.rb +95 -29
  34. data/spec/isodoc/postproc_spec.rb +114 -149
  35. data/spec/isodoc/ref_spec.rb +175 -3
  36. data/spec/isodoc/section_spec.rb +148 -82
  37. data/spec/isodoc/table_spec.rb +142 -5
  38. data/spec/isodoc/terms_spec.rb +78 -53
  39. data/spec/isodoc/xref_spec.rb +831 -658
  40. data/spec/metanorma/processor_spec.rb +2 -1
  41. metadata +11 -9
@@ -1,9 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes IsoXML tables" do
5
- FileUtils.rm_f("test.html")
6
- IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", false)
4
+ it "processes IsoXML tables (Presentation XML)" do
5
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
7
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
8
7
  <preface>
9
8
  <foreword>
@@ -57,6 +56,144 @@ RSpec.describe IsoDoc do
57
56
  <note><p>This is a table about rice</p></note>
58
57
  </table>
59
58
 
59
+ </foreword>
60
+ </preface>
61
+ </iso-standard>
62
+ INPUT
63
+ <?xml version='1.0'?>
64
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
65
+ <preface>
66
+ <foreword>
67
+ <table id='tableD-1' alt='tool tip' summary='long desc'>
68
+ <name>
69
+ Table 1&#xA0;&#x2014; Repeatability and reproducibility of
70
+ <em>husked</em>
71
+ rice yield
72
+ </name>
73
+ <thead>
74
+ <tr>
75
+ <td rowspan='2' align='left'>Description</td>
76
+ <td colspan='4' align='center'>Rice sample</td>
77
+ </tr>
78
+ <tr>
79
+ <td align='left'>Arborio</td>
80
+ <td align='center'>
81
+ Drago
82
+ <fn reference='a'>
83
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
84
+ </fn>
85
+ </td>
86
+ <td align='center'>
87
+ Balilla
88
+ <fn reference='a'>
89
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
90
+ </fn>
91
+ </td>
92
+ <td align='center'>Thaibonnet</td>
93
+ </tr>
94
+ </thead>
95
+ <tbody>
96
+ <tr>
97
+ <th align='left'>Number of laboratories retained after eliminating outliers</th>
98
+ <td align='center'>13</td>
99
+ <td align='center'>11</td>
100
+ <td align='center'>13</td>
101
+ <td align='center'>13</td>
102
+ </tr>
103
+ <tr>
104
+ <td align='left'>Mean value, g/100 g</td>
105
+ <td align='center'>81,2</td>
106
+ <td align='center'>82,0</td>
107
+ <td align='center'>81,8</td>
108
+ <td align='center'>77,7</td>
109
+ </tr>
110
+ </tbody>
111
+ <tfoot>
112
+ <tr>
113
+ <td align='left'>
114
+ Reproducibility limit,
115
+ <stem type='AsciiMath'>R</stem>
116
+ (= 2,83
117
+ <stem type='AsciiMath'>s_R</stem>
118
+ )
119
+ </td>
120
+ <td align='center'>2,89</td>
121
+ <td align='center'>0,57</td>
122
+ <td align='center'>2,26</td>
123
+ <td align='center'>6,06</td>
124
+ </tr>
125
+ </tfoot>
126
+ <dl>
127
+ <dt>Drago</dt>
128
+ <dd>A type of rice</dd>
129
+ </dl>
130
+ <note>
131
+ <name>NOTE</name>
132
+ <p>This is a table about rice</p>
133
+ </note>
134
+ </table>
135
+ </foreword>
136
+ </preface>
137
+ </iso-standard>
138
+ OUTPUT
139
+ end
140
+
141
+ it "processes IsoXML tables (HTML)" do
142
+ FileUtils.rm_f("test.html")
143
+ IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", false)
144
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
145
+ <preface>
146
+ <foreword>
147
+ <table id="tableD-1" alt="tool tip" summary="long desc">
148
+ <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of <em>husked</em> rice yield</name>
149
+ <thead>
150
+ <tr>
151
+ <td rowspan="2" align="left">Description</td>
152
+ <td colspan="4" align="center">Rice sample</td>
153
+ </tr>
154
+ <tr>
155
+ <td align="left">Arborio</td>
156
+ <td align="center">Drago<fn reference="a">
157
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
158
+ </fn></td>
159
+ <td align="center">Balilla<fn reference="a">
160
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
161
+ </fn></td>
162
+ <td align="center">Thaibonnet</td>
163
+ </tr>
164
+ </thead>
165
+ <tbody>
166
+ <tr>
167
+ <th align="left">Number of laboratories retained after eliminating outliers</th>
168
+ <td align="center">13</td>
169
+ <td align="center">11</td>
170
+ <td align="center">13</td>
171
+ <td align="center">13</td>
172
+ </tr>
173
+ <tr>
174
+ <td align="left">Mean value, g/100 g</td>
175
+ <td align="center">81,2</td>
176
+ <td align="center">82,0</td>
177
+ <td align="center">81,8</td>
178
+ <td align="center">77,7</td>
179
+ </tr>
180
+ </tbody>
181
+ <tfoot>
182
+ <tr>
183
+ <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
184
+ <td align="center">2,89</td>
185
+ <td align="center">0,57</td>
186
+ <td align="center">2,26</td>
187
+ <td align="center">6,06</td>
188
+ </tr>
189
+ </tfoot>
190
+ <dl>
191
+ <dt>Drago</dt>
192
+ <dd>A type of rice</dd>
193
+ </dl>
194
+ <note><name>NOTE</name><p>This is a table about rice</p></note>
195
+ </table>
196
+
60
197
  </foreword>
61
198
  </preface>
62
199
  </iso-standard>
@@ -168,7 +305,7 @@ OUTPUT
168
305
  <preface>
169
306
  <foreword>
170
307
  <table id="tableD-1" alt="tool tip" summary="long desc">
171
- <name>Repeatability and reproducibility of <em>husked</em> rice yield</name>
308
+ <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of <em>husked</em> rice yield</name>
172
309
  <thead>
173
310
  <tr>
174
311
  <td rowspan="2" align="left">Description</td>
@@ -214,7 +351,7 @@ OUTPUT
214
351
  <dt>Drago</dt>
215
352
  <dd>A type of rice</dd>
216
353
  </dl>
217
- <note><p>This is a table about rice</p></note>
354
+ <note><name>NOTE</name><p>This is a table about rice</p></note>
218
355
  </table>
219
356
 
220
357
  </foreword>
@@ -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::Iso::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>
@@ -52,6 +52,79 @@ RSpec.describe IsoDoc do
52
52
  </sections>
53
53
  </iso-standard>
54
54
  INPUT
55
+ presxml = <<~OUTPUT
56
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
57
+ <sections>
58
+ <terms id='_terms_and_definitions' obligation='normative'>
59
+ <title depth='1'>1<tab/>Terms and Definitions</title>
60
+
61
+ <term id='paddy1'><name>1.1</name>
62
+ <preferred>paddy</preferred>
63
+ <domain>rice</domain>
64
+ <definition>
65
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
66
+ </definition>
67
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892'>
68
+ <name>EXAMPLE 1</name>
69
+ <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
70
+ <ul>
71
+ <li>A</li>
72
+ </ul>
73
+ </termexample>
74
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
75
+ <name>EXAMPLE 2</name>
76
+ <ul>
77
+ <li>A</li>
78
+ </ul>
79
+ </termexample>
80
+ <termsource status='modified'>
81
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
82
+ <modification>
83
+ <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>
84
+ </modification>
85
+ </termsource>
86
+ </term>
87
+ <term id='paddy'><name>1.2</name>
88
+ <preferred>paddy</preferred>
89
+ <admitted>paddy rice</admitted>
90
+ <admitted>rough rice</admitted>
91
+ <deprecates>cargo rice</deprecates>
92
+ <definition>
93
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
94
+ </definition>
95
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
96
+ <name>Note 1 to entry</name>
97
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
98
+ The starch of waxy rice consists almost entirely of amylopectin. The
99
+ kernels have a tendency to stick together after cooking.
100
+ </p>
101
+ </termnote>
102
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
103
+ <name>Note 2 to entry</name>
104
+ <ul>
105
+ <li>A</li>
106
+ </ul>
107
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
108
+ The starch of waxy rice consists almost entirely of amylopectin. The
109
+ kernels have a tendency to stick together after cooking.
110
+ </p>
111
+ </termnote>
112
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f893'>
113
+ <name>EXAMPLE</name>
114
+ <ul>
115
+ <li>A</li>
116
+ </ul>
117
+ </termexample>
118
+ <termsource status='identical'>
119
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
120
+ </termsource>
121
+ </term>
122
+ </terms>
123
+ </sections>
124
+ </iso-standard>
125
+ OUTPUT
126
+
127
+ html = <<~OUTPUT
55
128
  #{HTML_HDR}
56
129
  <p class="zzSTDTitle1"/>
57
130
  <div id="_terms_and_definitions"><h1>1&#160; Terms and Definitions</h1>
@@ -88,59 +161,8 @@ RSpec.describe IsoDoc do
88
161
  </body>
89
162
  </html>
90
163
  OUTPUT
91
- end
92
164
 
93
- it "processes IsoXML terms (Word)" do
94
- expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{^.*<p class="zzSTDTitle1"/>}m, "").sub(%r{</div>\s*<br.*$}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
95
- <iso-standard xmlns="http://riboseinc.com/isoxml">
96
- <sections>
97
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
98
-
99
- <term id="paddy1"><preferred>paddy</preferred>
100
- <domain>rice</domain>
101
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
102
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
103
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
104
- <ul>
105
- <li>A</li>
106
- </ul>
107
- </termexample>
108
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
109
- <ul>
110
- <li>A</li>
111
- </ul>
112
- </termexample>
113
-
114
- <termsource status="modified">
115
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
116
- <modification>
117
- <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>
118
- </modification>
119
- </termsource></term>
120
-
121
- <term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
122
- <admitted>rough rice</admitted>
123
- <deprecates>cargo rice</deprecates>
124
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
125
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
126
- <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>
127
- </termnote>
128
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
129
- <ul><li>A</li></ul>
130
- <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>
131
- </termnote>
132
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
133
- <ul>
134
- <li>A</li>
135
- </ul>
136
- </termexample>
137
- <termsource status="identical">
138
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
139
- </termsource></term>
140
- </terms>
141
- </sections>
142
- </iso-standard>
143
- INPUT
165
+ word = <<~OUTPUT
144
166
  <div id="_terms_and_definitions"><h1>1<span style="mso-tab-count:1">&#160; </span>Terms and Definitions</h1>
145
167
  <p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
146
168
 
@@ -173,5 +195,8 @@ OUTPUT
173
195
  [/TERMREF]</p></div>
174
196
 
175
197
  OUTPUT
198
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
199
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
200
+ expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true).sub(%r{^.*<p class="zzSTDTitle1"/>}m, "").sub(%r{</div>\s*<br.*$}m, ""))).to be_equivalent_to xmlpp(word)
176
201
  end
177
202
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "cross-references notes" do
5
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <preface>
8
8
  <foreword>
@@ -17,7 +17,7 @@ RSpec.describe IsoDoc do
17
17
  </foreword>
18
18
  </preface>
19
19
  <sections>
20
- <clause id="scope"><title>Scope</title>
20
+ <clause id="scope" type="scope"><title>Scope</title>
21
21
  <note id="N">
22
22
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
23
23
  </note>
@@ -55,66 +55,96 @@ RSpec.describe IsoDoc do
55
55
  </annex>
56
56
  </iso-standard>
57
57
  INPUT
58
- #{HTML_HDR}
59
- <br/>
60
- <div>
61
- <h1 class="ForewordTitle">Foreword</h1>
62
- <p>
63
- <a href="#N">Clause 1, Note</a>
64
- <a href="#note1">3.1, Note 1</a>
65
- <a href="#note2">3.1, Note 2</a>
66
- <a href="#AN">A.1, Note</a>
67
- <a href="#Anote1">A.2, Note 1</a>
68
- <a href="#Anote2">A.2, Note 2</a>
69
- </p>
70
- </div>
71
- <p class="zzSTDTitle1"/>
72
- <div id="scope">
73
- <h1>1&#160; Scope</h1>
74
- <div id="N" class="Note">
75
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
76
- </div>
77
- <p>
78
- <a href="#N">Note</a>
79
- </p>
80
- </div>
81
- <div id="terms"><h1>2&#160; </h1>
82
- </div>
83
- <div id="widgets">
84
- <h1>3&#160; Widgets</h1>
85
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
86
- <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>
87
- <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>
88
- <p> <a href="#note1">Note 1</a> <a href="#note2">Note 2</a> </p>
58
+ <?xml version='1.0'?>
59
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
60
+ <preface>
61
+ <foreword>
62
+ <p>
63
+ <xref target='N'>Clause 1, Note</xref>
64
+ <xref target='note1'>3.1, Note 1</xref>
65
+ <xref target='note2'>3.1, Note 2</xref>
66
+ <xref target='AN'>A.1, Note</xref>
67
+ <xref target='Anote1'>A.2, Note 1</xref>
68
+ <xref target='Anote2'>A.2, Note 2</xref>
69
+ </p>
70
+ </foreword>
71
+ </preface>
72
+ <sections>
73
+ <clause id='scope' type='scope'>
74
+ <title depth='1'>1<tab/>Scope</title>
89
75
 
90
- </div>
91
- </div>
92
- <br/>
93
- <div id="annex1" class="Section3">
94
- <h1 class='Annex'>
95
- <b>Annex A</b>
96
- <br/>
97
- (informative)
98
- <br/>
99
- <br/>
100
- <b/>
101
- </h1>
102
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
103
- <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>
104
- </div>
105
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
106
- <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>
107
- <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>
108
- </div>
109
- </div>
110
- </div>
111
- </body>
112
- </html>
76
+ <note id='N'>
77
+ <name>NOTE</name>
78
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
79
+ These results are based on a study carried out on three different
80
+ types of kernel.
81
+ </p>
82
+ </note>
83
+ <p>
84
+ <xref target='N'>Note</xref>
85
+ </p>
86
+ </clause>
87
+ <terms id='terms'><title>2</title></terms>
88
+ <clause id='widgets'>
89
+ <title depth='1'>3<tab/>Widgets</title>
90
+
91
+ <clause id='widgets1' inline-header='true'><title>3.1</title>
92
+ <note id='note1'>
93
+ <name>NOTE 1</name>
94
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
95
+ These results are based on a study carried out on three different
96
+ types of kernel.
97
+ </p>
98
+ </note>
99
+ <note id='note2'>
100
+ <name>NOTE 2</name>
101
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
102
+ These results are based on a study carried out on three different
103
+ types of kernel.
104
+ </p>
105
+ </note>
106
+ <p>
107
+ <xref target='note1'>Note 1</xref>
108
+ <xref target='note2'>Note 2</xref>
109
+ </p>
110
+ </clause>
111
+ </clause>
112
+ </sections>
113
+ <annex id='annex1'>
114
+ <title><strong>Annex A</strong><br/>(informative)</title>
115
+ <clause id='annex1a' inline-header='true'><title>A.1</title>
116
+ <note id='AN'>
117
+ <name>NOTE</name>
118
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
119
+ These results are based on a study carried out on three different
120
+ types of kernel.
121
+ </p>
122
+ </note>
123
+ </clause>
124
+ <clause id='annex1b' inline-header='true'>
125
+ <title>A.2</title>
126
+ <note id='Anote1'>
127
+ <name>NOTE 1</name>
128
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
129
+ These results are based on a study carried out on three different
130
+ types of kernel.
131
+ </p>
132
+ </note>
133
+ <note id='Anote2'>
134
+ <name>NOTE 2</name>
135
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
136
+ These results are based on a study carried out on three different
137
+ types of kernel.
138
+ </p>
139
+ </note>
140
+ </clause>
141
+ </annex>
142
+ </iso-standard>
113
143
  OUTPUT
114
144
  end
115
145
 
116
- it "cross-references figures" do
117
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
146
+ it "cross-references figures (Presentation XML)" do
147
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
118
148
  <iso-standard xmlns="http://riboseinc.com/isoxml">
119
149
  <preface>
120
150
  <foreword id="fwd">
@@ -129,7 +159,7 @@ RSpec.describe IsoDoc do
129
159
  </foreword>
130
160
  </preface>
131
161
  <sections>
132
- <clause id="scope"><title>Scope</title>
162
+ <clause id="scope" type="scope"><title>Scope</title>
133
163
  <figure id="N">
134
164
  <name>Split-it-right sample divider</name>
135
165
  <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
@@ -171,81 +201,75 @@ RSpec.describe IsoDoc do
171
201
  </annex>
172
202
  </iso-standard>
173
203
  INPUT
174
- #{HTML_HDR}
175
- <br/>
176
- <div id="fwd">
177
- <h1 class="ForewordTitle">Foreword</h1>
178
- <p>
179
- <a href="#N">Figure 1</a>
180
- <a href="#note1">Figure 2</a>
181
- <a href="#note2">Figure 3</a>
182
- <a href="#AN">Figure A.1</a>
183
- <a href="#Anote1">Figure A.2</a>
184
- <a href="#Anote2">Figure A.3</a>
185
- </p>
186
- </div>
187
- <p class="zzSTDTitle1"/>
188
- <div id="scope">
189
- <h1>1&#160; Scope</h1>
190
- <div id="N" class="figure">
191
-
192
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
193
- <p class="FigureTitle" style="text-align:center;">Figure 1&#160;&#8212; Split-it-right sample divider</p></div>
194
- <p>
195
- <a href="#N">Figure 1</a>
196
- </p>
197
- </div>
198
- <div id="terms"><h1>2&#160; </h1>
199
- </div>
200
- <div id="widgets">
201
- <h1>3&#160; Widgets</h1>
202
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
203
- <div id="note1" class="figure">
204
-
205
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
206
- <p class="FigureTitle" style="text-align:center;">Figure 2&#160;&#8212; Split-it-right sample divider</p></div>
207
- <div id="note2" class="figure">
208
-
209
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
210
- <p class="FigureTitle" style="text-align:center;">Figure 3&#160;&#8212; Split-it-right sample divider</p></div>
211
- <p> <a href="#note1">Figure 2</a> <a href="#note2">Figure 3</a> </p>
212
- </div>
213
- </div>
214
- <br/>
215
- <div id="annex1" class="Section3">
216
- <h1 class='Annex'>
217
- <b>Annex A</b>
218
- <br/>
219
- (informative)
220
- <br/>
221
- <br/>
222
- <b/>
223
- </h1>
224
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
225
- <div id="AN" class="figure">
226
-
227
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
228
- <p class="FigureTitle" style="text-align:center;">Figure A.1&#160;&#8212; Split-it-right sample divider</p></div>
229
- </div>
230
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
231
- <div id="Anote1" class="figure">
232
-
233
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
234
- <p class="FigureTitle" style="text-align:center;">Figure A.2&#160;&#8212; Split-it-right sample divider</p></div>
235
- <div id="Anote2" class="figure">
236
-
237
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
238
- <p class="FigureTitle" style="text-align:center;">Figure A.3&#160;&#8212; Split-it-right sample divider</p></div>
239
- </div>
240
- </div>
241
- </div>
242
- </body>
243
- </html>
204
+ <?xml version='1.0'?>
205
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
206
+ <preface>
207
+ <foreword id='fwd'>
208
+ <p>
209
+ <xref target='N'>Figure 1</xref>
210
+ <xref target='note1'>Figure 2</xref>
211
+ <xref target='note2'>Figure 3</xref>
212
+ <xref target='AN'>Figure A.1</xref>
213
+ <xref target='Anote1'>Figure A.2</xref>
214
+ <xref target='Anote2'>Figure A.3</xref>
215
+ </p>
216
+ </foreword>
217
+ </preface>
218
+ <sections>
219
+ <clause id='scope' type='scope'>
220
+ <title depth='1'>1<tab/>Scope</title>
221
+ <figure id='N'>
222
+ <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
223
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
224
+ </figure>
225
+ <p>
226
+ <xref target='N'>Figure 1</xref>
227
+ </p>
228
+ </clause>
229
+ <terms id='terms'><title>2</title></terms>
230
+ <clause id='widgets'>
231
+ <title depth='1'>3<tab/>Widgets</title>
232
+ <clause inline-header="true" id='widgets1'><title>3.1</title>
233
+ <figure id='note1'>
234
+ <name>Figure 2&#xA0;&#x2014; Split-it-right sample divider</name>
235
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
236
+ </figure>
237
+ <figure id='note2'>
238
+ <name>Figure 3&#xA0;&#x2014; Split-it-right sample divider</name>
239
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
240
+ </figure>
241
+ <p>
242
+ <xref target='note1'>Figure 2</xref>
243
+ <xref target='note2'>Figure 3</xref>
244
+ </p>
245
+ </clause>
246
+ </clause>
247
+ </sections>
248
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
249
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
250
+ <figure id='AN'>
251
+ <name>Figure A.1&#xA0;&#x2014; Split-it-right sample divider</name>
252
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
253
+ </figure>
254
+ </clause>
255
+ <clause inline-header="true" id='annex1b'>
256
+ <title>A.2</title>
257
+ <figure id='Anote1'>
258
+ <name>Figure A.2&#xA0;&#x2014; Split-it-right sample divider</name>
259
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
260
+ </figure>
261
+ <figure id='Anote2'>
262
+ <name>Figure A.3&#xA0;&#x2014; Split-it-right sample divider</name>
263
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
264
+ </figure>
265
+ </clause>
266
+ </annex>
267
+ </iso-standard>
244
268
  OUTPUT
245
- end
269
+ end
246
270
 
247
- it "cross-references subfigures" do
248
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
271
+ it "cross-references subfigures (Presentation XML)" do
272
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
249
273
  <iso-standard xmlns="http://riboseinc.com/isoxml">
250
274
  <preface>
251
275
  <foreword id="fwd">
@@ -260,7 +284,7 @@ RSpec.describe IsoDoc do
260
284
  </foreword>
261
285
  </preface>
262
286
  <sections>
263
- <clause id="scope"><title>Scope</title>
287
+ <clause id="scope" type="scope"><title>Scope</title>
264
288
  </clause>
265
289
  <terms id="terms"/>
266
290
  <clause id="widgets"><title>Widgets</title>
@@ -297,80 +321,69 @@ RSpec.describe IsoDoc do
297
321
  </annex>
298
322
  </iso-standard>
299
323
  INPUT
300
- #{HTML_HDR}
301
- <br/>
302
- <div id="fwd">
303
- <h1 class="ForewordTitle">Foreword</h1>
304
- <p>
305
- <a href="#N">Figure 1</a>
306
- <a href="#note1">Figure 1 a)</a>
307
- <a href="#note2">Figure 1 b)</a>
308
- <a href="#AN">Figure A.1</a>
309
- <a href="#Anote1">Figure A.1 a)</a>
310
- <a href="#Anote2">Figure A.1 b)</a>
311
- </p>
312
- </div>
313
- <p class="zzSTDTitle1"/>
314
- <div id="scope">
315
- <h1>1&#160; Scope</h1>
316
- </div>
317
- <div id="terms"><h1>2&#160; </h1>
318
- </div>
319
- <div id="widgets">
320
- <h1>3&#160; Widgets</h1>
321
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
322
- <div id="N" class="figure">
323
- <div id="note1" class="figure">
324
-
325
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
326
- <p class='FigureTitle' style='text-align:center;'>a)&#160;&#8212; Split-it-right sample divider</p>
327
- </div>
328
- <div id="note2" class="figure">
329
-
330
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
331
- <p class='FigureTitle' style='text-align:center;'>b)&#160;&#8212; Split-it-right sample divider</p>
332
- </div>
333
- <p class='FigureTitle' style='text-align:center;'>Figure 1</p>
334
- </div>
335
- <p> <a href="#note1">Figure 1 a)</a> <a href="#note2">Figure 1 b)</a> </p>
336
- </div>
337
- </div>
338
- <br/>
339
- <div id="annex1" class="Section3">
340
- <h1 class='Annex'>
341
- <b>Annex A</b>
342
- <br/>
343
- (informative)
344
- <br/>
345
- <br/>
346
- <b/>
347
- </h1>
348
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
349
- </div>
350
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
351
- <div id="AN" class="figure">
352
- <div id="Anote1" class="figure">
353
-
354
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
355
- <p class='FigureTitle' style='text-align:center;'>a)&#160;&#8212; Split-it-right sample divider</p>
356
- </div>
357
- <div id="Anote2" class="figure">
324
+ <?xml version='1.0'?>
325
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
326
+ <preface>
327
+ <foreword id='fwd'>
328
+ <p>
329
+ <xref target='N'>Figure 1</xref>
330
+ <xref target='note1'>Figure 1 a)</xref>
331
+ <xref target='note2'>Figure 1 b)</xref>
332
+ <xref target='AN'>Figure A.1</xref>
333
+ <xref target='Anote1'>Figure A.1 a)</xref>
334
+ <xref target='Anote2'>Figure A.1 b)</xref>
335
+ </p>
336
+ </foreword>
337
+ </preface>
338
+ <sections>
339
+ <clause id='scope' type='scope'>
340
+ <title depth='1'>1<tab/>Scope</title>
341
+ </clause>
342
+ <terms id='terms'><title>2</title></terms>
358
343
 
359
- <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
360
- <p class='FigureTitle' style='text-align:center;'>b)&#160;&#8212; Split-it-right sample divider</p>
361
- </div>
362
- <p class='FigureTitle' style='text-align:center;'>Figure A.1</p>
363
- </div>
364
- </div>
365
- </div>
366
- </div>
367
- </body>
368
- </html>
344
+ <clause id='widgets'>
345
+ <title depth='1'>3<tab/>Widgets</title>
346
+ <clause inline-header="true" id='widgets1'><title>3.1</title>
347
+ <figure id='N'>
348
+ <name>Figure 1</name>
349
+ <figure id='note1'>
350
+ <name>a)&#xA0; Split-it-right sample divider</name>
351
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
352
+ </figure>
353
+ <figure id='note2'>
354
+ <name>b)&#xA0; Split-it-right sample divider</name>
355
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
356
+ </figure>
357
+ </figure>
358
+ <p>
359
+ <xref target='note1'>Figure 1 a)</xref>
360
+ <xref target='note2'>Figure 1 b)</xref>
361
+ </p>
362
+ </clause>
363
+ </clause>
364
+ </sections>
365
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
366
+ <clause inline-header="true" id='annex1a'><title>A.1</title></clause>
367
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
368
+ <figure id='AN'>
369
+ <name>Figure A.1</name>
370
+ <figure id='Anote1'>
371
+ <name>a)&#xA0; Split-it-right sample divider</name>
372
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
373
+ </figure>
374
+ <figure id='Anote2'>
375
+ <name>b)&#xA0; Split-it-right sample divider</name>
376
+ <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
377
+ </figure>
378
+ </figure>
379
+ </clause>
380
+ </annex>
381
+ </iso-standard>
369
382
  OUTPUT
370
383
  end
371
384
 
372
385
  it "cross-references examples" do
373
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
386
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
374
387
  <iso-standard xmlns="http://riboseinc.com/isoxml">
375
388
  <preface>
376
389
  <foreword>
@@ -385,7 +398,7 @@ RSpec.describe IsoDoc do
385
398
  </foreword>
386
399
  </preface>
387
400
  <sections>
388
- <clause id="scope"><title>Scope</title>
401
+ <clause id="scope" type="scope"><title>Scope</title>
389
402
  <example id="N">
390
403
  <p>Hello</p>
391
404
  </example>
@@ -421,66 +434,75 @@ RSpec.describe IsoDoc do
421
434
  </annex>
422
435
  </iso-standard>
423
436
  INPUT
424
- #{HTML_HDR}
425
- <br/>
426
- <div>
427
- <h1 class="ForewordTitle">Foreword</h1>
428
- <p>
429
- <a href="#N">Clause 1, Example</a>
430
- <a href="#note1">3.1, Example 1</a>
431
- <a href="#note2">3.1, Example 2</a>
432
- <a href="#AN">A.1, Example</a>
433
- <a href="#Anote1">A.2, Example 1</a>
434
- <a href="#Anote2">A.2, Example 2</a>
435
- </p>
436
- </div>
437
- <p class="zzSTDTitle1"/>
438
- <div id="scope">
439
- <h1>1&#160; Scope</h1>
440
- <div id="N" class="example">
441
- <p><span class="example_label">EXAMPLE</span>&#160; Hello</p>
442
- </div>
437
+ <?xml version='1.0'?>
438
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
439
+ <preface>
440
+ <foreword>
441
+ <p>
442
+ <xref target='N'>Clause 1, Example</xref>
443
+ <xref target='note1'>3.1, Example 1</xref>
444
+ <xref target='note2'>3.1, Example 2</xref>
445
+ <xref target='AN'>A.1, Example</xref>
446
+ <xref target='Anote1'>A.2, Example 1</xref>
447
+ <xref target='Anote2'>A.2, Example 2</xref>
448
+ </p>
449
+ </foreword>
450
+ </preface>
451
+ <sections>
452
+ <clause id='scope' type='scope'>
453
+ <title depth='1'>1<tab/>Scope</title>
454
+ <example id='N'>
455
+ <name>EXAMPLE</name>
456
+ <p>Hello</p>
457
+ </example>
458
+ <p>
459
+ <xref target='N'>Example</xref>
460
+ </p>
461
+ </clause>
462
+ <terms id='terms'><title>2</title></terms>
463
+
464
+ <clause id='widgets'>
465
+ <title depth='1'>3<tab/>Widgets</title>
466
+ <clause inline-header='true' id='widgets1'><title>3.1</title>
467
+ <example id='note1'>
468
+ <name>EXAMPLE 1</name>
469
+ <p>Hello</p>
470
+ </example>
471
+ <example id='note2'>
472
+ <name>EXAMPLE 2</name>
473
+ <p>Hello</p>
474
+ </example>
443
475
  <p>
444
- <a href="#N">Example</a>
476
+ <xref target='note1'>Example 1</xref>
477
+ <xref target='note2'>Example 2</xref>
445
478
  </p>
446
- </div>
447
- <div id="terms"><h1>2&#160; </h1>
448
- </div>
449
- <div id="widgets">
450
- <h1>3&#160; Widgets</h1>
451
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
452
- <div id="note1" class="example"><p><span class="example_label">EXAMPLE 1</span>&#160; Hello</p></div>
453
- <div id="note2" class="example"><p><span class="example_label">EXAMPLE 2</span>&#160; Hello</p></div>
454
- <p> <a href="#note1">Example 1</a> <a href="#note2">Example 2</a> </p>
455
- </div>
456
- </div>
457
- <br/>
458
- <div id="annex1" class="Section3">
459
- <h1 class='Annex'>
460
- <b>Annex A</b>
461
- <br/>
462
- (informative)
463
- <br/>
464
- <br/>
465
- <b/>
466
- </h1>
467
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
468
- <div id="AN" class="example"><p><span class="example_label">EXAMPLE</span>&#160; Hello</p></div>
469
- </div>
470
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
471
- <div id="Anote1" class="example"><p><span class="example_label">EXAMPLE 1</span>&#160; Hello</p></div>
472
- <div id="Anote2" class="example"><p><span class="example_label">EXAMPLE 2</span>&#160; Hello</p></div>
473
- </div>
474
- </div>
475
- </div>
476
- </body>
477
- </html>
478
-
479
+ </clause>
480
+ </clause>
481
+ </sections>
482
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
483
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
484
+ <example id='AN'>
485
+ <name>EXAMPLE</name>
486
+ <p>Hello</p>
487
+ </example>
488
+ </clause>
489
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
490
+ <example id='Anote1'>
491
+ <name>EXAMPLE 1</name>
492
+ <p>Hello</p>
493
+ </example>
494
+ <example id='Anote2'>
495
+ <name>EXAMPLE 2</name>
496
+ <p>Hello</p>
497
+ </example>
498
+ </clause>
499
+ </annex>
500
+ </iso-standard>
479
501
  OUTPUT
480
502
  end
481
503
 
482
504
  it "cross-references formulae" do
483
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
505
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
484
506
  <iso-standard xmlns="http://riboseinc.com/isoxml">
485
507
  <preface>
486
508
  <foreword>
@@ -495,7 +517,7 @@ RSpec.describe IsoDoc do
495
517
  </foreword>
496
518
  </preface>
497
519
  <sections>
498
- <clause id="scope"><title>Scope</title>
520
+ <clause id="scope" type="scope"><title>Scope</title>
499
521
  <formula id="N">
500
522
  <stem type="AsciiMath">r = 1 %</stem>
501
523
  </formula>
@@ -545,63 +567,75 @@ RSpec.describe IsoDoc do
545
567
  </preface>
546
568
  </iso-standard>
547
569
  INPUT
548
- #{HTML_HDR}
549
- <br/>
550
- <div>
551
- <h1 class="ForewordTitle">Foreword</h1>
552
- <p>
553
- <a href="#N">Clause 1, Formula (1)</a>
554
- <a href="#note1">3.1, Formula (2)</a>
555
- <a href="#note2">3.1, Formula (3)</a>
556
- <a href="#AN">A.1, Formula (A.1)</a>
557
- <a href="#Anote1">A.2, Formula (A.2)</a>
558
- <a href="#Anote2">A.2, Formula (A.3)</a>
559
- </p>
560
- </div>
561
- <p class="zzSTDTitle1"/>
562
- <div id="scope">
563
- <h1>1&#160; Scope</h1>
564
- <div id="N"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (1)</p></div></div>
565
- <p>
566
- <a href="#N">Formula (1)</a>
567
- </p>
568
- </div>
569
- <div id="terms"><h1>2&#160; </h1>
570
- </div>
571
- <div id="widgets">
572
- <h1>3&#160; Widgets</h1>
573
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
574
- <div id="note1"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (2)</p></div></div>
575
- <div id="note2"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (3)</p></div></div>
576
- <p> <a href="#note1">Formula (2)</a> <a href="#note2">Formula (3)</a> </p>
577
- </div>
578
- </div>
579
- <br/>
580
- <div id="annex1" class="Section3">
581
- <h1 class='Annex'>
582
- <b>Annex A</b>
583
- <br/>
584
- (informative)
585
- <br/>
586
- <br/>
587
- <b/>
588
- </h1>
589
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
590
- <div id="AN"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (A.1)</p></div></div>
591
- </div>
592
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
593
- <div id="Anote1"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (A.2)</p></div></div>
594
- <div id="Anote2"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (A.3)</p></div></div>
595
- </div>
596
- </div>
597
- </div>
598
- </body>
599
- </html>
570
+ <?xml version='1.0'?>
571
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
572
+ <preface>
573
+ <foreword>
574
+ <p>
575
+ <xref target='N'>Clause 1, Formula (1)</xref>
576
+ <xref target='note1'>3.1, Formula (2)</xref>
577
+ <xref target='note2'>3.1, Formula (3)</xref>
578
+ <xref target='AN'>A.1, Formula (A.1)</xref>
579
+ <xref target='Anote1'>A.2, Formula (A.2)</xref>
580
+ <xref target='Anote2'>A.2, Formula (A.3)</xref>
581
+ </p>
582
+ </foreword>
583
+ </preface>
584
+ <sections>
585
+ <clause id='scope' type='scope'>
586
+ <title depth='1'>1<tab/>Scope</title>
587
+ <formula id='N'>
588
+ <name>1</name>
589
+ <stem type='AsciiMath'>r = 1 %</stem>
590
+ </formula>
591
+ <p>
592
+ <xref target='N'>Formula (1)</xref>
593
+ </p>
594
+ </clause>
595
+ <terms id='terms'><title>2</title></terms>
596
+
597
+ <clause id='widgets'>
598
+ <title depth='1'>3<tab/>Widgets</title>
599
+ <clause id='widgets1' inline-header='true'><title>3.1</title>
600
+ <formula id='note1'>
601
+ <name>2</name>
602
+ <stem type='AsciiMath'>r = 1 %</stem>
603
+ </formula>
604
+ <formula id='note2'>
605
+ <name>3</name>
606
+ <stem type='AsciiMath'>r = 1 %</stem>
607
+ </formula>
608
+ <p>
609
+ <xref target='note1'>Formula (2)</xref>
610
+ <xref target='note2'>Formula (3)</xref>
611
+ </p>
612
+ </clause>
613
+ </clause>
614
+ </sections>
615
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
616
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
617
+ <formula id='AN'>
618
+ <name>A.1</name>
619
+ <stem type='AsciiMath'>r = 1 %</stem>
620
+ </formula>
621
+ </clause>
622
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
623
+ <formula id='Anote1'>
624
+ <name>A.2</name>
625
+ <stem type='AsciiMath'>r = 1 %</stem>
626
+ </formula>
627
+ <formula id='Anote2'>
628
+ <name>A.3</name>
629
+ <stem type='AsciiMath'>r = 1 %</stem>
630
+ </formula>
631
+ </clause>
632
+ </annex>
633
+ </iso-standard>
600
634
  OUTPUT
601
635
  end
602
636
 
603
637
  it "cross-references tables" do
604
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
638
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
605
639
  <iso-standard xmlns="http://riboseinc.com/isoxml">
606
640
  <preface>
607
641
  <foreword>
@@ -616,7 +650,7 @@ RSpec.describe IsoDoc do
616
650
  </foreword>
617
651
  </preface>
618
652
  <sections>
619
- <clause id="scope"><title>Scope</title>
653
+ <clause id="scope" type="scope"><title>Scope</title>
620
654
  <table id="N">
621
655
  <name>Repeatability and reproducibility of husked rice yield</name>
622
656
  <tbody>
@@ -694,74 +728,111 @@ RSpec.describe IsoDoc do
694
728
  </annex>
695
729
  </iso-standard>
696
730
  INPUT
697
- #{HTML_HDR}
698
- <br/>
699
- <div>
700
- <h1 class="ForewordTitle">Foreword</h1>
701
- <p>
702
- <a href="#N">Table 1</a>
703
- <a href="#note1">Table 2</a>
704
- <a href="#note2">Table 3</a>
705
- <a href="#AN">Table A.1</a>
706
- <a href="#Anote1">Table A.2</a>
707
- <a href="#Anote2">Table A.3</a>
708
- </p>
709
- </div>
710
- <p class="zzSTDTitle1"/>
711
- <div id="scope">
712
- <h1>1&#160; Scope</h1>
713
- <p class="TableTitle" style="text-align:center;">
714
- Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield
715
- </p>
716
- <table id="N" class="MsoISOTable" style="border-width:1px;border-spacing:0;">
717
- <tbody>
718
- <tr>
719
- <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>
720
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td>
721
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td>
722
- </tr>
723
- </tbody>
724
- </table>
725
- <p>
726
- <a href="#N">Table 1</a>
727
- </p>
728
- </div>
729
- <div id="terms"><h1>2&#160; </h1>
730
- </div>
731
- <div id="widgets">
732
- <h1>3&#160; Widgets</h1>
733
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
734
- <p class="TableTitle" style="text-align:center;">Table 2&#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>
735
- <p class="TableTitle" style="text-align:center;">Table 3&#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>
736
- <p> <a href="#note1">Table 2</a> <a href="#note2">Table 3</a> </p>
737
- </div>
738
- </div>
739
- <br/>
740
- <div id="annex1" class="Section3">
741
- <h1 class='Annex'>
742
- <b>Annex A</b>
743
- <br/>
744
- (informative)
745
- <br/>
746
- <br/>
747
- <b/>
748
- </h1>
749
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
750
- <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>
751
- </div>
752
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
753
- <p class="TableTitle" style="text-align:center;">Table A.2&#160;&#8212; 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>
754
- <p class="TableTitle" style="text-align:center;">Table A.3&#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>
755
- </div>
756
- </div>
757
- </div>
758
- </body>
759
- </html>
731
+ <?xml version='1.0'?>
732
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
733
+ <preface>
734
+ <foreword>
735
+ <p>
736
+ <xref target='N'>Table 1</xref>
737
+ <xref target='note1'>Table 2</xref>
738
+ <xref target='note2'>Table 3</xref>
739
+ <xref target='AN'>Table A.1</xref>
740
+ <xref target='Anote1'>Table A.2</xref>
741
+ <xref target='Anote2'>Table A.3</xref>
742
+ </p>
743
+ </foreword>
744
+ </preface>
745
+ <sections>
746
+ <clause id='scope' type='scope'>
747
+ <title depth='1'>1<tab/>Scope</title>
748
+ <table id='N'>
749
+ <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
750
+ <tbody>
751
+ <tr>
752
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
753
+ <td align='center'>13</td>
754
+ <td align='center'>11</td>
755
+ </tr>
756
+ </tbody>
757
+ </table>
758
+ <p>
759
+ <xref target='N'>Table 1</xref>
760
+ </p>
761
+ </clause>
762
+ <terms id='terms'><title>2</title></terms>
763
+
764
+ <clause id='widgets'>
765
+ <title depth='1'>3<tab/>Widgets</title>
766
+ <clause id='widgets1' inline-header="true"><title>3.1</title>
767
+ <table id='note1'>
768
+ <name>Table 2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
769
+ <tbody>
770
+ <tr>
771
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
772
+ <td align='center'>13</td>
773
+ <td align='center'>11</td>
774
+ </tr>
775
+ </tbody>
776
+ </table>
777
+ <table id='note2'>
778
+ <name>Table 3&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
779
+ <tbody>
780
+ <tr>
781
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
782
+ <td align='center'>13</td>
783
+ <td align='center'>11</td>
784
+ </tr>
785
+ </tbody>
786
+ </table>
787
+ <p>
788
+ <xref target='note1'>Table 2</xref>
789
+ <xref target='note2'>Table 3</xref>
790
+ </p>
791
+ </clause>
792
+ </clause>
793
+ </sections>
794
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
795
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
796
+ <table id='AN'>
797
+ <name>Table A.1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
798
+ <tbody>
799
+ <tr>
800
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
801
+ <td align='center'>13</td>
802
+ <td align='center'>11</td>
803
+ </tr>
804
+ </tbody>
805
+ </table>
806
+ </clause>
807
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
808
+ <table id='Anote1'>
809
+ <name>Table A.2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
810
+ <tbody>
811
+ <tr>
812
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
813
+ <td align='center'>13</td>
814
+ <td align='center'>11</td>
815
+ </tr>
816
+ </tbody>
817
+ </table>
818
+ <table id='Anote2'>
819
+ <name>Table A.3&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
820
+ <tbody>
821
+ <tr>
822
+ <td align='left'>Number of laboratories retained after eliminating outliers</td>
823
+ <td align='center'>13</td>
824
+ <td align='center'>11</td>
825
+ </tr>
826
+ </tbody>
827
+ </table>
828
+ </clause>
829
+ </annex>
830
+ </iso-standard>
760
831
  OUTPUT
761
832
  end
762
833
 
763
834
  it "cross-references term notes" do
764
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
835
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
765
836
  <iso-standard xmlns="http://riboseinc.com/isoxml">
766
837
  <preface>
767
838
  <foreword>
@@ -773,7 +844,7 @@ RSpec.describe IsoDoc do
773
844
  </foreword>
774
845
  </preface>
775
846
  <sections>
776
- <clause id="scope"><title>Scope</title>
847
+ <clause id="scope" type="scope"><title>Scope</title>
777
848
  </clause>
778
849
  <terms id="terms">
779
850
  <term id="_waxy_rice"><preferred>waxy rice</preferred>
@@ -791,33 +862,60 @@ RSpec.describe IsoDoc do
791
862
 
792
863
  </iso-standard>
793
864
  INPUT
794
- #{HTML_HDR}
795
- <br/>
796
- <div>
797
- <h1 class="ForewordTitle">Foreword</h1>
798
- <p>
799
- <a href="#note1">2.1, Note 1</a>
800
- <a href="#note2">2.2, Note 1</a>
801
- <a href="#note3">2.2, Note 2</a>
802
- </p>
803
- </div>
804
- <p class="zzSTDTitle1"/>
805
- <div id="scope">
806
- <h1>1&#160; Scope</h1>
807
- </div>
808
- <div id="terms"><h1>2&#160; </h1>
809
- <p class="TermNum" id="_waxy_rice">2.1</p><p class="Terms" style="text-align:left;">waxy rice</p>
810
- <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>
811
- <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>
812
- <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>
813
- </div>
814
- </body>
815
- </html>
865
+ <?xml version='1.0'?>
866
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
867
+ <preface>
868
+ <foreword>
869
+ <p>
870
+ <xref target='note1'>2.1, Note 1</xref>
871
+ <xref target='note2'>2.2, Note 1</xref>
872
+ <xref target='note3'>2.2, Note 2</xref>
873
+ </p>
874
+ </foreword>
875
+ </preface>
876
+ <sections>
877
+ <clause id='scope' type='scope'>
878
+ <title depth='1'>1<tab/>Scope</title>
879
+ </clause>
880
+ <terms id='terms'><title>2</title>
881
+
882
+ <term id='_waxy_rice'><name>2.1</name>
883
+
884
+ <preferred>waxy rice</preferred>
885
+ <termnote id='note1'>
886
+ <name>Note 1 to entry</name>
887
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
888
+ The starch of waxy rice consists almost entirely of amylopectin. The
889
+ kernels have a tendency to stick together after cooking.
890
+ </p>
891
+ </termnote>
892
+ </term>
893
+ <term id='_nonwaxy_rice'> <name>2.2</name>
894
+
895
+ <preferred>nonwaxy rice</preferred>
896
+ <termnote id='note2'>
897
+ <name>Note 1 to entry</name>
898
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
899
+ The starch of waxy rice consists almost entirely of amylopectin. The
900
+ kernels have a tendency to stick together after cooking.
901
+ </p>
902
+ </termnote>
903
+ <termnote id='note3'>
904
+ <name>Note 2 to entry</name>
905
+ <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
906
+ The starch of waxy rice consists almost entirely of amylopectin. The
907
+ kernels have a tendency to stick together after cooking.
908
+ </p>
909
+ </termnote>
910
+ </term>
911
+ </terms>
912
+ </sections>
913
+ </iso-standard>
816
914
  OUTPUT
817
915
  end
818
916
 
819
917
  it "cross-references sections" do
820
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
918
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
821
919
  <iso-standard xmlns="http://riboseinc.com/isoxml">
822
920
  <preface>
823
921
  <foreword obligation="informative">
@@ -846,7 +944,7 @@ RSpec.describe IsoDoc do
846
944
  </clause>
847
945
  <clause id="C1" inline-header="false" obligation="informative">Text</clause>
848
946
  </introduction></preface><sections>
849
- <clause id="D" obligation="normative">
947
+ <clause id="D" obligation="normative" type="scope">
850
948
  <title>Scope</title>
851
949
  <p id="E">Text</p>
852
950
  </clause>
@@ -899,103 +997,158 @@ RSpec.describe IsoDoc do
899
997
  </bibliography>
900
998
  </iso-standard>
901
999
  INPUT
902
- #{HTML_HDR}
903
- <br/>
904
- <div>
905
- <h1 class="ForewordTitle">Foreword</h1>
906
- <p id="A">This is a preamble
907
- <a href="#C">0.1</a>
908
- <a href="#C1">0.2</a>
909
- <a href="#D">Clause 1</a>
910
- <a href="#H">Clause 3</a>
911
- <a href="#I">3.1</a>
912
- <a href="#J">3.1.1</a>
913
- <a href="#K">3.2</a>
914
- <a href="#L">Clause 4</a>
915
- <a href="#M">Clause 5</a>
916
- <a href="#N">5.1</a>
917
- <a href="#O">5.2</a>
918
- <a href="#P">Annex A</a>
919
- <a href="#Q">A.1</a>
920
- <a href="#Q1">A.1.1</a>
921
- <a href="#Q2">Annex A, Appendix 1</a>
922
- <a href="#R">Clause 2</a>
923
- </p>
924
- </div>
925
- <br/>
926
- <div class="Section3" id="B">
927
- <h1 class="IntroTitle">0&#160; Introduction</h1>
928
- <div id="C">
929
- <h2>0.1&#160; Introduction Subsection</h2>
930
- </div>
931
- <div id="C1"><span class='zzMoveToFollowing'>
932
- <b>0.2&#160; </b>
933
- </span>
934
- Text</div>
935
- </div>
936
- <p class="zzSTDTitle1"/>
937
- <div id="D">
938
- <h1>1&#160; Scope</h1>
939
- <p id="E">Text</p>
940
- </div>
941
- <div>
942
- <h1>2&#160; Normative references</h1>
943
- </div>
944
- <div id="H"><h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
945
- <div id="I">
946
- <h2>3.1&#160; Normal Terms</h2>
947
- <p class="TermNum" id="J">3.1.1</p>
948
- <p class="Terms" style="text-align:left;">Term2</p>
949
-
950
- </div><div id="K"><h2>3.2&#160; Symbols and abbreviated terms</h2>
951
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
952
- </div></div>
953
- <div id="L" class="Symbols">
954
- <h1>4&#160; Symbols and abbreviated terms</h1>
955
- <dl>
956
- <dt>
957
- <p>Symbol</p>
958
- </dt>
959
- <dd>Definition</dd>
960
- </dl>
961
- </div>
962
- <div id="M">
963
- <h1>5&#160; Clause 4</h1>
964
- <div id="N">
965
- <h2>5.1&#160; Introduction</h2>
966
- </div>
967
- <div id="O">
968
- <h2>5.2&#160; Clause 4.2</h2>
969
- </div>
970
- </div>
971
- <br/>
972
- <div id="P" class="Section3">
973
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
974
- <div id="Q">
975
- <h2>A.1&#160; Annex A.1</h2>
976
- <div id="Q1">
977
- <h3>A.1.1&#160; Annex A.1a</h3>
978
- </div>
979
- </div>
980
- <div id="Q2">
981
- <h2>Appendix 1&#160; An Appendix</h2>
982
- </div>
983
- </div>
984
- <br/>
985
- <div>
986
- <h1 class="Section3">Bibliography</h1>
987
- <div>
988
- <h2 class="Section3">Bibliography Subsection</h2>
989
- </div>
990
- </div>
991
- </div>
992
- </body>
993
- </html>
1000
+ <?xml version='1.0'?>
1001
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1002
+ <preface>
1003
+ <foreword obligation='informative'>
1004
+ <title>Foreword</title>
1005
+ <p id='A'>
1006
+ This is a preamble
1007
+ <xref target='C'>0.1</xref>
1008
+ <xref target='C1'>0.2</xref>
1009
+ <xref target='D'>Clause 1</xref>
1010
+ <xref target='H'>Clause 3</xref>
1011
+ <xref target='I'>3.1</xref>
1012
+ <xref target='J'>3.1.1</xref>
1013
+ <xref target='K'>3.2</xref>
1014
+ <xref target='L'>Clause 4</xref>
1015
+ <xref target='M'>Clause 5</xref>
1016
+ <xref target='N'>5.1</xref>
1017
+ <xref target='O'>5.2</xref>
1018
+ <xref target='P'>Annex A</xref>
1019
+ <xref target='Q'>A.1</xref>
1020
+ <xref target='Q1'>A.1.1</xref>
1021
+ <xref target='Q2'>Annex A, Appendix 1</xref>
1022
+ <xref target='R'>Clause 2</xref>
1023
+ </p>
1024
+ </foreword>
1025
+ <introduction id='B' obligation='informative'>
1026
+ <title depth='1'>
1027
+ 0
1028
+ <tab/>
1029
+ Introduction
1030
+ </title>
1031
+ <clause id='C' inline-header='false' obligation='informative'>
1032
+ <title depth='2'>
1033
+ 0.1
1034
+ <tab/>
1035
+ Introduction Subsection
1036
+ </title>
1037
+ </clause>
1038
+ <clause id='C1' inline-header='true' obligation='informative'><title>0.2</title>Text</clause>
1039
+ </introduction>
1040
+ </preface>
1041
+ <sections>
1042
+ <clause id='D' obligation='normative' type="scope">
1043
+ <title depth='1'>1<tab/>Scope</title>
1044
+ <p id='E'>Text</p>
1045
+ </clause>
1046
+ <terms id='H' obligation='normative'>
1047
+ <title depth='1'>
1048
+ 3
1049
+ <tab/>
1050
+ Terms, definitions, symbols and abbreviated terms
1051
+ </title>
1052
+ <terms id='I' obligation='normative'>
1053
+ <title depth='2'>
1054
+ 3.1
1055
+ <tab/>
1056
+ Normal Terms
1057
+ </title>
1058
+ <term id='J'>
1059
+ <name>3.1.1</name>
1060
+ <preferred>Term2</preferred>
1061
+ </term>
1062
+ </terms>
1063
+ <definitions id='K' inline-header="true">
1064
+ <title>3.2</title>
1065
+ <dl>
1066
+ <dt>Symbol</dt>
1067
+ <dd>Definition</dd>
1068
+ </dl>
1069
+ </definitions>
1070
+ </terms>
1071
+ <definitions id='L'>
1072
+ <title>4</title>
1073
+ <dl>
1074
+ <dt>Symbol</dt>
1075
+ <dd>Definition</dd>
1076
+ </dl>
1077
+ </definitions>
1078
+ <clause id='M' inline-header='false' obligation='normative'>
1079
+ <title depth='1'>
1080
+ 5
1081
+ <tab/>
1082
+ Clause 4
1083
+ </title>
1084
+ <clause id='N' inline-header='false' obligation='normative'>
1085
+ <title depth='2'>
1086
+ 5.1
1087
+ <tab/>
1088
+ Introduction
1089
+ </title>
1090
+ </clause>
1091
+ <clause id='O' inline-header='false' obligation='normative'>
1092
+ <title depth='2'>
1093
+ 5.2
1094
+ <tab/>
1095
+ Clause 4.2
1096
+ </title>
1097
+ </clause>
1098
+ </clause>
1099
+ </sections>
1100
+ <annex id='P' inline-header='false' obligation='normative'>
1101
+ <title>
1102
+ <strong>Annex A</strong>
1103
+ <br/>
1104
+ (normative)
1105
+ <br/>
1106
+ <br/>
1107
+ <strong>Annex</strong>
1108
+ </title>
1109
+ <clause id='Q' inline-header='false' obligation='normative'>
1110
+ <title depth='2'>
1111
+ A.1
1112
+ <tab/>
1113
+ Annex A.1
1114
+ </title>
1115
+ <clause id='Q1' inline-header='false' obligation='normative'>
1116
+ <title depth='3'>
1117
+ A.1.1
1118
+ <tab/>
1119
+ Annex A.1a
1120
+ </title>
1121
+ </clause>
1122
+ </clause>
1123
+ <appendix id='Q2' inline-header='false' obligation='normative'>
1124
+ <title depth='2'>
1125
+ Appendix 1
1126
+ <tab/>
1127
+ An Appendix
1128
+ </title>
1129
+ </appendix>
1130
+ </annex>
1131
+ <bibliography>
1132
+ <references id='R' obligation='informative' normative='true'>
1133
+ <title depth='1'>
1134
+ 2
1135
+ <tab/>
1136
+ Normative References
1137
+ </title>
1138
+ </references>
1139
+ <clause id='S' obligation='informative'>
1140
+ <title depth='1'>Bibliography</title>
1141
+ <references id='T' obligation='informative' normative='false'>
1142
+ <title depth='2'>Bibliography Subsection</title>
1143
+ </references>
1144
+ </clause>
1145
+ </bibliography>
1146
+ </iso-standard>
994
1147
  OUTPUT
995
1148
  end
996
1149
 
997
1150
  it "cross-references lists" do
998
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1151
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
999
1152
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1000
1153
  <preface>
1001
1154
  <foreword>
@@ -1010,7 +1163,7 @@ Text</div>
1010
1163
  </foreword>
1011
1164
  </preface>
1012
1165
  <sections>
1013
- <clause id="scope"><title>Scope</title>
1166
+ <clause id="scope" type="scope"><title>Scope</title>
1014
1167
  <ol id="N">
1015
1168
  <li><p>A</p></li>
1016
1169
  </ol>
@@ -1044,72 +1197,78 @@ Text</div>
1044
1197
  </annex>
1045
1198
  </iso-standard>
1046
1199
  INPUT
1047
- #{HTML_HDR}
1048
- <br/>
1049
- <div>
1050
- <h1 class="ForewordTitle">Foreword</h1>
1051
- <p>
1052
- <a href="#N">Clause 1, List</a>
1053
- <a href="#note1">3.1, List 1</a>
1054
- <a href="#note2">3.1, List 2</a>
1055
- <a href="#AN">A.1, List</a>
1056
- <a href="#Anote1">A.2, List 1</a>
1057
- <a href="#Anote2">A.2, List 2</a>
1058
- </p>
1059
- </div>
1060
- <p class="zzSTDTitle1"/>
1061
- <div id="scope">
1062
- <h1>1&#160; Scope</h1>
1063
- <ol type="a" id="N">
1064
- <li><p>A</p></li>
1065
- </ol>
1066
- </div>
1067
- <div id="terms"><h1>2&#160; </h1>
1068
- </div>
1069
- <div id="widgets">
1070
- <h1>3&#160; Widgets</h1>
1071
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
1072
- <ol type="a" id="note1">
1073
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1074
- </ol>
1075
- <ol type="a" id="note2">
1076
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1077
- </ol>
1078
- </div>
1079
- </div>
1080
- <br/>
1081
- <div id="annex1" class="Section3">
1082
- <h1 class='Annex'>
1083
- <b>Annex A</b>
1084
- <br/>
1085
- (informative)
1086
- <br/>
1087
- <br/>
1088
- <b/>
1089
- </h1>
1090
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
1091
- <ol type="a" id="AN">
1092
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1093
- </ol>
1094
- </div>
1095
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
1096
- <ol type="a" id="Anote1">
1097
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1098
- </ol>
1099
- <ol type="a" id="Anote2">
1100
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1101
- </ol>
1102
- </div>
1103
- </div>
1104
- </div>
1105
- </body>
1106
- </html>
1107
-
1200
+ <?xml version='1.0'?>
1201
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1202
+ <preface>
1203
+ <foreword>
1204
+ <p>
1205
+ <xref target='N'>Clause 1, List</xref>
1206
+ <xref target='note1'>3.1, List 1</xref>
1207
+ <xref target='note2'>3.1, List 2</xref>
1208
+ <xref target='AN'>A.1, List</xref>
1209
+ <xref target='Anote1'>A.2, List 1</xref>
1210
+ <xref target='Anote2'>A.2, List 2</xref>
1211
+ </p>
1212
+ </foreword>
1213
+ </preface>
1214
+ <sections>
1215
+ <clause id='scope' type='scope'>
1216
+ <title depth='1'>1<tab/>Scope</title>
1217
+ <ol id='N'>
1218
+ <li>
1219
+ <p>A</p>
1220
+ </li>
1221
+ </ol>
1222
+ </clause>
1223
+ <terms id='terms'><title>2</title></terms>
1224
+ <clause id='widgets'>
1225
+ <title depth='1'>3<tab/>Widgets</title>
1226
+ <clause id='widgets1' inline-header='true'><title>3.1</title>
1227
+ <ol id='note1'>
1228
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
1229
+ These results are based on a study carried out on three different
1230
+ types of kernel.
1231
+ </p>
1232
+ </ol>
1233
+ <ol id='note2'>
1234
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
1235
+ These results are based on a study carried out on three different
1236
+ types of kernel.
1237
+ </p>
1238
+ </ol>
1239
+ </clause>
1240
+ </clause>
1241
+ </sections>
1242
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
1243
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
1244
+ <ol id='AN'>
1245
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
1246
+ These results are based on a study carried out on three different
1247
+ types of kernel.
1248
+ </p>
1249
+ </ol>
1250
+ </clause>
1251
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
1252
+ <ol id='Anote1'>
1253
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
1254
+ These results are based on a study carried out on three different
1255
+ types of kernel.
1256
+ </p>
1257
+ </ol>
1258
+ <ol id='Anote2'>
1259
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
1260
+ These results are based on a study carried out on three different
1261
+ types of kernel.
1262
+ </p>
1263
+ </ol>
1264
+ </clause>
1265
+ </annex>
1266
+ </iso-standard>
1108
1267
  OUTPUT
1109
1268
  end
1110
1269
 
1111
1270
  it "cross-references list items" do
1112
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1271
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1113
1272
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1114
1273
  <preface>
1115
1274
  <foreword>
@@ -1124,7 +1283,7 @@ Text</div>
1124
1283
  </foreword>
1125
1284
  </preface>
1126
1285
  <sections>
1127
- <clause id="scope"><title>Scope</title>
1286
+ <clause id="scope" type="scope"><title>Scope</title>
1128
1287
  <ol id="N1">
1129
1288
  <li id="N"><p>A</p></li>
1130
1289
  </ol>
@@ -1158,71 +1317,73 @@ Text</div>
1158
1317
  </annex>
1159
1318
  </iso-standard>
1160
1319
  INPUT
1161
- #{HTML_HDR}
1162
- <br/>
1163
- <div>
1164
- <h1 class="ForewordTitle">Foreword</h1>
1165
- <p>
1166
- <a href="#N">Clause 1 a)</a>
1167
- <a href="#note1">3.1 List 1 a)</a>
1168
- <a href="#note2">3.1 List 2 a)</a>
1169
- <a href="#AN">A.1 a)</a>
1170
- <a href="#Anote1">A.2 List 1 a)</a>
1171
- <a href="#Anote2">A.2 List 2 a)</a>
1172
- </p>
1173
- </div>
1174
- <p class="zzSTDTitle1"/>
1175
- <div id="scope">
1176
- <h1>1&#160; Scope</h1>
1177
- <ol type="a" id="N1">
1178
- <li id="N"><p>A</p></li>
1179
- </ol>
1180
- </div>
1181
- <div id="terms"><h1>2&#160; </h1>
1182
- </div>
1183
- <div id="widgets">
1184
- <h1>3&#160; Widgets</h1>
1185
- <div id="widgets1"><span class='zzMoveToFollowing'><b>3.1&#160; </b></span>
1186
- <ol type="a" id="note1l">
1187
- <li id="note1"><p>A</p></li>
1188
- </ol>
1189
- <ol type="a" id="note2l">
1190
- <li id="note2"><p>A</p></li>
1191
- </ol>
1192
- </div>
1193
- </div>
1194
- <br/>
1195
- <div id="annex1" class="Section3">
1196
- <h1 class='Annex'>
1197
- <b>Annex A</b>
1198
- <br/>
1199
- (informative)
1200
- <br/>
1201
- <br/>
1202
- <b/>
1203
- </h1>
1204
- <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
1205
- <ol type="a" id="ANl">
1206
- <li id="AN"><p>A</p></li>
1207
- </ol>
1208
- </div>
1209
- <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
1210
- <ol type="a" id="Anote1l">
1211
- <li id="Anote1"><p>A</p></li>
1212
- </ol>
1213
- <ol type="a" id="Anote2l">
1214
- <li id="Anote2"><p>A</p></li>
1215
- </ol>
1216
- </div>
1217
- </div>
1218
- </div>
1219
- </body>
1220
- </html>
1320
+ <?xml version='1.0'?>
1321
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1322
+ <preface>
1323
+ <foreword>
1324
+ <p>
1325
+ <xref target='N'>Clause 1 a)</xref>
1326
+ <xref target='note1'>3.1 List 1 a)</xref>
1327
+ <xref target='note2'>3.1 List 2 a)</xref>
1328
+ <xref target='AN'>A.1 a)</xref>
1329
+ <xref target='Anote1'>A.2 List 1 a)</xref>
1330
+ <xref target='Anote2'>A.2 List 2 a)</xref>
1331
+ </p>
1332
+ </foreword>
1333
+ </preface>
1334
+ <sections>
1335
+ <clause id='scope' type='scope'>
1336
+ <title depth='1'>1<tab/>Scope</title>
1337
+ <ol id='N1'>
1338
+ <li id='N'>
1339
+ <p>A</p>
1340
+ </li>
1341
+ </ol>
1342
+ </clause>
1343
+ <terms id='terms'><title>2</title></terms>
1344
+ <clause id='widgets'>
1345
+ <title depth='1'>3<tab/>Widgets</title>
1346
+ <clause inline-header="true" id='widgets1'><title>3.1</title>
1347
+ <ol id='note1l'>
1348
+ <li id='note1'>
1349
+ <p>A</p>
1350
+ </li>
1351
+ </ol>
1352
+ <ol id='note2l'>
1353
+ <li id='note2'>
1354
+ <p>A</p>
1355
+ </li>
1356
+ </ol>
1357
+ </clause>
1358
+ </clause>
1359
+ </sections>
1360
+ <annex id='annex1'><title><strong>Annex A</strong><br/>(informative)</title>
1361
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
1362
+ <ol id='ANl'>
1363
+ <li id='AN'>
1364
+ <p>A</p>
1365
+ </li>
1366
+ </ol>
1367
+ </clause>
1368
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
1369
+ <ol id='Anote1l'>
1370
+ <li id='Anote1'>
1371
+ <p>A</p>
1372
+ </li>
1373
+ </ol>
1374
+ <ol id='Anote2l'>
1375
+ <li id='Anote2'>
1376
+ <p>A</p>
1377
+ </li>
1378
+ </ol>
1379
+ </clause>
1380
+ </annex>
1381
+ </iso-standard>
1221
1382
  OUTPUT
1222
1383
  end
1223
1384
 
1224
1385
  it "cross-references nested list items" do
1225
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1386
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1226
1387
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1227
1388
  <preface>
1228
1389
  <foreword>
@@ -1237,7 +1398,7 @@ Text</div>
1237
1398
  </foreword>
1238
1399
  </preface>
1239
1400
  <sections>
1240
- <clause id="scope"><title>Scope</title>
1401
+ <clause id="scope" type="scope"><title>Scope</title>
1241
1402
  <ol id="N1">
1242
1403
  <li id="N"><p>A</p>
1243
1404
  <ol>
@@ -1260,44 +1421,56 @@ Text</div>
1260
1421
  </sections>
1261
1422
  </iso-standard>
1262
1423
  INPUT
1263
- #{HTML_HDR}
1264
- <br/>
1265
- <div>
1266
- <h1 class="ForewordTitle">Foreword</h1>
1267
- <p>
1268
- <a href="#N">Clause 1 a)</a>
1269
- <a href="#note1">Clause 1 a.1)</a>
1270
- <a href="#note2">Clause 1 a.1.i)</a>
1271
- <a href="#AN">Clause 1 a.1.i.A)</a>
1272
- <a href="#Anote1">Clause 1 a.1.i.A.I)</a>
1273
- <a href="#Anote2">Clause 1 a.1.i.A.I.a)</a>
1274
- </p>
1275
- </div>
1276
- <p class="zzSTDTitle1"/>
1277
- <div id="scope">
1278
- <h1>1&#160; Scope</h1>
1279
- <ol type="a" id="N1">
1280
- <li id="N"><p>A</p>
1281
- <ol type="1">
1282
- <li id="note1"><p>A</p>
1283
- <ol type="i">
1284
- <li id="note2"><p>A</p>
1285
- <ol type="A">
1286
- <li id="AN"><p>A</p>
1287
- <ol type="I">
1288
- <li id="Anote1"><p>A</p>
1289
- <ol type="a">
1290
- <li id="Anote2"><p>A</p></li>
1291
- </ol></li>
1292
- </ol></li>
1293
- </ol></li>
1294
- </ol></li>
1295
- </ol></li>
1296
- </ol>
1297
- </div>
1298
- </div>
1299
- </body>
1300
- </html>
1424
+ <?xml version='1.0'?>
1425
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
1426
+ <preface>
1427
+ <foreword>
1428
+ <p>
1429
+ <xref target='N'>Clause 1 a)</xref>
1430
+ <xref target='note1'>Clause 1 a.1)</xref>
1431
+ <xref target='note2'>Clause 1 a.1.i)</xref>
1432
+ <xref target='AN'>Clause 1 a.1.i.A)</xref>
1433
+ <xref target='Anote1'>Clause 1 a.1.i.A.I)</xref>
1434
+ <xref target='Anote2'>Clause 1 a.1.i.A.I.a)</xref>
1435
+ </p>
1436
+ </foreword>
1437
+ </preface>
1438
+ <sections>
1439
+ <clause id='scope' type='scope'>
1440
+ <title depth='1'>1<tab/>Scope</title>
1441
+ <ol id='N1'>
1442
+ <li id='N'>
1443
+ <p>A</p>
1444
+ <ol>
1445
+ <li id='note1'>
1446
+ <p>A</p>
1447
+ <ol>
1448
+ <li id='note2'>
1449
+ <p>A</p>
1450
+ <ol>
1451
+ <li id='AN'>
1452
+ <p>A</p>
1453
+ <ol>
1454
+ <li id='Anote1'>
1455
+ <p>A</p>
1456
+ <ol>
1457
+ <li id='Anote2'>
1458
+ <p>A</p>
1459
+ </li>
1460
+ </ol>
1461
+ </li>
1462
+ </ol>
1463
+ </li>
1464
+ </ol>
1465
+ </li>
1466
+ </ol>
1467
+ </li>
1468
+ </ol>
1469
+ </li>
1470
+ </ol>
1471
+ </clause>
1472
+ </sections>
1473
+ </iso-standard>
1301
1474
  OUTPUT
1302
1475
  end
1303
1476