metanorma-iso 2.0.8.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +169 -0
  3. data/lib/isodoc/iso/base_convert.rb +11 -1
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +3 -1
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
  17. data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
  18. data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
  19. data/lib/isodoc/iso/html_convert.rb +7 -2
  20. data/lib/isodoc/iso/i18n-en.yaml +33 -4
  21. data/lib/isodoc/iso/i18n-fr.yaml +30 -3
  22. data/lib/isodoc/iso/i18n-ru.yaml +33 -4
  23. data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
  24. data/lib/isodoc/iso/i18n.rb +1 -1
  25. data/lib/isodoc/iso/init.rb +17 -1
  26. data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
  27. data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
  28. data/lib/isodoc/iso/metadata.rb +72 -78
  29. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  30. data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
  31. data/lib/isodoc/iso/presentation_xref.rb +132 -0
  32. data/lib/isodoc/iso/sections.rb +3 -3
  33. data/lib/isodoc/iso/word_cleanup.rb +17 -0
  34. data/lib/isodoc/iso/word_convert.rb +32 -12
  35. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  36. data/lib/isodoc/iso/word_dis_convert.rb +122 -0
  37. data/lib/isodoc/iso/xref.rb +78 -29
  38. data/lib/metanorma/iso/base.rb +20 -1
  39. data/lib/metanorma/iso/biblio.rng +69 -42
  40. data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
  41. data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
  42. data/lib/metanorma/iso/boilerplate.xml +4 -3
  43. data/lib/metanorma/iso/cleanup.rb +29 -1
  44. data/lib/metanorma/iso/front.rb +31 -6
  45. data/lib/metanorma/iso/front_id.rb +2 -0
  46. data/lib/metanorma/iso/isodoc.rng +65 -0
  47. data/lib/metanorma/iso/isostandard.rng +30 -12
  48. data/lib/metanorma/iso/macros.rb +29 -0
  49. data/lib/metanorma/iso/version.rb +1 -1
  50. data/lib/metanorma-iso.rb +1 -0
  51. data/lib/relaton/render/config.yml +4 -0
  52. data/lib/relaton/render/general.rb +13 -0
  53. data/metanorma-iso.gemspec +1 -1
  54. data/spec/isodoc/amd_spec.rb +35 -60
  55. data/spec/isodoc/blocks_spec.rb +783 -179
  56. data/spec/isodoc/i18n_spec.rb +331 -100
  57. data/spec/isodoc/inline_spec.rb +35 -42
  58. data/spec/isodoc/iso_spec.rb +51 -170
  59. data/spec/isodoc/metadata_spec.rb +240 -99
  60. data/spec/isodoc/postproc_spec.rb +68 -7
  61. data/spec/isodoc/ref_spec.rb +66 -69
  62. data/spec/isodoc/section_spec.rb +88 -80
  63. data/spec/isodoc/table_spec.rb +2 -2
  64. data/spec/isodoc/terms_spec.rb +2 -2
  65. data/spec/isodoc/word_dis_spec.rb +1886 -0
  66. data/spec/isodoc/xref_spec.rb +138 -64
  67. data/spec/metanorma/amd_spec.rb +53 -1
  68. data/spec/metanorma/base_spec.rb +195 -20
  69. data/spec/metanorma/blocks_spec.rb +54 -0
  70. data/spec/metanorma/lists_spec.rb +2 -2
  71. data/spec/metanorma/section_spec.rb +2 -2
  72. data/spec/spec_helper.rb +23 -4
  73. data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
  74. metadata +15 -10
  75. data/docs/asciiiso-syntax.adoc +0 -307
  76. data/docs/guidance.adoc +0 -487
  77. data/docs/navigation.adoc +0 -23
  78. data/docs/quickstart.adoc +0 -179
  79. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -30,11 +30,9 @@ RSpec.describe IsoDoc do
30
30
  .convert("test", <<~"INPUT", false)
31
31
  <iso-standard xmlns="http://riboseinc.com/isoxml">
32
32
  <bibdata>
33
- <title>
34
33
  <title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
35
34
  <title format="text/plain" language="en" type="title-main">Specifications and test methods</title>
36
35
  <title format="text/plain" language="en" type="title-part">Rice</title>
37
- </title>
38
36
  </bibdata>
39
37
  <preface>
40
38
  <foreword>
@@ -59,11 +57,9 @@ RSpec.describe IsoDoc do
59
57
  .convert("test", <<~"INPUT", false)
60
58
  <iso-standard xmlns="http://riboseinc.com/isoxml">
61
59
  <bibdata>
62
- <title>
63
60
  <title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
64
61
  <title format="text/plain" language="en" type="title-main">Specifications and test methods</title>
65
62
  <title format="text/plain" language="en" type="title-part">Rice</title>
66
- </title>
67
63
  </bibdata>
68
64
  <preface>
69
65
  <foreword>
@@ -374,12 +370,14 @@ RSpec.describe IsoDoc do
374
370
  </clause>
375
371
  </clause>
376
372
  </sections>
373
+ <annex id="AA"><title>Annex A<tab/>Annex First</title></annex>
377
374
  </iso-standard>
378
375
  INPUT
379
376
 
380
377
  word = File.read("test.doc", encoding: "UTF-8")
381
378
  .sub(/^.*An empty word intro page\./m, "")
382
379
  .sub(%r{</div>.*$}m, "</div>")
380
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")
383
381
 
384
382
  expect(xmlpp("<div>#{word.gsub(/_Toc\d\d+/, '_Toc')}"))
385
383
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
@@ -456,12 +454,35 @@ RSpec.describe IsoDoc do
456
454
  </span>
457
455
  </span>
458
456
  </p>
457
+ <p class='MsoToc1'>
458
+ <span class='MsoHyperlink'>
459
+ <span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
460
+ <a href='#_Toc'>
461
+ Annex A Annex First
462
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
463
+ <span style='mso-tab-count:1 dotted'>. </span>
464
+ </span>
465
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
466
+ <span style='mso-element:field-begin'/>
467
+ </span>
468
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
469
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
470
+ <span style='mso-element:field-separator'/>
471
+ </span>
472
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
473
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
474
+ <span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
475
+ <span style='mso-element:field-end'/>
476
+ </span>
477
+ </a>
478
+ </span>
479
+ </span>
480
+ </p>
459
481
  <p class="MsoToc1">
460
482
  <span lang="EN-GB" xml:lang="EN-GB">
461
483
  <span style="mso-element:field-end"/>
462
484
  </span>
463
485
  <span lang="EN-GB" xml:lang="EN-GB">
464
- <p class="MsoNormal"> </p>
465
486
  </span>
466
487
  </p>
467
488
  <p class="MsoNormal"> </p>
@@ -823,6 +844,46 @@ RSpec.describe IsoDoc do
823
844
  OUTPUT
824
845
  end
825
846
 
847
+ it "processes editorial notes (Word)" do
848
+ IsoDoc::Iso::WordConvert
849
+ .new(WORD_HTML_CSS.dup)
850
+ .convert("test", <<~"INPUT", false)
851
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
852
+ <annex id="P" inline-header="false" obligation="normative">
853
+ <admonition id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a" type="editorial">
854
+ <p id='_e94663cc-2473-4ccc-9a72-983a74d989f2'>
855
+ Only use paddy or parboiled rice for the
856
+ determination of husked rice yield.
857
+ </p>
858
+ <p id="_e94663cc-2473-4ccc-9a72-983a74d989f3">Para 2.</p>
859
+ </admonition>
860
+ </annex>
861
+ </iso-standard>
862
+ INPUT
863
+ word = File.read("test.doc", encoding: "UTF-8")
864
+ .sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
865
+ .sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
866
+ expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
867
+ <div class='WordSection3'>
868
+ <p class='zzSTDTitle1'/>
869
+ <p class='MsoNormal'>
870
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
871
+ </p>
872
+ <div class='Section3'>
873
+ <a name='P' id='P'/>
874
+ <div class='zzHelp'>
875
+ <a name='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a'/>
876
+ <p class='zzHelp'> Only use paddy or parboiled rice for the determination of husked rice yield. </p>
877
+ <p class='zzHelp'>
878
+ <a name='_e94663cc-2473-4ccc-9a72-983a74d989f3' id='_e94663cc-2473-4ccc-9a72-983a74d989f3'/>
879
+ Para 2.
880
+ </p>
881
+ </div>
882
+ </div>
883
+ </div>
884
+ OUTPUT
885
+ end
886
+
826
887
  it "processes boilerplate" do
827
888
  input = <<~INPUT
828
889
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -1005,7 +1066,8 @@ RSpec.describe IsoDoc do
1005
1066
  '<div class="WordSection2">')
1006
1067
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
1007
1068
 
1008
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
1069
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
1070
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
1009
1071
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
1010
1072
  <div class="WordSection2">An empty word intro page.
1011
1073
  <p class="MsoToc1">
@@ -1085,7 +1147,6 @@ RSpec.describe IsoDoc do
1085
1147
  <span style="mso-element:field-end"/>
1086
1148
  </span>
1087
1149
  <span lang="EN-GB" xml:lang="EN-GB">
1088
- <p class="MsoNormal"> </p>
1089
1150
  </span>
1090
1151
  </p>
1091
1152
  <p class="MsoNormal"> </p>
@@ -84,7 +84,7 @@ RSpec.describe IsoDoc do
84
84
  </references>
85
85
  <references id="_bibliography" normative="false" obligation="informative">
86
86
  <title>Bibliography</title>
87
- <bibitem id="ISBN" type="ISBN">
87
+ <bibitem id="ISBN" type="book">
88
88
  <title format="text/plain">Chemicals for analytical laboratory use</title>
89
89
  <docidentifier type="ISBN">ISBN</docidentifier>
90
90
  <docidentifier type="metanorma">[1]</docidentifier>
@@ -95,7 +95,7 @@ RSpec.describe IsoDoc do
95
95
  </organization>
96
96
  </contributor>
97
97
  </bibitem>
98
- <bibitem id="ISSN" type="ISSN">
98
+ <bibitem id="ISSN" type="journal">
99
99
  <title format="text/plain">Instruments for analytical laboratory use</title>
100
100
  <docidentifier type="ISSN">ISSN</docidentifier>
101
101
  <docidentifier type="metanorma">[2]</docidentifier>
@@ -177,49 +177,17 @@ RSpec.describe IsoDoc do
177
177
  amendments) applies.
178
178
  </p>
179
179
  <bibitem id="ISO712" type="standard">
180
- <title format="text/plain">Cereals or cereal products</title>
181
- <title format="text/plain" type="main">Cereals and cereal products</title>
180
+ <formattedref><em><span class="stddocTitle">Cereals and cereal products</span></em></formattedref>
182
181
  <docidentifier type="ISO">ISO 712</docidentifier>
183
- <contributor>
184
- <role type="publisher"/>
185
- <organization>
186
- <name>International Organization for Standardization</name>
187
- </organization>
188
- </contributor>
189
182
  </bibitem>
190
183
  <bibitem id="ISO16634" type="standard">
191
- <title format="text/plain" language="x">Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
192
- feeding stuffs
193
- </title>
194
- <title format="text/plain" language="en">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
184
+ <formattedref><em><span class="stddocTitle">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</span></em></formattedref>
195
185
  <docidentifier type="ISO">ISO 16634:-- (all parts)</docidentifier>
196
- <date type="published">
197
- <on>--</on>
198
- </date>
199
- <contributor>
200
- <role type="publisher"/>
201
- <organization>
202
- <abbreviation>ISO</abbreviation>
203
- </organization>
204
- </contributor>
205
186
  <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
206
- <extent type="part">
207
- <referenceFrom>all</referenceFrom>
208
- </extent>
209
187
  </bibitem>
210
188
  <bibitem id="ISO20483" type="standard">
211
- <title format="text/plain">Cereals and pulses</title>
189
+ <formattedref><em><span class="stddocTitle">Cereals and pulses</span></em></formattedref>
212
190
  <docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
213
- <date type="published">
214
- <from>2013</from>
215
- <to>2014</to>
216
- </date>
217
- <contributor>
218
- <role type="publisher"/>
219
- <organization>
220
- <name>International Organization for Standardization</name>
221
- </organization>
222
- </contributor>
223
191
  </bibitem>
224
192
  <bibitem id="ref1">
225
193
  <formattedref format="application/x-isodoc+xml">
@@ -229,8 +197,8 @@ RSpec.describe IsoDoc do
229
197
  for food and animal feeding stuffs according to the Dumas combustion
230
198
  method</em> (see
231
199
 
232
- <link target="http://www.icc.or.at"/>
233
- )</formattedref>
200
+ <link target="http://www.icc.or.at"/> )
201
+ </formattedref>
234
202
  <docidentifier type="ICC">ICC 167</docidentifier>
235
203
  </bibitem>
236
204
  <note>
@@ -240,27 +208,15 @@ RSpec.describe IsoDoc do
240
208
  </references>
241
209
  <references id="_bibliography" normative="false" obligation="informative" displayorder="3">
242
210
  <title depth="1">Bibliography</title>
243
- <bibitem id="ISBN" type="ISBN">
244
- <title format="text/plain">Chemicals for analytical laboratory use</title>
211
+ <bibitem id="ISBN" type="book">
212
+ <formattedref><em>Chemicals for analytical laboratory use</em>. ISBN.</formattedref>
245
213
  <docidentifier type="ISBN">ISBN</docidentifier>
246
214
  <docidentifier type="metanorma">[1]</docidentifier>
247
- <contributor>
248
- <role type="publisher"/>
249
- <organization>
250
- <abbreviation>ISBN</abbreviation>
251
- </organization>
252
- </contributor>
253
215
  </bibitem>
254
- <bibitem id="ISSN" type="ISSN">
255
- <title format="text/plain">Instruments for analytical laboratory use</title>
216
+ <bibitem id="ISSN" type="journal">
217
+ <formattedref><em>Instruments for analytical laboratory use</em>. ISSN.</formattedref>
256
218
  <docidentifier type="ISSN">ISSN</docidentifier>
257
219
  <docidentifier type="metanorma">[2]</docidentifier>
258
- <contributor>
259
- <role type="publisher"/>
260
- <organization>
261
- <abbreviation>ISSN</abbreviation>
262
- </organization>
263
- </contributor>
264
220
  </bibitem>
265
221
  <note>
266
222
  <name>NOTE</name>
@@ -271,15 +227,9 @@ RSpec.describe IsoDoc do
271
227
  <p>This is another annotation of document ISSN.</p>
272
228
  </note>
273
229
  <bibitem id="ISO3696" type="standard">
274
- <title format="text/plain">Water for analytical laboratory use</title>
230
+ <formattedref><em><span class='stddocTitle'>Water for analytical laboratory use</span></em></formattedref>
275
231
  <docidentifier type='metanorma-ordinal'>[3]</docidentifier>
276
232
  <docidentifier type="ISO">ISO 3696</docidentifier>
277
- <contributor>
278
- <role type="publisher"/>
279
- <organization>
280
- <abbreviation>ISO</abbreviation>
281
- </organization>
282
- </contributor>
283
233
  </bibitem>
284
234
  <bibitem id="ref10">
285
235
  <formattedref format="application/x-isodoc+xml">
@@ -294,15 +244,13 @@ RSpec.describe IsoDoc do
294
244
  <docidentifier type="metanorma">[10]</docidentifier>
295
245
  </bibitem>
296
246
  <bibitem id="ref11">
297
- <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
247
+ <formattedref><em>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</em>.</formattedref>
298
248
  <docidentifier type='metanorma-ordinal'>[4]</docidentifier>
299
249
  <docidentifier type="IETF">IETF RFC 10</docidentifier>
300
250
  </bibitem>
301
251
  <bibitem id="ref12">
302
252
  <formattedref format="application/x-isodoc+xml">CitationWorks. 2019.
303
-
304
- <em>How to cite a reference</em>
305
- .</formattedref>
253
+ <em>How to cite a reference</em>.</formattedref>
306
254
  <docidentifier type="metanorma">[Citn]</docidentifier>
307
255
  <docidentifier type="IETF">IETF RFC 20</docidentifier>
308
256
  </bibitem>
@@ -353,8 +301,8 @@ RSpec.describe IsoDoc do
353
301
  <br/>
354
302
  <div>
355
303
  <h1 class="Section3">Bibliography</h1>
356
- <p class="Biblio" id="ISBN">[1]&#160; <i>Chemicals for analytical laboratory use</i></p>
357
- <p class="Biblio" id="ISSN">[2]&#160; <i>Instruments for analytical laboratory use</i></p>
304
+ <p class="Biblio" id="ISBN">[1]&#160; <i>Chemicals for analytical laboratory use</i>. ISBN.</p>
305
+ <p class="Biblio" id="ISSN">[2]&#160; <i>Instruments for analytical laboratory use</i>. ISSN.</p>
358
306
  <div class="Note">
359
307
  <p>
360
308
  <span class="note_label">NOTE</span>&#160; This is an annotation of document ISSN.</p>
@@ -372,7 +320,7 @@ RSpec.describe IsoDoc do
372
320
  <a href="http://www.icc.or.at">http://www.icc.or.at</a>
373
321
  )</p>
374
322
  <p class="Biblio" id="ref11">[4]&#160; IETF RFC 10,
375
- <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i></p>
323
+ <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>.</p>
376
324
  <p class="Biblio" id="ref12">Citn&#160; IETF RFC 20, CitationWorks. 2019.
377
325
  <i>How to cite a reference</i>
378
326
  .</p>
@@ -392,4 +340,53 @@ RSpec.describe IsoDoc do
392
340
  .convert("test", presxml, true)))
393
341
  .to be_equivalent_to xmlpp(html)
394
342
  end
343
+
344
+ it "processes websites" do
345
+ input = <<~INPUT
346
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
347
+ <bibdata>
348
+ <language>en</language>
349
+ </bibdata>
350
+ <references normative="false">
351
+ <title>Bibliography</title>
352
+ <bibitem id="ignf" type="website">
353
+ <fetched>2022-05-06</fetched>
354
+ <title type="title-main" format="text/plain">IGNF. (IGN France) Registry</title>
355
+ <title type="main" format="text/plain">IGNF. (IGN France) Registry</title>
356
+ <uri>https://registre.ign.fr/ign/IGNF/</uri>
357
+ <docidentifier type="metanorma">2</docidentifier>
358
+ </bibitem>
359
+ </references>
360
+ </iso-standard>
361
+ INPUT
362
+ output = <<~OUTPUT
363
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
364
+ <bibdata>
365
+ <language current='true'>en</language>
366
+ </bibdata>
367
+
368
+ <references normative='false'>
369
+ <title depth='1'>Bibliography</title>
370
+ <bibitem id='ignf' type='website'>
371
+ <formattedref>
372
+ <em>
373
+ <span class='stddocTitle'>IGNF. (IGN France) Registry</span>
374
+ </em>
375
+ [website]. Available from:
376
+ <span class='biburl'>
377
+ <link target='https://registre.ign.fr/ign/IGNF/'>https://registre.ign.fr/ign/IGNF/</link>
378
+ </span>
379
+ .
380
+ </formattedref>
381
+ <uri>https://registre.ign.fr/ign/IGNF/</uri>
382
+ <docidentifier type='metanorma'>2</docidentifier>
383
+ </bibitem>
384
+ </references>
385
+ </iso-standard>
386
+ OUTPUT
387
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
388
+ .convert("test", input, true))
389
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
390
+ .to be_equivalent_to xmlpp(output)
391
+ end
395
392
  end
@@ -137,7 +137,7 @@ RSpec.describe IsoDoc do
137
137
  </clause>
138
138
  </sections>
139
139
  <annex id="P" inline-header="false" obligation="normative" displayorder="8">
140
- <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
140
+ <title><strong>Annex A</strong><br/><span class='obligation'>(normative)</span><br/><br/><strong>Annex</strong></title>
141
141
  <clause id="Q" inline-header="false" obligation="normative">
142
142
  <title depth="2">A.1<tab/>Annex A.1</title>
143
143
  <clause id="Q1" inline-header="false" obligation="normative">
@@ -369,7 +369,7 @@ RSpec.describe IsoDoc do
369
369
  </p>
370
370
  <div class="Section3" id="P">
371
371
  <h1 class="Annex">
372
- <br/>(normative)
372
+ <br/><span style='font-weight:normal;'>(normative)</span>
373
373
  <br/>
374
374
  <br/>
375
375
  <b>Annex</b></h1>
@@ -526,7 +526,7 @@ RSpec.describe IsoDoc do
526
526
 
527
527
  it "processes multiple terms & definitions sections" do
528
528
  input = <<~INPUT
529
- #{BLANK_HDR.sub(%r{<doctype>article</doctype>}, '<doctype>article</doctype><subdoctype>vocabulary</subdoctype>')}
529
+ #{BLANK_HDR.sub(%r{<doctype>standard</doctype>}, '<doctype>standard</doctype><subdoctype>vocabulary</subdoctype>')}
530
530
  <sections>
531
531
  <terms id='A' obligation='normative'>
532
532
  <title>Terms and definitions</title>
@@ -561,83 +561,89 @@ RSpec.describe IsoDoc do
561
561
  <language current='true'>en</language>
562
562
  <script current='true'>Latn</script>
563
563
  <status>
564
- <stage abbreviation='IS' language=''>60</stage>
565
- <stage abbreviation='IS' language='en'>International standard</stage>
566
- <substage language=''>60</substage>
564
+ <stage abbreviation='IS'>60</stage>
565
+ <substage>60</substage>
567
566
  </status>
568
- <copyright>
569
- <from>#{Time.new.year}</from>
570
- <owner>
571
- <organization>
572
- <name>International Organization for Standardization</name>
573
- <abbreviation>ISO</abbreviation>
574
- </organization>
575
- </owner>
576
- </copyright>
577
- <ext>
578
- <doctype language=''>article</doctype>
579
- <subdoctype>vocabulary</subdoctype>
580
- <editorialgroup>
581
- <technical-committee/>
582
- <subcommittee/>
583
- <workgroup/>
584
- </editorialgroup>
585
- <stagename>International standard</stagename>
586
- </ext>
587
- </bibdata>
588
- <sections>
589
- <terms id='A' obligation='normative' displayorder='1'>
590
- <title depth='1'>
591
- 1
592
- <tab/>
593
- Terms and definitions
594
- </title>
595
- <p id='A1'>No terms and definitions are listed in this document.</p>
596
- </terms>
597
- <clause id='B' inline-header='false' obligation='normative' displayorder='2'>
598
- <title depth='1'>
599
- 2
600
- <tab/>
601
- Clause
602
- </title>
603
- </clause>
604
- <terms id='C' obligation='normative' displayorder='3'>
605
- <title depth='1'>
606
- 3
607
- <tab/>
608
- More terms
609
- </title>
610
- </terms>
611
- </sections>
612
- </iso-standard>
567
+ <copyright>
568
+ <from>#{Time.new.year}</from>
569
+ <owner>
570
+ <organization>
571
+ <name>International Organization for Standardization</name>
572
+ <abbreviation>ISO</abbreviation>
573
+ </organization>
574
+ </owner>
575
+ </copyright>
576
+ <ext>
577
+ <doctype>standard</doctype>
578
+ <subdoctype>vocabulary</subdoctype>
579
+ <editorialgroup identifier='ISO/ / / '>
580
+ <agency>ISO</agency>
581
+ <technical-committee/>
582
+ <subcommittee/>
583
+ <workgroup/>
584
+ </editorialgroup>
585
+ <approvalgroup identifier='ISO/ / / '>
586
+ <agency>ISO</agency>
587
+ <technical-committee/>
588
+ <subcommittee/>
589
+ <workgroup/>
590
+ </approvalgroup>
591
+ <stagename>International standard</stagename>
592
+ </ext>
593
+ </bibdata>
594
+ <sections>
595
+ <terms id='A' obligation='normative' displayorder='1'>
596
+ <title depth='1'>
597
+ 1
598
+ <tab/>
599
+ Terms and definitions
600
+ </title>
601
+ <p id='A1'>No terms and definitions are listed in this document.</p>
602
+ </terms>
603
+ <clause id='B' inline-header='false' obligation='normative' displayorder='2'>
604
+ <title depth='1'>
605
+ 2
606
+ <tab/>
607
+ Clause
608
+ </title>
609
+ </clause>
610
+ <terms id='C' obligation='normative' displayorder='3'>
611
+ <title depth='1'>
612
+ 3
613
+ <tab/>
614
+ More terms
615
+ </title>
616
+ </terms>
617
+ </sections>
618
+ </iso-standard>
613
619
  OUTPUT
614
620
  output = <<~OUTPUT
615
- <html lang='en'>
616
- <head/>
617
- <body lang='en'>
618
- <div class='title-section'>
619
- <p>&#160;</p>
620
- </div>
621
- <br/>
622
- <div class='prefatory-section'>
623
- <p>&#160;</p>
624
- </div>
625
- <br/>
626
- <div class='main-section'>
627
- <p class='zzSTDTitle1'/>
628
- <div id='A'>
629
- <h1> 1 &#160; Terms and definitions </h1>
630
- <p id='A1'>No terms and definitions are listed in this document.</p>
631
- </div>
632
- <div id='B'>
633
- <h1> 2 &#160; Clause </h1>
634
- </div>
635
- <div id='C'>
636
- <h1> 3 &#160; More terms </h1>
637
- </div>
638
- </div>
639
- </body>
640
- </html>
621
+ <html lang='en'>
622
+ <head/>
623
+ <body lang='en'>
624
+ <div class='title-section'>
625
+ <p>&#160;</p>
626
+ </div>
627
+ <br/>
628
+ <div class='prefatory-section'>
629
+ <p>&#160;</p>
630
+ </div>
631
+ <br/>
632
+ <div class='main-section'>
633
+ <p class='zzSTDTitle1'/>
634
+ <div id='A'>
635
+ <h1> 1 &#160; Terms and definitions </h1>
636
+ <p id='A1'>No terms and definitions are listed in this document.</p>
637
+ </div>
638
+ <div id='B'>
639
+ <h1> 2 &#160; Clause </h1>
640
+ </div>
641
+ <div id='C'>
642
+ <h1> 3 &#160; More terms </h1>
643
+ </div>
644
+ </div>
645
+ </body>
646
+ </html>
641
647
  OUTPUT
642
648
  expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
643
649
  .convert("test", input, true)
@@ -695,7 +701,8 @@ RSpec.describe IsoDoc do
695
701
  <sections/>
696
702
  </iso-standard>
697
703
  INPUT
698
- expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
704
+ expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m,
705
+ "</body>")))
699
706
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
700
707
  <body lang="EN-US" link="blue" vlink="#954F72">
701
708
  <div class="WordSection1">
@@ -707,7 +714,7 @@ RSpec.describe IsoDoc do
707
714
  </div>
708
715
  <p><br clear="all" class="section"/></p>
709
716
  <div class="WordSection3">
710
- <p class="zzSTDTitle1"/>
717
+ <p class="zzSTDTitle"/>
711
718
  </div>
712
719
  <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
713
720
  <div class="colophon"/>
@@ -726,7 +733,8 @@ RSpec.describe IsoDoc do
726
733
  <sections/>
727
734
  </iso-standard>
728
735
  INPUT
729
- expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
736
+ expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m,
737
+ "</body>")))
730
738
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
731
739
  <body lang="EN-US" link="blue" vlink="#954F72">
732
740
  <div class="WordSection1">
@@ -154,7 +154,7 @@ RSpec.describe IsoDoc do
154
154
  <title>
155
155
  <strong>Annex A</strong>
156
156
  <br/>
157
- (informative)
157
+ <span class="obligation">(informative)</span>
158
158
  <br/>
159
159
  <br/>
160
160
  <strong>Annex</strong>
@@ -382,7 +382,7 @@ RSpec.describe IsoDoc do
382
382
  <a name='Annex' id='Annex'/>
383
383
  <p class='ANNEX'>
384
384
  <br/>
385
- (informative)
385
+ <span style='font-weight:normal;'>(informative)</span>
386
386
  <br/>
387
387
  <br/>
388
388
  <b>Annex</b>
@@ -90,7 +90,7 @@ RSpec.describe IsoDoc do
90
90
  </ul>
91
91
  </termexample>
92
92
  <termsource status='modified'>[SOURCE:
93
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified &#x2013; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
93
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>7301</span>:<span class='stdyear'>2011</span>, <span class='citesec'>3.1</span></origin>, modified &#x2013; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
94
94
  </termsource>
95
95
  </term>
96
96
  <term id='paddy'><name>1.2</name>
@@ -121,7 +121,7 @@ RSpec.describe IsoDoc do
121
121
  </ul>
122
122
  </termexample>
123
123
  <termsource status='identical'>[SOURCE:
124
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>]
124
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>7301</span>:<span class='stdyear'>2011</span>, <span class='citesec'>3.1</span></origin>]
125
125
  </termsource>
126
126
  </term>
127
127
  <term id='A'>