isodoc 1.7.7 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ RSpec.describe IsoDoc do
24
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
- <preferred>Term2</preferred>
27
+ <preferred><expression><name>Term2</name></expression></preferred>
28
28
  </term>
29
29
  </terms>
30
30
  <definitions id="K">
@@ -233,7 +233,7 @@ RSpec.describe IsoDoc do
233
233
  <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
234
234
  <title>Normal Terms</title>
235
235
  <term id="J">
236
- <preferred>Term2</preferred>
236
+ <preferred><expression><name>Term2</name></expression></preferred>
237
237
  </term>
238
238
  </terms>
239
239
  <definitions id="K">
@@ -361,7 +361,7 @@ RSpec.describe IsoDoc do
361
361
  <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
362
362
  <title>Normal Terms</title>
363
363
  <term id="J">
364
- <preferred>Term2</preferred>
364
+ <preferred><expression><name>Term2</name></expression></preferred>
365
365
  </term>
366
366
  </terms>
367
367
  <definitions id="K">
@@ -570,7 +570,7 @@ RSpec.describe IsoDoc do
570
570
  <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
571
571
  <title>Normal Terms</title>
572
572
  <term id="J">
573
- <preferred>Term2</preferred>
573
+ <preferred><expression><name>Term2</name></expression></preferred>
574
574
  </term>
575
575
  </terms>
576
576
  <definitions id="K">
@@ -812,7 +812,7 @@ RSpec.describe IsoDoc do
812
812
  <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
813
813
  <title>Normal Terms</title>
814
814
  <term id="J">
815
- <preferred>Term2</preferred>
815
+ <preferred><expression><name>Term2</name></expression></preferred>
816
816
  </term>
817
817
  </terms>
818
818
  <definitions id="K">
@@ -625,6 +625,84 @@ RSpec.describe IsoDoc do
625
625
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
626
626
  end
627
627
 
628
+ it "processes related terms" do
629
+ input = <<~INPUT
630
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
631
+ <sections>
632
+ <terms id='A' obligation='normative'>
633
+ <title>Terms and definitions</title>
634
+ <term id='second'>
635
+ <preferred>
636
+ <expression>
637
+ <name>Second Term</name>
638
+ </expression>
639
+ </preferred>
640
+ <usageinfo>
641
+ <p id='B'>Usage Info 1.</p>
642
+ </usageinfo>
643
+ <definition><verbaldefinition>Definition 1</verbaldefinition></definition>
644
+ </term>
645
+ <term id="C">
646
+ <preferred language='fr' script='Latn' type='prefix'>
647
+ <expression>
648
+ <name>First Designation</name>
649
+ </expression></preferred>
650
+ <related type='contrast'>
651
+ <preferred>
652
+ <expression>
653
+ <name>Fifth Designation</name>
654
+ <grammar>
655
+ <gender>neuter</gender>
656
+ </grammar>
657
+ </expression>
658
+ </preferred>
659
+ <xref target='second'/>
660
+ </related>
661
+ <definition><verbaldefinition>Definition 2</verbaldefinition></definition>
662
+ </term>
663
+ </terms>
664
+ </sections>
665
+ </iso-standard>
666
+ INPUT
667
+ output = <<~OUTPUT
668
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
669
+ <sections>
670
+ <terms id='A' obligation='normative' displayorder='1'>
671
+ <title depth='1'>
672
+ 1.
673
+ <tab/>
674
+ Terms and definitions
675
+ </title>
676
+ <term id='second'>
677
+ <name>1.1.</name>
678
+ <preferred>Second Term</preferred>
679
+ <usageinfo>
680
+ <p id='B'>Usage Info 1.</p>
681
+ </usageinfo>
682
+ <definition>Definition 1</definition>
683
+ </term>
684
+ <term id='C'>
685
+ <name>1.2.</name>
686
+ <preferred language='fr' script='Latn' type='prefix'>First Designation</preferred>
687
+ <p>
688
+ <strong>CONTRAST:</strong>
689
+ <em>
690
+ <preferred>Fifth Designation neut</preferred>
691
+ </em>
692
+ (
693
+ <xref target='second'>Clause 1.1</xref>
694
+ )
695
+ </p>
696
+ <definition>Definition 2</definition>
697
+ </term>
698
+ </terms>
699
+ </sections>
700
+ </iso-standard>
701
+ OUTPUT
702
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
703
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
704
+ end
705
+
628
706
  it "processes embedded inline formatting" do
629
707
  input = <<~INPUT
630
708
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -209,7 +209,7 @@ RSpec.describe IsoDoc do
209
209
  <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
210
210
  <title>Normal Terms</title>
211
211
  <term id="J">
212
- <preferred>Term2</preferred>
212
+ <preferred><expression><name>Term2</name></expression></preferred>
213
213
  </term>
214
214
  </terms>
215
215
  <definitions id="K">
@@ -745,7 +745,7 @@ RSpec.describe IsoDoc do
745
745
  <title>Normal Terms</title>
746
746
  <variant-title type="sub">Variant 1</variant-title>
747
747
  <term id="J">
748
- <preferred>Term2</preferred>
748
+ <preferred><expression><name>Term2</name></expression></preferred>
749
749
  </term>
750
750
  </terms>
751
751
  <definitions id="K">
@@ -1361,7 +1361,7 @@ RSpec.describe IsoDoc do
1361
1361
  <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
1362
1362
  <title>Normal Terms</title>
1363
1363
  <term id="J">
1364
- <preferred>Term2</preferred>
1364
+ <preferred><expression><name>Term2</name></expression></preferred>
1365
1365
  </term>
1366
1366
  </terms>
1367
1367
  <definitions id="K">
@@ -1515,8 +1515,9 @@ RSpec.describe IsoDoc do
1515
1515
  </preface>
1516
1516
  </iso-standard>
1517
1517
  OUTPUT
1518
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
1519
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1518
+ expect(xmlpp(IsoDoc::PresentationXMLConvert
1519
+ .new({ suppressheadingnumbers: true })
1520
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1520
1521
  end
1521
1522
 
1522
1523
  it "processes simple terms & definitions" do
@@ -1525,7 +1526,7 @@ RSpec.describe IsoDoc do
1525
1526
  <sections>
1526
1527
  <terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1527
1528
  <term id="J">
1528
- <preferred>Term2</preferred>
1529
+ <preferred><expression><name>Term2</name></expression></preferred>
1529
1530
  </term>
1530
1531
  </terms>
1531
1532
  </sections>
@@ -1786,7 +1787,7 @@ RSpec.describe IsoDoc do
1786
1787
  <title>Glossary</title>
1787
1788
  <terms id='PP1' obligation='normative'>
1788
1789
  <term id='term-glossary'>
1789
- <preferred>Glossary</preferred>
1790
+ <preferred><expression><name>Glossary</name></expression></preferred>
1790
1791
  </term>
1791
1792
  </terms>
1792
1793
  </annex>
@@ -1795,13 +1796,13 @@ RSpec.describe IsoDoc do
1795
1796
  <terms id='QQ1' obligation='normative'>
1796
1797
  <title>Term Collection</title>
1797
1798
  <term id='term-term-1'>
1798
- <preferred>Term</preferred>
1799
+ <preferred><expression><name>Term</name></expression></preferred>
1799
1800
  </term>
1800
1801
  </terms>
1801
1802
  <terms id='QQ2' obligation='normative'>
1802
1803
  <title>Term Collection 2</title>
1803
1804
  <term id='term-term-2'>
1804
- <preferred>Term</preferred>
1805
+ <preferred><expression><name>Term</name></expression></preferred>
1805
1806
  </term>
1806
1807
  </terms>
1807
1808
  </annex>
@@ -1810,7 +1811,7 @@ RSpec.describe IsoDoc do
1810
1811
  <terms id='RR1' obligation='normative'>
1811
1812
  <title>Term Collection</title>
1812
1813
  <term id='term-term-3'>
1813
- <preferred>Term</preferred>
1814
+ <preferred><expression><name>Term</name></expression></preferred>
1814
1815
  </term>
1815
1816
  </terms>
1816
1817
  <references id='RR2' obligation='normative'>