metanorma-iec 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -614,12 +614,12 @@
614
614
  <optional>
615
615
  <ref name="fetched"/>
616
616
  </optional>
617
- <choice>
618
- <oneOrMore>
619
- <ref name="btitle"/>
620
- </oneOrMore>
617
+ <optional>
621
618
  <ref name="formattedref"/>
622
- </choice>
619
+ </optional>
620
+ <oneOrMore>
621
+ <ref name="btitle"/>
622
+ </oneOrMore>
623
623
  <zeroOrMore>
624
624
  <ref name="bsource"/>
625
625
  </zeroOrMore>
@@ -986,36 +986,34 @@
986
986
  <ref name="SeriesType"/>
987
987
  </attribute>
988
988
  </optional>
989
- <choice>
989
+ <optional>
990
990
  <ref name="formattedref"/>
991
- <group>
992
- <ref name="btitle"/>
993
- <optional>
994
- <ref name="bplace"/>
995
- </optional>
996
- <optional>
997
- <ref name="seriesorganization"/>
998
- </optional>
999
- <optional>
1000
- <ref name="abbreviation"/>
1001
- </optional>
1002
- <optional>
1003
- <ref name="seriesfrom"/>
1004
- </optional>
1005
- <optional>
1006
- <ref name="seriesto"/>
1007
- </optional>
1008
- <optional>
1009
- <ref name="seriesnumber"/>
1010
- </optional>
1011
- <optional>
1012
- <ref name="seriespartnumber"/>
1013
- </optional>
1014
- <optional>
1015
- <ref name="seriesrun"/>
1016
- </optional>
1017
- </group>
1018
- </choice>
991
+ </optional>
992
+ <ref name="btitle"/>
993
+ <optional>
994
+ <ref name="bplace"/>
995
+ </optional>
996
+ <optional>
997
+ <ref name="seriesorganization"/>
998
+ </optional>
999
+ <optional>
1000
+ <ref name="abbreviation"/>
1001
+ </optional>
1002
+ <optional>
1003
+ <ref name="seriesfrom"/>
1004
+ </optional>
1005
+ <optional>
1006
+ <ref name="seriesto"/>
1007
+ </optional>
1008
+ <optional>
1009
+ <ref name="seriesnumber"/>
1010
+ </optional>
1011
+ <optional>
1012
+ <ref name="seriespartnumber"/>
1013
+ </optional>
1014
+ <optional>
1015
+ <ref name="seriesrun"/>
1016
+ </optional>
1019
1017
  </element>
1020
1018
  </define>
1021
1019
  <define name="SeriesType">
@@ -131,6 +131,11 @@ module Metanorma
131
131
  "#{t.children.to_xml}</variant-title>"
132
132
  end
133
133
  end
134
+
135
+ def ol_attrs(node)
136
+ attr_code(keep_attrs(node)
137
+ .merge(id: ::Metanorma::Utils::anchor_or_uuid(node)))
138
+ end
134
139
  end
135
140
  end
136
141
  end
@@ -213,6 +213,8 @@ module Metanorma
213
213
  a = node.attr("secretary") and xml.secretary a
214
214
  a = node.attr("interest-to-committees") and xml.interest_to_committees a
215
215
  end
216
+
217
+ def metadata_approval_committee(node, xml); end
216
218
  end
217
219
  end
218
220
  end
@@ -282,6 +282,9 @@
282
282
  <ref name="MultilingualRenderingType"/>
283
283
  </attribute>
284
284
  </optional>
285
+ <optional>
286
+ <ref name="tname"/>
287
+ </optional>
285
288
  <oneOrMore>
286
289
  <ref name="ul_li"/>
287
290
  </oneOrMore>
@@ -324,6 +327,9 @@
324
327
  </choice>
325
328
  </attribute>
326
329
  </optional>
330
+ <optional>
331
+ <ref name="tname"/>
332
+ </optional>
327
333
  <oneOrMore>
328
334
  <ref name="li"/>
329
335
  </oneOrMore>
@@ -360,6 +366,9 @@
360
366
  <ref name="MultilingualRenderingType"/>
361
367
  </attribute>
362
368
  </optional>
369
+ <optional>
370
+ <ref name="tname"/>
371
+ </optional>
363
372
  <oneOrMore>
364
373
  <ref name="dt"/>
365
374
  <ref name="dd"/>
@@ -45,6 +45,7 @@
45
45
  <ref name="horizontal"/>
46
46
  </optional>
47
47
  <ref name="editorialgroup"/>
48
+ <ref name="approvalgroup"/>
48
49
  <zeroOrMore>
49
50
  <ref name="ics"/>
50
51
  </zeroOrMore>
@@ -249,6 +250,7 @@
249
250
  <value>warning</value>
250
251
  <value>important</value>
251
252
  <value>safety precautions</value>
253
+ <value>editorial</value>
252
254
  </choice>
253
255
  </define>
254
256
  <define name="preface">
@@ -308,18 +310,7 @@
308
310
  </define>
309
311
  <define name="editorialgroup">
310
312
  <element name="editorialgroup">
311
- <oneOrMore>
312
- <ref name="technical-committee"/>
313
- </oneOrMore>
314
- <zeroOrMore>
315
- <ref name="subcommittee"/>
316
- </zeroOrMore>
317
- <zeroOrMore>
318
- <ref name="workgroup"/>
319
- </zeroOrMore>
320
- <optional>
321
- <ref name="secretariat"/>
322
- </optional>
313
+ <ref name="ISOProjectGroup"/>
323
314
  </element>
324
315
  </define>
325
316
  <define name="Content-Section">
@@ -367,6 +358,33 @@
367
358
  </define>
368
359
  </include>
369
360
  <!-- end overrides -->
361
+ <define name="ISOProjectGroup">
362
+ <zeroOrMore>
363
+ <ref name="agency"/>
364
+ </zeroOrMore>
365
+ <oneOrMore>
366
+ <ref name="technical-committee"/>
367
+ </oneOrMore>
368
+ <zeroOrMore>
369
+ <ref name="subcommittee"/>
370
+ </zeroOrMore>
371
+ <zeroOrMore>
372
+ <ref name="workgroup"/>
373
+ </zeroOrMore>
374
+ <optional>
375
+ <ref name="secretariat"/>
376
+ </optional>
377
+ </define>
378
+ <define name="approvalgroup">
379
+ <element name="approvalgroup">
380
+ <ref name="ISOProjectGroup"/>
381
+ </element>
382
+ </define>
383
+ <define name="agency">
384
+ <element name="agency">
385
+ <text/>
386
+ </element>
387
+ </define>
370
388
  <!--
371
389
  We display the Normative References between scope and terms; but to keep the
372
390
  grammar simple, we keep the references together
@@ -428,6 +446,11 @@
428
446
  <data type="int"/>
429
447
  </element>
430
448
  </define>
449
+ <define name="approvalgroup">
450
+ <element name="approvalgroup">
451
+ <ref name="IsoWorkgroup"/>
452
+ </element>
453
+ </define>
431
454
  <define name="subcommittee">
432
455
  <element name="subcommittee">
433
456
  <ref name="IsoWorkgroup"/>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.1.1".freeze
3
+ VERSION = "2.1.2".freeze
4
4
  end
5
5
  end
6
6
 
@@ -160,4 +160,41 @@ RSpec.describe IsoDoc::Iec do
160
160
  .gsub(%r{</body>.*}m, "</body>")))
161
161
  .to be_equivalent_to xmlpp(output)
162
162
  end
163
+
164
+ it "does not ignore intervening ul in numbering ol" do
165
+ input = <<~INPUT
166
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
167
+ <preface><foreword>
168
+ <ul>
169
+ <li>A</li>
170
+ <li>
171
+ <ol>
172
+ <li>List</li>
173
+ </ol>
174
+ </li>
175
+ </ul>
176
+ </foreword></preface>
177
+ </iso-standard>
178
+ INPUT
179
+ presxml = <<~INPUT
180
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
181
+ <preface>
182
+ <foreword displayorder='1'>
183
+ <ul>
184
+ <li>A</li>
185
+ <li>
186
+ <ol type='arabic'>
187
+ <li>List</li>
188
+ </ol>
189
+ </li>
190
+ </ul>
191
+ </foreword>
192
+ </preface>
193
+ </iso-standard>
194
+ INPUT
195
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
196
+ .convert("test", input, true)))
197
+ .to be_equivalent_to xmlpp(presxml)
198
+
199
+ end
163
200
  end
@@ -109,7 +109,7 @@ RSpec.describe IsoDoc do
109
109
  </owner>
110
110
  </copyright>
111
111
  <ext>
112
- <doctype>article</doctype>
112
+ <doctype>international-standard</doctype>
113
113
  <editorialgroup>
114
114
  <technical-committee/>
115
115
  <subcommittee/>
@@ -170,7 +170,7 @@ RSpec.describe IsoDoc do
170
170
  <status>
171
171
  <stage language="">60</stage>
172
172
  <stage language='fr'>Norme internationale</stage>
173
- <stage language='en'>International standard</stage>
173
+ <stage language='en'>International Standard</stage>
174
174
  <substage>60</substage>
175
175
  </status>
176
176
  <copyright>
@@ -183,8 +183,10 @@ RSpec.describe IsoDoc do
183
183
  </owner>
184
184
  </copyright>
185
185
  <ext>
186
- <doctype>article</doctype>
187
- <editorialgroup>
186
+ <doctype language=''>international-standard</doctype>
187
+ <doctype language='fr'>Norme internationale</doctype>
188
+ <doctype language='en'>International Standard</doctype>
189
+ <editorialgroup identifier=' / / '>
188
190
  <technical-committee/>
189
191
  <subcommittee/>
190
192
  <workgroup/>