metanorma-iso 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/header-dis.html +111 -29
- data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
- data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
- data/lib/isodoc/iso/html/style-human.css +7 -2
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +7 -2
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/wordstyle-dis.css +160 -4
- data/lib/isodoc/iso/html/wordstyle-dis.scss +154 -4
- data/lib/isodoc/iso/html/wordstyle.css +150 -0
- data/lib/isodoc/iso/html/wordstyle.scss +144 -0
- data/lib/isodoc/iso/i18n-en.yaml +4 -4
- data/lib/isodoc/iso/iso.amendment.xsl +1649 -1199
- data/lib/isodoc/iso/iso.international-standard.xsl +1649 -1199
- data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
- data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
- data/lib/isodoc/iso/word_convert.rb +6 -4
- data/lib/isodoc/iso/word_dis_cleanup.rb +30 -8
- data/lib/isodoc/iso/word_dis_convert.rb +5 -2
- data/lib/metanorma/iso/base.rb +2 -1
- data/lib/metanorma/iso/biblio.rng +5 -0
- data/lib/metanorma/iso/isodoc.rng +47 -13
- data/lib/metanorma/iso/validate.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +5 -2
- metadata +4 -87
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.github/workflows/ubuntu.yml +0 -41
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.css +0 -2
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -2
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -71
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -45
- data/spec/examples/iso_123_all_parts.xml +0 -45
- data/spec/examples/iso_123_no_year_note.xml +0 -46
- data/spec/examples/iso_124_.xml +0 -41
- data/spec/examples/iso_216_.xml +0 -47
- data/spec/examples/iso_iec_12382_.xml +0 -48
- data/spec/examples/rice.adoc +0 -714
- data/spec/examples/rice.preview.html +0 -1870
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
- data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/ISO_1213_1.png +0 -0
- data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/rice_image1.png +0 -0
- data/spec/examples/rice_img/rice_image2.png +0 -0
- data/spec/examples/rice_img/rice_image3_1.png +0 -0
- data/spec/examples/rice_img/rice_image3_2.png +0 -0
- data/spec/examples/rice_img/rice_image3_3.png +0 -0
- data/spec/isodoc/amd_spec.rb +0 -986
- data/spec/isodoc/blocks_spec.rb +0 -1174
- data/spec/isodoc/i18n_spec.rb +0 -1579
- data/spec/isodoc/inline_spec.rb +0 -1060
- data/spec/isodoc/iso_spec.rb +0 -255
- data/spec/isodoc/metadata_spec.rb +0 -701
- data/spec/isodoc/postproc_spec.rb +0 -1089
- data/spec/isodoc/ref_spec.rb +0 -439
- data/spec/isodoc/section_spec.rb +0 -998
- data/spec/isodoc/table_spec.rb +0 -420
- data/spec/isodoc/terms_spec.rb +0 -314
- data/spec/isodoc/word_dis_spec.rb +0 -2064
- data/spec/isodoc/xref_spec.rb +0 -1747
- data/spec/metanorma/amd_spec.rb +0 -724
- data/spec/metanorma/base_spec.rb +0 -1384
- data/spec/metanorma/blank_spec.rb +0 -38
- data/spec/metanorma/blocks_spec.rb +0 -624
- data/spec/metanorma/cleanup_spec.rb +0 -1645
- data/spec/metanorma/inline_spec.rb +0 -203
- data/spec/metanorma/lists_spec.rb +0 -197
- data/spec/metanorma/macros_spec.rb +0 -99
- data/spec/metanorma/processor_spec.rb +0 -161
- data/spec/metanorma/refs_spec.rb +0 -672
- data/spec/metanorma/section_spec.rb +0 -492
- data/spec/metanorma/table_spec.rb +0 -329
- data/spec/metanorma/validate_spec.rb +0 -2153
- data/spec/relaton/render_spec.rb +0 -568
- data/spec/requirements/requirement_components_spec.rb +0 -610
- data/spec/requirements/requirements_spec.rb +0 -1596
- data/spec/requirements/xref_spec.rb +0 -1211
- data/spec/spec_helper.rb +0 -313
- data/spec/vcr_cassettes/docrels.yml +0 -385
- data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
    
        data/spec/isodoc/xref_spec.rb
    DELETED
    
    | @@ -1,1747 +0,0 @@ | |
| 1 | 
            -
            require "spec_helper"
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            RSpec.describe IsoDoc do
         | 
| 4 | 
            -
              it "cross-references notes" do
         | 
| 5 | 
            -
                input = <<~INPUT
         | 
| 6 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 7 | 
            -
                    <preface>
         | 
| 8 | 
            -
                      <foreword>
         | 
| 9 | 
            -
                        <p>
         | 
| 10 | 
            -
                          <xref target="N"/>
         | 
| 11 | 
            -
                          <xref target="note1"/>
         | 
| 12 | 
            -
                          <xref target="note2"/>
         | 
| 13 | 
            -
                          <xref target="AN"/>
         | 
| 14 | 
            -
                          <xref target="Anote1"/>
         | 
| 15 | 
            -
                          <xref target="Anote2"/>
         | 
| 16 | 
            -
                        </p>
         | 
| 17 | 
            -
                      </foreword>
         | 
| 18 | 
            -
                    </preface>
         | 
| 19 | 
            -
                    <sections>
         | 
| 20 | 
            -
                      <clause id="scope" type="scope">
         | 
| 21 | 
            -
                        <title>Scope</title>
         | 
| 22 | 
            -
                        <note id="N">
         | 
| 23 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 24 | 
            -
                        </note>
         | 
| 25 | 
            -
                        <p>
         | 
| 26 | 
            -
                          <xref target="N"/>
         | 
| 27 | 
            -
                        </p>
         | 
| 28 | 
            -
                      </clause>
         | 
| 29 | 
            -
                      <terms id="terms"/>
         | 
| 30 | 
            -
                      <clause id="widgets">
         | 
| 31 | 
            -
                        <title>Widgets</title>
         | 
| 32 | 
            -
                        <clause id="widgets1">
         | 
| 33 | 
            -
                          <note id="note1">
         | 
| 34 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 35 | 
            -
                          </note>
         | 
| 36 | 
            -
                          <note id="note2">
         | 
| 37 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 38 | 
            -
                          </note>
         | 
| 39 | 
            -
                          <p>
         | 
| 40 | 
            -
                            <xref target="note1"/>
         | 
| 41 | 
            -
                            <xref target="note2"/>
         | 
| 42 | 
            -
                          </p>
         | 
| 43 | 
            -
                        </clause>
         | 
| 44 | 
            -
                      </clause>
         | 
| 45 | 
            -
                    </sections>
         | 
| 46 | 
            -
                    <annex id="annex1">
         | 
| 47 | 
            -
                      <clause id="annex1a">
         | 
| 48 | 
            -
                        <note id="AN">
         | 
| 49 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 50 | 
            -
                        </note>
         | 
| 51 | 
            -
                      </clause>
         | 
| 52 | 
            -
                      <clause id="annex1b">
         | 
| 53 | 
            -
                        <note id="Anote1">
         | 
| 54 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 55 | 
            -
                        </note>
         | 
| 56 | 
            -
                        <note id="Anote2">
         | 
| 57 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 58 | 
            -
                        </note>
         | 
| 59 | 
            -
                      </clause>
         | 
| 60 | 
            -
                    </annex>
         | 
| 61 | 
            -
                  </iso-standard>
         | 
| 62 | 
            -
                INPUT
         | 
| 63 | 
            -
                output = <<~OUTPUT
         | 
| 64 | 
            -
                  <?xml version='1.0'?>
         | 
| 65 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 66 | 
            -
                    <preface>
         | 
| 67 | 
            -
                      <foreword displayorder='1'>
         | 
| 68 | 
            -
                        <p>
         | 
| 69 | 
            -
                          <xref target="N">Clause 1, Note</xref>
         | 
| 70 | 
            -
                          <xref target="note1">3.1, Note 1</xref>
         | 
| 71 | 
            -
                          <xref target="note2">3.1, Note 2</xref>
         | 
| 72 | 
            -
                          <xref target="AN">A.1, Note</xref>
         | 
| 73 | 
            -
                          <xref target="Anote1">A.2, Note 1</xref>
         | 
| 74 | 
            -
                          <xref target="Anote2">A.2, Note 2</xref>
         | 
| 75 | 
            -
                        </p>
         | 
| 76 | 
            -
                      </foreword>
         | 
| 77 | 
            -
                    </preface>
         | 
| 78 | 
            -
                    <sections>
         | 
| 79 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 80 | 
            -
                        <title depth="1">1
         | 
| 81 | 
            -
                          <tab/>
         | 
| 82 | 
            -
                          Scope</title>
         | 
| 83 | 
            -
                        <note id="N">
         | 
| 84 | 
            -
                          <name>NOTE</name>
         | 
| 85 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 86 | 
            -
                                    types of kernel.
         | 
| 87 | 
            -
                                  </p>
         | 
| 88 | 
            -
                        </note>
         | 
| 89 | 
            -
                        <p>
         | 
| 90 | 
            -
                          <xref target="N">Note</xref>
         | 
| 91 | 
            -
                        </p>
         | 
| 92 | 
            -
                      </clause>
         | 
| 93 | 
            -
                      <terms id="terms"  displayorder='3'>
         | 
| 94 | 
            -
                        <title>2</title>
         | 
| 95 | 
            -
                      </terms>
         | 
| 96 | 
            -
                      <clause id="widgets"  displayorder='4'>
         | 
| 97 | 
            -
                        <title depth="1">3
         | 
| 98 | 
            -
                          <tab/>
         | 
| 99 | 
            -
                          Widgets</title>
         | 
| 100 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 101 | 
            -
                          <title>3.1</title>
         | 
| 102 | 
            -
                          <note id="note1">
         | 
| 103 | 
            -
                            <name>NOTE 1</name>
         | 
| 104 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 105 | 
            -
                                      types of kernel.
         | 
| 106 | 
            -
                                    </p>
         | 
| 107 | 
            -
                          </note>
         | 
| 108 | 
            -
                          <note id="note2">
         | 
| 109 | 
            -
                            <name>NOTE 2</name>
         | 
| 110 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
         | 
| 111 | 
            -
                                      types of kernel.
         | 
| 112 | 
            -
                                    </p>
         | 
| 113 | 
            -
                          </note>
         | 
| 114 | 
            -
                          <p>
         | 
| 115 | 
            -
                            <xref target="note1">Note 1</xref>
         | 
| 116 | 
            -
                            <xref target="note2">Note 2</xref>
         | 
| 117 | 
            -
                          </p>
         | 
| 118 | 
            -
                        </clause>
         | 
| 119 | 
            -
                      </clause>
         | 
| 120 | 
            -
                    </sections>
         | 
| 121 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 122 | 
            -
                      <title>
         | 
| 123 | 
            -
                        <strong>Annex A</strong>
         | 
| 124 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 125 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 126 | 
            -
                        <title>A.1</title>
         | 
| 127 | 
            -
                        <note id="AN">
         | 
| 128 | 
            -
                          <name>NOTE</name>
         | 
| 129 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 130 | 
            -
                                    types of kernel.
         | 
| 131 | 
            -
                                  </p>
         | 
| 132 | 
            -
                        </note>
         | 
| 133 | 
            -
                      </clause>
         | 
| 134 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 135 | 
            -
                        <title>A.2</title>
         | 
| 136 | 
            -
                        <note id="Anote1">
         | 
| 137 | 
            -
                          <name>NOTE 1</name>
         | 
| 138 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 139 | 
            -
                                    types of kernel.
         | 
| 140 | 
            -
                                  </p>
         | 
| 141 | 
            -
                        </note>
         | 
| 142 | 
            -
                        <note id="Anote2">
         | 
| 143 | 
            -
                          <name>NOTE 2</name>
         | 
| 144 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
         | 
| 145 | 
            -
                                    types of kernel.
         | 
| 146 | 
            -
                                  </p>
         | 
| 147 | 
            -
                        </note>
         | 
| 148 | 
            -
                      </clause>
         | 
| 149 | 
            -
                    </annex>
         | 
| 150 | 
            -
                  </iso-standard>
         | 
| 151 | 
            -
                OUTPUT
         | 
| 152 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 153 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 154 | 
            -
              end
         | 
| 155 | 
            -
             | 
| 156 | 
            -
              it "cross-references figures" do
         | 
| 157 | 
            -
                input = <<~INPUT
         | 
| 158 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 159 | 
            -
                    <preface>
         | 
| 160 | 
            -
                      <foreword id="fwd">
         | 
| 161 | 
            -
                        <p>
         | 
| 162 | 
            -
                          <xref target="N"/>
         | 
| 163 | 
            -
                          <xref target="note1"/>
         | 
| 164 | 
            -
                          <xref target="note2"/>
         | 
| 165 | 
            -
                          <xref target="AN"/>
         | 
| 166 | 
            -
                          <xref target="Anote1"/>
         | 
| 167 | 
            -
                          <xref target="Anote2"/>
         | 
| 168 | 
            -
                        </p>
         | 
| 169 | 
            -
                      </foreword>
         | 
| 170 | 
            -
                    </preface>
         | 
| 171 | 
            -
                    <sections>
         | 
| 172 | 
            -
                      <clause id="scope" type="scope">
         | 
| 173 | 
            -
                        <title>Scope</title>
         | 
| 174 | 
            -
                        <figure id="N">
         | 
| 175 | 
            -
                          <name>Split-it-right sample divider</name>
         | 
| 176 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 177 | 
            -
                        </figure>
         | 
| 178 | 
            -
                        <p>
         | 
| 179 | 
            -
                          <xref target="N"/>
         | 
| 180 | 
            -
                        </p>
         | 
| 181 | 
            -
                      </clause>
         | 
| 182 | 
            -
                      <terms id="terms"/>
         | 
| 183 | 
            -
                      <clause id="widgets">
         | 
| 184 | 
            -
                        <title>Widgets</title>
         | 
| 185 | 
            -
                        <clause id="widgets1">
         | 
| 186 | 
            -
                          <figure id="note1">
         | 
| 187 | 
            -
                            <name>Split-it-right sample divider</name>
         | 
| 188 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 189 | 
            -
                          </figure>
         | 
| 190 | 
            -
                          <figure id="note2">
         | 
| 191 | 
            -
                            <name>Split-it-right sample divider</name>
         | 
| 192 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 193 | 
            -
                          </figure>
         | 
| 194 | 
            -
                          <p>
         | 
| 195 | 
            -
                            <xref target="note1"/>
         | 
| 196 | 
            -
                            <xref target="note2"/>
         | 
| 197 | 
            -
                          </p>
         | 
| 198 | 
            -
                        </clause>
         | 
| 199 | 
            -
                      </clause>
         | 
| 200 | 
            -
                    </sections>
         | 
| 201 | 
            -
                    <annex id="annex1">
         | 
| 202 | 
            -
                      <clause id="annex1a">
         | 
| 203 | 
            -
                        <figure id="AN">
         | 
| 204 | 
            -
                          <name>Split-it-right sample divider</name>
         | 
| 205 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 206 | 
            -
                        </figure>
         | 
| 207 | 
            -
                      </clause>
         | 
| 208 | 
            -
                      <clause id="annex1b">
         | 
| 209 | 
            -
                        <figure id="Anote1">
         | 
| 210 | 
            -
                          <name>Split-it-right sample divider</name>
         | 
| 211 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 212 | 
            -
                        </figure>
         | 
| 213 | 
            -
                        <figure id="Anote2">
         | 
| 214 | 
            -
                          <name>Split-it-right sample divider</name>
         | 
| 215 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 216 | 
            -
                        </figure>
         | 
| 217 | 
            -
                      </clause>
         | 
| 218 | 
            -
                    </annex>
         | 
| 219 | 
            -
                  </iso-standard>
         | 
| 220 | 
            -
                INPUT
         | 
| 221 | 
            -
                output = <<~OUTPUT
         | 
| 222 | 
            -
                  <?xml version='1.0'?>
         | 
| 223 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 224 | 
            -
                    <preface>
         | 
| 225 | 
            -
                      <foreword id="fwd" displayorder='1'>
         | 
| 226 | 
            -
                        <p>
         | 
| 227 | 
            -
                          <xref target="N"><span class='citefig'>Figure 1</span></xref>
         | 
| 228 | 
            -
                          <xref target="note1"><span class='citefig'>Figure 2</span></xref>
         | 
| 229 | 
            -
                          <xref target="note2"><span class='citefig'>Figure 3</span></xref>
         | 
| 230 | 
            -
                          <xref target="AN"><span class='citefig'>Figure A.1</span></xref>
         | 
| 231 | 
            -
                          <xref target="Anote1"><span class='citefig'>Figure A.2</span></xref>
         | 
| 232 | 
            -
                          <xref target="Anote2"><span class='citefig'>Figure A.3</span></xref>
         | 
| 233 | 
            -
                        </p>
         | 
| 234 | 
            -
                      </foreword>
         | 
| 235 | 
            -
                    </preface>
         | 
| 236 | 
            -
                    <sections>
         | 
| 237 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 238 | 
            -
                        <title depth="1">1
         | 
| 239 | 
            -
                          <tab/>
         | 
| 240 | 
            -
                          Scope</title>
         | 
| 241 | 
            -
                        <figure id="N">
         | 
| 242 | 
            -
                          <name>Figure 1 — Split-it-right sample divider</name>
         | 
| 243 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 244 | 
            -
                        </figure>
         | 
| 245 | 
            -
                        <p>
         | 
| 246 | 
            -
                          <xref target="N"><span class='citefig'>Figure 1</span></xref>
         | 
| 247 | 
            -
                        </p>
         | 
| 248 | 
            -
                      </clause>
         | 
| 249 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 250 | 
            -
                        <title>2</title>
         | 
| 251 | 
            -
                      </terms>
         | 
| 252 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 253 | 
            -
                        <title depth="1">3
         | 
| 254 | 
            -
                          <tab/>
         | 
| 255 | 
            -
                          Widgets</title>
         | 
| 256 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 257 | 
            -
                          <title>3.1</title>
         | 
| 258 | 
            -
                          <figure id="note1">
         | 
| 259 | 
            -
                            <name>Figure 2 — Split-it-right sample divider</name>
         | 
| 260 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 261 | 
            -
                          </figure>
         | 
| 262 | 
            -
                          <figure id="note2">
         | 
| 263 | 
            -
                            <name>Figure 3 — Split-it-right sample divider</name>
         | 
| 264 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 265 | 
            -
                          </figure>
         | 
| 266 | 
            -
                          <p>
         | 
| 267 | 
            -
                            <xref target="note1"><span class='citefig'>Figure 2</span></xref>
         | 
| 268 | 
            -
                            <xref target="note2"><span class='citefig'>Figure 3</span></xref>
         | 
| 269 | 
            -
                          </p>
         | 
| 270 | 
            -
                        </clause>
         | 
| 271 | 
            -
                      </clause>
         | 
| 272 | 
            -
                    </sections>
         | 
| 273 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 274 | 
            -
                      <title>
         | 
| 275 | 
            -
                        <strong>Annex A</strong>
         | 
| 276 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 277 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 278 | 
            -
                        <title>A.1</title>
         | 
| 279 | 
            -
                        <figure id="AN">
         | 
| 280 | 
            -
                          <name>Figure A.1 — Split-it-right sample divider</name>
         | 
| 281 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 282 | 
            -
                        </figure>
         | 
| 283 | 
            -
                      </clause>
         | 
| 284 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 285 | 
            -
                        <title>A.2</title>
         | 
| 286 | 
            -
                        <figure id="Anote1">
         | 
| 287 | 
            -
                          <name>Figure A.2 — Split-it-right sample divider</name>
         | 
| 288 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 289 | 
            -
                        </figure>
         | 
| 290 | 
            -
                        <figure id="Anote2">
         | 
| 291 | 
            -
                          <name>Figure A.3 — Split-it-right sample divider</name>
         | 
| 292 | 
            -
                          <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 293 | 
            -
                        </figure>
         | 
| 294 | 
            -
                      </clause>
         | 
| 295 | 
            -
                    </annex>
         | 
| 296 | 
            -
                  </iso-standard>
         | 
| 297 | 
            -
                OUTPUT
         | 
| 298 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 299 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 300 | 
            -
              end
         | 
| 301 | 
            -
             | 
| 302 | 
            -
              it "cross-references subfigures" do
         | 
| 303 | 
            -
                input = <<~INPUT
         | 
| 304 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 305 | 
            -
                    <preface>
         | 
| 306 | 
            -
                      <foreword id="fwd">
         | 
| 307 | 
            -
                        <p>
         | 
| 308 | 
            -
                          <xref target="N"/>
         | 
| 309 | 
            -
                          <xref target="note1"/>
         | 
| 310 | 
            -
                          <xref target="note2"/>
         | 
| 311 | 
            -
                          <xref target="AN"/>
         | 
| 312 | 
            -
                          <xref target="Anote1"/>
         | 
| 313 | 
            -
                          <xref target="Anote2"/>
         | 
| 314 | 
            -
                        </p>
         | 
| 315 | 
            -
                      </foreword>
         | 
| 316 | 
            -
                    </preface>
         | 
| 317 | 
            -
                    <sections>
         | 
| 318 | 
            -
                      <clause id="scope" type="scope">
         | 
| 319 | 
            -
                        <title>Scope</title>
         | 
| 320 | 
            -
                      </clause>
         | 
| 321 | 
            -
                      <terms id="terms"/>
         | 
| 322 | 
            -
                      <clause id="widgets">
         | 
| 323 | 
            -
                        <title>Widgets</title>
         | 
| 324 | 
            -
                        <clause id="widgets1">
         | 
| 325 | 
            -
                          <figure id="N">
         | 
| 326 | 
            -
                            <figure id="note1">
         | 
| 327 | 
            -
                              <name>Split-it-right sample divider</name>
         | 
| 328 | 
            -
                              <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 329 | 
            -
                            </figure>
         | 
| 330 | 
            -
                            <figure id="note2">
         | 
| 331 | 
            -
                              <name>Split-it-right sample divider</name>
         | 
| 332 | 
            -
                              <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 333 | 
            -
                            </figure>
         | 
| 334 | 
            -
                          </figure>
         | 
| 335 | 
            -
                          <p>
         | 
| 336 | 
            -
                            <xref target="note1"/>
         | 
| 337 | 
            -
                            <xref target="note2"/>
         | 
| 338 | 
            -
                          </p>
         | 
| 339 | 
            -
                        </clause>
         | 
| 340 | 
            -
                      </clause>
         | 
| 341 | 
            -
                    </sections>
         | 
| 342 | 
            -
                    <annex id="annex1">
         | 
| 343 | 
            -
                      <clause id="annex1a"/>
         | 
| 344 | 
            -
                      <clause id="annex1b">
         | 
| 345 | 
            -
                        <figure id="AN">
         | 
| 346 | 
            -
                          <figure id="Anote1">
         | 
| 347 | 
            -
                            <name>Split-it-right sample divider</name>
         | 
| 348 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 349 | 
            -
                          </figure>
         | 
| 350 | 
            -
                          <figure id="Anote2">
         | 
| 351 | 
            -
                            <name>Split-it-right sample divider</name>
         | 
| 352 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 353 | 
            -
                          </figure>
         | 
| 354 | 
            -
                        </figure>
         | 
| 355 | 
            -
                      </clause>
         | 
| 356 | 
            -
                    </annex>
         | 
| 357 | 
            -
                  </iso-standard>
         | 
| 358 | 
            -
                INPUT
         | 
| 359 | 
            -
                output = <<~OUTPUT
         | 
| 360 | 
            -
                  <?xml version='1.0'?>
         | 
| 361 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 362 | 
            -
                    <preface>
         | 
| 363 | 
            -
                      <foreword id="fwd" displayorder='1'>
         | 
| 364 | 
            -
                        <p>
         | 
| 365 | 
            -
                          <xref target="N"><span class='citefig'>Figure 1</span></xref>
         | 
| 366 | 
            -
                          <xref target="note1"><span class='citefig'>Figure 1 a)</span></xref>
         | 
| 367 | 
            -
                          <xref target="note2"><span class='citefig'>Figure 1 b)</span></xref>
         | 
| 368 | 
            -
                          <xref target="AN"><span class='citefig'>Figure A.1</span></xref>
         | 
| 369 | 
            -
                          <xref target="Anote1"><span class='citefig'>Figure A.1 a)</span></xref>
         | 
| 370 | 
            -
                          <xref target="Anote2"><span class='citefig'>Figure A.1 b)</span></xref>
         | 
| 371 | 
            -
                        </p>
         | 
| 372 | 
            -
                      </foreword>
         | 
| 373 | 
            -
                    </preface>
         | 
| 374 | 
            -
                    <sections>
         | 
| 375 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 376 | 
            -
                        <title depth="1">1
         | 
| 377 | 
            -
                          <tab/>
         | 
| 378 | 
            -
                          Scope</title>
         | 
| 379 | 
            -
                      </clause>
         | 
| 380 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 381 | 
            -
                        <title>2</title>
         | 
| 382 | 
            -
                      </terms>
         | 
| 383 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 384 | 
            -
                        <title depth="1">3
         | 
| 385 | 
            -
                          <tab/>
         | 
| 386 | 
            -
                          Widgets</title>
         | 
| 387 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 388 | 
            -
                          <title>3.1</title>
         | 
| 389 | 
            -
                          <figure id="N">
         | 
| 390 | 
            -
                            <name>Figure 1</name>
         | 
| 391 | 
            -
                            <figure id="note1">
         | 
| 392 | 
            -
                              <name>a)  Split-it-right sample divider</name>
         | 
| 393 | 
            -
                              <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 394 | 
            -
                            </figure>
         | 
| 395 | 
            -
                            <figure id="note2">
         | 
| 396 | 
            -
                              <name>b)  Split-it-right sample divider</name>
         | 
| 397 | 
            -
                              <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 398 | 
            -
                            </figure>
         | 
| 399 | 
            -
                          </figure>
         | 
| 400 | 
            -
                          <p>
         | 
| 401 | 
            -
                            <xref target="note1"><span class='citefig'>Figure 1 a)</span></xref>
         | 
| 402 | 
            -
                            <xref target="note2"><span class='citefig'>Figure 1 b)</span></xref>
         | 
| 403 | 
            -
                          </p>
         | 
| 404 | 
            -
                        </clause>
         | 
| 405 | 
            -
                      </clause>
         | 
| 406 | 
            -
                    </sections>
         | 
| 407 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 408 | 
            -
                      <title>
         | 
| 409 | 
            -
                        <strong>Annex A</strong>
         | 
| 410 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 411 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 412 | 
            -
                        <title>A.1</title>
         | 
| 413 | 
            -
                      </clause>
         | 
| 414 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 415 | 
            -
                        <title>A.2</title>
         | 
| 416 | 
            -
                        <figure id="AN">
         | 
| 417 | 
            -
                          <name>Figure A.1</name>
         | 
| 418 | 
            -
                          <figure id="Anote1">
         | 
| 419 | 
            -
                            <name>a)  Split-it-right sample divider</name>
         | 
| 420 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 421 | 
            -
                          </figure>
         | 
| 422 | 
            -
                          <figure id="Anote2">
         | 
| 423 | 
            -
                            <name>b)  Split-it-right sample divider</name>
         | 
| 424 | 
            -
                            <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
         | 
| 425 | 
            -
                          </figure>
         | 
| 426 | 
            -
                        </figure>
         | 
| 427 | 
            -
                      </clause>
         | 
| 428 | 
            -
                    </annex>
         | 
| 429 | 
            -
                  </iso-standard>
         | 
| 430 | 
            -
                OUTPUT
         | 
| 431 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 432 | 
            -
                 .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 433 | 
            -
              end
         | 
| 434 | 
            -
             | 
| 435 | 
            -
              it "cross-references examples" do
         | 
| 436 | 
            -
                input = <<~INPUT
         | 
| 437 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 438 | 
            -
                    <preface>
         | 
| 439 | 
            -
                      <foreword>
         | 
| 440 | 
            -
                        <p>
         | 
| 441 | 
            -
                          <xref target="N"/>
         | 
| 442 | 
            -
                          <xref target="note1"/>
         | 
| 443 | 
            -
                          <xref target="note2"/>
         | 
| 444 | 
            -
                          <xref target="AN"/>
         | 
| 445 | 
            -
                          <xref target="Anote1"/>
         | 
| 446 | 
            -
                          <xref target="Anote2"/>
         | 
| 447 | 
            -
                        </p>
         | 
| 448 | 
            -
                      </foreword>
         | 
| 449 | 
            -
                    </preface>
         | 
| 450 | 
            -
                    <sections>
         | 
| 451 | 
            -
                      <clause id="scope" type="scope">
         | 
| 452 | 
            -
                        <title>Scope</title>
         | 
| 453 | 
            -
                        <example id="N">
         | 
| 454 | 
            -
                          <p>Hello</p>
         | 
| 455 | 
            -
                        </example>
         | 
| 456 | 
            -
                        <p>
         | 
| 457 | 
            -
                          <xref target="N"/>
         | 
| 458 | 
            -
                        </p>
         | 
| 459 | 
            -
                      </clause>
         | 
| 460 | 
            -
                      <terms id="terms"/>
         | 
| 461 | 
            -
                      <clause id="widgets">
         | 
| 462 | 
            -
                        <title>Widgets</title>
         | 
| 463 | 
            -
                        <clause id="widgets1">
         | 
| 464 | 
            -
                          <example id="note1">
         | 
| 465 | 
            -
                            <p>Hello</p>
         | 
| 466 | 
            -
                          </example>
         | 
| 467 | 
            -
                          <example id="note2">
         | 
| 468 | 
            -
                            <p>Hello</p>
         | 
| 469 | 
            -
                          </example>
         | 
| 470 | 
            -
                          <p>
         | 
| 471 | 
            -
                            <xref target="note1"/>
         | 
| 472 | 
            -
                            <xref target="note2"/>
         | 
| 473 | 
            -
                          </p>
         | 
| 474 | 
            -
                        </clause>
         | 
| 475 | 
            -
                      </clause>
         | 
| 476 | 
            -
                    </sections>
         | 
| 477 | 
            -
                    <annex id="annex1">
         | 
| 478 | 
            -
                      <clause id="annex1a">
         | 
| 479 | 
            -
                        <example id="AN">
         | 
| 480 | 
            -
                          <p>Hello</p>
         | 
| 481 | 
            -
                        </example>
         | 
| 482 | 
            -
                      </clause>
         | 
| 483 | 
            -
                      <clause id="annex1b">
         | 
| 484 | 
            -
                        <example id="Anote1">
         | 
| 485 | 
            -
                          <p>Hello</p>
         | 
| 486 | 
            -
                        </example>
         | 
| 487 | 
            -
                        <example id="Anote2">
         | 
| 488 | 
            -
                          <p>Hello</p>
         | 
| 489 | 
            -
                        </example>
         | 
| 490 | 
            -
                      </clause>
         | 
| 491 | 
            -
                    </annex>
         | 
| 492 | 
            -
                  </iso-standard>
         | 
| 493 | 
            -
                INPUT
         | 
| 494 | 
            -
                output = <<~OUTPUT
         | 
| 495 | 
            -
                  <?xml version='1.0'?>
         | 
| 496 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 497 | 
            -
                    <preface>
         | 
| 498 | 
            -
                      <foreword displayorder='1'>
         | 
| 499 | 
            -
                        <p>
         | 
| 500 | 
            -
                          <xref target="N">Clause 1, Example</xref>
         | 
| 501 | 
            -
                          <xref target="note1">3.1, Example 1</xref>
         | 
| 502 | 
            -
                          <xref target="note2">3.1, Example 2</xref>
         | 
| 503 | 
            -
                          <xref target="AN">A.1, Example</xref>
         | 
| 504 | 
            -
                          <xref target="Anote1">A.2, Example 1</xref>
         | 
| 505 | 
            -
                          <xref target="Anote2">A.2, Example 2</xref>
         | 
| 506 | 
            -
                        </p>
         | 
| 507 | 
            -
                      </foreword>
         | 
| 508 | 
            -
                    </preface>
         | 
| 509 | 
            -
                    <sections>
         | 
| 510 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 511 | 
            -
                        <title depth="1">1
         | 
| 512 | 
            -
                          <tab/>
         | 
| 513 | 
            -
                          Scope</title>
         | 
| 514 | 
            -
                        <example id="N">
         | 
| 515 | 
            -
                          <name>EXAMPLE</name>
         | 
| 516 | 
            -
                          <p>Hello</p>
         | 
| 517 | 
            -
                        </example>
         | 
| 518 | 
            -
                        <p>
         | 
| 519 | 
            -
                          <xref target="N">Example</xref>
         | 
| 520 | 
            -
                        </p>
         | 
| 521 | 
            -
                      </clause>
         | 
| 522 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 523 | 
            -
                        <title>2</title>
         | 
| 524 | 
            -
                      </terms>
         | 
| 525 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 526 | 
            -
                        <title depth="1">3
         | 
| 527 | 
            -
                          <tab/>
         | 
| 528 | 
            -
                          Widgets</title>
         | 
| 529 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 530 | 
            -
                          <title>3.1</title>
         | 
| 531 | 
            -
                          <example id="note1">
         | 
| 532 | 
            -
                            <name>EXAMPLE 1</name>
         | 
| 533 | 
            -
                            <p>Hello</p>
         | 
| 534 | 
            -
                          </example>
         | 
| 535 | 
            -
                          <example id="note2">
         | 
| 536 | 
            -
                            <name>EXAMPLE 2</name>
         | 
| 537 | 
            -
                            <p>Hello</p>
         | 
| 538 | 
            -
                          </example>
         | 
| 539 | 
            -
                          <p>
         | 
| 540 | 
            -
                            <xref target="note1">Example 1</xref>
         | 
| 541 | 
            -
                            <xref target="note2">Example 2</xref>
         | 
| 542 | 
            -
                          </p>
         | 
| 543 | 
            -
                        </clause>
         | 
| 544 | 
            -
                      </clause>
         | 
| 545 | 
            -
                    </sections>
         | 
| 546 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 547 | 
            -
                      <title>
         | 
| 548 | 
            -
                        <strong>Annex A</strong>
         | 
| 549 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 550 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 551 | 
            -
                        <title>A.1</title>
         | 
| 552 | 
            -
                        <example id="AN">
         | 
| 553 | 
            -
                          <name>EXAMPLE</name>
         | 
| 554 | 
            -
                          <p>Hello</p>
         | 
| 555 | 
            -
                        </example>
         | 
| 556 | 
            -
                      </clause>
         | 
| 557 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 558 | 
            -
                        <title>A.2</title>
         | 
| 559 | 
            -
                        <example id="Anote1">
         | 
| 560 | 
            -
                          <name>EXAMPLE 1</name>
         | 
| 561 | 
            -
                          <p>Hello</p>
         | 
| 562 | 
            -
                        </example>
         | 
| 563 | 
            -
                        <example id="Anote2">
         | 
| 564 | 
            -
                          <name>EXAMPLE 2</name>
         | 
| 565 | 
            -
                          <p>Hello</p>
         | 
| 566 | 
            -
                        </example>
         | 
| 567 | 
            -
                      </clause>
         | 
| 568 | 
            -
                    </annex>
         | 
| 569 | 
            -
                  </iso-standard>
         | 
| 570 | 
            -
                OUTPUT
         | 
| 571 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 572 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 573 | 
            -
              end
         | 
| 574 | 
            -
             | 
| 575 | 
            -
              it "cross-references formulae" do
         | 
| 576 | 
            -
                input = <<~INPUT
         | 
| 577 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 578 | 
            -
                    <preface>
         | 
| 579 | 
            -
                      <foreword>
         | 
| 580 | 
            -
                        <p>
         | 
| 581 | 
            -
                          <xref target="N"/>
         | 
| 582 | 
            -
                          <xref target="note1"/>
         | 
| 583 | 
            -
                          <xref target="note2"/>
         | 
| 584 | 
            -
                          <xref target="AN"/>
         | 
| 585 | 
            -
                          <xref target="Anote1"/>
         | 
| 586 | 
            -
                          <xref target="Anote2"/>
         | 
| 587 | 
            -
                        </p>
         | 
| 588 | 
            -
                      </foreword>
         | 
| 589 | 
            -
                    </preface>
         | 
| 590 | 
            -
                    <sections>
         | 
| 591 | 
            -
                      <clause id="scope" type="scope">
         | 
| 592 | 
            -
                        <title>Scope</title>
         | 
| 593 | 
            -
                        <formula id="N">
         | 
| 594 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 595 | 
            -
                        </formula>
         | 
| 596 | 
            -
                        <p>
         | 
| 597 | 
            -
                          <xref target="N"/>
         | 
| 598 | 
            -
                        </p>
         | 
| 599 | 
            -
                      </clause>
         | 
| 600 | 
            -
                      <terms id="terms"/>
         | 
| 601 | 
            -
                      <clause id="widgets">
         | 
| 602 | 
            -
                        <title>Widgets</title>
         | 
| 603 | 
            -
                        <clause id="widgets1">
         | 
| 604 | 
            -
                          <formula id="note1">
         | 
| 605 | 
            -
                            <stem type="AsciiMath">r = 1 %</stem>
         | 
| 606 | 
            -
                          </formula>
         | 
| 607 | 
            -
                          <formula id="note2">
         | 
| 608 | 
            -
                            <stem type="AsciiMath">r = 1 %</stem>
         | 
| 609 | 
            -
                          </formula>
         | 
| 610 | 
            -
                          <p>
         | 
| 611 | 
            -
                            <xref target="note1"/>
         | 
| 612 | 
            -
                            <xref target="note2"/>
         | 
| 613 | 
            -
                          </p>
         | 
| 614 | 
            -
                        </clause>
         | 
| 615 | 
            -
                      </clause>
         | 
| 616 | 
            -
                    </sections>
         | 
| 617 | 
            -
                    <annex id="annex1">
         | 
| 618 | 
            -
                      <clause id="annex1a">
         | 
| 619 | 
            -
                        <formula id="AN">
         | 
| 620 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 621 | 
            -
                        </formula>
         | 
| 622 | 
            -
                      </clause>
         | 
| 623 | 
            -
                      <clause id="annex1b">
         | 
| 624 | 
            -
                        <formula id="Anote1">
         | 
| 625 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 626 | 
            -
                        </formula>
         | 
| 627 | 
            -
                        <formula id="Anote2">
         | 
| 628 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 629 | 
            -
                        </formula>
         | 
| 630 | 
            -
                      </clause>
         | 
| 631 | 
            -
                    </annex>
         | 
| 632 | 
            -
                  </iso-standard>
         | 
| 633 | 
            -
                  <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934">
         | 
| 634 | 
            -
                    <stem type="AsciiMath">r = 1 %</stem>
         | 
| 635 | 
            -
                    <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
         | 
| 636 | 
            -
                      <dt>
         | 
| 637 | 
            -
                        <stem type="AsciiMath">r</stem>
         | 
| 638 | 
            -
                      </dt>
         | 
| 639 | 
            -
                      <dd>
         | 
| 640 | 
            -
                        <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
         | 
| 641 | 
            -
                      </dd>
         | 
| 642 | 
            -
                    </dl>
         | 
| 643 | 
            -
                  </formula>
         | 
| 644 | 
            -
                      </foreword>
         | 
| 645 | 
            -
                    </preface>
         | 
| 646 | 
            -
                  </iso-standard>
         | 
| 647 | 
            -
                INPUT
         | 
| 648 | 
            -
                output = <<~OUTPUT
         | 
| 649 | 
            -
                  <?xml version='1.0'?>
         | 
| 650 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 651 | 
            -
                    <preface>
         | 
| 652 | 
            -
                      <foreword displayorder='1'>
         | 
| 653 | 
            -
                        <p>
         | 
| 654 | 
            -
                          <xref target="N">Clause 1, Formula (1)</xref>
         | 
| 655 | 
            -
                          <xref target="note1">3.1, Formula (2)</xref>
         | 
| 656 | 
            -
                          <xref target="note2">3.1, Formula (3)</xref>
         | 
| 657 | 
            -
                          <xref target="AN">A.1, Formula (A.1)</xref>
         | 
| 658 | 
            -
                          <xref target="Anote1">A.2, Formula (A.2)</xref>
         | 
| 659 | 
            -
                          <xref target="Anote2">A.2, Formula (A.3)</xref>
         | 
| 660 | 
            -
                        </p>
         | 
| 661 | 
            -
                      </foreword>
         | 
| 662 | 
            -
                    </preface>
         | 
| 663 | 
            -
                    <sections>
         | 
| 664 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 665 | 
            -
                        <title depth="1">1
         | 
| 666 | 
            -
                          <tab/>
         | 
| 667 | 
            -
                          Scope</title>
         | 
| 668 | 
            -
                        <formula id="N">
         | 
| 669 | 
            -
                          <name>1</name>
         | 
| 670 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 671 | 
            -
                        </formula>
         | 
| 672 | 
            -
                        <p>
         | 
| 673 | 
            -
                          <xref target="N">Formula (1)</xref>
         | 
| 674 | 
            -
                        </p>
         | 
| 675 | 
            -
                      </clause>
         | 
| 676 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 677 | 
            -
                        <title>2</title>
         | 
| 678 | 
            -
                      </terms>
         | 
| 679 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 680 | 
            -
                        <title depth="1">3
         | 
| 681 | 
            -
                          <tab/>
         | 
| 682 | 
            -
                          Widgets</title>
         | 
| 683 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 684 | 
            -
                          <title>3.1</title>
         | 
| 685 | 
            -
                          <formula id="note1">
         | 
| 686 | 
            -
                            <name>2</name>
         | 
| 687 | 
            -
                            <stem type="AsciiMath">r = 1 %</stem>
         | 
| 688 | 
            -
                          </formula>
         | 
| 689 | 
            -
                          <formula id="note2">
         | 
| 690 | 
            -
                            <name>3</name>
         | 
| 691 | 
            -
                            <stem type="AsciiMath">r = 1 %</stem>
         | 
| 692 | 
            -
                          </formula>
         | 
| 693 | 
            -
                          <p>
         | 
| 694 | 
            -
                            <xref target="note1">Formula (2)</xref>
         | 
| 695 | 
            -
                            <xref target="note2">Formula (3)</xref>
         | 
| 696 | 
            -
                          </p>
         | 
| 697 | 
            -
                        </clause>
         | 
| 698 | 
            -
                      </clause>
         | 
| 699 | 
            -
                    </sections>
         | 
| 700 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 701 | 
            -
                      <title>
         | 
| 702 | 
            -
                        <strong>Annex A</strong>
         | 
| 703 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 704 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 705 | 
            -
                        <title>A.1</title>
         | 
| 706 | 
            -
                        <formula id="AN">
         | 
| 707 | 
            -
                          <name>A.1</name>
         | 
| 708 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 709 | 
            -
                        </formula>
         | 
| 710 | 
            -
                      </clause>
         | 
| 711 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 712 | 
            -
                        <title>A.2</title>
         | 
| 713 | 
            -
                        <formula id="Anote1">
         | 
| 714 | 
            -
                          <name>A.2</name>
         | 
| 715 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 716 | 
            -
                        </formula>
         | 
| 717 | 
            -
                        <formula id="Anote2">
         | 
| 718 | 
            -
                          <name>A.3</name>
         | 
| 719 | 
            -
                          <stem type="AsciiMath">r = 1 %</stem>
         | 
| 720 | 
            -
                        </formula>
         | 
| 721 | 
            -
                      </clause>
         | 
| 722 | 
            -
                    </annex>
         | 
| 723 | 
            -
                  </iso-standard>
         | 
| 724 | 
            -
                OUTPUT
         | 
| 725 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 726 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 727 | 
            -
              end
         | 
| 728 | 
            -
             | 
| 729 | 
            -
              it "cross-references tables" do
         | 
| 730 | 
            -
                input = <<~INPUT
         | 
| 731 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 732 | 
            -
                    <preface>
         | 
| 733 | 
            -
                      <foreword>
         | 
| 734 | 
            -
                        <p>
         | 
| 735 | 
            -
                          <xref target="N"/>
         | 
| 736 | 
            -
                          <xref target="note1"/>
         | 
| 737 | 
            -
                          <xref target="note2"/>
         | 
| 738 | 
            -
                          <xref target="AN"/>
         | 
| 739 | 
            -
                          <xref target="Anote1"/>
         | 
| 740 | 
            -
                          <xref target="Anote2"/>
         | 
| 741 | 
            -
                        </p>
         | 
| 742 | 
            -
                      </foreword>
         | 
| 743 | 
            -
                    </preface>
         | 
| 744 | 
            -
                    <sections>
         | 
| 745 | 
            -
                      <clause id="scope" type="scope">
         | 
| 746 | 
            -
                        <title>Scope</title>
         | 
| 747 | 
            -
                        <table id="N">
         | 
| 748 | 
            -
                          <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 749 | 
            -
                          <tbody>
         | 
| 750 | 
            -
                            <tr>
         | 
| 751 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 752 | 
            -
                              <td align="center">13</td>
         | 
| 753 | 
            -
                              <td align="center">11</td>
         | 
| 754 | 
            -
                            </tr>
         | 
| 755 | 
            -
                          </tbody>
         | 
| 756 | 
            -
                        </table>
         | 
| 757 | 
            -
                        <p>
         | 
| 758 | 
            -
                          <xref target="N"/>
         | 
| 759 | 
            -
                        </p>
         | 
| 760 | 
            -
                      </clause>
         | 
| 761 | 
            -
                      <terms id="terms"/>
         | 
| 762 | 
            -
                      <clause id="widgets">
         | 
| 763 | 
            -
                        <title>Widgets</title>
         | 
| 764 | 
            -
                        <clause id="widgets1">
         | 
| 765 | 
            -
                          <table id="note1">
         | 
| 766 | 
            -
                            <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 767 | 
            -
                            <tbody>
         | 
| 768 | 
            -
                              <tr>
         | 
| 769 | 
            -
                                <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 770 | 
            -
                                <td align="center">13</td>
         | 
| 771 | 
            -
                                <td align="center">11</td>
         | 
| 772 | 
            -
                              </tr>
         | 
| 773 | 
            -
                            </tbody>
         | 
| 774 | 
            -
                          </table>
         | 
| 775 | 
            -
                          <table id="note2">
         | 
| 776 | 
            -
                            <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 777 | 
            -
                            <tbody>
         | 
| 778 | 
            -
                              <tr>
         | 
| 779 | 
            -
                                <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 780 | 
            -
                                <td align="center">13</td>
         | 
| 781 | 
            -
                                <td align="center">11</td>
         | 
| 782 | 
            -
                              </tr>
         | 
| 783 | 
            -
                            </tbody>
         | 
| 784 | 
            -
                          </table>
         | 
| 785 | 
            -
                          <p>
         | 
| 786 | 
            -
                            <xref target="note1"/>
         | 
| 787 | 
            -
                            <xref target="note2"/>
         | 
| 788 | 
            -
                          </p>
         | 
| 789 | 
            -
                        </clause>
         | 
| 790 | 
            -
                      </clause>
         | 
| 791 | 
            -
                    </sections>
         | 
| 792 | 
            -
                    <annex id="annex1">
         | 
| 793 | 
            -
                      <clause id="annex1a">
         | 
| 794 | 
            -
                        <table id="AN">
         | 
| 795 | 
            -
                          <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 796 | 
            -
                          <tbody>
         | 
| 797 | 
            -
                            <tr>
         | 
| 798 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 799 | 
            -
                              <td align="center">13</td>
         | 
| 800 | 
            -
                              <td align="center">11</td>
         | 
| 801 | 
            -
                            </tr>
         | 
| 802 | 
            -
                          </tbody>
         | 
| 803 | 
            -
                        </table>
         | 
| 804 | 
            -
                      </clause>
         | 
| 805 | 
            -
                      <clause id="annex1b">
         | 
| 806 | 
            -
                        <table id="Anote1">
         | 
| 807 | 
            -
                          <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 808 | 
            -
                          <tbody>
         | 
| 809 | 
            -
                            <tr>
         | 
| 810 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 811 | 
            -
                              <td align="center">13</td>
         | 
| 812 | 
            -
                              <td align="center">11</td>
         | 
| 813 | 
            -
                            </tr>
         | 
| 814 | 
            -
                          </tbody>
         | 
| 815 | 
            -
                        </table>
         | 
| 816 | 
            -
                        <table id="Anote2">
         | 
| 817 | 
            -
                          <name>Repeatability and reproducibility of husked rice yield</name>
         | 
| 818 | 
            -
                          <tbody>
         | 
| 819 | 
            -
                            <tr>
         | 
| 820 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 821 | 
            -
                              <td align="center">13</td>
         | 
| 822 | 
            -
                              <td align="center">11</td>
         | 
| 823 | 
            -
                            </tr>
         | 
| 824 | 
            -
                          </tbody>
         | 
| 825 | 
            -
                        </table>
         | 
| 826 | 
            -
                      </clause>
         | 
| 827 | 
            -
                    </annex>
         | 
| 828 | 
            -
                  </iso-standard>
         | 
| 829 | 
            -
                INPUT
         | 
| 830 | 
            -
                output = <<~OUTPUT
         | 
| 831 | 
            -
                  <?xml version='1.0'?>
         | 
| 832 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 833 | 
            -
                    <preface>
         | 
| 834 | 
            -
                      <foreword displayorder='1'>
         | 
| 835 | 
            -
                        <p>
         | 
| 836 | 
            -
                          <xref target="N"><span class='citetbl'>Table 1</span></xref>
         | 
| 837 | 
            -
                          <xref target="note1"><span class='citetbl'>Table 2</span></xref>
         | 
| 838 | 
            -
                          <xref target="note2"><span class='citetbl'>Table 3</span></xref>
         | 
| 839 | 
            -
                          <xref target="AN"><span class='citetbl'>Table A.1</span></xref>
         | 
| 840 | 
            -
                          <xref target="Anote1"><span class='citetbl'>Table A.2</span></xref>
         | 
| 841 | 
            -
                          <xref target="Anote2"><span class='citetbl'>Table A.3</span></xref>
         | 
| 842 | 
            -
                        </p>
         | 
| 843 | 
            -
                      </foreword>
         | 
| 844 | 
            -
                    </preface>
         | 
| 845 | 
            -
                    <sections>
         | 
| 846 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 847 | 
            -
                        <title depth="1">1
         | 
| 848 | 
            -
                          <tab/>
         | 
| 849 | 
            -
                          Scope</title>
         | 
| 850 | 
            -
                        <table id="N">
         | 
| 851 | 
            -
                          <name>Table 1 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 852 | 
            -
                          <tbody>
         | 
| 853 | 
            -
                            <tr>
         | 
| 854 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 855 | 
            -
                              <td align="center">13</td>
         | 
| 856 | 
            -
                              <td align="center">11</td>
         | 
| 857 | 
            -
                            </tr>
         | 
| 858 | 
            -
                          </tbody>
         | 
| 859 | 
            -
                        </table>
         | 
| 860 | 
            -
                        <p>
         | 
| 861 | 
            -
                          <xref target="N"><span class='citetbl'>Table 1</span></xref>
         | 
| 862 | 
            -
                        </p>
         | 
| 863 | 
            -
                      </clause>
         | 
| 864 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 865 | 
            -
                        <title>2</title>
         | 
| 866 | 
            -
                      </terms>
         | 
| 867 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 868 | 
            -
                        <title depth="1">3
         | 
| 869 | 
            -
                          <tab/>
         | 
| 870 | 
            -
                          Widgets</title>
         | 
| 871 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 872 | 
            -
                          <title>3.1</title>
         | 
| 873 | 
            -
                          <table id="note1">
         | 
| 874 | 
            -
                            <name>Table 2 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 875 | 
            -
                            <tbody>
         | 
| 876 | 
            -
                              <tr>
         | 
| 877 | 
            -
                                <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 878 | 
            -
                                <td align="center">13</td>
         | 
| 879 | 
            -
                                <td align="center">11</td>
         | 
| 880 | 
            -
                              </tr>
         | 
| 881 | 
            -
                            </tbody>
         | 
| 882 | 
            -
                          </table>
         | 
| 883 | 
            -
                          <table id="note2">
         | 
| 884 | 
            -
                            <name>Table 3 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 885 | 
            -
                            <tbody>
         | 
| 886 | 
            -
                              <tr>
         | 
| 887 | 
            -
                                <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 888 | 
            -
                                <td align="center">13</td>
         | 
| 889 | 
            -
                                <td align="center">11</td>
         | 
| 890 | 
            -
                              </tr>
         | 
| 891 | 
            -
                            </tbody>
         | 
| 892 | 
            -
                          </table>
         | 
| 893 | 
            -
                          <p>
         | 
| 894 | 
            -
                            <xref target="note1"><span class='citetbl'>Table 2</span></xref>
         | 
| 895 | 
            -
                            <xref target="note2"><span class='citetbl'>Table 3</span></xref>
         | 
| 896 | 
            -
                          </p>
         | 
| 897 | 
            -
                        </clause>
         | 
| 898 | 
            -
                      </clause>
         | 
| 899 | 
            -
                    </sections>
         | 
| 900 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 901 | 
            -
                      <title>
         | 
| 902 | 
            -
                        <strong>Annex A</strong>
         | 
| 903 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 904 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 905 | 
            -
                        <title>A.1</title>
         | 
| 906 | 
            -
                        <table id="AN">
         | 
| 907 | 
            -
                          <name>Table A.1 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 908 | 
            -
                          <tbody>
         | 
| 909 | 
            -
                            <tr>
         | 
| 910 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 911 | 
            -
                              <td align="center">13</td>
         | 
| 912 | 
            -
                              <td align="center">11</td>
         | 
| 913 | 
            -
                            </tr>
         | 
| 914 | 
            -
                          </tbody>
         | 
| 915 | 
            -
                        </table>
         | 
| 916 | 
            -
                      </clause>
         | 
| 917 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 918 | 
            -
                        <title>A.2</title>
         | 
| 919 | 
            -
                        <table id="Anote1">
         | 
| 920 | 
            -
                          <name>Table A.2 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 921 | 
            -
                          <tbody>
         | 
| 922 | 
            -
                            <tr>
         | 
| 923 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 924 | 
            -
                              <td align="center">13</td>
         | 
| 925 | 
            -
                              <td align="center">11</td>
         | 
| 926 | 
            -
                            </tr>
         | 
| 927 | 
            -
                          </tbody>
         | 
| 928 | 
            -
                        </table>
         | 
| 929 | 
            -
                        <table id="Anote2">
         | 
| 930 | 
            -
                          <name>Table A.3 — Repeatability and reproducibility of husked rice yield</name>
         | 
| 931 | 
            -
                          <tbody>
         | 
| 932 | 
            -
                            <tr>
         | 
| 933 | 
            -
                              <td align="left">Number of laboratories retained after eliminating outliers</td>
         | 
| 934 | 
            -
                              <td align="center">13</td>
         | 
| 935 | 
            -
                              <td align="center">11</td>
         | 
| 936 | 
            -
                            </tr>
         | 
| 937 | 
            -
                          </tbody>
         | 
| 938 | 
            -
                        </table>
         | 
| 939 | 
            -
                      </clause>
         | 
| 940 | 
            -
                    </annex>
         | 
| 941 | 
            -
                  </iso-standard>
         | 
| 942 | 
            -
                OUTPUT
         | 
| 943 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 944 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 945 | 
            -
              end
         | 
| 946 | 
            -
             | 
| 947 | 
            -
              it "cross-references term notes" do
         | 
| 948 | 
            -
                input = <<~INPUT
         | 
| 949 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 950 | 
            -
                    <preface>
         | 
| 951 | 
            -
                      <foreword>
         | 
| 952 | 
            -
                        <p>
         | 
| 953 | 
            -
                          <xref target="note1"/>
         | 
| 954 | 
            -
                          <xref target="note2"/>
         | 
| 955 | 
            -
                          <xref target="note3"/>
         | 
| 956 | 
            -
                        </p>
         | 
| 957 | 
            -
                      </foreword>
         | 
| 958 | 
            -
                    </preface>
         | 
| 959 | 
            -
                    <sections>
         | 
| 960 | 
            -
                      <clause id="scope" type="scope">
         | 
| 961 | 
            -
                        <title>Scope</title>
         | 
| 962 | 
            -
                      </clause>
         | 
| 963 | 
            -
                      <terms id="terms">
         | 
| 964 | 
            -
                        <term id="_waxy_rice">
         | 
| 965 | 
            -
                          <preferred><expression><name>waxy rice</name></expression></preferred>
         | 
| 966 | 
            -
                          <termnote id="note1">
         | 
| 967 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
         | 
| 968 | 
            -
                          </termnote>
         | 
| 969 | 
            -
                        </term>
         | 
| 970 | 
            -
                        <term id="_nonwaxy_rice">
         | 
| 971 | 
            -
                          <preferred><expression><name>nonwaxy rice</name></expression></preferred>
         | 
| 972 | 
            -
                          <termnote id="note2">
         | 
| 973 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
         | 
| 974 | 
            -
                          </termnote>
         | 
| 975 | 
            -
                          <termnote id="note3">
         | 
| 976 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
         | 
| 977 | 
            -
                          </termnote>
         | 
| 978 | 
            -
                        </term>
         | 
| 979 | 
            -
                      </terms>
         | 
| 980 | 
            -
             | 
| 981 | 
            -
                  </iso-standard>
         | 
| 982 | 
            -
                INPUT
         | 
| 983 | 
            -
                output = <<~OUTPUT
         | 
| 984 | 
            -
                  <?xml version='1.0'?>
         | 
| 985 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 986 | 
            -
                    <preface>
         | 
| 987 | 
            -
                      <foreword displayorder='1'>
         | 
| 988 | 
            -
                        <p>
         | 
| 989 | 
            -
                          <xref target="note1">2.1, Note 1</xref>
         | 
| 990 | 
            -
                          <xref target="note2">2.2, Note 1</xref>
         | 
| 991 | 
            -
                          <xref target="note3">2.2, Note 2</xref>
         | 
| 992 | 
            -
                        </p>
         | 
| 993 | 
            -
                      </foreword>
         | 
| 994 | 
            -
                    </preface>
         | 
| 995 | 
            -
                    <sections>
         | 
| 996 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 997 | 
            -
                        <title depth="1">1
         | 
| 998 | 
            -
                          <tab/>
         | 
| 999 | 
            -
                          Scope</title>
         | 
| 1000 | 
            -
                      </clause>
         | 
| 1001 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 1002 | 
            -
                        <title>2</title>
         | 
| 1003 | 
            -
                        <term id="_waxy_rice">
         | 
| 1004 | 
            -
                          <name>2.1</name>
         | 
| 1005 | 
            -
                          <preferred><strong>waxy rice</strong></preferred>
         | 
| 1006 | 
            -
                          <termnote id="note1">
         | 
| 1007 | 
            -
                            <name>Note 1 to entry</name>
         | 
| 1008 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
         | 
| 1009 | 
            -
                              kernels have a tendency to stick together after cooking.
         | 
| 1010 | 
            -
                            </p>
         | 
| 1011 | 
            -
                          </termnote>
         | 
| 1012 | 
            -
                        </term>
         | 
| 1013 | 
            -
                        <term id="_nonwaxy_rice">
         | 
| 1014 | 
            -
                          <name>2.2</name>
         | 
| 1015 | 
            -
                          <preferred><strong>nonwaxy rice</strong></preferred>
         | 
| 1016 | 
            -
                          <termnote id="note2">
         | 
| 1017 | 
            -
                            <name>Note 1 to entry</name>
         | 
| 1018 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
         | 
| 1019 | 
            -
                              kernels have a tendency to stick together after cooking.
         | 
| 1020 | 
            -
                            </p>
         | 
| 1021 | 
            -
                          </termnote>
         | 
| 1022 | 
            -
                          <termnote id="note3">
         | 
| 1023 | 
            -
                            <name>Note 2 to entry</name>
         | 
| 1024 | 
            -
                            <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
         | 
| 1025 | 
            -
                              kernels have a tendency to stick together after cooking.
         | 
| 1026 | 
            -
                            </p>
         | 
| 1027 | 
            -
                          </termnote>
         | 
| 1028 | 
            -
                        </term>
         | 
| 1029 | 
            -
                      </terms>
         | 
| 1030 | 
            -
                    </sections>
         | 
| 1031 | 
            -
                  </iso-standard>
         | 
| 1032 | 
            -
                OUTPUT
         | 
| 1033 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1034 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 1035 | 
            -
              end
         | 
| 1036 | 
            -
             | 
| 1037 | 
            -
              it "cross-references sections" do
         | 
| 1038 | 
            -
                input = <<~INPUT
         | 
| 1039 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1040 | 
            -
                    <preface>
         | 
| 1041 | 
            -
                      <foreword obligation="informative">
         | 
| 1042 | 
            -
                        <title>Foreword</title>
         | 
| 1043 | 
            -
                        <p id="A">This is a preamble
         | 
| 1044 | 
            -
                          <xref target="C"/>
         | 
| 1045 | 
            -
                          <xref target="C1"/>
         | 
| 1046 | 
            -
                          <xref target="D"/>
         | 
| 1047 | 
            -
                          <xref target="H"/>
         | 
| 1048 | 
            -
                          <xref target="I"/>
         | 
| 1049 | 
            -
                          <xref target="J"/>
         | 
| 1050 | 
            -
                          <xref target="K"/>
         | 
| 1051 | 
            -
                          <xref target="L"/>
         | 
| 1052 | 
            -
                          <xref target="M"/>
         | 
| 1053 | 
            -
                          <xref target="N"/>
         | 
| 1054 | 
            -
                          <xref target="O"/>
         | 
| 1055 | 
            -
                          <xref target="P"/>
         | 
| 1056 | 
            -
                          <xref target="Q"/>
         | 
| 1057 | 
            -
                          <xref target="Q1"/>
         | 
| 1058 | 
            -
                          <xref target="Q2"/>
         | 
| 1059 | 
            -
                          <xref target="Q3"/>
         | 
| 1060 | 
            -
                          <xref target="R"/></p>
         | 
| 1061 | 
            -
                      </foreword>
         | 
| 1062 | 
            -
                      <introduction id="B" obligation="informative">
         | 
| 1063 | 
            -
                        <title>Introduction</title>
         | 
| 1064 | 
            -
                        <clause id="C" inline-header="false" obligation="informative">
         | 
| 1065 | 
            -
                          <title>Introduction Subsection</title>
         | 
| 1066 | 
            -
                        </clause>
         | 
| 1067 | 
            -
                        <clause id="C1" inline-header="false" obligation="informative">Text</clause>
         | 
| 1068 | 
            -
                      </introduction>
         | 
| 1069 | 
            -
                    </preface>
         | 
| 1070 | 
            -
                    <sections>
         | 
| 1071 | 
            -
                      <clause id="D" obligation="normative" type="scope">
         | 
| 1072 | 
            -
                        <title>Scope</title>
         | 
| 1073 | 
            -
                        <p id="E">Text</p>
         | 
| 1074 | 
            -
                      </clause>
         | 
| 1075 | 
            -
                      <terms id="H" obligation="normative">
         | 
| 1076 | 
            -
                        <title>Terms, definitions, symbols and abbreviated terms</title>
         | 
| 1077 | 
            -
                        <terms id="I" obligation="normative">
         | 
| 1078 | 
            -
                          <title>Normal Terms</title>
         | 
| 1079 | 
            -
                          <term id="J">
         | 
| 1080 | 
            -
                            <preferred><expression><name>Term2</name></expression></preferred>
         | 
| 1081 | 
            -
                          </term>
         | 
| 1082 | 
            -
                        </terms>
         | 
| 1083 | 
            -
                        <definitions id="K">
         | 
| 1084 | 
            -
                          <dl>
         | 
| 1085 | 
            -
                            <dt>Symbol</dt>
         | 
| 1086 | 
            -
                            <dd>Definition</dd>
         | 
| 1087 | 
            -
                          </dl>
         | 
| 1088 | 
            -
                        </definitions>
         | 
| 1089 | 
            -
                      </terms>
         | 
| 1090 | 
            -
                      <definitions id="L">
         | 
| 1091 | 
            -
                        <dl>
         | 
| 1092 | 
            -
                          <dt>Symbol</dt>
         | 
| 1093 | 
            -
                          <dd>Definition</dd>
         | 
| 1094 | 
            -
                        </dl>
         | 
| 1095 | 
            -
                      </definitions>
         | 
| 1096 | 
            -
                      <clause id="M" inline-header="false" obligation="normative">
         | 
| 1097 | 
            -
                        <title>Clause 4</title>
         | 
| 1098 | 
            -
                        <clause id="N" inline-header="false" obligation="normative">
         | 
| 1099 | 
            -
                          <title>Introduction</title>
         | 
| 1100 | 
            -
                        </clause>
         | 
| 1101 | 
            -
                        <clause id="O" inline-header="false" obligation="normative">
         | 
| 1102 | 
            -
                          <title>Clause 4.2</title>
         | 
| 1103 | 
            -
                        </clause>
         | 
| 1104 | 
            -
                      </clause>
         | 
| 1105 | 
            -
                    </sections>
         | 
| 1106 | 
            -
                    <annex id="P" inline-header="false" obligation="normative">
         | 
| 1107 | 
            -
                      <title>Annex</title>
         | 
| 1108 | 
            -
                      <clause id="Q" inline-header="false" obligation="normative">
         | 
| 1109 | 
            -
                        <title>Annex A.1</title>
         | 
| 1110 | 
            -
                        <clause id="Q1" inline-header="false" obligation="normative">
         | 
| 1111 | 
            -
                          <title>Annex A.1a</title>
         | 
| 1112 | 
            -
                        </clause>
         | 
| 1113 | 
            -
                      </clause>
         | 
| 1114 | 
            -
                      <appendix id="Q2" inline-header="false" obligation="normative">
         | 
| 1115 | 
            -
                        <title>An Appendix</title>
         | 
| 1116 | 
            -
                        <clause id="Q3" inline-header="false" obligation="normative">
         | 
| 1117 | 
            -
                          <title>Appendix subclause</title>
         | 
| 1118 | 
            -
                        </clause>
         | 
| 1119 | 
            -
                      </appendix>
         | 
| 1120 | 
            -
                    </annex>
         | 
| 1121 | 
            -
                    <bibliography>
         | 
| 1122 | 
            -
                      <references id="R" normative="true" obligation="informative">
         | 
| 1123 | 
            -
                        <title>Normative References</title>
         | 
| 1124 | 
            -
                      </references>
         | 
| 1125 | 
            -
                      <clause id="S" obligation="informative">
         | 
| 1126 | 
            -
                        <title>Bibliography</title>
         | 
| 1127 | 
            -
                        <references id="T" normative="false" obligation="informative">
         | 
| 1128 | 
            -
                          <title>Bibliography Subsection</title>
         | 
| 1129 | 
            -
                        </references>
         | 
| 1130 | 
            -
                      </clause>
         | 
| 1131 | 
            -
                    </bibliography>
         | 
| 1132 | 
            -
                  </iso-standard>
         | 
| 1133 | 
            -
                INPUT
         | 
| 1134 | 
            -
                output = <<~OUTPUT
         | 
| 1135 | 
            -
                  <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
         | 
| 1136 | 
            -
                    <preface>
         | 
| 1137 | 
            -
                      <foreword obligation='informative' displayorder='1'>
         | 
| 1138 | 
            -
                        <title>Foreword</title>
         | 
| 1139 | 
            -
                        <p id='A'>
         | 
| 1140 | 
            -
                          This is a preamble
         | 
| 1141 | 
            -
                          <xref target='C'><span class='citesec'>0.1</span></xref>
         | 
| 1142 | 
            -
                          <xref target='C1'><span class='citesec'>0.2</span></xref>
         | 
| 1143 | 
            -
                          <xref target='D'><span class='citesec'>Clause 1</span></xref>
         | 
| 1144 | 
            -
                          <xref target='H'><span class='citesec'>Clause 3</span></xref>
         | 
| 1145 | 
            -
                          <xref target='I'><span class='citesec'>3.1</span></xref>
         | 
| 1146 | 
            -
                          <xref target='J'><span class='citesec'>3.1.1</span></xref>
         | 
| 1147 | 
            -
                          <xref target='K'><span class='citesec'>3.2</span></xref>
         | 
| 1148 | 
            -
                          <xref target='L'><span class='citesec'>Clause 4</span></xref>
         | 
| 1149 | 
            -
                          <xref target='M'><span class='citesec'>Clause 5</span></xref>
         | 
| 1150 | 
            -
                          <xref target='N'><span class='citesec'>5.1</span></xref>
         | 
| 1151 | 
            -
                          <xref target='O'><span class='citesec'>5.2</span></xref>
         | 
| 1152 | 
            -
                          <xref target='P'><span class='citeapp'>Annex A</span></xref>
         | 
| 1153 | 
            -
                          <xref target='Q'><span class='citeapp'>A.1</span></xref>
         | 
| 1154 | 
            -
                          <xref target='Q1'><span class='citeapp'>A.1.1</span></xref>
         | 
| 1155 | 
            -
                          <xref target='Q2'><span class='citeapp'>Annex A, Appendix 1</span></xref>
         | 
| 1156 | 
            -
                          <xref target='Q3'>Annex A, Appendix 1.1</xref>
         | 
| 1157 | 
            -
                          <xref target='R'><span class='citesec'>Clause 2</span></xref>
         | 
| 1158 | 
            -
                        </p>
         | 
| 1159 | 
            -
                      </foreword>
         | 
| 1160 | 
            -
                      <introduction id='B' obligation='informative' displayorder='2'>
         | 
| 1161 | 
            -
                        <title depth='1'>
         | 
| 1162 | 
            -
                          0
         | 
| 1163 | 
            -
                          <tab/>
         | 
| 1164 | 
            -
                          Introduction
         | 
| 1165 | 
            -
                        </title>
         | 
| 1166 | 
            -
                        <clause id='C' inline-header='false' obligation='informative'>
         | 
| 1167 | 
            -
                          <title depth='2'>
         | 
| 1168 | 
            -
                            0.1
         | 
| 1169 | 
            -
                            <tab/>
         | 
| 1170 | 
            -
                            Introduction Subsection
         | 
| 1171 | 
            -
                          </title>
         | 
| 1172 | 
            -
                        </clause>
         | 
| 1173 | 
            -
                        <clause id='C1' inline-header='true' obligation='informative'>
         | 
| 1174 | 
            -
                          <title>0.2</title>
         | 
| 1175 | 
            -
                          Text
         | 
| 1176 | 
            -
                        </clause>
         | 
| 1177 | 
            -
                      </introduction>
         | 
| 1178 | 
            -
                    </preface>
         | 
| 1179 | 
            -
                    <sections>
         | 
| 1180 | 
            -
                      <clause id='D' obligation='normative' type='scope' displayorder='3'>
         | 
| 1181 | 
            -
                        <title depth='1'>
         | 
| 1182 | 
            -
                          1
         | 
| 1183 | 
            -
                          <tab/>
         | 
| 1184 | 
            -
                          Scope
         | 
| 1185 | 
            -
                        </title>
         | 
| 1186 | 
            -
                        <p id='E'>Text</p>
         | 
| 1187 | 
            -
                      </clause>
         | 
| 1188 | 
            -
                      <terms id='H' obligation='normative' displayorder='5'>
         | 
| 1189 | 
            -
                        <title depth='1'>
         | 
| 1190 | 
            -
                          3
         | 
| 1191 | 
            -
                          <tab/>
         | 
| 1192 | 
            -
                          Terms, definitions, symbols and abbreviated terms
         | 
| 1193 | 
            -
                        </title>
         | 
| 1194 | 
            -
                        <terms id='I' obligation='normative'>
         | 
| 1195 | 
            -
                          <title depth='2'>
         | 
| 1196 | 
            -
                            3.1
         | 
| 1197 | 
            -
                            <tab/>
         | 
| 1198 | 
            -
                            Normal Terms
         | 
| 1199 | 
            -
                          </title>
         | 
| 1200 | 
            -
                          <term id='J'>
         | 
| 1201 | 
            -
                            <name>3.1.1</name>
         | 
| 1202 | 
            -
                            <preferred><strong>Term2</strong></preferred>
         | 
| 1203 | 
            -
                          </term>
         | 
| 1204 | 
            -
                        </terms>
         | 
| 1205 | 
            -
                        <definitions id='K' inline-header='true'>
         | 
| 1206 | 
            -
                          <title>3.2</title>
         | 
| 1207 | 
            -
                          <dl>
         | 
| 1208 | 
            -
                            <dt>Symbol</dt>
         | 
| 1209 | 
            -
                            <dd>Definition</dd>
         | 
| 1210 | 
            -
                          </dl>
         | 
| 1211 | 
            -
                        </definitions>
         | 
| 1212 | 
            -
                      </terms>
         | 
| 1213 | 
            -
                      <definitions id='L' displayorder='6'>
         | 
| 1214 | 
            -
                        <title>4</title>
         | 
| 1215 | 
            -
                        <dl>
         | 
| 1216 | 
            -
                          <dt>Symbol</dt>
         | 
| 1217 | 
            -
                          <dd>Definition</dd>
         | 
| 1218 | 
            -
                        </dl>
         | 
| 1219 | 
            -
                      </definitions>
         | 
| 1220 | 
            -
                      <clause id='M' inline-header='false' obligation='normative' displayorder='7'>
         | 
| 1221 | 
            -
                        <title depth='1'>
         | 
| 1222 | 
            -
                          5
         | 
| 1223 | 
            -
                          <tab/>
         | 
| 1224 | 
            -
                          Clause 4
         | 
| 1225 | 
            -
                        </title>
         | 
| 1226 | 
            -
                        <clause id='N' inline-header='false' obligation='normative'>
         | 
| 1227 | 
            -
                          <title depth='2'>
         | 
| 1228 | 
            -
                            5.1
         | 
| 1229 | 
            -
                            <tab/>
         | 
| 1230 | 
            -
                            Introduction
         | 
| 1231 | 
            -
                          </title>
         | 
| 1232 | 
            -
                        </clause>
         | 
| 1233 | 
            -
                        <clause id='O' inline-header='false' obligation='normative'>
         | 
| 1234 | 
            -
                          <title depth='2'>
         | 
| 1235 | 
            -
                            5.2
         | 
| 1236 | 
            -
                            <tab/>
         | 
| 1237 | 
            -
                            Clause 4.2
         | 
| 1238 | 
            -
                          </title>
         | 
| 1239 | 
            -
                        </clause>
         | 
| 1240 | 
            -
                      </clause>
         | 
| 1241 | 
            -
                    </sections>
         | 
| 1242 | 
            -
                    <annex id='P' inline-header='false' obligation='normative' displayorder='8'>
         | 
| 1243 | 
            -
                      <title>
         | 
| 1244 | 
            -
                        <strong>Annex A</strong>
         | 
| 1245 | 
            -
                        <br/>
         | 
| 1246 | 
            -
                        <span class="obligation">(normative)</span>
         | 
| 1247 | 
            -
                        <br/>
         | 
| 1248 | 
            -
                        <br/>
         | 
| 1249 | 
            -
                        <strong>Annex</strong>
         | 
| 1250 | 
            -
                      </title>
         | 
| 1251 | 
            -
                      <clause id='Q' inline-header='false' obligation='normative'>
         | 
| 1252 | 
            -
                        <title depth='2'>
         | 
| 1253 | 
            -
                          A.1
         | 
| 1254 | 
            -
                          <tab/>
         | 
| 1255 | 
            -
                          Annex A.1
         | 
| 1256 | 
            -
                        </title>
         | 
| 1257 | 
            -
                        <clause id='Q1' inline-header='false' obligation='normative'>
         | 
| 1258 | 
            -
                          <title depth='3'>
         | 
| 1259 | 
            -
                            A.1.1
         | 
| 1260 | 
            -
                            <tab/>
         | 
| 1261 | 
            -
                            Annex A.1a
         | 
| 1262 | 
            -
                          </title>
         | 
| 1263 | 
            -
                        </clause>
         | 
| 1264 | 
            -
                      </clause>
         | 
| 1265 | 
            -
                      <appendix id='Q2' inline-header='false' obligation='normative'>
         | 
| 1266 | 
            -
                        <title depth='2'>
         | 
| 1267 | 
            -
                          Appendix 1
         | 
| 1268 | 
            -
                          <tab/>
         | 
| 1269 | 
            -
                          An Appendix
         | 
| 1270 | 
            -
                        </title>
         | 
| 1271 | 
            -
                        <clause id='Q3' inline-header='false' obligation='normative'>
         | 
| 1272 | 
            -
                          <title depth='3'>
         | 
| 1273 | 
            -
                            Appendix 1.1
         | 
| 1274 | 
            -
                            <tab/>
         | 
| 1275 | 
            -
                            Appendix subclause
         | 
| 1276 | 
            -
                          </title>
         | 
| 1277 | 
            -
                        </clause>
         | 
| 1278 | 
            -
                      </appendix>
         | 
| 1279 | 
            -
                    </annex>
         | 
| 1280 | 
            -
                    <bibliography>
         | 
| 1281 | 
            -
                      <references id='R' normative='true' obligation='informative' displayorder='4'>
         | 
| 1282 | 
            -
                        <title depth='1'>
         | 
| 1283 | 
            -
                          2
         | 
| 1284 | 
            -
                          <tab/>
         | 
| 1285 | 
            -
                          Normative References
         | 
| 1286 | 
            -
                        </title>
         | 
| 1287 | 
            -
                      </references>
         | 
| 1288 | 
            -
                      <clause id='S' obligation='informative' displayorder='9'>
         | 
| 1289 | 
            -
                        <title depth='1'>Bibliography</title>
         | 
| 1290 | 
            -
                        <references id='T' normative='false' obligation='informative'>
         | 
| 1291 | 
            -
                          <title depth='2'>Bibliography Subsection</title>
         | 
| 1292 | 
            -
                        </references>
         | 
| 1293 | 
            -
                      </clause>
         | 
| 1294 | 
            -
                    </bibliography>
         | 
| 1295 | 
            -
                  </iso-standard>
         | 
| 1296 | 
            -
                OUTPUT
         | 
| 1297 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1298 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 1299 | 
            -
              end
         | 
| 1300 | 
            -
             | 
| 1301 | 
            -
              it "cross-references lists" do
         | 
| 1302 | 
            -
                output = IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1303 | 
            -
                  .convert("test", <<~"INPUT", true)
         | 
| 1304 | 
            -
                    <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1305 | 
            -
                      <preface>
         | 
| 1306 | 
            -
                        <foreword>
         | 
| 1307 | 
            -
                          <p>
         | 
| 1308 | 
            -
                            <xref target="N"/>
         | 
| 1309 | 
            -
                            <xref target="note1"/>
         | 
| 1310 | 
            -
                            <xref target="note2"/>
         | 
| 1311 | 
            -
                            <xref target="AN"/>
         | 
| 1312 | 
            -
                            <xref target="Anote1"/>
         | 
| 1313 | 
            -
                            <xref target="Anote2"/>
         | 
| 1314 | 
            -
                          </p>
         | 
| 1315 | 
            -
                        </foreword>
         | 
| 1316 | 
            -
                      </preface>
         | 
| 1317 | 
            -
                      <sections>
         | 
| 1318 | 
            -
                        <clause id="scope" type="scope">
         | 
| 1319 | 
            -
                          <title>Scope</title>
         | 
| 1320 | 
            -
                          <ol id="N">
         | 
| 1321 | 
            -
                            <li>
         | 
| 1322 | 
            -
                              <p>A</p>
         | 
| 1323 | 
            -
                            </li>
         | 
| 1324 | 
            -
                          </ol>
         | 
| 1325 | 
            -
                        </clause>
         | 
| 1326 | 
            -
                        <terms id="terms"/>
         | 
| 1327 | 
            -
                        <clause id="widgets">
         | 
| 1328 | 
            -
                          <title>Widgets</title>
         | 
| 1329 | 
            -
                          <clause id="widgets1">
         | 
| 1330 | 
            -
                            <ol id="note1">
         | 
| 1331 | 
            -
                              <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 1332 | 
            -
                            </ol>
         | 
| 1333 | 
            -
                            <ol id="note2">
         | 
| 1334 | 
            -
                              <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 1335 | 
            -
                            </ol>
         | 
| 1336 | 
            -
                          </clause>
         | 
| 1337 | 
            -
                        </clause>
         | 
| 1338 | 
            -
                      </sections>
         | 
| 1339 | 
            -
                      <annex id="annex1">
         | 
| 1340 | 
            -
                        <clause id="annex1a">
         | 
| 1341 | 
            -
                          <ol id="AN">
         | 
| 1342 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 1343 | 
            -
                          </ol>
         | 
| 1344 | 
            -
                        </clause>
         | 
| 1345 | 
            -
                        <clause id="annex1b">
         | 
| 1346 | 
            -
                          <ol id="Anote1">
         | 
| 1347 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 1348 | 
            -
                          </ol>
         | 
| 1349 | 
            -
                          <ol id="Anote2">
         | 
| 1350 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
         | 
| 1351 | 
            -
                          </ol>
         | 
| 1352 | 
            -
                        </clause>
         | 
| 1353 | 
            -
                      </annex>
         | 
| 1354 | 
            -
                    </iso-standard>
         | 
| 1355 | 
            -
                  INPUT
         | 
| 1356 | 
            -
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 1357 | 
            -
                  <?xml version='1.0'?>
         | 
| 1358 | 
            -
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 1359 | 
            -
                    <preface>
         | 
| 1360 | 
            -
                      <foreword displayorder='1'>
         | 
| 1361 | 
            -
                        <p>
         | 
| 1362 | 
            -
                          <xref target="N">Clause 1, List</xref>
         | 
| 1363 | 
            -
                          <xref target="note1">3.1, List 1</xref>
         | 
| 1364 | 
            -
                          <xref target="note2">3.1, List 2</xref>
         | 
| 1365 | 
            -
                          <xref target="AN">A.1, List</xref>
         | 
| 1366 | 
            -
                          <xref target="Anote1">A.2, List 1</xref>
         | 
| 1367 | 
            -
                          <xref target="Anote2">A.2, List 2</xref>
         | 
| 1368 | 
            -
                        </p>
         | 
| 1369 | 
            -
                      </foreword>
         | 
| 1370 | 
            -
                    </preface>
         | 
| 1371 | 
            -
                    <sections>
         | 
| 1372 | 
            -
                      <clause id="scope" type="scope" displayorder='2'>
         | 
| 1373 | 
            -
                        <title depth="1">1
         | 
| 1374 | 
            -
                          <tab/>
         | 
| 1375 | 
            -
                          Scope</title>
         | 
| 1376 | 
            -
                        <ol id="N" type="alphabet">
         | 
| 1377 | 
            -
                          <li>
         | 
| 1378 | 
            -
                            <p>A</p>
         | 
| 1379 | 
            -
                          </li>
         | 
| 1380 | 
            -
                        </ol>
         | 
| 1381 | 
            -
                      </clause>
         | 
| 1382 | 
            -
                      <terms id="terms" displayorder='3'>
         | 
| 1383 | 
            -
                        <title>2</title>
         | 
| 1384 | 
            -
                      </terms>
         | 
| 1385 | 
            -
                      <clause id="widgets" displayorder='4'>
         | 
| 1386 | 
            -
                        <title depth="1">3
         | 
| 1387 | 
            -
                          <tab/>
         | 
| 1388 | 
            -
                          Widgets</title>
         | 
| 1389 | 
            -
                        <clause id="widgets1" inline-header="true">
         | 
| 1390 | 
            -
                          <title>3.1</title>
         | 
| 1391 | 
            -
                          <ol id="note1" type="alphabet">
         | 
| 1392 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 1393 | 
            -
                                      types of kernel.
         | 
| 1394 | 
            -
                                    </p>
         | 
| 1395 | 
            -
                          </ol>
         | 
| 1396 | 
            -
                          <ol id="note2" type="alphabet">
         | 
| 1397 | 
            -
                            <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
         | 
| 1398 | 
            -
                                      types of kernel.
         | 
| 1399 | 
            -
                                    </p>
         | 
| 1400 | 
            -
                          </ol>
         | 
| 1401 | 
            -
                        </clause>
         | 
| 1402 | 
            -
                      </clause>
         | 
| 1403 | 
            -
                    </sections>
         | 
| 1404 | 
            -
                    <annex id="annex1" displayorder='5'>
         | 
| 1405 | 
            -
                      <title>
         | 
| 1406 | 
            -
                        <strong>Annex A</strong>
         | 
| 1407 | 
            -
                        <br/><span class="obligation">(informative)</span></title>
         | 
| 1408 | 
            -
                      <clause id="annex1a" inline-header="true">
         | 
| 1409 | 
            -
                        <title>A.1</title>
         | 
| 1410 | 
            -
                        <ol id="AN" type="alphabet">
         | 
| 1411 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 1412 | 
            -
                                    types of kernel.
         | 
| 1413 | 
            -
                                  </p>
         | 
| 1414 | 
            -
                        </ol>
         | 
| 1415 | 
            -
                      </clause>
         | 
| 1416 | 
            -
                      <clause id="annex1b" inline-header="true">
         | 
| 1417 | 
            -
                        <title>A.2</title>
         | 
| 1418 | 
            -
                        <ol id="Anote1" type="alphabet">
         | 
| 1419 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
         | 
| 1420 | 
            -
                                    types of kernel.
         | 
| 1421 | 
            -
                                  </p>
         | 
| 1422 | 
            -
                        </ol>
         | 
| 1423 | 
            -
                        <ol id="Anote2" type="alphabet">
         | 
| 1424 | 
            -
                          <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
         | 
| 1425 | 
            -
                                    types of kernel.
         | 
| 1426 | 
            -
                                  </p>
         | 
| 1427 | 
            -
                        </ol>
         | 
| 1428 | 
            -
                      </clause>
         | 
| 1429 | 
            -
                    </annex>
         | 
| 1430 | 
            -
                  </iso-standard>
         | 
| 1431 | 
            -
                OUTPUT
         | 
| 1432 | 
            -
              end
         | 
| 1433 | 
            -
             | 
| 1434 | 
            -
              it "cross-references list items" do
         | 
| 1435 | 
            -
                input = <<~INPUT
         | 
| 1436 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1437 | 
            -
                    <preface>
         | 
| 1438 | 
            -
                      <foreword>
         | 
| 1439 | 
            -
                        <p>
         | 
| 1440 | 
            -
                          <xref target="N"/>
         | 
| 1441 | 
            -
                          <xref target="note1"/>
         | 
| 1442 | 
            -
                          <xref target="note2"/>
         | 
| 1443 | 
            -
                          <xref target="AN"/>
         | 
| 1444 | 
            -
                          <xref target="Anote1"/>
         | 
| 1445 | 
            -
                          <xref target="Anote2"/>
         | 
| 1446 | 
            -
                        </p>
         | 
| 1447 | 
            -
                      </foreword>
         | 
| 1448 | 
            -
                    </preface>
         | 
| 1449 | 
            -
                    <sections>
         | 
| 1450 | 
            -
                      <clause id="scope" type="scope">
         | 
| 1451 | 
            -
                        <title>Scope</title>
         | 
| 1452 | 
            -
                        <ol id="N1">
         | 
| 1453 | 
            -
                          <li id="N">
         | 
| 1454 | 
            -
                            <p>A</p>
         | 
| 1455 | 
            -
                          </li>
         | 
| 1456 | 
            -
                        </ol>
         | 
| 1457 | 
            -
                      </clause>
         | 
| 1458 | 
            -
                      <terms id="terms"/>
         | 
| 1459 | 
            -
                      <clause id="widgets">
         | 
| 1460 | 
            -
                        <title>Widgets</title>
         | 
| 1461 | 
            -
                        <clause id="widgets1">
         | 
| 1462 | 
            -
                          <ol id="note1l">
         | 
| 1463 | 
            -
                            <li id="note1">
         | 
| 1464 | 
            -
                              <p>A</p>
         | 
| 1465 | 
            -
                            </li>
         | 
| 1466 | 
            -
                          </ol>
         | 
| 1467 | 
            -
                          <ol id="note2l">
         | 
| 1468 | 
            -
                            <li id="note2">
         | 
| 1469 | 
            -
                              <p>A</p>
         | 
| 1470 | 
            -
                            </li>
         | 
| 1471 | 
            -
                          </ol>
         | 
| 1472 | 
            -
                        </clause>
         | 
| 1473 | 
            -
                      </clause>
         | 
| 1474 | 
            -
                    </sections>
         | 
| 1475 | 
            -
                    <annex id="annex1">
         | 
| 1476 | 
            -
                      <clause id="annex1a">
         | 
| 1477 | 
            -
                        <ol id="ANl">
         | 
| 1478 | 
            -
                          <li id="AN">
         | 
| 1479 | 
            -
                            <p>A</p>
         | 
| 1480 | 
            -
                          </li>
         | 
| 1481 | 
            -
                        </ol>
         | 
| 1482 | 
            -
                      </clause>
         | 
| 1483 | 
            -
                      <clause id="annex1b">
         | 
| 1484 | 
            -
                        <ol id="Anote1l">
         | 
| 1485 | 
            -
                          <li id="Anote1">
         | 
| 1486 | 
            -
                            <p>A</p>
         | 
| 1487 | 
            -
                          </li>
         | 
| 1488 | 
            -
                        </ol>
         | 
| 1489 | 
            -
                        <ol id="Anote2l">
         | 
| 1490 | 
            -
                          <li id="Anote2">
         | 
| 1491 | 
            -
                            <p>A</p>
         | 
| 1492 | 
            -
                          </li>
         | 
| 1493 | 
            -
                        </ol>
         | 
| 1494 | 
            -
                      </clause>
         | 
| 1495 | 
            -
                    </annex>
         | 
| 1496 | 
            -
                  </iso-standard>
         | 
| 1497 | 
            -
                INPUT
         | 
| 1498 | 
            -
                output = <<~OUTPUT
         | 
| 1499 | 
            -
                  <?xml version='1.0'?>
         | 
| 1500 | 
            -
                  <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
         | 
| 1501 | 
            -
                    <preface>
         | 
| 1502 | 
            -
                      <foreword displayorder='1'>
         | 
| 1503 | 
            -
                        <p>
         | 
| 1504 | 
            -
                          <xref target='N'>1 a)</xref>
         | 
| 1505 | 
            -
                          <xref target='note1'>3.1, List 1 a)</xref>
         | 
| 1506 | 
            -
                          <xref target='note2'>3.1, List 2 a)</xref>
         | 
| 1507 | 
            -
                          <xref target='AN'>A.1 a)</xref>
         | 
| 1508 | 
            -
                          <xref target='Anote1'>A.2, List 1 a)</xref>
         | 
| 1509 | 
            -
                          <xref target='Anote2'>A.2, List 2 a)</xref>
         | 
| 1510 | 
            -
                        </p>
         | 
| 1511 | 
            -
                      </foreword>
         | 
| 1512 | 
            -
                    </preface>
         | 
| 1513 | 
            -
                    <sections>
         | 
| 1514 | 
            -
                      <clause id='scope' type='scope' displayorder='2'>
         | 
| 1515 | 
            -
                        <title depth='1'>1<tab/>Scope</title>
         | 
| 1516 | 
            -
                        <ol id='N1' type="alphabet">
         | 
| 1517 | 
            -
                          <li id='N'>
         | 
| 1518 | 
            -
                            <p>A</p>
         | 
| 1519 | 
            -
                          </li>
         | 
| 1520 | 
            -
                        </ol>
         | 
| 1521 | 
            -
                      </clause>
         | 
| 1522 | 
            -
                      <terms id='terms' displayorder='3'><title>2</title></terms>
         | 
| 1523 | 
            -
                      <clause id='widgets' displayorder='4'>
         | 
| 1524 | 
            -
                      <title depth='1'>3<tab/>Widgets</title>
         | 
| 1525 | 
            -
                        <clause inline-header="true" id='widgets1'><title>3.1</title>
         | 
| 1526 | 
            -
                          <ol id='note1l' type="alphabet">
         | 
| 1527 | 
            -
                            <li id='note1'>
         | 
| 1528 | 
            -
                              <p>A</p>
         | 
| 1529 | 
            -
                            </li>
         | 
| 1530 | 
            -
                          </ol>
         | 
| 1531 | 
            -
                          <ol id='note2l' type="alphabet">
         | 
| 1532 | 
            -
                            <li id='note2'>
         | 
| 1533 | 
            -
                              <p>A</p>
         | 
| 1534 | 
            -
                            </li>
         | 
| 1535 | 
            -
                          </ol>
         | 
| 1536 | 
            -
                        </clause>
         | 
| 1537 | 
            -
                      </clause>
         | 
| 1538 | 
            -
                    </sections>
         | 
| 1539 | 
            -
                    <annex id='annex1'  displayorder='5'><title><strong>Annex A</strong><br/><span class="obligation">(informative)</span></title>
         | 
| 1540 | 
            -
                      <clause inline-header="true" id='annex1a'><title>A.1</title>
         | 
| 1541 | 
            -
                        <ol id='ANl' type="alphabet">
         | 
| 1542 | 
            -
                          <li id='AN'>
         | 
| 1543 | 
            -
                            <p>A</p>
         | 
| 1544 | 
            -
                          </li>
         | 
| 1545 | 
            -
                        </ol>
         | 
| 1546 | 
            -
                      </clause>
         | 
| 1547 | 
            -
                      <clause inline-header="true" id='annex1b'><title>A.2</title>
         | 
| 1548 | 
            -
                        <ol id='Anote1l' type="alphabet">
         | 
| 1549 | 
            -
                          <li id='Anote1'>
         | 
| 1550 | 
            -
                            <p>A</p>
         | 
| 1551 | 
            -
                          </li>
         | 
| 1552 | 
            -
                        </ol>
         | 
| 1553 | 
            -
                        <ol id='Anote2l' type="alphabet">
         | 
| 1554 | 
            -
                          <li id='Anote2'>
         | 
| 1555 | 
            -
                            <p>A</p>
         | 
| 1556 | 
            -
                          </li>
         | 
| 1557 | 
            -
                        </ol>
         | 
| 1558 | 
            -
                      </clause>
         | 
| 1559 | 
            -
                    </annex>
         | 
| 1560 | 
            -
                  </iso-standard>
         | 
| 1561 | 
            -
                OUTPUT
         | 
| 1562 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1563 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 1564 | 
            -
              end
         | 
| 1565 | 
            -
             | 
| 1566 | 
            -
              it "cross-references nested list items" do
         | 
| 1567 | 
            -
                input = <<~INPUT
         | 
| 1568 | 
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1569 | 
            -
                    <preface>
         | 
| 1570 | 
            -
                      <foreword>
         | 
| 1571 | 
            -
                        <p>
         | 
| 1572 | 
            -
                          <xref target="N"/>
         | 
| 1573 | 
            -
                          <xref target="note1"/>
         | 
| 1574 | 
            -
                          <xref target="note2"/>
         | 
| 1575 | 
            -
                          <xref target="AN"/>
         | 
| 1576 | 
            -
                          <xref target="Anote1"/>
         | 
| 1577 | 
            -
                          <xref target="Anote2"/>
         | 
| 1578 | 
            -
                        </p>
         | 
| 1579 | 
            -
                      </foreword>
         | 
| 1580 | 
            -
                    </preface>
         | 
| 1581 | 
            -
                    <sections>
         | 
| 1582 | 
            -
                      <clause id="scope" type="scope">
         | 
| 1583 | 
            -
                        <title>Scope</title>
         | 
| 1584 | 
            -
                        <ol id="N1">
         | 
| 1585 | 
            -
                          <li id="N">
         | 
| 1586 | 
            -
                            <p>A</p>
         | 
| 1587 | 
            -
                            <ol>
         | 
| 1588 | 
            -
                              <li id="note1">
         | 
| 1589 | 
            -
                                <p>A</p>
         | 
| 1590 | 
            -
                                <ol>
         | 
| 1591 | 
            -
                                  <li id="note2">
         | 
| 1592 | 
            -
                                    <p>A</p>
         | 
| 1593 | 
            -
                                    <ol>
         | 
| 1594 | 
            -
                                      <li id="AN">
         | 
| 1595 | 
            -
                                        <p>A</p>
         | 
| 1596 | 
            -
                                        <ol>
         | 
| 1597 | 
            -
                                          <li id="Anote1">
         | 
| 1598 | 
            -
                                            <p>A</p>
         | 
| 1599 | 
            -
                                            <ol>
         | 
| 1600 | 
            -
                                              <li id="Anote2">
         | 
| 1601 | 
            -
                                                <p>A</p>
         | 
| 1602 | 
            -
                                              </li>
         | 
| 1603 | 
            -
                                            </ol>
         | 
| 1604 | 
            -
                                          </li>
         | 
| 1605 | 
            -
                                        </ol>
         | 
| 1606 | 
            -
                                      </li>
         | 
| 1607 | 
            -
                                    </ol>
         | 
| 1608 | 
            -
                                  </li>
         | 
| 1609 | 
            -
                                </ol>
         | 
| 1610 | 
            -
                              </li>
         | 
| 1611 | 
            -
                            </ol>
         | 
| 1612 | 
            -
                          </li>
         | 
| 1613 | 
            -
                        </ol>
         | 
| 1614 | 
            -
                      </clause>
         | 
| 1615 | 
            -
                    </sections>
         | 
| 1616 | 
            -
                  </iso-standard>
         | 
| 1617 | 
            -
                INPUT
         | 
| 1618 | 
            -
                output = <<~OUTPUT
         | 
| 1619 | 
            -
                  <?xml version='1.0'?>
         | 
| 1620 | 
            -
                  <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
         | 
| 1621 | 
            -
                    <preface>
         | 
| 1622 | 
            -
                      <foreword displayorder='1'>
         | 
| 1623 | 
            -
                        <p>
         | 
| 1624 | 
            -
                          <xref target='N'>1 a)</xref>
         | 
| 1625 | 
            -
                          <xref target='note1'>1 a) 1)</xref>
         | 
| 1626 | 
            -
                          <xref target='note2'>1 a) 1) i)</xref>
         | 
| 1627 | 
            -
                          <xref target='AN'>1 a) 1) i) A)</xref>
         | 
| 1628 | 
            -
                          <xref target='Anote1'>1 a) 1) i) A) I)</xref>
         | 
| 1629 | 
            -
                          <xref target='Anote2'>1 a) 1) i) A) I) a)</xref>
         | 
| 1630 | 
            -
                        </p>
         | 
| 1631 | 
            -
                      </foreword>
         | 
| 1632 | 
            -
                    </preface>
         | 
| 1633 | 
            -
                    <sections>
         | 
| 1634 | 
            -
                      <clause id='scope' type='scope' displayorder='2'>
         | 
| 1635 | 
            -
                        <title depth='1'>1<tab/>Scope</title>
         | 
| 1636 | 
            -
                        <ol id='N1' type="alphabet">
         | 
| 1637 | 
            -
                          <li id='N'>
         | 
| 1638 | 
            -
                            <p>A</p>
         | 
| 1639 | 
            -
                            <ol type="arabic">
         | 
| 1640 | 
            -
                              <li id='note1'>
         | 
| 1641 | 
            -
                                <p>A</p>
         | 
| 1642 | 
            -
                                <ol type="roman">
         | 
| 1643 | 
            -
                                  <li id='note2'>
         | 
| 1644 | 
            -
                                    <p>A</p>
         | 
| 1645 | 
            -
                                    <ol type="alphabet_upper">
         | 
| 1646 | 
            -
                                      <li id='AN'>
         | 
| 1647 | 
            -
                                        <p>A</p>
         | 
| 1648 | 
            -
                                        <ol type="roman_upper">
         | 
| 1649 | 
            -
                                          <li id='Anote1'>
         | 
| 1650 | 
            -
                                            <p>A</p>
         | 
| 1651 | 
            -
                                            <ol type="alphabet">
         | 
| 1652 | 
            -
                                              <li id='Anote2'>
         | 
| 1653 | 
            -
                                                <p>A</p>
         | 
| 1654 | 
            -
                                              </li>
         | 
| 1655 | 
            -
                                            </ol>
         | 
| 1656 | 
            -
                                          </li>
         | 
| 1657 | 
            -
                                        </ol>
         | 
| 1658 | 
            -
                                      </li>
         | 
| 1659 | 
            -
                                    </ol>
         | 
| 1660 | 
            -
                                  </li>
         | 
| 1661 | 
            -
                                </ol>
         | 
| 1662 | 
            -
                              </li>
         | 
| 1663 | 
            -
                            </ol>
         | 
| 1664 | 
            -
                          </li>
         | 
| 1665 | 
            -
                        </ol>
         | 
| 1666 | 
            -
                      </clause>
         | 
| 1667 | 
            -
                    </sections>
         | 
| 1668 | 
            -
                  </iso-standard>
         | 
| 1669 | 
            -
                OUTPUT
         | 
| 1670 | 
            -
                expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1671 | 
            -
                  .convert("test", input, true))).to be_equivalent_to xmlpp(output)
         | 
| 1672 | 
            -
              end
         | 
| 1673 | 
            -
             | 
| 1674 | 
            -
              it "conflates cross-references to a split list" do
         | 
| 1675 | 
            -
                input = <<~INPUT
         | 
| 1676 | 
            -
                    <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1677 | 
            -
                    <preface>
         | 
| 1678 | 
            -
                      <foreword>
         | 
| 1679 | 
            -
                        <p><xref target="Na"/></p>
         | 
| 1680 | 
            -
                      </foreword>
         | 
| 1681 | 
            -
                    </preface>
         | 
| 1682 | 
            -
                    <sections>
         | 
| 1683 | 
            -
                      <clause id="scope" type="scope">
         | 
| 1684 | 
            -
                        <title>Scope</title>
         | 
| 1685 | 
            -
                        <ol id="N1">
         | 
| 1686 | 
            -
                          <li id="Na"><p>A</p></li>
         | 
| 1687 | 
            -
                          <li id="Na1"><p>A</p></li>
         | 
| 1688 | 
            -
                        </ol>
         | 
| 1689 | 
            -
                        <ol id="N2" start="3">
         | 
| 1690 | 
            -
                          <li id="Nb"><p>A</p></li>
         | 
| 1691 | 
            -
                          <li id="Nb1"><p>A</p></li>
         | 
| 1692 | 
            -
                        </ol>
         | 
| 1693 | 
            -
                        <ol id="N3" start="5">
         | 
| 1694 | 
            -
                          <li id="Nc"><p>A</p></li>
         | 
| 1695 | 
            -
                          <li id="Nc1"><p>A</p></li>
         | 
| 1696 | 
            -
                        </ol>
         | 
| 1697 | 
            -
                      </clause>
         | 
| 1698 | 
            -
                    </sections>
         | 
| 1699 | 
            -
                  </iso-standard>
         | 
| 1700 | 
            -
                INPUT
         | 
| 1701 | 
            -
                output = <<~OUTPUT
         | 
| 1702 | 
            -
                  <foreword displayorder='1'>
         | 
| 1703 | 
            -
                    <p><xref target='Na'>1 a)</xref></p>
         | 
| 1704 | 
            -
                  </foreword>
         | 
| 1705 | 
            -
                OUTPUT
         | 
| 1706 | 
            -
                expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1707 | 
            -
                .convert("test", input, true))
         | 
| 1708 | 
            -
                .at("//xmlns:foreword").to_xml))
         | 
| 1709 | 
            -
                  .to be_equivalent_to xmlpp(output)
         | 
| 1710 | 
            -
             | 
| 1711 | 
            -
                input = <<~INPUT
         | 
| 1712 | 
            -
                    <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 1713 | 
            -
                    <preface>
         | 
| 1714 | 
            -
                      <foreword>
         | 
| 1715 | 
            -
                        <p><xref target="Na"/></p>
         | 
| 1716 | 
            -
                      </foreword>
         | 
| 1717 | 
            -
                    </preface>
         | 
| 1718 | 
            -
                    <sections>
         | 
| 1719 | 
            -
                      <clause id="scope" type="scope">
         | 
| 1720 | 
            -
                        <title>Scope</title>
         | 
| 1721 | 
            -
                        <ol id="N1">
         | 
| 1722 | 
            -
                          <li id="Na"><p>A</p></li>
         | 
| 1723 | 
            -
                          <li id="Na1"><p>A</p></li>
         | 
| 1724 | 
            -
                        </ol>
         | 
| 1725 | 
            -
                        <ol id="N2" start="3">
         | 
| 1726 | 
            -
                          <li id="Nb"><p>A</p></li>
         | 
| 1727 | 
            -
                          <li id="Nb1"><p>A</p></li>
         | 
| 1728 | 
            -
                        </ol>
         | 
| 1729 | 
            -
                        <ol id="N3" start="6">
         | 
| 1730 | 
            -
                          <li id="Nc"><p>A</p></li>
         | 
| 1731 | 
            -
                          <li id="Nc1"><p>A</p></li>
         | 
| 1732 | 
            -
                        </ol>
         | 
| 1733 | 
            -
                      </clause>
         | 
| 1734 | 
            -
                    </sections>
         | 
| 1735 | 
            -
                  </iso-standard>
         | 
| 1736 | 
            -
                INPUT
         | 
| 1737 | 
            -
                output = <<~OUTPUT
         | 
| 1738 | 
            -
                  <foreword displayorder='1'>
         | 
| 1739 | 
            -
                    <p><xref target='Na'>Clause 1, List 1 a)</xref></p>
         | 
| 1740 | 
            -
                  </foreword>
         | 
| 1741 | 
            -
                OUTPUT
         | 
| 1742 | 
            -
                expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert.new({})
         | 
| 1743 | 
            -
                .convert("test", input, true))
         | 
| 1744 | 
            -
                .at("//xmlns:foreword").to_xml))
         | 
| 1745 | 
            -
                  .to be_equivalent_to xmlpp(output)
         | 
| 1746 | 
            -
              end
         | 
| 1747 | 
            -
            end
         |