lib/asciidoctor/gb/isodoc.rng in asciidoctor-gb-0.1.5 vs lib/asciidoctor/gb/isodoc.rng in asciidoctor-gb-0.2.2

- old
+ new

@@ -15,11 +15,12 @@ DO NOT introduce a namespace here. We do not want a distinct namespace for these elements, and a distinct namespace for any grammar inheriting these elements; we just want one namespace for any child grammars of this. --> -<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"> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="biblio.rng"/> <start> <ref name="standard-document"/> </start> <define name="standard-document"> <element name="standard-document"> @@ -41,93 +42,57 @@ <define name="bibdata"> <element name="bibdata"> <ref name="BibData"/> </element> </define> - <define name="docrelation"> - <element name="relation"> - <attribute name="type"> - <choice> - <value>parent</value> - <value>child</value> - <value>obsoletes</value> - <value>updates</value> - <value>complements</value> - <value>derivedFrom</value> - <value>adoptedFrom</value> - <value>equivalent</value> - <value>identical</value> - <value>nonequivalent</value> - </choice> - </attribute> - <element name="bibitem"> - <ref name="BibliographicItem"/> - </element> - <zeroOrMore> - <ref name="locality"/> - </zeroOrMore> - </element> - </define> <define name="status"> <element name="status"> <ref name="FormattedString"/> </element> </define> - <define name="language"> - <element name="language"> - <text/> - </element> - </define> - <define name="script"> - <a:documentation>ISO-639</a:documentation> - <element name="script"> - <text/> - </element> - </define> <define name="version"> - <a:documentation>ISO-15924: Latn</a:documentation> <element name="version"> <optional> - <ref name="edition"/> + <ref name="vedition"/> </optional> <optional> <ref name="revision-date"/> </optional> <zeroOrMore> - <ref name="version"/> + <ref name="draft"/> </zeroOrMore> </element> </define> - <define name="edition"> + <define name="vedition"> <element name="edition"> <data type="int"/> </element> </define> <define name="revision-date"> <element name="revision-date"> <data type="date"/> </element> </define> - <define name="version"> - <element name="version"> + <define name="draft"> + <element name="draft"> <text/> </element> </define> <define name="sections"> <element name="sections"> <oneOrMore> <choice> <ref name="content"/> <ref name="clause"/> <ref name="terms"/> - <ref name="symbols-abbrevs"/> + <ref name="definitions"/> </choice> </oneOrMore> </element> </define> - <define name="symbols-abbrevs"> - <element name="symbols-abbrevs"> + <define name="definitions"> + <element name="definitions"> <optional> <attribute name="id"> <data type="ID"/> </attribute> </optional> @@ -146,14 +111,30 @@ <element name="content"> <ref name="Content-Section"/> </element> </define> <define name="content-subsection"> - <element name="subsection"> + <element name="clause"> <ref name="Content-Section"/> </element> </define> + <define name="Basic-Section"> + <optional> + <attribute name="id"> + <data type="ID"/> + </attribute> + </optional> + <optional> + <ref name="section-title"/> + </optional> + <oneOrMore> + <ref name="BasicBlock"/> + </oneOrMore> + <zeroOrMore> + <ref name="note"/> + </zeroOrMore> + </define> <define name="Content-Section"> <optional> <attribute name="id"> <data type="ID"/> </attribute> @@ -202,11 +183,11 @@ <ref name="clause-subsection"/> </oneOrMore> </choice> </define> <define name="clause-subsection"> - <element name="subsection"> + <element name="clause"> <ref name="Clause-Section"/> </element> </define> <define name="annex"> <element name="annex"> @@ -452,11 +433,11 @@ <data type="ID"/> </attribute> <attribute name="reviewer"/> <optional> <attribute name="date"> - <data type="date"/> + <data type="dateTime"/> </attribute> </optional> <attribute name="from"> <data type="IDREF"/> </attribute> @@ -744,10 +725,15 @@ <ref name="hr"/> <ref name="pagebreak"/> <ref name="bookmark"/> </choice> </define> + <define name="source"> + <element name="source"> + <data type="anyURI"/> + </element> + </define> <define name="em"> <element name="em"> <text/> </element> </define> @@ -997,421 +983,10 @@ <zeroOrMore> <ref name="paragraph-with-footnote"/> </zeroOrMore> </element> </define> - <define name="LocalizedString"> - <optional> - <!-- multiple languages and scripts possible: comma delimit them if so --> - <attribute name="language"/> - </optional> - <optional> - <attribute name="script"/> - </optional> - <text/> - </define> - <!-- - Unlike UML, change type to format: type is overloaded - Would be need if plain were default value and could omit the attribute - Added LocalizedStringOrXsAny - --> - <define name="FormattedString"> - <optional> - <!-- attribute format { ( "plain" | "html" | "docbook" | "tei" | "asciidoc" | "markdown" ) }?, --> - <attribute name="format"> - <choice> - <value>text/plain</value> - <value>text/html</value> - <value>application/docbook+xml</value> - <value>application/tei+xml</value> - <value>text/x-asciidoc</value> - <value>text/markdown</value> - <value>application/x-isodoc+xml</value> - <text/> - </choice> - </attribute> - </optional> - <ref name="LocalizedStringOrXsAny"/> - </define> - <define name="LocalizedStringOrXsAny"> - <optional> - <!-- multiple languages and scripts possible: comma delimit them if so --> - <attribute name="language"/> - </optional> - <optional> - <attribute name="script"/> - </optional> - <oneOrMore> - <choice> - <text/> - <ref name="AnyElement"/> - </choice> - </oneOrMore> - </define> - <define name="contributor"> - <element name="contributor"> - <zeroOrMore> - <ref name="role"/> - </zeroOrMore> - <ref name="ContributorInfo"/> - </element> - </define> - <define name="role"> - <element name="role"> - <optional> - <attribute name="type"> - <choice> - <value>author</value> - <value>edition</value> - <value>publisher</value> - <text/> - </choice> - </attribute> - </optional> - <zeroOrMore> - <ref name="roledescription"/> - </zeroOrMore> - </element> - </define> - <define name="ContributorInfo"> - <choice> - <ref name="person"/> - <ref name="organization"/> - </choice> - </define> - <define name="roledescription"> - <element name="description"> - <ref name="FormattedString"/> - </element> - </define> - <define name="person"> - <element name="person"> - <optional> - <ref name="fullname"/> - </optional> - <zeroOrMore> - <ref name="affiliation"/> - </zeroOrMore> - <zeroOrMore> - <ref name="person-identifier"/> - </zeroOrMore> - <zeroOrMore> - <ref name="contact"/> - </zeroOrMore> - <optional> - <ref name="uri"/> - </optional> - </element> - </define> - <define name="fullname"> - <element name="name"> - <zeroOrMore> - <ref name="prefix"/> - </zeroOrMore> - <zeroOrMore> - <ref name="forename"/> - </zeroOrMore> - <zeroOrMore> - <ref name="initial"/> - </zeroOrMore> - <ref name="surname"/> - <zeroOrMore> - <ref name="addition"/> - </zeroOrMore> - </element> - </define> - <define name="prefix"> - <element name="prefix"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="initial"> - <element name="initial"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="addition"> - <element name="addition"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="surname"> - <element name="surname"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="forename"> - <element name="forename"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="affiliation"> - <element name="affiliation"> - <optional> - <ref name="affiliationname"/> - </optional> - <zeroOrMore> - <ref name="affiliationdescription"/> - </zeroOrMore> - <ref name="organization"/> - </element> - </define> - <define name="affiliationname"> - <element name="name"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="affiliationdescription"> - <element name="description"> - <ref name="FormattedString"/> - </element> - </define> - <define name="organization"> - <element name="organization"> - <ref name="orgname"/> - <optional> - <ref name="uri"/> - </optional> - <zeroOrMore> - <ref name="org-identifier"/> - </zeroOrMore> - <zeroOrMore> - <ref name="contact"/> - </zeroOrMore> - </element> - </define> - <define name="orgname"> - <element name="name"> - <ref name="LocalizedString"/> - </element> - </define> - <define name="uri"> - <element name="uri"> - <data type="anyURI"/> - </element> - </define> - <!-- TODO may change --> - <define name="contact"> - <choice> - <ref name="address"/> - <ref name="phone"/> - <ref name="email"/> - <ref name="uri"/> - </choice> - </define> - <define name="phone"> - <element name="phone"> - <text/> - </element> - </define> - <define name="email"> - <element name="email"> - <text/> - </element> - </define> - <define name="address"> - <element name="address"> - <oneOrMore> - <!-- iso191606 TODO --> - <ref name="street"/> - </oneOrMore> - <ref name="city"/> - <optional> - <ref name="state"/> - </optional> - <ref name="country"/> - <optional> - <ref name="postcode"/> - </optional> - </element> - </define> - <define name="street"> - <element name="street"> - <text/> - </element> - </define> - <define name="city"> - <element name="city"> - <text/> - </element> - </define> - <define name="state"> - <element name="state"> - <text/> - </element> - </define> - <define name="country"> - <element name="country"> - <text/> - </element> - </define> - <define name="postcode"> - <element name="postcode"> - <text/> - </element> - </define> - <define name="person-identifier"> - <element name="identifier"> - <attribute name="type"> - <choice> - <value>isni</value> - <value>uri</value> - </choice> - </attribute> - <text/> - </element> - </define> - <define name="org-identifier"> - <element name="identifier"> - <attribute name="type"> - <choice> - <value>orcid</value> - <value>uri</value> - </choice> - </attribute> - <text/> - </element> - </define> - <define name="citation"> - <element name="citation"> - <ref name="CitationType"/> - </element> - </define> - <define name="CitationType"> - <attribute name="bibitemid"> - <data type="IDREF"/> - </attribute> - <zeroOrMore> - <ref name="locality"/> - </zeroOrMore> - <optional> - <ref name="date"/> - </optional> - </define> - <define name="date"> - <element name="date"> - <choice> - <data type="gYear"/> - <data type="date"/> - </choice> - </element> - </define> - <define name="locality"> - <element name="locality"> - <attribute name="type"> - <choice> - <value>section</value> - <value>clause</value> - <value>part</value> - <value>paragraph</value> - <value>chapter</value> - <value>page</value> - <value>whole</value> - <value>table</value> - <value>annex</value> - <value>figure</value> - <value>note</value> - <value>example</value> - </choice> - </attribute> - <ref name="referenceFrom"/> - <optional> - <ref name="referenceTo"/> - </optional> - </element> - </define> - <define name="referenceFrom"> - <element name="referenceFrom"> - <text/> - </element> - </define> - <define name="referenceTo"> - <element name="referenceTo"> - <text/> - </element> - </define> - <!-- unlike UML, has id attribute; that results from including bibitem in a docmodel --> - <define name="bibitem"> - <element name="bibitem"> - <attribute name="id"> - <data type="ID"/> - </attribute> - <ref name="BibliographicItem"/> - </element> - </define> - <define name="bibitem_no_id"> - <element name="bibitem"> - <ref name="BibliographicItem"/> - </element> - </define> - <define name="BibItemType" combine="choice"> - <choice> - <value>article</value> - <value>book</value> - <value>booklet</value> - <value>conference</value> - <value>manual</value> - <value>proceedings</value> - <value>presentation</value> - <value>thesis</value> - <value>techreport</value> - <value>standard</value> - <value>unpublished</value> - </choice> - </define> - <define name="BibliographicItem"> - <optional> - <attribute name="type"> - <ref name="BibItemType"/> - </attribute> - </optional> - <choice> - <oneOrMore> - <ref name="btitle"/> - </oneOrMore> - <ref name="formattedref"/> - </choice> - <optional> - <ref name="source"/> - </optional> - <zeroOrMore> - <ref name="docidentifier"/> - </zeroOrMore> - <zeroOrMore> - <ref name="bdate"/> - </zeroOrMore> - <zeroOrMore> - <ref name="contributor"/> - </zeroOrMore> - <optional> - <ref name="edition"/> - </optional> - <zeroOrMore> - <ref name="biblionote"/> - </zeroOrMore> - <zeroOrMore> - <ref name="partof"/> - </zeroOrMore> - <zeroOrMore> - <ref name="language"/> - </zeroOrMore> - <zeroOrMore> - <ref name="script"/> - </zeroOrMore> - <optional> - <ref name="abstract"/> - </optional> - <optional> - <ref name="status"/> - </optional> - <optional> - <ref name="copyright"/> - </optional> - <zeroOrMore> - <ref name="docrelation"/> - </zeroOrMore> - </define> <define name="BibData"> <optional> <attribute name="type"> <ref name="BibItemType"/> </attribute> @@ -1420,13 +995,13 @@ <ref name="btitle"/> </oneOrMore> <optional> <ref name="formattedref"/> </optional> - <optional> + <zeroOrMore> <ref name="source"/> - </optional> + </zeroOrMore> <zeroOrMore> <ref name="docidentifier"/> </zeroOrMore> <zeroOrMore> <ref name="bdate"/> @@ -1439,13 +1014,10 @@ </optional> <zeroOrMore> <ref name="biblionote"/> </zeroOrMore> <zeroOrMore> - <ref name="partof"/> - </zeroOrMore> - <zeroOrMore> <ref name="language"/> </zeroOrMore> <zeroOrMore> <ref name="script"/> </zeroOrMore> @@ -1457,107 +1029,7 @@ </optional> <ref name="copyright"/> <zeroOrMore> <ref name="docrelation"/> </zeroOrMore> - </define> - <define name="btitle"> - <element name="title"> - <ref name="FormattedString"/> - </element> - </define> - <define name="formattedref"> - <element name="formattedref"> - <ref name="FormattedString"/> - </element> - </define> - <define name="source"> - <element name="source"> - <data type="anyURI"/> - </element> - </define> - <define name="bdate"> - <element name="date"> - <attribute name="type"> - <choice> - <value>published</value> - <value>accessed</value> - <value>created</value> - <value>activated</value> - <value>obsoleted</value> - </choice> - </attribute> - <choice> - <data type="gYear"/> - <data type="date"/> - </choice> - </element> - </define> - <define name="docidentifier"> - <element name="docidentifier"> - <optional> - <attribute name="type"/> - </optional> - <text/> - </element> - </define> - <define name="biblionote"> - <element name="note"> - <ref name="FormattedString"/> - </element> - </define> - <define name="abstract"> - <element name="abstract"> - <ref name="FormattedString"/> - </element> - </define> - <define name="partof"> - <element name="partof"> - <ref name="BibliographicItem"/> - </element> - </define> - <define name="copyright"> - <element name="copyright"> - <ref name="from"/> - <optional> - <ref name="to"/> - </optional> - <ref name="owner"/> - </element> - </define> - <define name="from"> - <element name="from"> - <data type="gYear"/> - </element> - </define> - <define name="to"> - <element name="to"> - <data type="gYear"/> - </element> - </define> - <define name="owner"> - <element name="owner"> - <ref name="ContributorInfo"/> - </element> - </define> - <!-- - Anycontents = mixed { - https://github.com/relaxng/jing-trang/issues/211 - https://lists.oasis-open.org/archives/office/200808/msg00024.html - https://lists.oasis-open.org/archives/office/200808/msg00099.html - For this to work, we will actually strip any attributes in the Anycontents before - passing it for validation. Horrible I know, but there are no good alternatives - that also allow us to do grammar inheritance - (attribute * { text } | Any)* - Any* - } - --> - <define name="AnyElement"> - <element> - <anyName/> - <choice> - <text/> - <ref name="AnyElement"/> - </choice> - </element> </define> </grammar>