Skip to content

Commit e8b2e80

Browse files
committed
allow unnumbered clauses: metanorma/metanorma-standoc#887
1 parent 535eb9f commit e8b2e80

File tree

3 files changed

+46
-139
lines changed

3 files changed

+46
-139
lines changed

grammars/isodoc.rnc

+9-23
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,18 @@ bibliography =
441441
(references | reference-clause)+
442442
}
443443

444-
reference-clause =
445-
element clause {
444+
Section-Attributes =
446445
attribute id { xsd:ID }?,
447446
attribute language { text }?,
448447
attribute script { text }?,
449448
attribute inline-header { xsd:boolean }?,
450449
attribute number { text }?,
451450
attribute branch-number { text }?,
452-
attribute obligation { "normative" | "informative" }?,
451+
attribute obligation { "normative" | "informative" }?
452+
453+
reference-clause =
454+
element clause {
455+
Section-Attributes,
453456
section-title?,
454457
BasicBlock*,
455458
(
@@ -524,13 +527,7 @@ content-subsection =
524527
element clause { Content-Section }
525528

526529
Content-Section =
527-
attribute id { xsd:ID }?,
528-
attribute language { text }?,
529-
attribute script { text }?,
530-
attribute inline-header { xsd:boolean }?,
531-
attribute obligation { "normative" | "informative" }?,
532-
attribute number { text }?,
533-
attribute branch-number { text }?,
530+
Section-Attributes,
534531
attribute type { text }?,
535532
section-title?,
536533
( (BasicBlock*),
@@ -540,14 +537,8 @@ clause =
540537
element clause { Clause-Section }
541538

542539
Clause-Section =
543-
attribute id { xsd:ID }?,
544-
attribute language { text }?,
545-
attribute script { text }?,
546-
attribute inline-header { xsd:boolean }?,
547-
attribute obligation { "normative" | "informative" }?,
540+
Section-Attributes,
548541
attribute type { text }?,
549-
attribute number { text }?,
550-
attribute branch-number { text }?,
551542
section-title?,
552543
(
553544
( ( BasicBlock+ ) | amend ) |
@@ -577,13 +568,8 @@ annex =
577568

578569
terms =
579570
element terms {
580-
attribute id { xsd:ID }?,
581-
attribute language { text }?,
582-
attribute script { text }?,
571+
Section-Attributes,
583572
attribute type { text }?,
584-
attribute number { text }?,
585-
attribute branch-number { text }?,
586-
attribute obligation { "normative" | "informative" }?,
587573
section-title?,
588574
BasicBlock*,
589575
( (term | terms)+ | ( terms*, definitions?) )

grammars/isodoc.rng

+36-115
Original file line numberDiff line numberDiff line change
@@ -1345,38 +1345,41 @@
13451345
</oneOrMore>
13461346
</element>
13471347
</define>
1348+
<define name="Section-Attributes">
1349+
<optional>
1350+
<attribute name="id">
1351+
<data type="ID"/>
1352+
</attribute>
1353+
</optional>
1354+
<optional>
1355+
<attribute name="language"/>
1356+
</optional>
1357+
<optional>
1358+
<attribute name="script"/>
1359+
</optional>
1360+
<optional>
1361+
<attribute name="inline-header">
1362+
<data type="boolean"/>
1363+
</attribute>
1364+
</optional>
1365+
<optional>
1366+
<attribute name="number"/>
1367+
</optional>
1368+
<optional>
1369+
<attribute name="branch-number"/>
1370+
</optional>
1371+
<optional>
1372+
<attribute name="obligation">
1373+
<choice>
1374+
<value>normative</value>
1375+
<value>informative</value>
1376+
</choice>
1377+
</attribute>
1378+
</optional>
1379+
</define>
13481380
<define name="reference-clause">
13491381
<element name="clause">
1350-
<optional>
1351-
<attribute name="id">
1352-
<data type="ID"/>
1353-
</attribute>
1354-
</optional>
1355-
<optional>
1356-
<attribute name="language"/>
1357-
</optional>
1358-
<optional>
1359-
<attribute name="script"/>
1360-
</optional>
1361-
<optional>
1362-
<attribute name="inline-header">
1363-
<data type="boolean"/>
1364-
</attribute>
1365-
</optional>
1366-
<optional>
1367-
<attribute name="number"/>
1368-
</optional>
1369-
<optional>
1370-
<attribute name="branch-number"/>
1371-
</optional>
1372-
<optional>
1373-
<attribute name="obligation">
1374-
<choice>
1375-
<value>normative</value>
1376-
<value>informative</value>
1377-
</choice>
1378-
</attribute>
1379-
</optional>
1382+
<ref name="Section-Attributes"/>
13801383
<optional>
13811384
<ref name="section-title"/>
13821385
</optional>
@@ -1565,36 +1568,7 @@
15651568
</element>
15661569
</define>
15671570
<define name="Content-Section">
1568-
<optional>
1569-
<attribute name="id">
1570-
<data type="ID"/>
1571-
</attribute>
1572-
</optional>
1573-
<optional>
1574-
<attribute name="language"/>
1575-
</optional>
1576-
<optional>
1577-
<attribute name="script"/>
1578-
</optional>
1579-
<optional>
1580-
<attribute name="inline-header">
1581-
<data type="boolean"/>
1582-
</attribute>
1583-
</optional>
1584-
<optional>
1585-
<attribute name="obligation">
1586-
<choice>
1587-
<value>normative</value>
1588-
<value>informative</value>
1589-
</choice>
1590-
</attribute>
1591-
</optional>
1592-
<optional>
1593-
<attribute name="number"/>
1594-
</optional>
1595-
<optional>
1596-
<attribute name="branch-number"/>
1597-
</optional>
1571+
<ref name="Section-Attributes"/>
15981572
<optional>
15991573
<attribute name="type"/>
16001574
</optional>
@@ -1616,39 +1590,10 @@
16161590
</element>
16171591
</define>
16181592
<define name="Clause-Section">
1619-
<optional>
1620-
<attribute name="id">
1621-
<data type="ID"/>
1622-
</attribute>
1623-
</optional>
1624-
<optional>
1625-
<attribute name="language"/>
1626-
</optional>
1627-
<optional>
1628-
<attribute name="script"/>
1629-
</optional>
1630-
<optional>
1631-
<attribute name="inline-header">
1632-
<data type="boolean"/>
1633-
</attribute>
1634-
</optional>
1635-
<optional>
1636-
<attribute name="obligation">
1637-
<choice>
1638-
<value>normative</value>
1639-
<value>informative</value>
1640-
</choice>
1641-
</attribute>
1642-
</optional>
1593+
<ref name="Section-Attributes"/>
16431594
<optional>
16441595
<attribute name="type"/>
16451596
</optional>
1646-
<optional>
1647-
<attribute name="number"/>
1648-
</optional>
1649-
<optional>
1650-
<attribute name="branch-number"/>
1651-
</optional>
16521597
<optional>
16531598
<ref name="section-title"/>
16541599
</optional>
@@ -1729,34 +1674,10 @@
17291674
</define>
17301675
<define name="terms">
17311676
<element name="terms">
1732-
<optional>
1733-
<attribute name="id">
1734-
<data type="ID"/>
1735-
</attribute>
1736-
</optional>
1737-
<optional>
1738-
<attribute name="language"/>
1739-
</optional>
1740-
<optional>
1741-
<attribute name="script"/>
1742-
</optional>
1677+
<ref name="Section-Attributes"/>
17431678
<optional>
17441679
<attribute name="type"/>
17451680
</optional>
1746-
<optional>
1747-
<attribute name="number"/>
1748-
</optional>
1749-
<optional>
1750-
<attribute name="branch-number"/>
1751-
</optional>
1752-
<optional>
1753-
<attribute name="obligation">
1754-
<choice>
1755-
<value>normative</value>
1756-
<value>informative</value>
1757-
</choice>
1758-
</attribute>
1759-
</optional>
17601681
<optional>
17611682
<ref name="section-title"/>
17621683
</optional>

grammars/relaton-models

0 commit comments

Comments
 (0)