isodoc 2.0.2 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/convert.rb +36 -18
  3. data/lib/isodoc/function/inline.rb +24 -13
  4. data/lib/isodoc/function/references.rb +18 -6
  5. data/lib/isodoc/html_function/html.rb +6 -0
  6. data/lib/isodoc/i18n.rb +20 -7
  7. data/lib/isodoc/metadata.rb +1 -1
  8. data/lib/isodoc/metadata_contributor.rb +1 -1
  9. data/lib/isodoc/presentation_function/bibdata.rb +26 -9
  10. data/lib/isodoc/presentation_function/block.rb +24 -0
  11. data/lib/isodoc/presentation_function/image.rb +3 -4
  12. data/lib/isodoc/presentation_function/inline.rb +118 -76
  13. data/lib/isodoc/presentation_function/math.rb +1 -0
  14. data/lib/isodoc/presentation_function/xrefs.rb +100 -0
  15. data/lib/isodoc/presentation_xml_convert.rb +1 -0
  16. data/lib/isodoc/version.rb +1 -1
  17. data/lib/isodoc/word_function/body.rb +11 -1
  18. data/lib/isodoc/word_function/postprocess.rb +4 -6
  19. data/lib/isodoc/word_function/postprocess_cover.rb +82 -1
  20. data/lib/isodoc/xref/xref_anchor.rb +1 -0
  21. data/lib/isodoc/xref/xref_gen.rb +2 -1
  22. data/lib/isodoc/xref/xref_sect_gen.rb +14 -8
  23. data/lib/isodoc/xslfo_convert.rb +19 -19
  24. data/lib/isodoc-yaml/i18n-ar.yaml +11 -0
  25. data/lib/isodoc-yaml/i18n-de.yaml +11 -0
  26. data/lib/isodoc-yaml/i18n-en.yaml +11 -0
  27. data/lib/isodoc-yaml/i18n-es.yaml +11 -0
  28. data/lib/isodoc-yaml/i18n-fr.yaml +11 -0
  29. data/lib/isodoc-yaml/i18n-ru.yaml +11 -0
  30. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +11 -0
  31. data/spec/isodoc/blocks_spec.rb +13 -77
  32. data/spec/isodoc/inline_spec.rb +565 -22
  33. data/spec/isodoc/metadata_spec.rb +1 -1
  34. data/spec/isodoc/postproc_spec.rb +466 -2
  35. data/spec/isodoc/presentation_xml_spec.rb +380 -78
  36. data/spec/isodoc/ref_spec.rb +96 -11
  37. data/spec/isodoc/section_spec.rb +1 -2
  38. data/spec/isodoc/table_spec.rb +1 -1
  39. data/spec/isodoc/terms_spec.rb +8 -8
  40. data/spec/isodoc/xref_spec.rb +71 -1190
  41. data/spec/isodoc/xslfo_convert_spec.rb +12 -7
  42. metadata +3 -2
@@ -152,9 +152,6 @@ RSpec.describe IsoDoc do
152
152
  </iso-standard>
153
153
  INPUT
154
154
  output = <<~OUTPUT
155
- <?xml version='1.0'?>
156
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
157
- <preface>
158
155
  <foreword displayorder='1'>
159
156
  <p>
160
157
  <xref target='N1'>Introduction, Note</xref>
@@ -167,111 +164,11 @@ RSpec.describe IsoDoc do
167
164
  <xref target='Anote2'>Annex A.2, Note 2</xref>
168
165
  </p>
169
166
  </foreword>
170
- <introduction id='intro' displayorder="2">
171
- <note id='N1'>
172
- <name>NOTE</name>
173
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83e'>
174
- These results are based on a study carried out on three different
175
- types of kernel.
176
- </p>
177
- </note>
178
- <clause id='xyz'>
179
- <title depth='2'>Preparatory</title>
180
- <note id='N2'>
181
- <name>NOTE</name>
182
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83d'>
183
- These results are based on a study carried out on three different
184
- types of kernel.
185
- </p>
186
- </note>
187
- </clause>
188
- </introduction>
189
- </preface>
190
- <sections>
191
- <clause id='scope' type="scope" displayorder="3">
192
- <title depth='1'>
193
- 1.
194
- <tab/>
195
- Scope
196
- </title>
197
- <note id='N'>
198
- <name>NOTE</name>
199
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
200
- These results are based on a study carried out on three different
201
- types of kernel.
202
- </p>
203
- </note>
204
- <p>
205
- <xref target='N'>Note</xref>
206
- </p>
207
- </clause>
208
- <terms id='terms' displayorder="4">
209
- <title>2.</title>
210
- </terms>
211
- <clause id='widgets' displayorder="5">
212
- <title depth='1'>
213
- 3.
214
- <tab/>
215
- Widgets
216
- </title>
217
- <clause id='widgets1'><title>3.1.</title>
218
- <note id='note1'>
219
- <name>NOTE 1</name>
220
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
221
- These results are based on a study carried out on three different
222
- types of kernel.
223
- </p>
224
- </note>
225
- <note id='note2'>
226
- <name>NOTE 2</name>
227
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
228
- These results are based on a study carried out on three different
229
- types of kernel.
230
- </p>
231
- </note>
232
- <p>
233
- <xref target='note1'>Note 1</xref>
234
- <xref target='note2'>Note 2</xref>
235
- </p>
236
- </clause>
237
- </clause>
238
- </sections>
239
- <annex id='annex1' displayorder="6">
240
- <title>
241
- <strong>Annex A</strong>
242
- <br/>
243
- (informative)
244
- </title>
245
- <clause id='annex1a'><title>A.1.</title>
246
- <note id='AN'>
247
- <name>NOTE</name>
248
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
249
- These results are based on a study carried out on three different
250
- types of kernel.
251
- </p>
252
- </note>
253
- </clause>
254
- <clause id='annex1b'><title>A.2.</title>
255
- <note id='Anote1'>
256
- <name>NOTE 1</name>
257
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
258
- These results are based on a study carried out on three different
259
- types of kernel.
260
- </p>
261
- </note>
262
- <note id='Anote2'>
263
- <name>NOTE 2</name>
264
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
265
- These results are based on a study carried out on three different
266
- types of kernel.
267
- </p>
268
- </note>
269
- </clause>
270
- </annex>
271
- </iso-standard>
272
167
  OUTPUT
273
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
274
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
168
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
169
+ .convert("test", input, true))
170
+ .at("//xmlns:foreword").to_xml))
171
+ .to be_equivalent_to xmlpp(output)
275
172
  end
276
173
 
277
174
  it "cross-references figures" do
@@ -365,9 +262,6 @@ RSpec.describe IsoDoc do
365
262
  </iso-standard>
366
263
  INPUT
367
264
  output = <<~OUTPUT
368
- <?xml version='1.0'?>
369
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
370
- <preface>
371
265
  <foreword id='fwd' displayorder="1">
372
266
  <p>
373
267
  <xref target='N1'>Figure 1</xref>
@@ -384,103 +278,11 @@ RSpec.describe IsoDoc do
384
278
  <xref target='Anote3'>Figure A.3</xref>
385
279
  </p>
386
280
  </foreword>
387
- <introduction id='intro' displayorder="2">
388
- <figure id='N1'>
389
- <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
390
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
391
- </figure>
392
- <clause id='xyz'>
393
- <title depth='2'>Preparatory</title>
394
- <figure id='N2' unnumbered='true'>
395
- <name>Split-it-right sample divider</name>
396
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
397
- </figure>
398
- </clause>
399
- </introduction>
400
- </preface>
401
- <sections>
402
- <clause id='scope' type="scope" displayorder="3">
403
- <title depth='1'>
404
- 1.
405
- <tab/>
406
- Scope
407
- </title>
408
- <figure id='N'>
409
- <name>Figure 2&#xA0;&#x2014; Split-it-right sample divider</name>
410
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
411
- </figure>
412
- <p>
413
- <xref target='N'>Figure 2</xref>
414
- </p>
415
- </clause>
416
- <terms id='terms' displayorder="4">
417
- <title>2.</title>
418
- </terms>
419
- <clause id='widgets' displayorder="5">
420
- <title depth='1'>
421
- 3.
422
- <tab/>
423
- Widgets
424
- </title>
425
- <clause id='widgets1'><title>3.1.</title>
426
- <figure id='note1'>
427
- <name>Figure 3&#xA0;&#x2014; Split-it-right sample divider</name>
428
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
429
- </figure>
430
- <figure id='note3' class='pseudocode'>
431
- <name>Figure 4</name>
432
- <p>pseudocode</p>
433
- </figure>
434
- <sourcecode id='note4'>
435
- <name>Figure 5&#xA0;&#x2014; Source! Code!</name>
436
- A B C
437
- </sourcecode>
438
- <example id='note5'>
439
- <name>EXAMPLE</name>
440
- <sourcecode id='note51'> A B C </sourcecode>
441
- </example>
442
- <figure id='note2'>
443
- <name>Figure 6&#xA0;&#x2014; Split-it-right sample divider</name>
444
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
445
- </figure>
446
- <p>
447
- <xref target='note1'>Figure 3</xref>
448
- <xref target='note2'>Figure 6</xref>
449
- </p>
450
- </clause>
451
- </clause>
452
- </sections>
453
- <annex id='annex1' displayorder="6">
454
- <title>
455
- <strong>Annex A</strong>
456
- <br/>
457
- (informative)
458
- </title>
459
- <clause id='annex1a'><title>A.1.</title>
460
- <figure id='AN'>
461
- <name>Figure A.1&#xA0;&#x2014; Split-it-right sample divider</name>
462
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
463
- </figure>
464
- </clause>
465
- <clause id='annex1b'><title>A.2.</title>
466
- <figure id='Anote1' unnumbered='true'>
467
- <name>Split-it-right sample divider</name>
468
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
469
- </figure>
470
- <figure id='Anote2'>
471
- <name>Figure A.2&#xA0;&#x2014; Split-it-right sample divider</name>
472
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
473
- </figure>
474
- <sourcecode id='Anote3'>
475
- <name>Figure A.3&#xA0;&#x2014; Source! Code!</name>
476
- A B C
477
- </sourcecode>
478
- </clause>
479
- </annex>
480
- </iso-standard>
481
281
  OUTPUT
482
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
483
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
282
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
283
+ .convert("test", input, true))
284
+ .at("//xmlns:foreword").to_xml))
285
+ .to be_equivalent_to xmlpp(output)
484
286
  end
485
287
 
486
288
  it "cross-references subfigures" do
@@ -537,9 +339,6 @@ RSpec.describe IsoDoc do
537
339
  </iso-standard>
538
340
  INPUT
539
341
  output = <<~OUTPUT
540
- <?xml version='1.0'?>
541
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
542
- <preface>
543
342
  <foreword id='fwd' displayorder="1">
544
343
  <p>
545
344
  <xref target='N'>Figure 1</xref>
@@ -550,67 +349,11 @@ RSpec.describe IsoDoc do
550
349
  <xref target='Anote2'>Figure A.1-2</xref>
551
350
  </p>
552
351
  </foreword>
553
- </preface>
554
- <sections>
555
- <clause id='scope' type="scope" displayorder="2">
556
- <title depth='1'>
557
- 1.
558
- <tab/>
559
- Scope
560
- </title>
561
- </clause>
562
- <terms id='terms' displayorder="3">
563
- <title>2.</title>
564
- </terms>
565
- <clause id='widgets' displayorder="4">
566
- <title depth='1'>
567
- 3.
568
- <tab/>
569
- Widgets
570
- </title>
571
- <clause id='widgets1'><title>3.1.</title>
572
- <figure id='N'>
573
- <figure id='note1'>
574
- <name>Figure 1-1&#xA0;&#x2014; Split-it-right sample divider</name>
575
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
576
- </figure>
577
- <figure id='note2'>
578
- <name>Figure 1-2&#xA0;&#x2014; Split-it-right sample divider</name>
579
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
580
- </figure>
581
- </figure>
582
- <p>
583
- <xref target='note1'>Figure 1-1</xref>
584
- <xref target='note2'>Figure 1-2</xref>
585
- </p>
586
- </clause>
587
- </clause>
588
- </sections>
589
- <annex id='annex1' displayorder="5">
590
- <title>
591
- <strong>Annex A</strong>
592
- <br/>
593
- (informative)
594
- </title>
595
- <clause id='annex1a'> <title>A.1.</title>
596
- </clause>
597
- <clause id='annex1b'><title>A.2.</title>
598
- <figure id='AN'>
599
- <figure id='Anote1'>
600
- <name>Figure A.1-1&#xA0;&#x2014; Split-it-right sample divider</name>
601
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
602
- </figure>
603
- <figure id='Anote2'>
604
- <name>Figure A.1-2&#xA0;&#x2014; Split-it-right sample divider</name>
605
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
606
- </figure>
607
- </figure>
608
- </clause>
609
- </annex>
610
- </iso-standard>
611
352
  OUTPUT
612
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
613
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
353
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
354
+ .convert("test", input, true))
355
+ .at("//xmlns:foreword").to_xml))
356
+ .to be_equivalent_to xmlpp(output)
614
357
  end
615
358
 
616
359
  it "cross-references examples" do
@@ -678,9 +421,6 @@ RSpec.describe IsoDoc do
678
421
  </iso-standard>
679
422
  INPUT
680
423
  output = <<~OUTPUT
681
- <?xml version='1.0'?>
682
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
683
- <preface>
684
424
  <foreword displayorder='1'>
685
425
  <p>
686
426
  <xref target='N1'>Introduction, Example</xref>
@@ -693,87 +433,11 @@ RSpec.describe IsoDoc do
693
433
  <xref target='Anote2'>Annex A.2, Example 1</xref>
694
434
  </p>
695
435
  </foreword>
696
- <introduction id='intro' displayorder="2">
697
- <example id='N1'>
698
- <name>EXAMPLE</name>
699
- <p>Hello</p>
700
- </example>
701
- <clause id='xyz'>
702
- <title depth='2'>Preparatory</title>
703
- <example id='N2' unnumbered='true'>
704
- <name>EXAMPLE</name>
705
- <p>Hello</p>
706
- </example>
707
- </clause>
708
- </introduction>
709
- </preface>
710
- <sections>
711
- <clause id='scope' type="scope" displayorder="3">
712
- <title depth='1'>
713
- 1.
714
- <tab/>
715
- Scope
716
- </title>
717
- <example id='N'>
718
- <name>EXAMPLE</name>
719
- <p>Hello</p>
720
- </example>
721
- <p>
722
- <xref target='N'>Example</xref>
723
- </p>
724
- </clause>
725
- <terms id='terms' displayorder="4">
726
- <title>2.</title>
727
- </terms>
728
- <clause id='widgets' displayorder="5">
729
- <title depth='1'>
730
- 3.
731
- <tab/>
732
- Widgets
733
- </title>
734
- <clause id='widgets1'><title>3.1.</title>
735
- <example id='note1'>
736
- <name>EXAMPLE 1</name>
737
- <p>Hello</p>
738
- </example>
739
- <example id='note2' unnumbered='true'>
740
- <name>EXAMPLE</name>
741
- <p>Hello</p>
742
- </example>
743
- <p>
744
- <xref target='note1'>Example 1</xref>
745
- <xref target='note2'>Example (??)</xref>
746
- </p>
747
- </clause>
748
- </clause>
749
- </sections>
750
- <annex id='annex1' displayorder="6">
751
- <title>
752
- <strong>Annex A</strong>
753
- <br/>
754
- (informative)
755
- </title>
756
- <clause id='annex1a'><title>A.1.</title>
757
- <example id='AN'>
758
- <name>EXAMPLE</name>
759
- <p>Hello</p>
760
- </example>
761
- </clause>
762
- <clause id='annex1b'><title>A.2.</title>
763
- <example id='Anote1' unnumbered='true'>
764
- <name>EXAMPLE</name>
765
- <p>Hello</p>
766
- </example>
767
- <example id='Anote2'>
768
- <name>EXAMPLE 1</name>
769
- <p>Hello</p>
770
- </example>
771
- </clause>
772
- </annex>
773
- </iso-standard>
774
436
  OUTPUT
775
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
776
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
437
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
438
+ .convert("test", input, true))
439
+ .at("//xmlns:foreword").to_xml))
440
+ .to be_equivalent_to xmlpp(output)
777
441
  end
778
442
 
779
443
  it "cross-references formulae" do
@@ -841,9 +505,6 @@ RSpec.describe IsoDoc do
841
505
  </iso-standard>
842
506
  INPUT
843
507
  output = <<~OUTPUT
844
- <?xml version='1.0'?>
845
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
846
- <preface>
847
508
  <foreword displayorder='1'>
848
509
  <p>
849
510
  <xref target='N1'>Introduction, Formula (1)</xref>
@@ -856,85 +517,11 @@ RSpec.describe IsoDoc do
856
517
  <xref target='Anote2'>Formula (A.2)</xref>
857
518
  </p>
858
519
  </foreword>
859
- <introduction id='intro' displayorder="2">
860
- <formula id='N1'>
861
- <name>1</name>
862
- <stem type='AsciiMath'>r = 1 %</stem>
863
- </formula>
864
- <clause id='xyz'>
865
- <title depth='2'>Preparatory</title>
866
- <formula id='N2' unnumbered='true'>
867
- <stem type='AsciiMath'>r = 1 %</stem>
868
- </formula>
869
- </clause>
870
- </introduction>
871
- </preface>
872
- <sections>
873
- <clause id='scope' type="scope" displayorder="3">
874
- <title depth='1'>
875
- 1.
876
- <tab/>
877
- Scope
878
- </title>
879
- <formula id='N'>
880
- <name>2</name>
881
- <stem type='AsciiMath'>r = 1 %</stem>
882
- </formula>
883
- <p>
884
- <xref target='N'>Formula (2)</xref>
885
- </p>
886
- </clause>
887
- <terms id='terms' displayorder="4">
888
- <title>2.</title>
889
- </terms>
890
- <clause id='widgets' displayorder="5">
891
- <title depth='1'>
892
- 3.
893
- <tab/>
894
- Widgets
895
- </title>
896
- <clause id='widgets1'><title>3.1.</title>
897
- <formula id='note1'>
898
- <name>3</name>
899
- <stem type='AsciiMath'>r = 1 %</stem>
900
- </formula>
901
- <formula id='note2'>
902
- <name>4</name>
903
- <stem type='AsciiMath'>r = 1 %</stem>
904
- </formula>
905
- <p>
906
- <xref target='note1'>Formula (3)</xref>
907
- <xref target='note2'>Formula (4)</xref>
908
- </p>
909
- </clause>
910
- </clause>
911
- </sections>
912
- <annex id='annex1' displayorder="6">
913
- <title>
914
- <strong>Annex A</strong>
915
- <br/>
916
- (informative)
917
- </title>
918
- <clause id='annex1a'><title>A.1.</title>
919
- <formula id='AN'>
920
- <name>A.1</name>
921
- <stem type='AsciiMath'>r = 1 %</stem>
922
- </formula>
923
- </clause>
924
- <clause id='annex1b'><title>A.2.</title>
925
- <formula id='Anote1' unnumbered='true'>
926
- <stem type='AsciiMath'>r = 1 %</stem>
927
- </formula>
928
- <formula id='Anote2'>
929
- <name>A.2</name>
930
- <stem type='AsciiMath'>r = 1 %</stem>
931
- </formula>
932
- </clause>
933
- </annex>
934
- </iso-standard>
935
520
  OUTPUT
936
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
937
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
521
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
522
+ .convert("test", input, true))
523
+ .at("//xmlns:foreword").to_xml))
524
+ .to be_equivalent_to xmlpp(output)
938
525
  end
939
526
 
940
527
  it "cross-references requirements" do
@@ -1002,9 +589,6 @@ RSpec.describe IsoDoc do
1002
589
  </iso-standard>
1003
590
  INPUT
1004
591
  output = <<~OUTPUT
1005
- <?xml version='1.0'?>
1006
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1007
- <preface>
1008
592
  <foreword displayorder='1'>
1009
593
  <p>
1010
594
  <xref target='N1'>Introduction, Requirement 1</xref>
@@ -1017,87 +601,11 @@ RSpec.describe IsoDoc do
1017
601
  <xref target='Anote2'>Requirement A.2</xref>
1018
602
  </p>
1019
603
  </foreword>
1020
- <introduction id='intro' displayorder="2">
1021
- <requirement id='N1'>
1022
- <name>Requirement 1</name>
1023
- <stem type='AsciiMath'>r = 1 %</stem>
1024
- </requirement>
1025
- <clause id='xyz'>
1026
- <title depth='2'>Preparatory</title>
1027
- <requirement id='N2' unnumbered='true'>
1028
- <name>Requirement</name>
1029
- <stem type='AsciiMath'>r = 1 %</stem>
1030
- </requirement>
1031
- </clause>
1032
- </introduction>
1033
- </preface>
1034
- <sections>
1035
- <clause id='scope' type="scope" displayorder="3">
1036
- <title depth='1'>
1037
- 1.
1038
- <tab/>
1039
- Scope
1040
- </title>
1041
- <requirement id='N'>
1042
- <name>Requirement 2</name>
1043
- <stem type='AsciiMath'>r = 1 %</stem>
1044
- </requirement>
1045
- <p>
1046
- <xref target='N'>Requirement 2</xref>
1047
- </p>
1048
- </clause>
1049
- <terms id='terms' displayorder="4">
1050
- <title>2.</title>
1051
- </terms>
1052
- <clause id='widgets' displayorder="5">
1053
- <title depth='1'>
1054
- 3.
1055
- <tab/>
1056
- Widgets
1057
- </title>
1058
- <clause id='widgets1'><title>3.1.</title>
1059
- <requirement id='note1'>
1060
- <name>Requirement 3</name>
1061
- <stem type='AsciiMath'>r = 1 %</stem>
1062
- </requirement>
1063
- <requirement id='note2'>
1064
- <name>Requirement 4</name>
1065
- <stem type='AsciiMath'>r = 1 %</stem>
1066
- </requirement>
1067
- <p>
1068
- <xref target='note1'>Requirement 3</xref>
1069
- <xref target='note2'>Requirement 4</xref>
1070
- </p>
1071
- </clause>
1072
- </clause>
1073
- </sections>
1074
- <annex id='annex1' displayorder="6">
1075
- <title>
1076
- <strong>Annex A</strong>
1077
- <br/>
1078
- (informative)
1079
- </title>
1080
- <clause id='annex1a'><title>A.1.</title>
1081
- <requirement id='AN'>
1082
- <name>Requirement A.1</name>
1083
- <stem type='AsciiMath'>r = 1 %</stem>
1084
- </requirement>
1085
- </clause>
1086
- <clause id='annex1b'><title>A.2.</title>
1087
- <requirement id='Anote1' unnumbered='true'>
1088
- <name>Requirement</name>
1089
- <stem type='AsciiMath'>r = 1 %</stem>
1090
- </requirement>
1091
- <requirement id='Anote2'>
1092
- <name>Requirement A.2</name>
1093
- <stem type='AsciiMath'>r = 1 %</stem>
1094
- </requirement>
1095
- </clause>
1096
- </annex>
1097
- </iso-standard>
1098
604
  OUTPUT
1099
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1100
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
605
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
606
+ .convert("test", input, true))
607
+ .at("//xmlns:foreword").to_xml))
608
+ .to be_equivalent_to xmlpp(output)
1101
609
  end
1102
610
 
1103
611
  it "cross-references recommendations" do
@@ -1165,9 +673,6 @@ RSpec.describe IsoDoc do
1165
673
  </iso-standard>
1166
674
  INPUT
1167
675
  output = <<~OUTPUT
1168
- <?xml version='1.0'?>
1169
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1170
- <preface>
1171
676
  <foreword displayorder='1'>
1172
677
  <p>
1173
678
  <xref target='N1'>Introduction, Recommendation 1</xref>
@@ -1180,87 +685,11 @@ RSpec.describe IsoDoc do
1180
685
  <xref target='Anote2'>Recommendation A.2</xref>
1181
686
  </p>
1182
687
  </foreword>
1183
- <introduction id='intro' displayorder="2">
1184
- <recommendation id='N1'>
1185
- <name>Recommendation 1</name>
1186
- <stem type='AsciiMath'>r = 1 %</stem>
1187
- </recommendation>
1188
- <clause id='xyz'>
1189
- <title depth='2'>Preparatory</title>
1190
- <recommendation id='N2' unnumbered='true'>
1191
- <name>Recommendation</name>
1192
- <stem type='AsciiMath'>r = 1 %</stem>
1193
- </recommendation>
1194
- </clause>
1195
- </introduction>
1196
- </preface>
1197
- <sections>
1198
- <clause id='scope' type="scope" displayorder="3">
1199
- <title depth='1'>
1200
- 1.
1201
- <tab/>
1202
- Scope
1203
- </title>
1204
- <recommendation id='N'>
1205
- <name>Recommendation 2</name>
1206
- <stem type='AsciiMath'>r = 1 %</stem>
1207
- </recommendation>
1208
- <p>
1209
- <xref target='N'>Recommendation 2</xref>
1210
- </p>
1211
- </clause>
1212
- <terms id='terms' displayorder="4">
1213
- <title>2.</title>
1214
- </terms>
1215
- <clause id='widgets' displayorder="5">
1216
- <title depth='1'>
1217
- 3.
1218
- <tab/>
1219
- Widgets
1220
- </title>
1221
- <clause id='widgets1'><title>3.1.</title>
1222
- <recommendation id='note1'>
1223
- <name>Recommendation 3</name>
1224
- <stem type='AsciiMath'>r = 1 %</stem>
1225
- </recommendation>
1226
- <recommendation id='note2'>
1227
- <name>Recommendation 4</name>
1228
- <stem type='AsciiMath'>r = 1 %</stem>
1229
- </recommendation>
1230
- <p>
1231
- <xref target='note1'>Recommendation 3</xref>
1232
- <xref target='note2'>Recommendation 4</xref>
1233
- </p>
1234
- </clause>
1235
- </clause>
1236
- </sections>
1237
- <annex id='annex1' displayorder="6">
1238
- <title>
1239
- <strong>Annex A</strong>
1240
- <br/>
1241
- (informative)
1242
- </title>
1243
- <clause id='annex1a'><title>A.1.</title>
1244
- <recommendation id='AN'>
1245
- <name>Recommendation A.1</name>
1246
- <stem type='AsciiMath'>r = 1 %</stem>
1247
- </recommendation>
1248
- </clause>
1249
- <clause id='annex1b'><title>A.2.</title>
1250
- <recommendation id='Anote1' unnumbered='true'>
1251
- <name>Recommendation</name>
1252
- <stem type='AsciiMath'>r = 1 %</stem>
1253
- </recommendation>
1254
- <recommendation id='Anote2'>
1255
- <name>Recommendation A.2</name>
1256
- <stem type='AsciiMath'>r = 1 %</stem>
1257
- </recommendation>
1258
- </clause>
1259
- </annex>
1260
- </iso-standard>
1261
688
  OUTPUT
1262
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1263
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
689
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
690
+ .convert("test", input, true))
691
+ .at("//xmlns:foreword").to_xml))
692
+ .to be_equivalent_to xmlpp(output)
1264
693
  end
1265
694
 
1266
695
  it "cross-references permissions" do
@@ -1328,9 +757,6 @@ RSpec.describe IsoDoc do
1328
757
  </iso-standard>
1329
758
  INPUT
1330
759
  output = <<~OUTPUT
1331
- <?xml version='1.0'?>
1332
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1333
- <preface>
1334
760
  <foreword displayorder='1'>
1335
761
  <p>
1336
762
  <xref target='N1'>Introduction, Permission 1</xref>
@@ -1343,87 +769,11 @@ RSpec.describe IsoDoc do
1343
769
  <xref target='Anote2'>Permission A.2</xref>
1344
770
  </p>
1345
771
  </foreword>
1346
- <introduction id='intro' displayorder="2">
1347
- <permission id='N1'>
1348
- <name>Permission 1</name>
1349
- <stem type='AsciiMath'>r = 1 %</stem>
1350
- </permission>
1351
- <clause id='xyz'>
1352
- <title depth='2'>Preparatory</title>
1353
- <permission id='N2' unnumbered='true'>
1354
- <name>Permission</name>
1355
- <stem type='AsciiMath'>r = 1 %</stem>
1356
- </permission>
1357
- </clause>
1358
- </introduction>
1359
- </preface>
1360
- <sections>
1361
- <clause id='scope' type="scope" displayorder="3">
1362
- <title depth='1'>
1363
- 1.
1364
- <tab/>
1365
- Scope
1366
- </title>
1367
- <permission id='N'>
1368
- <name>Permission 2</name>
1369
- <stem type='AsciiMath'>r = 1 %</stem>
1370
- </permission>
1371
- <p>
1372
- <xref target='N'>Permission 2</xref>
1373
- </p>
1374
- </clause>
1375
- <terms id='terms' displayorder="4">
1376
- <title>2.</title>
1377
- </terms>
1378
- <clause id='widgets' displayorder="5">
1379
- <title depth='1'>
1380
- 3.
1381
- <tab/>
1382
- Widgets
1383
- </title>
1384
- <clause id='widgets1'><title>3.1.</title>
1385
- <permission id='note1'>
1386
- <name>Permission 3</name>
1387
- <stem type='AsciiMath'>r = 1 %</stem>
1388
- </permission>
1389
- <permission id='note2'>
1390
- <name>Permission 4</name>
1391
- <stem type='AsciiMath'>r = 1 %</stem>
1392
- </permission>
1393
- <p>
1394
- <xref target='note1'>Permission 3</xref>
1395
- <xref target='note2'>Permission 4</xref>
1396
- </p>
1397
- </clause>
1398
- </clause>
1399
- </sections>
1400
- <annex id='annex1' displayorder="6">
1401
- <title>
1402
- <strong>Annex A</strong>
1403
- <br/>
1404
- (informative)
1405
- </title>
1406
- <clause id='annex1a'><title>A.1.</title>
1407
- <permission id='AN'>
1408
- <name>Permission A.1</name>
1409
- <stem type='AsciiMath'>r = 1 %</stem>
1410
- </permission>
1411
- </clause>
1412
- <clause id='annex1b'><title>A.2.</title>
1413
- <permission id='Anote1' unnumbered='true'>
1414
- <name>Permission</name>
1415
- <stem type='AsciiMath'>r = 1 %</stem>
1416
- </permission>
1417
- <permission id='Anote2'>
1418
- <name>Permission A.2</name>
1419
- <stem type='AsciiMath'>r = 1 %</stem>
1420
- </permission>
1421
- </clause>
1422
- </annex>
1423
- </iso-standard>
1424
772
  OUTPUT
1425
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1426
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
773
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
774
+ .convert("test", input, true))
775
+ .at("//xmlns:foreword").to_xml))
776
+ .to be_equivalent_to xmlpp(output)
1427
777
  end
1428
778
 
1429
779
  it "labels and cross-references nested requirements" do
@@ -1474,9 +824,6 @@ RSpec.describe IsoDoc do
1474
824
  </iso-standard>
1475
825
  INPUT
1476
826
  output = <<~OUTPUT
1477
- <?xml version='1.0'?>
1478
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1479
- <preface>
1480
827
  <foreword displayorder='1'>
1481
828
  <p>
1482
829
  <xref target='N1'>Clause 1, Permission 1</xref>
@@ -1491,59 +838,11 @@ RSpec.describe IsoDoc do
1491
838
  <xref target='AR1'>Recommendation A.1-1</xref>
1492
839
  </p>
1493
840
  </foreword>
1494
- </preface>
1495
- <sections>
1496
- <clause id='xyz' displayorder="2">
1497
- <title depth='1'>
1498
- 1.
1499
- <tab/>
1500
- Preparatory
1501
- </title>
1502
- <permission id='N1'>
1503
- <name>Permission 1</name>
1504
- <permission id='N2'>
1505
- <name>Permission 1-1</name>
1506
- <permission id='N'>
1507
- <name>Permission 1-1-1</name>
1508
- </permission>
1509
- </permission>
1510
- <requirement id='Q1'>
1511
- <name>Requirement 1-1</name>
1512
- </requirement>
1513
- <recommendation id='R1'>
1514
- <name>Recommendation 1-1</name>
1515
- </recommendation>
1516
- </permission>
1517
- </clause>
1518
- </sections>
1519
- <annex id='Axyz' displayorder="3">
1520
- <title>
1521
- <strong>Annex A</strong>
1522
- <br/>
1523
- (informative)
1524
- <br/>
1525
- <br/>
1526
- <strong>Preparatory</strong></title>
1527
- <permission id='AN1'>
1528
- <name>Permission A.1</name>
1529
- <permission id='AN2'>
1530
- <name>Permission A.1-1</name>
1531
- <permission id='AN'>
1532
- <name>Permission A.1-1-1</name>
1533
- </permission>
1534
- </permission>
1535
- <requirement id='AQ1'>
1536
- <name>Requirement A.1-1</name>
1537
- </requirement>
1538
- <recommendation id='AR1'>
1539
- <name>Recommendation A.1-1</name>
1540
- </recommendation>
1541
- </permission>
1542
- </annex>
1543
- </iso-standard>
1544
841
  OUTPUT
1545
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1546
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
842
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
843
+ .convert("test", input, true))
844
+ .at("//xmlns:foreword").to_xml))
845
+ .to be_equivalent_to xmlpp(output)
1547
846
  end
1548
847
 
1549
848
  it "cross-references tables" do
@@ -1667,8 +966,6 @@ RSpec.describe IsoDoc do
1667
966
  </iso-standard>
1668
967
  INPUT
1669
968
  output = <<~OUTPUT
1670
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1671
- <preface>
1672
969
  <foreword displayorder='1'>
1673
970
  <p>
1674
971
  <xref target='N1'>Table 1</xref>
@@ -1681,138 +978,11 @@ RSpec.describe IsoDoc do
1681
978
  <xref target='Anote2'>Table A.2</xref>
1682
979
  </p>
1683
980
  </foreword>
1684
- <introduction id='intro' displayorder='2'>
1685
- <table id='N1'>
1686
- <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1687
- <tbody>
1688
- <tr>
1689
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1690
- <td align='center'>13</td>
1691
- <td align='center'>11</td>
1692
- </tr>
1693
- </tbody>
1694
- </table>
1695
- <clause id='xyz'>
1696
- <title depth='2'>Preparatory</title>
1697
- <table id='N2' unnumbered='true'>
1698
- <name>Table &#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1699
- <tbody>
1700
- <tr>
1701
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1702
- <td align='center'>13</td>
1703
- <td align='center'>11</td>
1704
- </tr>
1705
- </tbody>
1706
- </table>
1707
- </clause>
1708
- </introduction>
1709
- </preface>
1710
- <sections>
1711
- <clause id='scope' type='scope' displayorder='3'>
1712
- <title depth='1'>
1713
- 1.
1714
- <tab/>
1715
- Scope
1716
- </title>
1717
- <table id='N'>
1718
- <name>Table 2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1719
- <tbody>
1720
- <tr>
1721
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1722
- <td align='center'>13</td>
1723
- <td align='center'>11</td>
1724
- </tr>
1725
- </tbody>
1726
- </table>
1727
- <p>
1728
- <xref target='N'>Table 2</xref>
1729
- </p>
1730
- </clause>
1731
- <terms id='terms' displayorder='4'>
1732
- <title>2.</title>
1733
- </terms>
1734
- <clause id='widgets' displayorder='5'>
1735
- <title depth='1'>
1736
- 3.
1737
- <tab/>
1738
- Widgets
1739
- </title>
1740
- <clause id='widgets1'>
1741
- <title>3.1.</title>
1742
- <table id='note1'>
1743
- <name>Table 3&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1744
- <tbody>
1745
- <tr>
1746
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1747
- <td align='center'>13</td>
1748
- <td align='center'>11</td>
1749
- </tr>
1750
- </tbody>
1751
- </table>
1752
- <table id='note2'>
1753
- <name>Table 4&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1754
- <tbody>
1755
- <tr>
1756
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1757
- <td align='center'>13</td>
1758
- <td align='center'>11</td>
1759
- </tr>
1760
- </tbody>
1761
- </table>
1762
- <p>
1763
- <xref target='note1'>Table 3</xref>
1764
- <xref target='note2'>Table 4</xref>
1765
- </p>
1766
- </clause>
1767
- </clause>
1768
- </sections>
1769
- <annex id='annex1' displayorder='6'>
1770
- <title>
1771
- <strong>Annex A</strong>
1772
- <br/>
1773
- (informative)
1774
- </title>
1775
- <clause id='annex1a'>
1776
- <title>A.1.</title>
1777
- <table id='AN'>
1778
- <name>Table A.1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1779
- <tbody>
1780
- <tr>
1781
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1782
- <td align='center'>13</td>
1783
- <td align='center'>11</td>
1784
- </tr>
1785
- </tbody>
1786
- </table>
1787
- </clause>
1788
- <clause id='annex1b'>
1789
- <title>A.2.</title>
1790
- <table id='Anote1' unnumbered='true'>
1791
- <name>Table &#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1792
- <tbody>
1793
- <tr>
1794
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1795
- <td align='center'>13</td>
1796
- <td align='center'>11</td>
1797
- </tr>
1798
- </tbody>
1799
- </table>
1800
- <table id='Anote2'>
1801
- <name>Table A.2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</name>
1802
- <tbody>
1803
- <tr>
1804
- <td align='left'>Number of laboratories retained after eliminating outliers</td>
1805
- <td align='center'>13</td>
1806
- <td align='center'>11</td>
1807
- </tr>
1808
- </tbody>
1809
- </table>
1810
- </clause>
1811
- </annex>
1812
- </iso-standard>
1813
981
  OUTPUT
1814
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1815
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
982
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
983
+ .convert("test", input, true))
984
+ .at("//xmlns:foreword").to_xml))
985
+ .to be_equivalent_to xmlpp(output)
1816
986
  end
1817
987
 
1818
988
  it "cross-references term notes" do
@@ -1846,9 +1016,6 @@ RSpec.describe IsoDoc do
1846
1016
  </iso-standard>
1847
1017
  INPUT
1848
1018
  output = <<~OUTPUT
1849
- <?xml version='1.0'?>
1850
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1851
- <preface>
1852
1019
  <foreword displayorder="1">
1853
1020
  <p>
1854
1021
  <xref target='note1'>Clause 2.1, Note 1</xref>
@@ -1856,52 +1023,11 @@ RSpec.describe IsoDoc do
1856
1023
  <xref target='note3'>Clause 2.2, Note 2</xref>
1857
1024
  </p>
1858
1025
  </foreword>
1859
- </preface>
1860
- <sections>
1861
- <clause id='scope' type="scope" displayorder="2">
1862
- <title depth='1'>
1863
- 1.
1864
- <tab/>
1865
- Scope
1866
- </title>
1867
- </clause>
1868
- <terms id='terms'displayorder="3">
1869
- <title>2.</title>
1870
- <term id='_waxy_rice'>
1871
- <name>2.1.</name>
1872
- <preferred><strong>waxy rice</strong></preferred>
1873
- <termnote id='note1'>
1874
- <name>Note 1 to entry</name>
1875
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1876
- The starch of waxy rice consists almost entirely of amylopectin. The
1877
- kernels have a tendency to stick together after cooking.
1878
- </p>
1879
- </termnote>
1880
- </term>
1881
- <term id='_nonwaxy_rice'>
1882
- <name>2.2.</name>
1883
- <preferred><strong>nonwaxy rice</strong></preferred>
1884
- <termnote id='note2'>
1885
- <name>Note 1 to entry</name>
1886
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1887
- The starch of waxy rice consists almost entirely of amylopectin. The
1888
- kernels have a tendency to stick together after cooking.
1889
- </p>
1890
- </termnote>
1891
- <termnote id='note3'>
1892
- <name>Note 2 to entry</name>
1893
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1894
- The starch of waxy rice consists almost entirely of amylopectin. The
1895
- kernels have a tendency to stick together after cooking.
1896
- </p>
1897
- </termnote>
1898
- </term>
1899
- </terms>
1900
- </sections>
1901
- </iso-standard>
1902
1026
  OUTPUT
1903
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1904
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1027
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
1028
+ .convert("test", input, true))
1029
+ .at("//xmlns:foreword").to_xml))
1030
+ .to be_equivalent_to xmlpp(output)
1905
1031
  end
1906
1032
 
1907
1033
  it "cross-references nested term notes" do
@@ -1935,8 +1061,6 @@ RSpec.describe IsoDoc do
1935
1061
  </iso-standard>
1936
1062
  INPUT
1937
1063
  output = <<~OUTPUT
1938
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1939
- <preface>
1940
1064
  <foreword displayorder='1'>
1941
1065
  <p>
1942
1066
  <xref target='note1'>Clause 2.1, Note 1</xref>
@@ -1944,52 +1068,11 @@ RSpec.describe IsoDoc do
1944
1068
  <xref target='note3'>Clause 2.1.1, Note 2</xref>
1945
1069
  </p>
1946
1070
  </foreword>
1947
- </preface>
1948
- <sections>
1949
- <clause id='scope' type='scope' displayorder='2'>
1950
- <title depth='1'>
1951
- 1.
1952
- <tab/>
1953
- Scope
1954
- </title>
1955
- </clause>
1956
- <terms id='terms' displayorder='3'>
1957
- <title>2.</title>
1958
- <term id='_waxy_rice'>
1959
- <name>2.1.</name>
1960
- <preferred><strong>waxy rice</strong></preferred>
1961
- <termnote id='note1'>
1962
- <name>Note 1 to entry</name>
1963
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1964
- The starch of waxy rice consists almost entirely of amylopectin. The
1965
- kernels have a tendency to stick together after cooking.
1966
- </p>
1967
- </termnote>
1968
- <term id='_nonwaxy_rice'>
1969
- <name>2.1.1.</name>
1970
- <preferred><strong>nonwaxy rice</strong></preferred>
1971
- <termnote id='note2'>
1972
- <name>Note 1 to entry</name>
1973
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1974
- The starch of waxy rice consists almost entirely of amylopectin.
1975
- The kernels have a tendency to stick together after cooking.
1976
- </p>
1977
- </termnote>
1978
- <termnote id='note3'>
1979
- <name>Note 2 to entry</name>
1980
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
1981
- The starch of waxy rice consists almost entirely of amylopectin.
1982
- The kernels have a tendency to stick together after cooking.
1983
- </p>
1984
- </termnote>
1985
- </term>
1986
- </term>
1987
- </terms>
1988
- </sections>
1989
- </iso-standard>
1990
1071
  OUTPUT
1991
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1992
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1072
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
1073
+ .convert("test", input, true))
1074
+ .at("//xmlns:foreword").to_xml))
1075
+ .to be_equivalent_to xmlpp(output)
1993
1076
  end
1994
1077
 
1995
1078
  it "cross-references term examples" do
@@ -2023,9 +1106,6 @@ RSpec.describe IsoDoc do
2023
1106
  </iso-standard>
2024
1107
  INPUT
2025
1108
  output = <<~OUTPUT
2026
- <?xml version='1.0'?>
2027
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2028
- <preface>
2029
1109
  <foreword displayorder="1">
2030
1110
  <p>
2031
1111
  <xref target='note1'>Clause 2.1, Example</xref>
@@ -2033,52 +1113,11 @@ RSpec.describe IsoDoc do
2033
1113
  <xref target='note3'>Clause 2.2, Example 2</xref>
2034
1114
  </p>
2035
1115
  </foreword>
2036
- </preface>
2037
- <sections>
2038
- <clause id='scope' type="scope" displayorder="2">
2039
- <title depth='1'>
2040
- 1.
2041
- <tab/>
2042
- Scope
2043
- </title>
2044
- </clause>
2045
- <terms id='terms'displayorder="3">
2046
- <title>2.</title>
2047
- <term id='_waxy_rice'>
2048
- <name>2.1.</name>
2049
- <preferred><strong>waxy rice</strong></preferred>
2050
- <termexample id='note1'>
2051
- <name>EXAMPLE</name>
2052
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2053
- The starch of waxy rice consists almost entirely of amylopectin. The
2054
- kernels have a tendency to stick together after cooking.
2055
- </p>
2056
- </termexample>
2057
- </term>
2058
- <term id='_nonwaxy_rice'>
2059
- <name>2.2.</name>
2060
- <preferred><strong>nonwaxy rice</strong></preferred>
2061
- <termexample id='note2'>
2062
- <name>EXAMPLE 1</name>
2063
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2064
- The starch of waxy rice consists almost entirely of amylopectin. The
2065
- kernels have a tendency to stick together after cooking.
2066
- </p>
2067
- </termexample>
2068
- <termexample id='note3'>
2069
- <name>EXAMPLE 2</name>
2070
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2071
- The starch of waxy rice consists almost entirely of amylopectin. The
2072
- kernels have a tendency to stick together after cooking.
2073
- </p>
2074
- </termexample>
2075
- </term>
2076
- </terms>
2077
- </sections>
2078
- </iso-standard>
2079
1116
  OUTPUT
2080
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2081
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1117
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
1118
+ .convert("test", input, true))
1119
+ .at("//xmlns:foreword").to_xml))
1120
+ .to be_equivalent_to xmlpp(output)
2082
1121
  end
2083
1122
 
2084
1123
  it "cross-references nested term examples" do
@@ -2112,8 +1151,6 @@ RSpec.describe IsoDoc do
2112
1151
  </iso-standard>
2113
1152
  INPUT
2114
1153
  output = <<~OUTPUT
2115
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2116
- <preface>
2117
1154
  <foreword displayorder='1'>
2118
1155
  <p>
2119
1156
  <xref target='note1'>Clause 2.1, Example</xref>
@@ -2121,52 +1158,11 @@ RSpec.describe IsoDoc do
2121
1158
  <xref target='note3'>Clause 2.1.1, Example 2</xref>
2122
1159
  </p>
2123
1160
  </foreword>
2124
- </preface>
2125
- <sections>
2126
- <clause id='scope' type='scope' displayorder='2'>
2127
- <title depth='1'>
2128
- 1.
2129
- <tab/>
2130
- Scope
2131
- </title>
2132
- </clause>
2133
- <terms id='terms' displayorder='3'>
2134
- <title>2.</title>
2135
- <term id='_waxy_rice'>
2136
- <name>2.1.</name>
2137
- <preferred><strong>waxy rice</strong></preferred>
2138
- <termexample id='note1'>
2139
- <name>EXAMPLE</name>
2140
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2141
- The starch of waxy rice consists almost entirely of amylopectin. The
2142
- kernels have a tendency to stick together after cooking.
2143
- </p>
2144
- </termexample>
2145
- <term id='_nonwaxy_rice'>
2146
- <name>2.1.1.</name>
2147
- <preferred><strong>nonwaxy rice</strong></preferred>
2148
- <termexample id='note2'>
2149
- <name>EXAMPLE 1</name>
2150
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2151
- The starch of waxy rice consists almost entirely of amylopectin.
2152
- The kernels have a tendency to stick together after cooking.
2153
- </p>
2154
- </termexample>
2155
- <termexample id='note3'>
2156
- <name>EXAMPLE 2</name>
2157
- <p id='_b0cb3dfd-78fc-47dd-a339-84070d947463'>
2158
- The starch of waxy rice consists almost entirely of amylopectin.
2159
- The kernels have a tendency to stick together after cooking.
2160
- </p>
2161
- </termexample>
2162
- </term>
2163
- </term>
2164
- </terms>
2165
- </sections>
2166
- </iso-standard>
2167
1161
  OUTPUT
2168
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2169
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1162
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
1163
+ .convert("test", input, true))
1164
+ .at("//xmlns:foreword").to_xml))
1165
+ .to be_equivalent_to xmlpp(output)
2170
1166
  end
2171
1167
 
2172
1168
  it "cross-references sections" do
@@ -2259,8 +1255,6 @@ RSpec.describe IsoDoc do
2259
1255
  </iso-standard>
2260
1256
  INPUT
2261
1257
  output = <<~OUTPUT
2262
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2263
- <preface>
2264
1258
  <foreword obligation='informative' displayorder='1'>
2265
1259
  <title>Foreword</title>
2266
1260
  <p id='A'>
@@ -2286,133 +1280,11 @@ RSpec.describe IsoDoc do
2286
1280
  <xref target='S'>Bibliography</xref>
2287
1281
  </p>
2288
1282
  </foreword>
2289
- <introduction id='B' obligation='informative' displayorder='2'>
2290
- <title>Introduction</title>
2291
- <clause id='C' inline-header='false' obligation='informative'>
2292
- <title depth='2'>Introduction Subsection</title>
2293
- </clause>
2294
- <clause id='C1' inline-header='false' obligation='informative'>Text</clause>
2295
- </introduction>
2296
- </preface>
2297
- <sections>
2298
- <clause id='D' obligation='normative' type='scope' displayorder='3'>
2299
- <title depth='1'>
2300
- 1.
2301
- <tab/>
2302
- Scope
2303
- </title>
2304
- <p id='E'>Text</p>
2305
- </clause>
2306
- <terms id='H' obligation='normative' displayorder='5'>
2307
- <title depth='1'>
2308
- 3.
2309
- <tab/>
2310
- Terms, definitions, symbols and abbreviated terms
2311
- </title>
2312
- <terms id='I' obligation='normative'>
2313
- <title depth='2'>
2314
- 3.1.
2315
- <tab/>
2316
- Normal Terms
2317
- </title>
2318
- <term id='J'>
2319
- <name>3.1.1.</name>
2320
- <preferred><strong>Term2</strong></preferred>
2321
- </term>
2322
- </terms>
2323
- <definitions id='K'>
2324
- <title>3.2.</title>
2325
- <dl>
2326
- <dt>Symbol</dt>
2327
- <dd>Definition</dd>
2328
- </dl>
2329
- </definitions>
2330
- </terms>
2331
- <definitions id='L' displayorder='6'>
2332
- <title>4.</title>
2333
- <dl>
2334
- <dt>Symbol</dt>
2335
- <dd>Definition</dd>
2336
- </dl>
2337
- </definitions>
2338
- <clause id='M' inline-header='false' obligation='normative' displayorder='7'>
2339
- <title depth='1'>
2340
- 5.
2341
- <tab/>
2342
- Clause 4
2343
- </title>
2344
- <clause id='N' inline-header='false' obligation='normative'>
2345
- <title depth='2'>
2346
- 5.1.
2347
- <tab/>
2348
- Introduction
2349
- </title>
2350
- </clause>
2351
- <clause id='O' inline-header='false' obligation='normative'>
2352
- <title depth='2'>
2353
- 5.2.
2354
- <tab/>
2355
- Clause 4.2
2356
- </title>
2357
- </clause>
2358
- </clause>
2359
- </sections>
2360
- <annex id='P' inline-header='false' obligation='normative' displayorder='8'>
2361
- <title>
2362
- <strong>Annex A</strong>
2363
- <br/>
2364
- (normative)
2365
- <br/>
2366
- <br/>
2367
- <strong>Annex</strong>
2368
- </title>
2369
- <clause id='Q' inline-header='false' obligation='normative'>
2370
- <title depth='2'>
2371
- A.1.
2372
- <tab/>
2373
- Annex A.1
2374
- </title>
2375
- <clause id='Q1' inline-header='false' obligation='normative'>
2376
- <title depth='3'>
2377
- A.1.1.
2378
- <tab/>
2379
- Annex A.1a
2380
- </title>
2381
- </clause>
2382
- </clause>
2383
- </annex>
2384
- <annex id='QQ' displayorder='9'>
2385
- <title>
2386
- <strong>Annex B</strong>
2387
- <br/>
2388
- (informative)
2389
- </title>
2390
- <terms id='QQ1'>
2391
- <title>B.</title>
2392
- <term id='QQ2'>
2393
- <name>B.1.</name>
2394
- </term>
2395
- </terms>
2396
- </annex>
2397
- <bibliography>
2398
- <references id='R' obligation='informative' normative='true' displayorder='4'>
2399
- <title depth='1'>
2400
- 2.
2401
- <tab/>
2402
- Normative References
2403
- </title>
2404
- </references>
2405
- <clause id='S' obligation='informative' displayorder='10'>
2406
- <title depth='1'>Bibliography</title>
2407
- <references id='T' obligation='informative' normative='false'>
2408
- <title depth='2'>Bibliography Subsection</title>
2409
- </references>
2410
- </clause>
2411
- </bibliography>
2412
- </iso-standard>
2413
1283
  OUTPUT
2414
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2415
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1284
+ expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
1285
+ .convert("test", input, true))
1286
+ .at("//xmlns:foreword").to_xml))
1287
+ .to be_equivalent_to xmlpp(output)
2416
1288
  end
2417
1289
 
2418
1290
  it "cross-references lists" do
@@ -2504,6 +1376,8 @@ RSpec.describe IsoDoc do
2504
1376
  <foreword>
2505
1377
  <p>
2506
1378
  <xref target="N1"/>
1379
+ <xref target="N11"/>
1380
+ <xref target="N12"/>
2507
1381
  <xref target="N2"/>
2508
1382
  <xref target="N"/>
2509
1383
  <xref target="note1"/>
@@ -2515,8 +1389,13 @@ RSpec.describe IsoDoc do
2515
1389
  </foreword>
2516
1390
  <introduction id="intro">
2517
1391
  <ol id="N01">
2518
- <li id="N1"><p>A</p></li>
2519
- </ol>
1392
+ <li id="N1"><p>A</p>
1393
+ <ol id="N011">
1394
+ <li id="N11"><p>A</p>
1395
+ <ol id="N012">
1396
+ <li id="N12"><p>A</p>
1397
+ </li>
1398
+ </ol></li></ol></li></ol>
2520
1399
  <clause id="xyz"><title>Preparatory</title>
2521
1400
  <ol id="N02" type="arabic">
2522
1401
  <li id="N2"><p>A</p></li>
@@ -2563,6 +1442,8 @@ RSpec.describe IsoDoc do
2563
1442
  <foreword displayorder='1'>
2564
1443
  <p>
2565
1444
  <xref target='N1'>Introduction, a)</xref>
1445
+ <xref target='N11'>Introduction, a.1)</xref>
1446
+ <xref target='N12'>Introduction, a.1.i)</xref>
2566
1447
  <xref target='N2'>Preparatory, 1)</xref>
2567
1448
  <xref target='N'>Clause 1, i)</xref>
2568
1449
  <xref target='note1'>Clause 3.1, List 1 a)</xref>