Skip to content

Commit

Permalink
rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed May 6, 2024
1 parent a675bb3 commit 328caf3
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 146 deletions.
45 changes: 22 additions & 23 deletions lib/metanorma/generic/biblio.rng
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<text/>
</element>
</define>
<define name="LocalizedString1">
<define name="LocalizedStringAttrs">
<optional>
<!-- multiple languages and scripts possible: comma delimit them if so -->
<attribute name="language"/>
Expand All @@ -106,6 +106,10 @@
<optional>
<attribute name="script"/>
</optional>
</define>
<define name="LocalizedString1">
<!-- multiple languages and scripts possible: comma delimit them if so -->
<ref name="LocalizedStringAttrs"/>
<text/>
</define>
<define name="LocalizedString">
Expand Down Expand Up @@ -142,16 +146,8 @@
<ref name="LocalizedStringOrXsAny"/>
</define>
<define name="LocalizedStringOrXsAny1">
<optional>
<!-- multiple languages and scripts possible: comma delimit them if so -->
<attribute name="language"/>
</optional>
<optional>
<attribute name="locale"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<!-- multiple languages and scripts possible: comma delimit them if so -->
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<choice>
<text/>
Expand Down Expand Up @@ -208,6 +204,7 @@
</define>
<define name="roledescription">
<element name="description">
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
Expand Down Expand Up @@ -335,6 +332,7 @@
</define>
<define name="affiliationdescription">
<element name="description">
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
Expand Down Expand Up @@ -948,6 +946,7 @@
<optional>
<attribute name="type"/>
</optional>
<ref name="LocalizedStringAttrs"/>
<zeroOrMore>
<ref name="TextElement"/>
</zeroOrMore>
Expand Down Expand Up @@ -1041,15 +1040,7 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="locale"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
Expand Down Expand Up @@ -1277,16 +1268,23 @@
<optional>
<attribute name="type"/>
</optional>
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
</element>
</define>
<define name="bibabstract">
<element name="abstract">
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
<ref name="LocalizedStringAttrs"/>
<choice>
<oneOrMore>
<ref name="BasicBlock"/>
</oneOrMore>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
</choice>
</element>
</define>
<define name="copyright">
Expand Down Expand Up @@ -1391,6 +1389,7 @@
</attribute>
<optional>
<element name="description">
<ref name="LocalizedStringAttrs"/>
<oneOrMore>
<ref name="TextElement"/>
</oneOrMore>
Expand Down
153 changes: 37 additions & 116 deletions lib/metanorma/generic/isodoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
these elements; we just want one namespace for any child grammars
of this.
-->
<!-- VERSION v1.3.0 -->
<!-- VERSION v1.3.1 -->
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href="reqt.rng"/>
<include href="basicdoc.rng">
Expand Down Expand Up @@ -1346,38 +1346,41 @@
</oneOrMore>
</element>
</define>
<define name="Section-Attributes">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<optional>
<attribute name="inline-header">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="number"/>
</optional>
<optional>
<attribute name="branch-number"/>
</optional>
<optional>
<attribute name="obligation">
<choice>
<value>normative</value>
<value>informative</value>
</choice>
</attribute>
</optional>
</define>
<define name="reference-clause">
<element name="clause">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<optional>
<attribute name="inline-header">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="number"/>
</optional>
<optional>
<attribute name="branch-number"/>
</optional>
<optional>
<attribute name="obligation">
<choice>
<value>normative</value>
<value>informative</value>
</choice>
</attribute>
</optional>
<ref name="Section-Attributes"/>
<optional>
<ref name="section-title"/>
</optional>
Expand Down Expand Up @@ -1566,36 +1569,7 @@
</element>
</define>
<define name="Content-Section">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<optional>
<attribute name="inline-header">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="obligation">
<choice>
<value>normative</value>
<value>informative</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="number"/>
</optional>
<optional>
<attribute name="branch-number"/>
</optional>
<ref name="Section-Attributes"/>
<optional>
<attribute name="type"/>
</optional>
Expand All @@ -1617,39 +1591,10 @@
</element>
</define>
<define name="Clause-Section">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<optional>
<attribute name="inline-header">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="obligation">
<choice>
<value>normative</value>
<value>informative</value>
</choice>
</attribute>
</optional>
<ref name="Section-Attributes"/>
<optional>
<attribute name="type"/>
</optional>
<optional>
<attribute name="number"/>
</optional>
<optional>
<attribute name="branch-number"/>
</optional>
<optional>
<ref name="section-title"/>
</optional>
Expand Down Expand Up @@ -1730,34 +1675,10 @@
</define>
<define name="terms">
<element name="terms">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<optional>
<attribute name="language"/>
</optional>
<optional>
<attribute name="script"/>
</optional>
<ref name="Section-Attributes"/>
<optional>
<attribute name="type"/>
</optional>
<optional>
<attribute name="number"/>
</optional>
<optional>
<attribute name="branch-number"/>
</optional>
<optional>
<attribute name="obligation">
<choice>
<value>normative</value>
<value>informative</value>
</choice>
</attribute>
</optional>
<optional>
<ref name="section-title"/>
</optional>
Expand Down
16 changes: 9 additions & 7 deletions spec/metanorma/processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@

output = <<~OUTPUT
<main class="main-section">
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<div id="H">
<h1 id='_'>Terms, Definitions, Symbols and Abbreviated Terms</h1>
<p class='Terms' style='text-align:left;' id='J'>
<strong/>&#xA0;Term2</p>
</div>
</main>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<div id="H">
<h1 id="_">
<a class="anchor" href="#H"/>
<a class="header" href="#H">Terms, Definitions, Symbols and Abbreviated Terms</a>
</h1>
<p class="Terms" style="text-align:left;" id="J"><strong/> Term2</p>
</div>
</main>
OUTPUT

processor.output(input, "test.xml", "test.html", :html)
Expand Down

0 comments on commit 328caf3

Please sign in to comment.