metanorma-iec 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -187,7 +187,7 @@ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INP
187
187
  <?xml version='1.0'?>
188
188
  <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
189
189
  <preface>
190
- <foreword>
190
+ <foreword displayorder="1">
191
191
  <p>
192
192
  <eref type='inline' bibitemid='IEV' citeas='IEV'>
193
193
  <locality type='clause'>
@@ -261,7 +261,7 @@ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INP
261
261
  </foreword>
262
262
  </preface>
263
263
  <bibliography>
264
- <references id='_normative_references' obligation='informative' normative='true'>
264
+ <references id='_normative_references' obligation='informative' normative='true' displayorder="2">
265
265
  <title depth='1'>
266
266
  1
267
267
  <tab/>
@@ -130,7 +130,7 @@ RSpec.describe IsoDoc::Iec do
130
130
  <bibdata>
131
131
  <language current="true">en</language>
132
132
  </bibdata>
133
- <preface><foreword>
133
+ <preface><foreword displayorder="1">
134
134
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
135
135
  <eref bibitemid="ISO712">[110]</eref>
136
136
  <eref bibitemid="ISBN">[1]</eref>
@@ -142,7 +142,7 @@ RSpec.describe IsoDoc::Iec do
142
142
  <eref bibitemid="zip_ffs">[5]</eref>
143
143
  </p>
144
144
  </foreword></preface>
145
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title depth="1">1<tab/>Normative References</title>
145
+ <bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="2"><title depth="1">1<tab/>Normative References</title>
146
146
  <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
147
147
  <bibitem id="ISO712" type="standard">
148
148
  <title format="text/plain">Cereals or cereal products</title>
@@ -186,13 +186,13 @@ RSpec.describe IsoDoc::Iec do
186
186
  </bibitem>
187
187
  <bibitem id="ref1">
188
188
  <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
189
- <docidentifier type="ICC">167</docidentifier>
189
+ <docidentifier type="ICC">ICC 167</docidentifier>
190
190
  </bibitem>
191
191
  <note><name>NOTE</name><p>This is an annotation of ISO 20483:2013-2014</p></note>
192
192
  <bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
193
193
 
194
194
 
195
- </references><references id="_bibliography" obligation="informative" normative="false">
195
+ </references><references id="_bibliography" obligation="informative" normative="false" displayorder="3">
196
196
  <title depth="1">Bibliography</title>
197
197
  <bibitem id="ISBN" type="ISBN">
198
198
  <title format="text/plain">Chemicals for analytical laboratory use</title>
@@ -234,12 +234,12 @@ RSpec.describe IsoDoc::Iec do
234
234
  </bibitem>
235
235
  <bibitem id="ref11">
236
236
  <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
237
- <docidentifier type="IETF">RFC 10</docidentifier>
237
+ <docidentifier type="IETF">IETF RFC 10</docidentifier>
238
238
  </bibitem>
239
239
  <bibitem id="ref12">
240
240
  <formattedref format="application/x-isodoc+xml">CitationWorks. 2019. <em>How to cite a reference</em>.</formattedref>
241
241
  <docidentifier type="metanorma">[Citn]</docidentifier>
242
- <docidentifier type="IETF">RFC 20</docidentifier>
242
+ <docidentifier type="IETF">IETF RFC 20</docidentifier>
243
243
  </bibitem>
244
244
 
245
245
 
@@ -69,23 +69,23 @@ RSpec.describe IsoDoc do
69
69
  INPUT
70
70
 
71
71
  presxml = <<~OUTPUT
72
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
72
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
73
73
  <preface>
74
- <foreword obligation="informative">
74
+ <foreword obligation="informative" displayorder="1">
75
75
  <title>Foreword</title>
76
76
  <p id="A">This is a preamble</p>
77
77
  </foreword>
78
- <introduction id="B" obligation="informative"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
78
+ <introduction id="B" obligation="informative" displayorder="2"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
79
79
  <title depth="2">0.1<tab/>Introduction Subsection</title>
80
80
  </clause>
81
81
  <p>This is patent boilerplate</p>
82
82
  </introduction></preface><sections>
83
- <clause id="D" obligation="normative" type="scope">
83
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
84
84
  <title depth="1">1<tab/>Scope</title>
85
85
  <p id="E">Text</p>
86
86
  </clause>
87
-
88
- <clause id="H" obligation="normative"><title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
87
+
88
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
89
89
  <title depth="2">3.1<tab/>Normal Terms</title>
90
90
  <term id="J"><name>3.1.1</name>
91
91
  <preferred>Term2</preferred>
@@ -98,20 +98,20 @@ RSpec.describe IsoDoc do
98
98
  </dl>
99
99
  </definitions>
100
100
  </clause>
101
- <definitions id="L"><title>4</title>
101
+ <definitions id="L" displayorder="6"><title>4</title>
102
102
  <dl>
103
103
  <dt>Symbol</dt>
104
104
  <dd>Definition</dd>
105
105
  </dl>
106
106
  </definitions>
107
- <clause id="M" inline-header="false" obligation="normative"><title depth="1">5<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
107
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
108
108
  <title depth="2">5.1<tab/>Introduction</title>
109
109
  </clause>
110
110
  <clause id="O" inline-header="false" obligation="normative">
111
111
  <title depth="2">5.2<tab/>Clause 4.2</title>
112
112
  </clause></clause>
113
-
114
- </sections><annex id="P" inline-header="false" obligation="normative">
113
+
114
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
115
115
  <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
116
116
  <clause id="Q" inline-header="false" obligation="normative">
117
117
  <title depth="2">A.1<tab/>Annex A.1</title>
@@ -122,9 +122,9 @@ RSpec.describe IsoDoc do
122
122
  <appendix id="Q2" inline-header="false" obligation="normative">
123
123
  <title depth="2">Appendix 1<tab/>An Appendix</title>
124
124
  </appendix>
125
- </annex><bibliography><references id="R" obligation="informative" normative="true">
125
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
126
126
  <title depth="1">2<tab/>Normative References</title>
127
- </references><clause id="S" obligation="informative">
127
+ </references><clause id="S" obligation="informative" displayorder="9">
128
128
  <title depth="1">Bibliography</title>
129
129
  <references id="T" obligation="informative" normative="false">
130
130
  <title depth="2">Bibliography Subsection</title>
@@ -135,178 +135,176 @@ RSpec.describe IsoDoc do
135
135
  OUTPUT
136
136
 
137
137
  html = <<~OUTPUT
138
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
139
- <head/>
140
- <body lang="en">
141
- <div class="title-section">
142
- <p>&#160;</p>
138
+ <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
139
+ <head/>
140
+ <body lang="en">
141
+ <div class="title-section">
142
+ <p>&#160;</p>
143
+ </div>
144
+ <br/>
145
+ <div class="prefatory-section">
146
+ <p>&#160;</p>
147
+ </div>
148
+ <br/>
149
+ <div class="main-section">
150
+ <br/>
151
+ #{IEC_TITLE}
152
+ <div>
153
+ <h1 class="ForewordTitle">FOREWORD</h1>
154
+ <div class="boilerplate_legal"/>
155
+ <p id="A">This is a preamble</p>
156
+ </div>
157
+ <br/>
158
+ <div class="Section3" id="B">
159
+ <h1 class="IntroTitle">0&#160; Introduction</h1>
160
+ <div id="C">
161
+ <h2>0.1&#160; Introduction Subsection</h2>
143
162
  </div>
144
- <br/>
145
- <div class="prefatory-section">
146
- <p>&#160;</p>
163
+ <p>This is patent boilerplate</p>
164
+ </div>
165
+ #{IEC_TITLE1}
166
+ <div id="D">
167
+ <h1>1&#160; Scope</h1>
168
+ <p id="E">Text</p>
169
+ </div>
170
+ <div>
171
+ <h1>2&#160; Normative References</h1>
172
+ </div>
173
+ <div id="H"><h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
174
+ <div id="I">
175
+ <h2>3.1&#160; Normal Terms</h2>
176
+ <p class="TermNum" id="J">3.1.1</p>
177
+ <p class="Terms" style="text-align:left;">Term2</p>
178
+ </div><div id="K"><h2>3.2</h2>
179
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
180
+ </div></div>
181
+ <div id="L" class="Symbols">
182
+ <h1>4</h1>
183
+ <dl>
184
+ <dt>
185
+ <p>Symbol</p>
186
+ </dt>
187
+ <dd>Definition</dd>
188
+ </dl>
189
+ </div>
190
+ <div id="M">
191
+ <h1>5&#160; Clause 4</h1>
192
+ <div id="N">
193
+ <h2>5.1&#160; Introduction</h2>
147
194
  </div>
148
- <br/>
149
- <div class="main-section">
150
- <br/>
151
- #{IEC_TITLE}
152
- <div>
153
- <h1 class="ForewordTitle">FOREWORD</h1>
154
- <div class="boilerplate_legal"/>
155
- <p id="A">This is a preamble</p>
156
- </div>
157
- <br/>
158
- <div class="Section3" id="B">
159
- <h1 class="IntroTitle">0&#160; Introduction</h1>
160
- <div id="C">
161
- <h2>0.1&#160; Introduction Subsection</h2>
162
- </div>
163
- <p>This is patent boilerplate</p>
164
- </div>
165
- #{IEC_TITLE1}
166
- <div id="D">
167
- <h1>1&#160; Scope</h1>
168
- <p id="E">Text</p>
169
- </div>
170
- <div>
171
- <h1>2&#160; Normative References</h1>
172
- </div>
173
- <div id="H"><h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
174
- <div id="I">
175
- <h2>3.1&#160; Normal Terms</h2>
176
- <p class="TermNum" id="J">3.1.1</p>
177
- <p class="Terms" style="text-align:left;">Term2</p>
178
-
179
- </div><div id="K"><h2>3.2</h2>
180
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
181
- </div></div>
182
- <div id="L" class="Symbols">
183
- <h1>4</h1>
184
- <dl>
185
- <dt>
186
- <p>Symbol</p>
187
- </dt>
188
- <dd>Definition</dd>
189
- </dl>
190
- </div>
191
- <div id="M">
192
- <h1>5&#160; Clause 4</h1>
193
- <div id="N">
194
- <h2>5.1&#160; Introduction</h2>
195
- </div>
196
- <div id="O">
197
- <h2>5.2&#160; Clause 4.2</h2>
198
- </div>
199
- </div>
200
- <br/>
201
- <div id="P" class="Section3">
202
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
203
- <div id="Q">
204
- <h2>A.1&#160; Annex A.1</h2>
205
- <div id="Q1">
206
- <h3>A.1.1&#160; Annex A.1a</h3>
195
+ <div id="O">
196
+ <h2>5.2&#160; Clause 4.2</h2>
207
197
  </div>
208
- </div>
209
- <div id="Q2">
210
- <h2>Appendix 1&#160; An Appendix</h2>
211
- </div>
212
-
213
- </div>
214
- <br/>
215
- <div>
216
- <h1 class="Section3">Bibliography</h1>
198
+ </div>
199
+ <br/>
200
+ <div id="P" class="Section3">
201
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
202
+ <div id="Q">
203
+ <h2>A.1&#160; Annex A.1</h2>
204
+ <div id="Q1">
205
+ <h3>A.1.1&#160; Annex A.1a</h3>
206
+ </div>
207
+ </div>
208
+ <div id="Q2">
209
+ <h2>Appendix 1&#160; An Appendix</h2>
210
+ </div>
211
+ </div>
212
+ <br/>
217
213
  <div>
218
- <h2 class="Section3">Bibliography Subsection</h2>
214
+ <h1 class="Section3">Bibliography</h1>
215
+ <div>
216
+ <h2 class="Section3">Bibliography Subsection</h2>
217
+ </div>
219
218
  </div>
220
219
  </div>
221
- </div>
222
- </body>
223
- </html>
224
- OUTPUT
220
+ </body>
221
+ </html>
222
+ OUTPUT
225
223
 
226
224
  word = <<~OUTPUT
227
- <body lang="EN-US" link="blue" vlink="#954F72">
228
- <div class="WordSection2">
229
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
230
- #{IEC_TITLE}
231
- <div>
232
- <h1 class="ForewordTitle">FOREWORD</h1>
233
- <div class="boilerplate_legal"/>
234
- <p id="A">This is a preamble</p>
235
- </div>
236
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
237
- <div class="Section3" id="B">
238
- <h1 class="IntroTitle">0<span style="mso-tab-count:1">&#160; </span>Introduction</h1>
239
- <div id="C">
240
- <h2>0.1<span style="mso-tab-count:1">&#160; </span>Introduction Subsection</h2>
241
- </div>
242
- <p>This is patent boilerplate</p>
243
- </div>
244
- <p>&#160;</p>
245
- </div>
246
- <p><br clear="all" class="section"/></p>
247
- <div class="WordSection3">
248
- #{IEC_TITLE1}
249
- <div id="D">
250
- <h1>1<span style="mso-tab-count:1">&#160; </span>Scope</h1>
251
- <p id="E">Text</p>
252
- </div>
253
- <div>
254
- <h1>2<span style="mso-tab-count:1">&#160; </span>Normative References</h1>
255
- </div>
256
- <div id="H"><h1>3<span style="mso-tab-count:1">&#160; </span>Terms, definitions, symbols and abbreviated terms</h1>
257
- <div id="I">
258
- <h2>3.1<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
259
- <p class="TermNum" id="J">3.1.1</p>
260
- <p class="Terms" style="text-align:left;">Term2</p>
225
+ <body lang="EN-US" link="blue" vlink="#954F72">
226
+ <div class="WordSection2">
227
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
228
+ #{IEC_TITLE}
229
+ <div>
230
+ <h1 class="ForewordTitle">FOREWORD</h1>
231
+ <div class="boilerplate_legal"/>
232
+ <p id="A">This is a preamble</p>
233
+ </div>
234
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
235
+ <div class="Section3" id="B">
236
+ <h1 class="IntroTitle">0<span style="mso-tab-count:1">&#160; </span>Introduction</h1>
237
+ <div id="C">
238
+ <h2>0.1<span style="mso-tab-count:1">&#160; </span>Introduction Subsection</h2>
239
+ </div>
240
+ <p>This is patent boilerplate</p>
241
+ </div>
242
+ <p>&#160;</p>
243
+ </div>
244
+ <p><br clear="all" class="section"/></p>
245
+ <div class="WordSection3">
246
+ #{IEC_TITLE1}
247
+ <div id="D">
248
+ <h1>1<span style="mso-tab-count:1">&#160; </span>Scope</h1>
249
+ <p id="E">Text</p>
250
+ </div>
251
+ <div>
252
+ <h1>2<span style="mso-tab-count:1">&#160; </span>Normative References</h1>
253
+ </div>
254
+ <div id="H"><h1>3<span style="mso-tab-count:1">&#160; </span>Terms, definitions, symbols and abbreviated terms</h1>
255
+ <div id="I">
256
+ <h2>3.1<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
257
+ <p class="TermNum" id="J">3.1.1</p>
258
+ <p class="Terms" style="text-align:left;">Term2</p>
261
259
 
262
- </div><div id="K"><h2>3.2</h2>
263
- <table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">Symbol</p></td><td valign="top">Definition</td></tr></table>
264
- </div></div>
265
- <div id="L" class="Symbols">
266
- <h1>4</h1>
267
- <table class="dl">
268
- <tr>
269
- <td valign="top" align="left">
270
- <p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
271
- </td>
272
- <td valign="top">Definition</td>
273
- </tr>
274
- </table>
275
- </div>
276
- <div id="M">
277
- <h1>5<span style="mso-tab-count:1">&#160; </span>Clause 4</h1>
278
- <div id="N">
279
- <h2>5.1<span style="mso-tab-count:1">&#160; </span>Introduction</h2>
280
- </div>
281
- <div id="O">
282
- <h2>5.2<span style="mso-tab-count:1">&#160; </span>Clause 4.2</h2>
283
- </div>
284
- </div>
285
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
286
- <div id="P" class="Section3">
287
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
288
- <div id="Q">
289
- <h2>A.1<span style="mso-tab-count:1">&#160; </span>Annex A.1</h2>
290
- <div id="Q1">
291
- <h3>A.1.1<span style="mso-tab-count:1">&#160; </span>Annex A.1a</h3>
292
- </div>
293
- </div>
294
- <div id="Q2">
295
- <h2>Appendix 1<span style="mso-tab-count:1">&#160; </span>An Appendix</h2>
296
- </div>
297
- </div>
298
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
299
- <div>
300
- <h1 class="Section3">Bibliography</h1>
301
- <div>
302
- <h2 class="Section3">Bibliography Subsection</h2>
303
- </div>
304
- </div>
305
- </div>
306
- <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
307
- <div class="colophon"/>
308
- </body>
309
- OUTPUT
260
+ </div><div id="K"><h2>3.2</h2>
261
+ <table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">Symbol</p></td><td valign="top">Definition</td></tr></table>
262
+ </div></div>
263
+ <div id="L" class="Symbols">
264
+ <h1>4</h1>
265
+ <table class="dl">
266
+ <tr>
267
+ <td valign="top" align="left">
268
+ <p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
269
+ </td>
270
+ <td valign="top">Definition</td>
271
+ </tr>
272
+ </table>
273
+ </div>
274
+ <div id="M">
275
+ <h1>5<span style="mso-tab-count:1">&#160; </span>Clause 4</h1>
276
+ <div id="N">
277
+ <h2>5.1<span style="mso-tab-count:1">&#160; </span>Introduction</h2>
278
+ </div>
279
+ <div id="O">
280
+ <h2>5.2<span style="mso-tab-count:1">&#160; </span>Clause 4.2</h2>
281
+ </div>
282
+ </div>
283
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
284
+ <div id="P" class="Section3">
285
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
286
+ <div id="Q">
287
+ <h2>A.1<span style="mso-tab-count:1">&#160; </span>Annex A.1</h2>
288
+ <div id="Q1">
289
+ <h3>A.1.1<span style="mso-tab-count:1">&#160; </span>Annex A.1a</h3>
290
+ </div>
291
+ </div>
292
+ <div id="Q2">
293
+ <h2>Appendix 1<span style="mso-tab-count:1">&#160; </span>An Appendix</h2>
294
+ </div>
295
+ </div>
296
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
297
+ <div>
298
+ <h1 class="Section3">Bibliography</h1>
299
+ <div>
300
+ <h2 class="Section3">Bibliography Subsection</h2>
301
+ </div>
302
+ </div>
303
+ </div>
304
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
305
+ <div class="colophon"/>
306
+ </body>
307
+ OUTPUT
310
308
  expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
311
309
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
312
310
  expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, true).sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(word)
@@ -314,111 +312,109 @@ OUTPUT
314
312
 
315
313
  it "processes subclauses with and without titles" do
316
314
  expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
317
- <iso-standard xmlns="http://riboseinc.com/isoxml">
318
- <sections>
319
- <clause id="D" obligation="normative">
320
- <title>Scope</title>
321
- <clause id="D1" obligation="normative">
322
- <title>Scope 1</title>
323
- </clause>
324
- <clause id="D2" obligation="normative">
325
- </clause>
326
- </clause>
327
- </sections>
328
- </iso-standard>
329
- INPUT
330
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
331
- <sections>
332
- <clause id='D' obligation='normative'>
333
- <title depth='1'>
334
- 1
335
- <tab/>
336
- Scope
337
- </title>
338
- <clause id='D1' obligation='normative'>
339
- <title depth='2'>
340
- 1.1
341
- <tab/>
342
- Scope 1
343
- </title>
344
- </clause>
345
- <clause id='D2' obligation='normative'>
346
- <title>1.2</title>
347
- </clause>
348
- </clause>
349
- </sections>
350
- </iso-standard>
351
- OUTPUT
352
- end
353
-
315
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
316
+ <sections>
317
+ <clause id="D" obligation="normative">
318
+ <title>Scope</title>
319
+ <clause id="D1" obligation="normative">
320
+ <title>Scope 1</title>
321
+ </clause>
322
+ <clause id="D2" obligation="normative">
323
+ </clause>
324
+ </clause>
325
+ </sections>
326
+ </iso-standard>
327
+ INPUT
328
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
329
+ <sections>
330
+ <clause id='D' obligation='normative' displayorder="1">
331
+ <title depth='1'>
332
+ 1
333
+ <tab/>
334
+ Scope
335
+ </title>
336
+ <clause id='D1' obligation='normative'>
337
+ <title depth='2'>
338
+ 1.1
339
+ <tab/>
340
+ Scope 1
341
+ </title>
342
+ </clause>
343
+ <clause id='D2' obligation='normative'>
344
+ <title>1.2</title>
345
+ </clause>
346
+ </clause>
347
+ </sections>
348
+ </iso-standard>
349
+ OUTPUT
350
+ end
354
351
 
355
352
  it "processes simple terms & definitions" do
356
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
357
- <iso-standard xmlns="http://riboseinc.com/isoxml">
358
- <sections>
359
- <terms id="H" obligation="normative"><title>1<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
360
- <term id="J">
361
- <name>1.1</name>
362
- <preferred>Term2</preferred>
363
- </term>
364
- </terms>
365
- </sections>
366
- </iso-standard>
353
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
354
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
355
+ <sections>
356
+ <terms id="H" obligation="normative"><title>1<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
357
+ <term id="J">
358
+ <name>1.1</name>
359
+ <preferred>Term2</preferred>
360
+ </term>
361
+ </terms>
362
+ </sections>
363
+ </iso-standard>
367
364
  INPUT
368
- #{HTML_HDR}
369
- <div id="">
370
- <h1 class="ForewordTitle">FOREWORD</h1>
371
- <div class="boilerplate_legal"/>
372
- </div>
373
- #{IEC_TITLE1}
374
- <div id="H"><h1>1&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
375
- <p class="TermNum" id="J">1.1</p>
376
- <p class="Terms" style="text-align:left;">Term2</p>
365
+ #{HTML_HDR}
366
+ <div id="">
367
+ <h1 class="ForewordTitle">FOREWORD</h1>
368
+ <div class="boilerplate_legal"/>
377
369
  </div>
370
+ #{IEC_TITLE1}
371
+ <div id="H"><h1>1&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
372
+ <p class="TermNum" id="J">1.1</p>
373
+ <p class="Terms" style="text-align:left;">Term2</p>
378
374
  </div>
379
- </body>
380
- </html>
375
+ </div>
376
+ </body>
377
+ </html>
381
378
  OUTPUT
382
379
  end
383
380
 
384
- it "processes inline section headers" do
381
+ it "processes inline section headers" do
385
382
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
386
- <iso-standard xmlns="http://riboseinc.com/isoxml">
387
- <sections>
388
- <clause id="M" inline-header="false" obligation="normative"><title>1<tab/>Clause 4</title>
389
- <clause id="N" inline-header="false" obligation="normative">
390
- <title>1.1<tab/>Introduction</title>
391
- </clause>
392
- <clause id="O" inline-header="true" obligation="normative">
393
- <title>1.2<tab/>Clause 4.2</title>
394
- </clause></clause>
395
-
396
- </sections>
397
- </iso-standard>
383
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
384
+ <sections>
385
+ <clause id="M" inline-header="false" obligation="normative"><title>1<tab/>Clause 4</title>
386
+ <clause id="N" inline-header="false" obligation="normative">
387
+ <title>1.1<tab/>Introduction</title>
388
+ </clause>
389
+ <clause id="O" inline-header="true" obligation="normative">
390
+ <title>1.2<tab/>Clause 4.2</title>
391
+ </clause></clause>
392
+ </sections>
393
+ </iso-standard>
398
394
  INPUT
399
- #{HTML_HDR}
400
- <div id="">
401
- <h1 class="ForewordTitle">FOREWORD</h1>
402
- <div class="boilerplate_legal"/>
403
- </div>
404
- #{IEC_TITLE1}
405
- <div id="M">
406
- <h1>1&#160; Clause 4</h1>
407
- <div id="N">
408
- <h2>1.1&#160; Introduction</h2>
409
- </div>
410
- <div id="O">
411
- <span class="zzMoveToFollowing"><b>1.2&#160; Clause 4.2&#160; </b></span>
412
- </div>
413
- </div>
414
- </div>
415
- </body>
416
- </html>
417
- OUTPUT
418
- end
395
+ #{HTML_HDR}
396
+ <div id="">
397
+ <h1 class="ForewordTitle">FOREWORD</h1>
398
+ <div class="boilerplate_legal"/>
399
+ </div>
400
+ #{IEC_TITLE1}
401
+ <div id="M">
402
+ <h1>1&#160; Clause 4</h1>
403
+ <div id="N">
404
+ <h2>1.1&#160; Introduction</h2>
405
+ </div>
406
+ <div id="O">
407
+ <span class="zzMoveToFollowing"><b>1.2&#160; Clause 4.2&#160; </b></span>
408
+ </div>
409
+ </div>
410
+ </div>
411
+ </body>
412
+ </html>
413
+ OUTPUT
414
+ end
419
415
 
420
- it "adds colophon to published standard (Word)" do
421
- expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
416
+ it "adds colophon to published standard (Word)" do
417
+ expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
422
418
  <iso-standard xmlns="http://riboseinc.com/isoxml">
423
419
  <bibdata>
424
420
  <status>
@@ -429,30 +425,30 @@ OUTPUT
429
425
  <sections>
430
426
  </sections>
431
427
  </iso-standard>
432
- INPUT
433
- <body lang="EN-US" link="blue" vlink="#954F72">
434
- <div class="WordSection2">
435
- <p>
436
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
437
- </p>
438
- #{IEC_TITLE}
439
- <div id="">
440
- <h1 class="ForewordTitle">FOREWORD</h1>
441
- <div class="boilerplate_legal"/>
442
- </div>
443
- <p>&#160;</p>
444
- </div>
445
- <p><br clear="all" class="section"/></p>
446
- <div class="WordSection3">
447
- #{IEC_TITLE1}
428
+ INPUT
429
+ <body lang="EN-US" link="blue" vlink="#954F72">
430
+ <div class="WordSection2">
431
+ <p>
432
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
433
+ </p>
434
+ #{IEC_TITLE}
435
+ <div id="">
436
+ <h1 class="ForewordTitle">FOREWORD</h1>
437
+ <div class="boilerplate_legal"/>
448
438
  </div>
449
- <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
450
- <div class="colophon"/>
451
- </body>
452
- OUTPUT
453
- end
439
+ <p>&#160;</p>
440
+ </div>
441
+ <p><br clear="all" class="section"/></p>
442
+ <div class="WordSection3">
443
+ #{IEC_TITLE1}
444
+ </div>
445
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
446
+ <div class="colophon"/>
447
+ </body>
448
+ OUTPUT
449
+ end
454
450
 
455
- it "does not add colophon to draft standard (Word)" do
451
+ it "does not add colophon to draft standard (Word)" do
456
452
  expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
457
453
  <iso-standard xmlns="http://riboseinc.com/isoxml">
458
454
  <bibdata>
@@ -464,29 +460,29 @@ OUTPUT
464
460
  <sections>
465
461
  </sections>
466
462
  </iso-standard>
467
- INPUT
468
- <body lang="EN-US" link="blue" vlink="#954F72">
469
- <div class="WordSection2">
470
- <p>
471
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
472
- </p>
473
- #{IEC_TITLE}
474
- <div id="">
475
- <h1 class="ForewordTitle">FOREWORD</h1>
476
- <div class="boilerplate_legal"/>
477
- </div>
478
- <p>&#160;</p>
479
- </div>
480
- <p><br clear="all" class="section"/></p>
481
- <div class="WordSection3">
482
- #{IEC_TITLE1}
483
- </div>
484
- </body>
485
- OUTPUT
486
- end
463
+ INPUT
464
+ <body lang="EN-US" link="blue" vlink="#954F72">
465
+ <div class="WordSection2">
466
+ <p>
467
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
468
+ </p>
469
+ #{IEC_TITLE}
470
+ <div id="">
471
+ <h1 class="ForewordTitle">FOREWORD</h1>
472
+ <div class="boilerplate_legal"/>
473
+ </div>
474
+ <p>&#160;</p>
475
+ </div>
476
+ <p><br clear="all" class="section"/></p>
477
+ <div class="WordSection3">
478
+ #{IEC_TITLE1}
479
+ </div>
480
+ </body>
481
+ OUTPUT
482
+ end
487
483
 
488
- it "adds boilerplate to foreword" do
489
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
484
+ it "adds boilerplate to foreword" do
485
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
490
486
  <iso-standard xmlns="http://riboseinc.com/isoxml">
491
487
  <bibdata>
492
488
  <ext><doctype>International Standard</doctype></ext>
@@ -499,22 +495,22 @@ OUTPUT
499
495
  <sections/>
500
496
  </iso-standard>
501
497
  INPUT
502
- #{HTML_HDR}
503
- <div id="">
504
- <h1 class="ForewordTitle">FOREWORD</h1>
505
- <div class="boilerplate_legal">
506
- <p>Boilerplate</p>
507
- </div>
508
- </div>
509
- #{IEC_TITLE1}
510
- </div>
511
- </body>
512
- </html>
513
- OUTPUT
514
- end
498
+ #{HTML_HDR}
499
+ <div id="">
500
+ <h1 class="ForewordTitle">FOREWORD</h1>
501
+ <div class="boilerplate_legal">
502
+ <p>Boilerplate</p>
503
+ </div>
504
+ </div>
505
+ #{IEC_TITLE1}
506
+ </div>
507
+ </body>
508
+ </html>
509
+ OUTPUT
510
+ end
515
511
 
516
- it "does not add boilerplate to foreword in amendments" do
517
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
512
+ it "does not add boilerplate to foreword in amendments" do
513
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
518
514
  <iso-standard xmlns="http://riboseinc.com/isoxml">
519
515
  <bibdata>
520
516
  <ext><doctype>Amendment</doctype></ext>
@@ -527,15 +523,14 @@ OUTPUT
527
523
  <sections/>
528
524
  </iso-standard>
529
525
  INPUT
530
- #{HTML_HDR}
531
- <div id="">
532
- <h1 class="ForewordTitle">FOREWORD</h1>
533
- </div>
534
- #{IEC_TITLE1}
535
- </div>
536
- </body>
537
- </html>
538
- OUTPUT
539
- end
540
-
526
+ #{HTML_HDR}
527
+ <div id="">
528
+ <h1 class="ForewordTitle">FOREWORD</h1>
529
+ </div>
530
+ #{IEC_TITLE1}
531
+ </div>
532
+ </body>
533
+ </html>
534
+ OUTPUT
535
+ end
541
536
  end