isodoc 1.0.23 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +10 -2
  3. data/.github/workflows/ubuntu.yml +13 -3
  4. data/.github/workflows/windows.yml +10 -2
  5. data/isodoc.gemspec +1 -1
  6. data/lib/isodoc-yaml/i18n-en.yaml +3 -1
  7. data/lib/isodoc-yaml/i18n-fr.yaml +3 -1
  8. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +3 -1
  9. data/lib/isodoc/base_style/reset.scss +1 -1
  10. data/lib/isodoc/convert.rb +1 -0
  11. data/lib/isodoc/function/blocks.rb +6 -1
  12. data/lib/isodoc/function/cleanup.rb +16 -2
  13. data/lib/isodoc/function/i18n.rb +5 -5
  14. data/lib/isodoc/function/inline.rb +77 -79
  15. data/lib/isodoc/function/inline_simple.rb +72 -0
  16. data/lib/isodoc/function/references.rb +49 -37
  17. data/lib/isodoc/function/section.rb +19 -8
  18. data/lib/isodoc/function/table.rb +0 -1
  19. data/lib/isodoc/function/to_word_html.rb +23 -13
  20. data/lib/isodoc/function/utils.rb +11 -5
  21. data/lib/isodoc/function/xref_gen.rb +2 -1
  22. data/lib/isodoc/function/xref_sect_gen.rb +24 -24
  23. data/lib/isodoc/headlesshtml_convert.rb +5 -0
  24. data/lib/isodoc/html_convert.rb +5 -0
  25. data/lib/isodoc/html_function/footnotes.rb +3 -3
  26. data/lib/isodoc/html_function/html.rb +15 -0
  27. data/lib/isodoc/html_function/postprocess.rb +6 -5
  28. data/lib/isodoc/metadata.rb +10 -3
  29. data/lib/isodoc/metadata_date.rb +19 -7
  30. data/lib/isodoc/pdf_convert.rb +5 -0
  31. data/lib/isodoc/version.rb +1 -1
  32. data/lib/isodoc/word_convert.rb +5 -0
  33. data/lib/isodoc/word_function/body.rb +0 -4
  34. data/lib/isodoc/word_function/footnotes.rb +3 -3
  35. data/lib/isodoc/word_function/postprocess.rb +13 -2
  36. data/lib/isodoc/xslfo_convert.rb +5 -0
  37. data/spec/assets/i18n.yaml +4 -1
  38. data/spec/isodoc/blocks_spec.rb +59 -8
  39. data/spec/isodoc/cleanup_spec.rb +317 -25
  40. data/spec/isodoc/footnotes_spec.rb +20 -5
  41. data/spec/isodoc/i18n_spec.rb +12 -12
  42. data/spec/isodoc/inline_spec.rb +118 -5
  43. data/spec/isodoc/metadata_spec.rb +8 -3
  44. data/spec/isodoc/postproc_spec.rb +34 -12
  45. data/spec/isodoc/ref_spec.rb +120 -51
  46. data/spec/isodoc/section_spec.rb +236 -207
  47. data/spec/isodoc/table_spec.rb +24 -24
  48. data/spec/isodoc/terms_spec.rb +50 -6
  49. data/spec/isodoc/xref_spec.rb +53 -26
  50. metadata +5 -4
@@ -24,9 +24,24 @@ RSpec.describe IsoDoc do
24
24
  <br/>
25
25
  <div>
26
26
  <h1 class="ForewordTitle">Foreword</h1>
27
- <p>A.<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
28
- <p>B.<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
29
- <p>C.<a rel="footnote" href="#fn:1" epub:type="footnote"><sup>1</sup></a></p>
27
+ <p>
28
+ A.
29
+ <a class='FootnoteRef' href='#fn:2'>
30
+ <sup>2</sup>
31
+ </a>
32
+ </p>
33
+ <p>
34
+ B.
35
+ <a class='FootnoteRef' href='#fn:2'>
36
+ <sup>2</sup>
37
+ </a>
38
+ </p>
39
+ <p>
40
+ C.
41
+ <a class='FootnoteRef' href='#fn:1'>
42
+ <sup>1</sup>
43
+ </a>
44
+ </p>
30
45
  </div>
31
46
  <p class="zzSTDTitle1"/>
32
47
  <aside id="fn:2" class="footnote">
@@ -80,7 +95,7 @@ RSpec.describe IsoDoc do
80
95
  <p>
81
96
  A.
82
97
  <span style='mso-bookmark:_Ref'>
83
- <a href='#ftn2' epub:type='footnote'>
98
+ <a href='#ftn2' epub:type='footnote' class='FootnoteRef'>
84
99
  <sup>2</sup>
85
100
  </a>
86
101
  </span>
@@ -96,7 +111,7 @@ RSpec.describe IsoDoc do
96
111
  <p>
97
112
  C.
98
113
  <span style='mso-bookmark:_Ref'>
99
- <a href='#ftn1' epub:type='footnote'>
114
+ <a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
100
115
  <sup>1</sup>
101
116
  </a>
102
117
  </span>
@@ -21,7 +21,7 @@ RSpec.describe IsoDoc do
21
21
  <p id="E">Text</p>
22
22
  </clause>
23
23
 
24
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
24
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
25
25
  <title>Normal Terms</title>
26
26
  <term id="J">
27
27
  <preferred>Term2</preferred>
@@ -55,11 +55,11 @@ RSpec.describe IsoDoc do
55
55
  <title>Annex A.1a</title>
56
56
  </clause>
57
57
  </clause>
58
- </annex><bibliography><references id="R" obligation="informative">
58
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
59
59
  <title>Normative References</title>
60
60
  </references><clause id="S" obligation="informative">
61
61
  <title>Bibliography</title>
62
- <references id="T" obligation="informative">
62
+ <references id="T" obligation="informative" normative="false">
63
63
  <title>Bibliography Subsection</title>
64
64
  </references>
65
65
  </clause>
@@ -157,7 +157,7 @@ RSpec.describe IsoDoc do
157
157
  <p id="E">Text</p>
158
158
  </clause>
159
159
 
160
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
160
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
161
161
  <title>Normal Terms</title>
162
162
  <term id="J">
163
163
  <preferred>Term2</preferred>
@@ -191,11 +191,11 @@ RSpec.describe IsoDoc do
191
191
  <title>Annex A.1a</title>
192
192
  </clause>
193
193
  </clause>
194
- </annex><bibliography><references id="R" obligation="informative">
194
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
195
195
  <title>Normative References</title>
196
196
  </references><clause id="S" obligation="informative">
197
197
  <title>Bibliography</title>
198
- <references id="T" obligation="informative">
198
+ <references id="T" obligation="informative" normative="false">
199
199
  <title>Bibliography Subsection</title>
200
200
  </references>
201
201
  </clause>
@@ -293,7 +293,7 @@ RSpec.describe IsoDoc do
293
293
  <p id="E">Text</p>
294
294
  </clause>
295
295
 
296
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
296
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
297
297
  <title>Normal Terms</title>
298
298
  <term id="J">
299
299
  <preferred>Term2</preferred>
@@ -327,11 +327,11 @@ RSpec.describe IsoDoc do
327
327
  <title>Annex A.1a</title>
328
328
  </clause>
329
329
  </clause>
330
- </annex><bibliography><references id="R" obligation="informative">
330
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
331
331
  <title>Normative References</title>
332
332
  </references><clause id="S" obligation="informative">
333
333
  <title>Bibliography</title>
334
- <references id="T" obligation="informative">
334
+ <references id="T" obligation="informative" normative="false">
335
335
  <title>Bibliography Subsection</title>
336
336
  </references>
337
337
  </clause>
@@ -430,7 +430,7 @@ RSpec.describe IsoDoc do
430
430
  <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
431
431
  </clause>
432
432
 
433
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
433
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
434
434
  <title>Normal Terms</title>
435
435
  <term id="J">
436
436
  <preferred>Term2</preferred>
@@ -464,7 +464,7 @@ RSpec.describe IsoDoc do
464
464
  <title>Annex A.1a</title>
465
465
  </clause>
466
466
  </clause>
467
- </annex><bibliography><references id="R" obligation="informative">
467
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
468
468
  <title>Normative References</title>
469
469
  <bibitem id="ISO712" type="standard">
470
470
  <title format="text/plain">Cereals and cereal products</title>
@@ -478,7 +478,7 @@ RSpec.describe IsoDoc do
478
478
  </bibitem>
479
479
  </references><clause id="S" obligation="informative">
480
480
  <title>Bibliography</title>
481
- <references id="T" obligation="informative">
481
+ <references id="T" obligation="informative" normative="false">
482
482
  <title>Bibliography Subsection</title>
483
483
  </references>
484
484
  </clause>
@@ -126,13 +126,31 @@ RSpec.describe IsoDoc do
126
126
  </concept></li>
127
127
  <li><concept>
128
128
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
129
+ <localityStack>
129
130
  <locality type='clause'>
130
131
  <referenceFrom>3.1</referenceFrom>
131
132
  </locality>
133
+ </localityStack>
134
+ <localityStack>
132
135
  <locality type='figure'>
133
- <referenceFrom>a</referenceFrom>
136
+ <referenceFrom>b</referenceFrom>
137
+ </locality>
138
+ </localityStack>
139
+ </eref>
140
+ </concept></li>
141
+ <li><concept>
142
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
143
+ <localityStack>
144
+ <locality type='clause'>
145
+ <referenceFrom>3.1</referenceFrom>
146
+ </locality>
147
+ </localityStack>
148
+ <localityStack>
149
+ <locality type='figure'>
150
+ <referenceFrom>b</referenceFrom>
134
151
  </locality>
135
- <em>word</em>
152
+ </localityStack>
153
+ <em>word</em>
136
154
  </eref>
137
155
  </concept></li>
138
156
  <li><concept term='term'>
@@ -147,7 +165,7 @@ RSpec.describe IsoDoc do
147
165
  <sections>
148
166
  <clause id="clause1"><title>Clause 1</title></clause>
149
167
  </sections>
150
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
168
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
151
169
  <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>
152
170
  <bibitem id="ISO712" type="standard">
153
171
  <title format="text/plain">Cereals or cereal products</title>
@@ -180,6 +198,9 @@ RSpec.describe IsoDoc do
180
198
  <li>
181
199
  [Term defined in <a href='#ISO712'>ISO 712, Clause 3.1, Figure a</a>]
182
200
  </li>
201
+ <li>
202
+ [Term defined in <a href='#ISO712'>ISO 712, Clause 3.1; Figure b</a>]
203
+ </li>
183
204
  <li>
184
205
  <i>word</i>
185
206
  </li>
@@ -393,7 +414,7 @@ OUTPUT
393
414
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
394
415
  </p>
395
416
  </foreword></preface>
396
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
417
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
397
418
  <bibitem id="ISO712" type="standard">
398
419
  <title format="text/plain">Cereals and cereal products</title>
399
420
  <docidentifier>ISO 712</docidentifier>
@@ -436,6 +457,8 @@ OUTPUT
436
457
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
437
458
  <eref type="inline" bibitemid="ISO712"/>
438
459
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
460
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
461
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
439
462
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
440
463
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
441
464
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
@@ -446,7 +469,7 @@ OUTPUT
446
469
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
447
470
  </p>
448
471
  </foreword></preface>
449
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
472
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
450
473
  <bibitem id="ISO712" type="standard">
451
474
  <title format="text/plain">Cereals and cereal products</title>
452
475
  <docidentifier>ISO 712</docidentifier>
@@ -469,6 +492,8 @@ OUTPUT
469
492
  <a href="#ISO712">ISO 712</a>
470
493
  <a href="#ISO712">ISO 712</a>
471
494
  <a href="#ISO712">ISO 712, Table 1</a>
495
+ <a href='#ISO712'>ISO 712, Table 1</a>
496
+ <a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
472
497
  <a href="#ISO712">ISO 712, Table 1&#8211;1</a>
473
498
  <a href="#ISO712">ISO 712, Clause 1, Table 1</a>
474
499
  <a href="#ISO712">ISO 712, Clause 1</a>
@@ -490,5 +515,93 @@ OUTPUT
490
515
  OUTPUT
491
516
  end
492
517
 
518
+ it "processes variant" do
519
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
520
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
521
+ <bibdata>
522
+ <language>en</language>
523
+ <script>Latn</script>
524
+ </bibdata>
525
+ <preface>
526
+ <clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
527
+ <clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
528
+ <clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
529
+ </preface>
530
+ </iso-standard>
531
+ INPUT
532
+ #{HTML_HDR}
533
+ <br/>
534
+ <div class='Section3' id='A'>
535
+ <h1 class='IntroTitle'>ABC</h1>
536
+ </div>
537
+ <br/>
538
+ <div class='Section3' id='B'>
539
+ <h1 class='IntroTitle'>GHI</h1>
540
+ </div>
541
+ <br/>
542
+ <div class='Section3' id='C'>
543
+ <h1 class='IntroTitle'>DEF</h1>
544
+ </div>
545
+ <p class='zzSTDTitle1'/>
546
+ </div>
547
+ </body>
548
+ </html>
549
+ OUTPUT
550
+ end
551
+
552
+ it "cases xrefs" do
553
+ expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
554
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
555
+ <sections>
556
+ <clause id="A">
557
+ <table id="B">
558
+ </table>
559
+ </clause>
560
+ <clause id="C">
561
+ <p>This is <xref target="A"/> and <xref target="B"/>.
562
+ This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
563
+ <xref target="A"/> is clause <em>initial.</em><br/>
564
+ <xref target="A"/> is too. </p>
565
+ <p><xref target="A"/> is also.</p>
566
+ </clause>
567
+ </sections>
568
+ </iso-standard>
569
+ INPUT
570
+ #{HTML_HDR}
571
+ <p class='zzSTDTitle1'/>
572
+ <div id='A'>
573
+ <h1>1.&#160; </h1>
574
+ <p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
575
+ <table id='B' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
576
+ </div>
577
+ <div id='C'>
578
+ <h1>2.&#160; </h1>
579
+ <p>
580
+ This is
581
+ <a href='#A'>kla&#365;zo 1</a>
582
+ and
583
+ <a href='#B'>Tabelo 1</a>
584
+ . This is
585
+ <a href='#A'>Kla&#365;zo 1</a>
586
+ and
587
+ <a href='#B'>tabelo 1</a>
588
+ .
589
+ <a href='#A'>Kla&#365;zo 1</a>
590
+ is clause
591
+ <i>initial.</i>
592
+ <br/>
593
+ <a href='#A'>Kla&#365;zo 1</a>
594
+ is too.
595
+ </p>
596
+ <p>
597
+ <a href='#A'>Kla&#365;zo 1</a>
598
+ is also.
599
+ </p>
600
+ </div>
601
+ </div>
602
+ </body>
603
+ </html>
604
+ OUTPUT
605
+ end
493
606
 
494
607
  end
@@ -30,6 +30,8 @@ RSpec.describe IsoDoc do
30
30
  <date type="updated"><on>2018</on></date>
31
31
  <date type="unchanged"><on>2019</on></date>
32
32
  <date type="transmitted"><on>2020</on></date>
33
+ <date type="vote-started"><on>2021</on></date>
34
+ <date type="vote-ended"><on>2022</on></date>
33
35
  <edition>2</edition>
34
36
  <version>
35
37
  <revision-date>2016-05-01</revision-date>
@@ -86,13 +88,16 @@ RSpec.describe IsoDoc do
86
88
  </organization>
87
89
  </owner>
88
90
  </copyright>
91
+ <keyword>KW2</keyword>
92
+ <keyword>KW1</keyword>
93
+ <keyword>KW3</keyword>
89
94
  <ext>
90
95
  <doctype>international-standard</doctype>
91
96
  </ext>
92
97
  </bibdata>
93
98
  </iso-standard>
94
99
  INPUT
95
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :circulateddate=>"2015", :confirmeddate=>"2017", :copieddate=>"2016", :createddate=>"2010&ndash;2011", :doc=>"URL E", :docnumber=>"17301-1", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :html=>"URL B", :implementeddate=>"XXX", :issueddate=>"XXX", :iteration=>"2", :obsoleteddate=>"2014", :pdf=>"URL D", :publisheddate=>"2011", :publisher=>"", :receiveddate=>"XXX", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :stage=>"Committee draft", :stageabbr=>"CD", :substage=>"Withdrawn", :transmitteddate=>"2020", :unchangeddate=>"2019", :unpublished=>true, :updateddate=>"2018", :url=>"URL A", :xml=>"URL C"}
100
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :circulateddate=>"2015", :confirmeddate=>"2017", :copieddate=>"2016", :createddate=>"2010&ndash;2011", :doc=>"URL E", :docnumber=>"17301-1", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :html=>"URL B", :implementeddate=>"XXX", :issueddate=>"XXX", :iteration=>"2", :keywords=>["KW2", "KW1", "KW3"], :obsoleteddate=>"2014", :pdf=>"URL D", :publisheddate=>"2011", :publisher=>"", :receiveddate=>"XXX", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :stage=>"Committee draft", :stageabbr=>"CD", :substage=>"Withdrawn", :transmitteddate=>"2020", :unchangeddate=>"2019", :unpublished=>true, :updateddate=>"2018", :url=>"URL A", :vote_endeddate=>"2022", :vote_starteddate=>"2021", :xml=>"URL C"}
96
101
  OUTPUT
97
102
  end
98
103
 
@@ -166,7 +171,7 @@ OUTPUT
166
171
  </version>
167
172
  </iso-standard>
168
173
  INPUT
169
- {:accesseddate=>"XXX", :agency=>"ISO/IEC/IEEE", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05)", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :partof=>"IEC 8122", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"May 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX"}
174
+ {:accesseddate=>"XXX", :agency=>"ISO/IEC/IEEE", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05)", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :keywords=>[], :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :partof=>"IEC 8122", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"May 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
170
175
  OUTPUT
171
176
  end
172
177
 
@@ -225,7 +230,7 @@ OUTPUT
225
230
  </bibdata>
226
231
  </iso-standard>
227
232
  INPUT
228
- {:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization et International Electrotechnical Commission", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"Mai 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX"}
233
+ {:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :keywords=>[], :obsoleteddate=>"XXX", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization et International Electrotechnical Commission", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"Mai 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
229
234
  OUTPUT
230
235
  end
231
236
 
@@ -299,7 +299,7 @@ expect(File.exist?("test.doc")).to be true
299
299
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
300
300
  <div class="WordSection3">
301
301
  <p class="zzSTDTitle1"></p>
302
- <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1.<span style="mso-tab-count:1">&#xA0; </span>Terms and definitions</h1>
302
+ <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1.<span style="mso-tab-count:1">&#xA0; </span>Terms and Definitions</h1>
303
303
  <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
304
304
  <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
305
305
  <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
@@ -558,25 +558,25 @@ TOCLEVEL
558
558
  <p class="zzSTDTitle1"></p>
559
559
  <div id="A">
560
560
  <h1>1.&#xA0; Clause 4</h1>
561
- <a rel="footnote" href="#fn:3" epub:type="footnote" id="fnref:1">
561
+ <a class='FootnoteRef' href='#fn:3' id='fnref:1'>
562
562
  <sup>1</sup>
563
563
  </a>
564
564
  <div id="N">
565
565
 
566
- <h2>1.1.&#160; Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2</sup></a></h2>
566
+ <h2>1.1.&#160; Introduction to this<a class='FootnoteRef' href='#fn:2' id='fnref:2'><sup>2</sup></a></h2>
567
567
  </div>
568
568
  <div id="O">
569
569
  <h2>1.2.&#160; Clause 4.2</h2>
570
- <p>A<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
570
+ <p>A<a class='FootnoteRef' href='#fn:2'><sup>2</sup></a></p>
571
571
  </div>
572
572
  </div>
573
573
  <aside id="fn:3" class="footnote">
574
- <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:3" epub:type="footnote">
574
+ <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class='FootnoteRef' href='#fn:3'>
575
575
  <sup>1</sup>
576
576
  </a>This is a footnote.</p>
577
577
  <a href="#fnref:1">&#x21A9;</a></aside>
578
578
  <aside id="fn:2" class="footnote">
579
- <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
579
+ <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class='FootnoteRef' href='#fn:2'><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
580
580
  <a href="#fnref:2">&#x21A9;</a></aside>
581
581
 
582
582
  </main>
@@ -1316,7 +1316,11 @@ OUTPUT
1316
1316
  <pagebreak orientation="portrait"/>
1317
1317
  <p>And up</p>
1318
1318
  </note>
1319
+ <pagebreak orientation="portrait"/>
1319
1320
  </clause></sections>
1321
+ <annex id="_level_1" inline-header="false" obligation="normative">
1322
+ <title>Annex 1</title>
1323
+ </annex>
1320
1324
  </standard-document>
1321
1325
  INPUT
1322
1326
  expect(File.exist?("test.doc")).to be true
@@ -1324,7 +1328,9 @@ OUTPUT
1324
1328
  expect(html).to include "div.WordSection2_0 {page:WordSection2P;}"
1325
1329
  expect(html).to include "div.WordSection2_1 {page:WordSection2L;}"
1326
1330
  expect(html).to include "div.WordSection3_0 {page:WordSection3P;}"
1327
- expect(html).to include "div.WordSection3_1 {page:WordSection3L;}"
1331
+ expect(html).to include "div.WordSection3_1 {page:WordSection3P;}"
1332
+ expect(html).to include "div.WordSection3_2 {page:WordSection3L;}"
1333
+
1328
1334
 
1329
1335
  expect(xmlpp(html.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1330
1336
  <body lang='EN-US' xml:lang='EN-US' link='blue' vlink='#954F72'>
@@ -1335,9 +1341,9 @@ expect(xmlpp(html.sub(/^.*.*$}m, ""))).
1335
1341
  <br clear='all' class='section'/>
1336
1342
  </p>
1337
1343
  <div class='WordSection2'>
1338
- <p class='MsoNormal'>
1339
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1340
- </p>
1344
+ <p class='MsoNormal'>
1345
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1346
+ </p>
1341
1347
  <div class='Section3' id=''>
1342
1348
  <h1 class='IntroTitle'>Introduction</h1>
1343
1349
  <p align='center' style='text-align:center' class='MsoNormal'>
@@ -1396,7 +1402,7 @@ expect(xmlpp(html.sub(/^.*.*$}m, ""))).
1396
1402
  </div>
1397
1403
  </div>
1398
1404
  </div>
1399
- <div class='WordSection3_1'>
1405
+ <div class='WordSection3_2'>
1400
1406
  <p class='TableTitle' style='text-align:center;'>Table 1</p>
1401
1407
  <div align='center' class='table_container'>
1402
1408
  <table class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
@@ -1433,8 +1439,24 @@ expect(xmlpp(html.sub(/^.*.*$}m, ""))).
1433
1439
  <br clear='all' class='section'/>
1434
1440
  </p>
1435
1441
  </div>
1436
- <div class='WordSection3_0'>
1442
+ <div class='WordSection3_1'>
1437
1443
  <p class='Note'>And up</p>
1444
+ <p class='MsoNormal'>
1445
+ <br clear='all' class='section'/>
1446
+ </p>
1447
+ </div>
1448
+ <div class='WordSection3_0'>
1449
+ <div class='Section3'>
1450
+ <a name='_level_1' id='_level_1'/>
1451
+ <h1 class='Annex'>
1452
+ <b>Annex A</b>
1453
+ <br/>
1454
+ (normative)
1455
+ <br/>
1456
+ <br/>
1457
+ <b>Annex 1</b>
1458
+ </h1>
1459
+ </div>
1438
1460
  </div>
1439
1461
  <div style='mso-element:footnote-list'/>
1440
1462
  </body>