metanorma-iso 1.5.14 → 1.7.2

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