spec/isodoc/xref_spec.rb in isodoc-0.5.8 vs spec/isodoc/xref_spec.rb in isodoc-0.5.9

- old
+ new

@@ -2,56 +2,58 @@ RSpec.describe IsoDoc do it "cross-references notes" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)). to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <note id="N"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </note> <p><xref target="N"/></p> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <note id="note1"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </note> <note id="note2"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p> </note> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <note id="AN"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </note> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <note id="Anote1"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </note> <note id="Anote2"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p> </note> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -65,12 +67,12 @@ <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> <a href="#N">Clause 1, Note</a> - <a href="#note1">4.1, Note 1</a> - <a href="#note2">4.1, Note 2</a> + <a href="#note1">3.1, Note 1</a> + <a href="#note2">3.1, Note 2</a> <a href="#AN">A.1, Note</a> <a href="#Anote1">A.2, Note 1</a> <a href="#Anote2">A.2, Note 2</a> </p> </div> @@ -80,17 +82,17 @@ <div class="WordSection3"> <p class="zzSTDTitle1"/> <div id="scope"> <h1>1.&#160; Scope</h1> <div id="N" class="Note"> - <p class="Note">NOTE&#160; These results are based on a study carried out on three different types of kernel.</p> + <p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p> </div> <p> <a href="#N">Note</a> </p> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -98,26 +100,26 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> - <div id="note1" class="Note"><p class="Note">NOTE 1&#160; These results are based on a study carried out on three different types of kernel.</p></div> - <div id="note2" class="Note"><p class="Note">NOTE 2&#160; These results are based on a study carried out on three different types of kernel.</p></div> + <div id="note1" class="Note"><p class="Note"><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div> + <div id="note2" class="Note"><p class="Note"><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div> <p> <a href="#note1">Note 1</a> <a href="#note2">Note 2</a> </p> </div> </div> <br/> <div id="annex1" class="Section3"> <div id="annex1a"> - <div id="AN" class="Note"><p class="Note">NOTE&#160; These results are based on a study carried out on three different types of kernel.</p></div> + <div id="AN" class="Note"><p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div> </div> <div id="annex1b"> - <div id="Anote1" class="Note"><p class="Note">NOTE 1&#160; These results are based on a study carried out on three different types of kernel.</p></div> - <div id="Anote2" class="Note"><p class="Note">NOTE 2&#160; These results are based on a study carried out on three different types of kernel.</p></div> + <div id="Anote1" class="Note"><p class="Note"><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div> + <div id="Anote2" class="Note"><p class="Note"><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div> </div> </div> </div> </body> </head> @@ -126,60 +128,62 @@ end it "cross-references figures" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword id="fwd"> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <figure id="N"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> <p><xref target="N"/></p> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <figure id="note1"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> <figure id="note2"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <figure id="AN"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <figure id="Anote1"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> <figure id="Anote2"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -210,16 +214,16 @@ <div id="scope"> <h1>1.&#160; Scope</h1> <div id="N" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure 1&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure 1&#160;&#8212; Split-it-right sample divider</p></div> <p> <a href="#N">Figure 1</a> </p> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -227,40 +231,40 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> <div id="note1" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure 2&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure 2&#160;&#8212; Split-it-right sample divider</p></div> <div id="note2" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure 3&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure 3&#160;&#8212; Split-it-right sample divider</p></div> <p> <a href="#note1">Figure 2</a> <a href="#note2">Figure 3</a> </p> </div> </div> <br/> <div id="annex1" class="Section3"> <div id="annex1a"> <div id="AN" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure A.1&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure A.1&#160;&#8212; Split-it-right sample divider</p></div> </div> <div id="annex1b"> <div id="Anote1" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure A.2&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure A.2&#160;&#8212; Split-it-right sample divider</p></div> <div id="Anote2" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure A.3&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure A.3&#160;&#8212; Split-it-right sample divider</p></div> </div> </div> </div> </body> </head> @@ -269,26 +273,28 @@ end it "cross-references subfigures" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword id="fwd"> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <figure id="N"> <figure id="note1"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> @@ -296,28 +302,28 @@ <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> </figure> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> - </subsection> - <subsection id="annex1b"> + <clause id="annex1a"> + </clause> + <clause id="annex1b"> <figure id="AN"> <figure id="Anote1"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> <figure id="Anote2"> <name>Split-it-right sample divider</name> <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/> </figure> </figure> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -346,11 +352,11 @@ <div class="WordSection3"> <p class="zzSTDTitle1"/> <div id="scope"> <h1>1.&#160; Scope</h1> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -358,21 +364,21 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> <div id="N" class="figure"> <div id="note1" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure 1-1&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure 1-1&#160;&#8212; Split-it-right sample divider</p></div> <div id="note2" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure 1-2&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure 1-2&#160;&#8212; Split-it-right sample divider</p></div> </div> <p> <a href="#note1">Figure 1-1</a> <a href="#note2">Figure 1-2</a> </p> </div> </div> <br/> @@ -382,15 +388,15 @@ <div id="annex1b"> <div id="AN" class="figure"> <div id="Anote1" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure A.1-1&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure A.1-1&#160;&#8212; Split-it-right sample divider</p></div> <div id="Anote2" class="figure"> <img src="rice_images/rice_image1.png"/> - <p class="FigureTitle" align="center"><b>Figure A.1-2&#160;&#8212; Split-it-right sample divider</b></p></div> + <p class="FigureTitle" align="center">Figure A.1-2&#160;&#8212; Split-it-right sample divider</p></div> </div> </div> </div> </div> </body> @@ -400,54 +406,56 @@ end it "cross-references examples" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <example id="N"> <p>Hello</p> </example> <p><xref target="N"/></p> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <example id="note1"> <p>Hello</p> </example> <example id="note2"> <p>Hello</p> </example> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <example id="AN"> <p>Hello</p> </example> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <example id="Anote1"> <p>Hello</p> </example> <example id="Anote2"> <p>Hello</p> </example> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -461,12 +469,12 @@ <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> <a href="#N">Clause 1, Example</a> - <a href="#note1">4.1, Example 1</a> - <a href="#note2">4.1, Example 2</a> + <a href="#note1">3.1, Example 1</a> + <a href="#note2">3.1, Example 2</a> <a href="#AN">A.1, Example</a> <a href="#Anote1">A.2, Example 1</a> <a href="#Anote2">A.2, Example 2</a> </p> </div> @@ -477,21 +485,21 @@ <p class="zzSTDTitle1"/> <div id="scope"> <h1>1.&#160; Scope</h1> <table id="N" class="example"> <tr> - <td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE</td> - <td valign="top"> + <td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE</td> + <td valign="top" class="example"> <p>Hello</p> </td> </tr> </table> <p> <a href="#N">Example</a> </p> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -499,33 +507,33 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> - <table id="note1" class="example"><tr><td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top"> + <table id="note1" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top" class="example"> <p>Hello</p> </td></tr></table> - <table id="note2" class="example"><tr><td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 2</td><td valign="top"> + <table id="note2" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 2</td><td valign="top" class="example"> <p>Hello</p> </td></tr></table> <p> <a href="#note1">Example 1</a> <a href="#note2">Example 2</a> </p> </div> </div> <br/> <div id="annex1" class="Section3"> <div id="annex1a"> - <table id="AN" class="example"><tr><td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE</td><td valign="top"> + <table id="AN" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE</td><td valign="top" class="example"> <p>Hello</p> </td></tr></table> </div> <div id="annex1b"> - <table id="Anote1" class="example"><tr><td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top"> + <table id="Anote1" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top" class="example"> <p>Hello</p> </td></tr></table> - <table id="Anote2" class="example"><tr><td width="110pt" valign="top" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 2</td><td valign="top"> + <table id="Anote2" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 2</td><td valign="top" class="example"> <p>Hello</p> </td></tr></table> </div> </div> </div> @@ -536,54 +544,56 @@ end it "cross-references formulae" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <formula id="N"> <stem type="AsciiMath">r = 1 %</stem> </formula> <p><xref target="N"/></p> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <formula id="note1"> <stem type="AsciiMath">r = 1 %</stem> </formula> <formula id="note2"> <stem type="AsciiMath">r = 1 %</stem> </formula> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <formula id="AN"> <stem type="AsciiMath">r = 1 %</stem> </formula> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <formula id="Anote1"> <stem type="AsciiMath">r = 1 %</stem> </formula> <formula id="Anote2"> <stem type="AsciiMath">r = 1 %</stem> </formula> - </subsection> + </clause> </annex> </iso-standard> <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934"> <stem type="AsciiMath">r = 1 %</stem> @@ -594,10 +604,11 @@ <dd> <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p> </dd> </dl></formula> </foreword> + </preface> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title>test</title> @@ -610,12 +621,12 @@ <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> <a href="#N">Clause 1, Formula (1)</a> - <a href="#note1">4.1, Formula (2)</a> - <a href="#note2">4.1, Formula (3)</a> + <a href="#note1">3.1, Formula (2)</a> + <a href="#note2">3.1, Formula (3)</a> <a href="#AN">A.1, Formula (A.1)</a> <a href="#Anote1">A.2, Formula (A.2)</a> <a href="#Anote2">A.2, Formula (A.3)</a> </p> </div> @@ -629,11 +640,11 @@ <div id="N" class="formula"><span class="stem">(#(r = 1 %)#)</span>&#160; (1)</div> <p> <a href="#N">Formula (1)</a> </p> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -641,11 +652,11 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> <div id="note1" class="formula"><span class="stem">(#(r = 1 %)#)</span>&#160; (2)</div> <div id="note2" class="formula"><span class="stem">(#(r = 1 %)#)</span>&#160; (3)</div> <p> <a href="#note1">Formula (2)</a> <a href="#note2">Formula (3)</a> </p> </div> @@ -668,20 +679,22 @@ end it "cross-references tables" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <table id="N"> <name>Repeatability and reproducibility of husked rice yield</name> <tbody> @@ -694,11 +707,11 @@ </table> <p><xref target="N"/></p> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <table id="note1"> <name>Repeatability and reproducibility of husked rice yield</name> <tbody> <tr> <td align="left">Number of laboratories retained after eliminating outliers</td> @@ -716,27 +729,27 @@ <td align="center">11</td> </tr> </tbody> </table> <p> <xref target="note1"/> <xref target="note2"/> </p> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <table id="AN"> <name>Repeatability and reproducibility of husked rice yield</name> <tbody> <tr> <td align="left">Number of laboratories retained after eliminating outliers</td> <td align="center">13</td> <td align="center">11</td> </tr> </tbody> </table> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <table id="Anote1"> <name>Repeatability and reproducibility of husked rice yield</name> <tbody> <tr> <td align="left">Number of laboratories retained after eliminating outliers</td> @@ -753,11 +766,11 @@ <td align="center">13</td> <td align="center">11</td> </tr> </tbody> </table> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -786,11 +799,11 @@ <div class="WordSection3"> <p class="zzSTDTitle1"/> <div id="scope"> <h1>1.&#160; Scope</h1> <p class="TableTitle" align="center"> - <b>Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield</b> + Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield </p> <table id="N" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"> <tbody> <tr> <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td> @@ -801,11 +814,11 @@ </table> <p> <a href="#N">Table 1</a> </p> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -813,25 +826,25 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> - <p class="TableTitle" align="center"><b>Table 2&#160;&#8212; Repeatability and reproducibility of husked rice yield</b></p><table id="note1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> - <p class="TableTitle" align="center"><b>Table 3&#160;&#8212; Repeatability and reproducibility of husked rice yield</b></p><table id="note2" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> + <p class="TableTitle" align="center">Table 2&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="note1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> + <p class="TableTitle" align="center">Table 3&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="note2" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> <p> <a href="#note1">Table 2</a> <a href="#note2">Table 3</a> </p> </div> </div> <br/> <div id="annex1" class="Section3"> <div id="annex1a"> - <p class="TableTitle" align="center"><b>Table A.1&#160;&#8212; Repeatability and reproducibility of husked rice yield</b></p><table id="AN" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> + <p class="TableTitle" align="center">Table A.1&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="AN" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> </div> <div id="annex1b"> - <p class="TableTitle" align="center"><b>Table A.2&#160;&#8212; Repeatability and reproducibility of husked rice yield</b></p><table id="Anote1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> - <p class="TableTitle" align="center"><b>Table A.3&#160;&#8212; Repeatability and reproducibility of husked rice yield</b></p><table id="Anote2" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> + <p class="TableTitle" align="center">Table A.2&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="Anote1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> + <p class="TableTitle" align="center">Table A.3&#160;&#8212; Repeatability and reproducibility of husked rice yield</p><table id="Anote2" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Number of laboratories retained after eliminating outliers</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">13</td><td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">11</td></tr></tbody></table> </div> </div> </div> </body> </head> @@ -840,17 +853,19 @@ end it "cross-references term notes" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="note1"/> <xref target="note2"/> <xref target="note3"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> </clause> <terms id="terms"> <term id="_waxy_rice"><preferred>waxy rice</preferred> @@ -879,36 +894,36 @@ <div class="WordSection2"> <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> - <a href="#note1">3.1, Note 1</a> - <a href="#note2">3.2, Note 1</a> - <a href="#note3">3.2, Note 2</a> + <a href="#note1">2.1, Note 1</a> + <a href="#note2">2.2, Note 1</a> + <a href="#note3">2.2, Note 2</a> </p> </div> <p>&#160;</p> </div> <br/> <div class="WordSection3"> <p class="zzSTDTitle1"/> <div id="scope"> <h1>1.&#160; Scope</h1> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>For the purposes of this document, + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>For the purposes of this document, the following terms and definitions apply.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li> <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> - <p class="TermNum" id="_waxy_rice">3.1</p><p class="Terms">waxy rice</p> - <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">3.2</p><p class="Terms">nonwaxy rice</p> + <p class="TermNum" id="_waxy_rice">2.1</p><p class="Terms" style="text-align:left;">waxy rice</p> + <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2</p><p class="Terms" style="text-align:left;">nonwaxy rice</p> <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div> <div class="Note"><p class="Note">Note 2 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div></div> </div> </body> </head> @@ -917,10 +932,11 @@ end it "cross-references sections" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword obligation="informative"> <title>Foreword</title> <p id="A">This is a preamble <xref target="C"/> <xref target="D"/> @@ -933,20 +949,21 @@ <xref target="N"/> <xref target="O"/> <xref target="P"/> <xref target="Q"/> <xref target="Q1"/> + <xref target="Q2"/> <xref target="R"/> </p> </foreword> - <introduction id="B" obligation="informative"><title>Introduction</title><subsection id="C" inline-header="false" obligation="informative"> + <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative"> <title>Introduction Subsection</title> - </subsection> + </clause> <patent-notice> <p>This is patent boilerplate</p> </patent-notice> - </introduction><sections> + </introduction></preface><sections> <clause id="D" obligation="normative"> <title>Scope</title> <p id="E">Text</p> </clause> @@ -967,33 +984,37 @@ <dl> <dt>Symbol</dt> <dd>Definition</dd> </dl> </symbols-abbrevs> - <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><subsection id="N" inline-header="false" obligation="normative"> + <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative"> <title>Introduction</title> - </subsection> - <subsection id="O" inline-header="false" obligation="normative"> + </clause> + <clause id="O" inline-header="false" obligation="normative"> <title>Clause 4.2</title> - </subsection></clause> + </clause></clause> </sections><annex id="P" inline-header="false" obligation="normative"> <title>Annex</title> - <subsection id="Q" inline-header="false" obligation="normative"> + <clause id="Q" inline-header="false" obligation="normative"> <title>Annex A.1</title> - <subsection id="Q1" inline-header="false" obligation="normative"> + <clause id="Q1" inline-header="false" obligation="normative"> <title>Annex A.1a</title> - </subsection> - </subsection> - </annex><references id="R" obligation="informative"> + </clause> + </clause> + <appendix id="Q2" inline-header="false" obligation="normative"> + <title>An Appendix</title> + </appendix> + </annex><bibliography><references id="R" obligation="informative"> <title>Normative References</title> </references><clause id="S" obligation="informative"> <title>Bibliography</title> <references id="T" obligation="informative"> <title>Bibliography Subsection</title> </references> </clause> + </bibliography> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title>test</title> @@ -1018,10 +1039,11 @@ <a href="#N">5.1</a> <a href="#O">5.2</a> <a href="#P">Annex A</a> <a href="#Q">A.1</a> <a href="#Q1">A.1.1</a> + <a href="#Q2">Annex A, Appendix 1</a> <a href="#R">Clause 2</a> </p> </div> <br/> <div class="Section3" id="B"> @@ -1056,11 +1078,11 @@ <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> <div id="I"> <h2>3.1. Normal Terms</h2> <p class="TermNum" id="J">3.1.1</p> - <p class="Terms">Term2</p> + <p class="Terms" style="text-align:left;">Term2</p> </div><div id="K"><h2>3.2. Symbols and Abbreviated Terms</h2> <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl> </div></div> <div id="L" class="Symbols"> @@ -1088,10 +1110,13 @@ <h2>A.1. Annex A.1</h2> <div id="Q1"> <h3>A.1.1. Annex A.1a</h3> </div> </div> + <div id="Q2"> + <h2>Appendix 1. An Appendix</h2> + </div> </div> <br/> <div> <h1 class="Section3">Bibliography</h1> <div> @@ -1106,52 +1131,54 @@ end it "cross-references lists" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <ol id="N"> <li><p>A</p></li> </ol> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <ol id="note1"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </ol> <ol id="note2"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p> </ol> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <ol id="AN"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </ol> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <ol id="Anote1"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </ol> <ol id="Anote2"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p> </ol> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -1165,12 +1192,12 @@ <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> <a href="#N">Clause 1, List</a> - <a href="#note1">4.1, List 1</a> - <a href="#note2">4.1, List 2</a> + <a href="#note1">3.1, List 1</a> + <a href="#note2">3.1, List 2</a> <a href="#AN">A.1, List</a> <a href="#Anote1">A.2, List 1</a> <a href="#Anote2">A.2, List 2</a> </p> </div> @@ -1183,11 +1210,11 @@ <h1>1.&#160; Scope</h1> <ol type="a"> <li><p>A</p></li> </ol> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -1195,11 +1222,11 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> <ol type="a"> <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p> </ol> <ol type="a"> @@ -1231,52 +1258,54 @@ end it "cross-references list items" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <ol id="N1"> <li id="N"><p>A</p></li> </ol> </clause> <terms id="terms"/> <clause id="widgets"><title>Widgets</title> - <subsection id="widgets1"> + <clause id="widgets1"> <ol id="note1l"> <li id="note1"><p>A</p></li> </ol> <ol id="note2l"> <li id="note2"><p>A</p></li> </ol> - </subsection> </clause> + </clause> </sections> <annex id="annex1"> - <subsection id="annex1a"> + <clause id="annex1a"> <ol id="ANl"> <li id="AN"><p>A</p></li> </ol> - </subsection> - <subsection id="annex1b"> + </clause> + <clause id="annex1b"> <ol id="Anote1l"> <li id="Anote1"><p>A</p></li> </ol> <ol id="Anote2l"> <li id="Anote2"><p>A</p></li> </ol> - </subsection> + </clause> </annex> </iso-standard> INPUT <html xmlns:epub="http://www.idpf.org/2007/ops"> <head> @@ -1290,12 +1319,12 @@ <br/> <div> <h1 class="ForewordTitle">Foreword</h1> <p> <a href="#N">Clause 1, a)</a> - <a href="#note1">4.1, List 1 a)</a> - <a href="#note2">4.1, List 2 a)</a> + <a href="#note1">3.1, List 1 a)</a> + <a href="#note2">3.1, List 2 a)</a> <a href="#AN">A.1, a)</a> <a href="#Anote1">A.2, List 1 a)</a> <a href="#Anote2">A.2, List 2 a)</a> </p> </div> @@ -1308,11 +1337,11 @@ <h1>1.&#160; Scope</h1> <ol type="a"> <li><p>A</p></li> </ol> </div> - <div id="terms"><h1>3.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> + <div id="terms"><h1>2.&#160; Terms and Definitions</h1><p>No terms and definitions are listed in this document.</p> <p>ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p> <ul> <li> <p>ISO Online browsing platform: available at @@ -1320,11 +1349,11 @@ <li> <p>IEC Electropedia: available at <a href="http://www.electropedia.org">http://www.electropedia.org</a> </p> </li> </ul> </div> <div id="widgets"> - <h1>4.&#160; Widgets</h1> + <h1>3.&#160; Widgets</h1> <div id="widgets1"> <ol type="a"> <li><p>A</p></li> </ol> <ol type="a"> @@ -1356,19 +1385,21 @@ end it "cross-references nested list items" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" <iso-standard xmlns="http://riboseinc.com/isoxml"> + <preface> <foreword> <p> <xref target="N"/> <xref target="note1"/> <xref target="note2"/> <xref target="AN"/> <xref target="Anote1"/> <xref target="Anote2"/> </p> </foreword> + </preface> <sections> <clause id="scope"><title>Scope</title> <ol id="N1"> <li id="N"><p>A</p> <ol>