metanorma-iso 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +4 -0
  3. data/.gitignore +11 -0
  4. data/.hound.yml +3 -0
  5. data/.oss-guides.rubocop.yml +1077 -0
  6. data/.rubocop.ribose.yml +66 -0
  7. data/.rubocop.tb.yml +650 -0
  8. data/.rubocop.yml +15 -0
  9. data/.travis.yml +21 -0
  10. data/CODE_OF_CONDUCT.md +46 -0
  11. data/Gemfile +7 -0
  12. data/LICENSE +25 -0
  13. data/Makefile +39 -0
  14. data/README.adoc +882 -0
  15. data/Rakefile +6 -0
  16. data/asciidoctor-iso.gemspec.old +50 -0
  17. data/bin/rspec +18 -0
  18. data/docs/customisation.adoc +186 -0
  19. data/docs/guidance.adoc +436 -0
  20. data/docs/htmloutput.adoc +115 -0
  21. data/docs/quickstart.adoc +375 -0
  22. data/lib/asciidoctor-iso.rb +11 -0
  23. data/lib/asciidoctor/iso/base.rb +48 -0
  24. data/lib/asciidoctor/iso/biblio.rng +836 -0
  25. data/lib/asciidoctor/iso/cleanup.rb +39 -0
  26. data/lib/asciidoctor/iso/converter.rb +19 -0
  27. data/lib/asciidoctor/iso/front.rb +131 -0
  28. data/lib/asciidoctor/iso/isodoc.rng +1059 -0
  29. data/lib/asciidoctor/iso/isostandard.rnc +176 -0
  30. data/lib/asciidoctor/iso/isostandard.rng +1001 -0
  31. data/lib/asciidoctor/iso/section.rb +72 -0
  32. data/lib/asciidoctor/iso/validate.rb +190 -0
  33. data/lib/asciidoctor/iso/validate_requirements.rb +105 -0
  34. data/lib/asciidoctor/iso/validate_section.rb +214 -0
  35. data/lib/asciidoctor/iso/validate_style.rb +134 -0
  36. data/lib/asciidoctor/iso/version.rb +5 -0
  37. data/lib/isodoc/iso/html/header.html +206 -0
  38. data/lib/isodoc/iso/html/html_iso_intro.html +34 -0
  39. data/lib/isodoc/iso/html/html_iso_titlepage.html +34 -0
  40. data/lib/isodoc/iso/html/htmlstyle.scss +46 -0
  41. data/lib/isodoc/iso/html/isodoc.scss +696 -0
  42. data/lib/isodoc/iso/html/scripts.html +174 -0
  43. data/lib/isodoc/iso/html/style-human.scss +1277 -0
  44. data/lib/isodoc/iso/html/style-iso.scss +1257 -0
  45. data/lib/isodoc/iso/html/word_iso_intro.html +72 -0
  46. data/lib/isodoc/iso/html/word_iso_titlepage.html +62 -0
  47. data/lib/isodoc/iso/html/wordstyle.scss +1175 -0
  48. data/lib/isodoc/iso/html_convert.rb +118 -0
  49. data/lib/isodoc/iso/metadata.rb +107 -0
  50. data/lib/isodoc/iso/word_convert.rb +141 -0
  51. data/lib/metanorma/iso.rb +7 -0
  52. data/lib/metanorma/iso/processor.rb +44 -0
  53. data/spec/asciidoctor-iso/base_spec.rb +350 -0
  54. data/spec/asciidoctor-iso/blocks_spec.rb +469 -0
  55. data/spec/asciidoctor-iso/cleanup_spec.rb +765 -0
  56. data/spec/asciidoctor-iso/inline_spec.rb +162 -0
  57. data/spec/asciidoctor-iso/isobib_cache_spec.rb +332 -0
  58. data/spec/asciidoctor-iso/lists_spec.rb +190 -0
  59. data/spec/asciidoctor-iso/macros_spec.rb +111 -0
  60. data/spec/asciidoctor-iso/refs_spec.rb +643 -0
  61. data/spec/asciidoctor-iso/section_spec.rb +334 -0
  62. data/spec/asciidoctor-iso/table_spec.rb +307 -0
  63. data/spec/asciidoctor-iso/validate_spec.rb +907 -0
  64. data/spec/assets/header.html +7 -0
  65. data/spec/assets/html.css +2 -0
  66. data/spec/assets/htmlcover.html +4 -0
  67. data/spec/assets/htmlintro.html +5 -0
  68. data/spec/assets/i18n.yaml +2 -0
  69. data/spec/assets/iso.doc +1093 -0
  70. data/spec/assets/iso.headless.html +33 -0
  71. data/spec/assets/iso.html +278 -0
  72. data/spec/assets/iso.xml +8 -0
  73. data/spec/assets/rice_image1.png +0 -0
  74. data/spec/assets/scripts.html +3 -0
  75. data/spec/assets/std.css +2 -0
  76. data/spec/assets/word.css +2 -0
  77. data/spec/assets/wordcover.html +3 -0
  78. data/spec/assets/wordintro.html +4 -0
  79. data/spec/examples/103_01_02.html +247 -0
  80. data/spec/examples/english.yaml +69 -0
  81. data/spec/examples/iso_123_.xml +45 -0
  82. data/spec/examples/iso_123_all_parts.xml +45 -0
  83. data/spec/examples/iso_123_no_year_note.xml +46 -0
  84. data/spec/examples/iso_124_.xml +41 -0
  85. data/spec/examples/iso_216_.xml +47 -0
  86. data/spec/examples/iso_iec_12382_.xml +48 -0
  87. data/spec/examples/rice.adoc +715 -0
  88. data/spec/examples/rice.preview.html +1877 -0
  89. data/spec/examples/rice.sh +4 -0
  90. data/spec/examples/rice_images/rice_image1.png +0 -0
  91. data/spec/examples/rice_images/rice_image2.png +0 -0
  92. data/spec/examples/rice_images/rice_image3_1.png +0 -0
  93. data/spec/examples/rice_images/rice_image3_2.png +0 -0
  94. data/spec/examples/rice_images/rice_image3_3.png +0 -0
  95. data/spec/isodoc/i18n_spec.rb +642 -0
  96. data/spec/isodoc/iso_spec.rb +168 -0
  97. data/spec/isodoc/metadata_spec.rb +152 -0
  98. data/spec/isodoc/postproc_spec.rb +405 -0
  99. data/spec/isodoc/section_spec.rb +522 -0
  100. data/spec/isodoc/xref_spec.rb +1337 -0
  101. data/spec/metanorma/processor_spec.rb +70 -0
  102. data/spec/spec_helper.rb +227 -0
  103. metadata +402 -0
@@ -0,0 +1,176 @@
1
+ default namespace = "http://riboseinc.com/isoxml"
2
+ grammar { start = iso-standard standard-document = element standard-document { bibdata , version ? , sections + }
3
+ bibdata = element bibdata { BibliographicItem }
4
+ status = element status { FormattedString | ( stage , substage ? ) }
5
+ language = element language { ( "en" | "fr" ) }
6
+ script = element script { "Latn" }
7
+ version = element version { edition ? , revision-date ? , draft ? }
8
+ edition = element edition { xsd:int }
9
+ revision-date = element revision-date { xsd:date }
10
+ sections = element sections { content , content ? , clause , references , terms , clause + , annex * , references ? }
11
+ section-title = element title { text }
12
+ content = element content { Content-Section }
13
+ content-subsection = element subsection { Content-Section }
14
+ Content-Section = attribute id { xsd:ID } ? , section-title ? , ( BasicBlock + | content-subsection + ) clause = element clause { Clause-Section }
15
+ Clause-Section = attribute id { xsd:ID } ? , attribute inline-header { xsd:boolean } ? , section-title ? , ( BasicBlock + | clause-subsection + ) clause-subsection = element subsection { Clause-Section }
16
+ annex = element annex { attribute id { xsd:ID } ? , attribute inline-header { xsd:boolean } ? , attribute subtype { "normative" | "informative" } ? , section-title ? , BasicBlock * , clause-hanging-paragraph-with-footnote * }
17
+ references = element references { attribute id { xsd:ID } ? , section-title ? , bibitem * , references * }
18
+ terms = element terms { attribute id { xsd:ID } ? , section-title ? , paragraph-with-footnote * , ul ? , ( term + | terms ? ) }
19
+ term = element term { attribute id { xsd:ID } ? , preferred , admitted * , deprecates * , termdomain ? , definition , termnote * , termexample * , termsource * }
20
+ preferred = element preferred { TextElement + }
21
+ admitted = element admitted { TextElement + }
22
+ deprecates = element deprecates { TextElement + }
23
+ termdomain = element domain { TextElement + }
24
+ definition = element definition { ( paragraph | figure | formula ) + }
25
+ termnote = element termnote { attribute id { xsd:ID } , paragraph }
26
+ termexample = element termexample { attribute id { xsd:ID } , BasicBlock }
27
+ termsource = element termsource { attribute status { ( "identical" | "modified" ) } , origin , modification ? }
28
+ origin = element origin { attribute citeas { text } , CitationType }
29
+ modification = element modification { paragraph }
30
+ BasicBlock = paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | example paragraph = element p { ParagraphType }
31
+ Alignments = ( "left" | "right" | "center" | "justified" ) ParagraphType = attribute id { xsd:ID } , attribute align { Alignments } ? , ( TextElement ) * , review * paragraph-with-footnote = element p { attribute id { xsd:ID } , attribute align { Alignments } ? , ( TextElement | fn ) * , review * }
32
+ note = element note { attribute id { xsd:ID } , paragraph-with-footnote + }
33
+ review = element review { attribute id { xsd:ID } , attribute reviewer { text } ? , attribute date { xsd:date } ? , attribute from { xsd:ID } , attribute to { xsd:ID } , paragraph + }
34
+ formula = element formula { attribute id { xsd:ID } , stem , dl ? }
35
+ quote = element quote { attribute id { xsd:ID } , attribute alignment { Alignments } ? , quote-source ? , quote-author ? , paragraph-with-footnote + }
36
+ quote-source = element source { CitationType }
37
+ quote-author = element author { ContributorInfo }
38
+ sourcecode = element sourcecode { attribute id { xsd:ID } , tname ? , ( text | callout ) + , annotation * }
39
+ table = element table { attribute id { xsd:ID } , tname ? , thead ? , tbody , tfoot ? , table-note * , dl ? }
40
+ tname = element name { text }
41
+ thead = element thead { tr + }
42
+ tfoot = element tfoot { tr }
43
+ tbody = element tbody { tr + }
44
+ table-note = element note { attribute id { xsd:ID } ? , paragraph }
45
+ tr = element tr { ( td | th ) + }
46
+ td = element td { attribute colspan { text } ? , attribute rowspan { text } ? , attribute align { "left" | "right" | "center" } ? , ( ( TextElement | fn | review ) * | paragraph-with-footnote + ) }
47
+ th = element th { attribute colspan { text } ? , attribute rowspan { text } ? , attribute align { "left" | "right" | "center" } ? , ( ( TextElement | fn | review ) * | paragraph-with-footnote + ) }
48
+ example = element example { attribute id { xsd:ID } , ( formula | ul | ol | dl | quote | sourcecode | paragraph-with-footnote | review ) + }
49
+ admonition = element admonition { attribute id { xsd:ID } , attribute type { ( "danger" | "caution" | "warning" | "important" | "safety precautions" ) } , paragraph-with-footnote + }
50
+ figure = element figure { attribute id { xsd:ID } , tname ? , ( image | figure + ) , fn * , dl ? , note * }
51
+ TextElement = text | em | eref | strong | stem | sub | sup | tt | strike | smallcap | xref | br | hyperlink | hr | pagebreak | bookmark em = element em { text }
52
+ strong = element strong { text }
53
+ tt = element tt { text }
54
+ sub = element sub { text }
55
+ sup = element sup { text }
56
+ strike = element strike { text }
57
+ smallcap = element smallcap { text }
58
+ br = element br { empty }
59
+ hr = element hr { empty }
60
+ pagebreak = element pagebreak { empty }
61
+ bookmark = element bookmark { attribute id { xsd:ID } , empty }
62
+ ReferenceFormat = ( "external" | "inline" | "footnote" | "callout" ) eref = element eref { attribute normative { xsd:boolean } ? , attribute citeas { text } , attribute type { ReferenceFormat } , CitationType , text }
63
+ hyperlink = element link { attribute target { xsd:anyURI } , text }
64
+ xref = element xref { attribute target { xsd:IDREF } , text }
65
+ fn = element fn { attribute reference { text } , paragraph + }
66
+ callout = element callout { attribute target { xsd:IDREF } , text }
67
+ image = element image { attribute id { xsd:ID } , attribute src { xsd:anyURI } ? , attribute imagetype { ( "SVG" | "JPEG" | "GIF" | "PNG" | "PDF" ) } , attribute width { xsd:int } ? , attribute height { xsd:int } ? }
68
+ stem = element stem { attribute type { "MathML" | "AsciiMath" } , text }
69
+ annotation = element annotation { attribute id { xsd:ID } , paragraph }
70
+ ul = element ul { attribute id { xsd:ID } , li + }
71
+ li = element li { BasicBlock + }
72
+ ol = element ol { attribute id { xsd:ID } , attribute type { ( "roman" | "alphabet" | "arabic" | "roman_upper" | "alphabet_upper" ) } , li + }
73
+ dl = element dl { attribute id { xsd:ID } , ( dt , dd ) + }
74
+ dt = element dt { TextElement }
75
+ dd = element dd { BasicBlock }
76
+ LocalizedString = attribute language { text } ? , attribute script { text } ? , text FormattedString = attribute format { ( "plain" | "html" | "docbook" | "tei" | "asciidoc" | "markdown" ) } , LocalizedStringOrXsAny LocalizedStringOrXsAny = attribute language { text } ? , attribute script { text } ? , ( text | Any ) + contributor = element contributor { role * , ContributorInfo }
77
+ role = element role { attribute type { ( "author" | "edition" | "publisher" | text ) } ? , roledescription * }
78
+ ContributorInfo = ( person | organization ) roledescription = element description { FormattedString }
79
+ person = element person { fullname ? , affiliation * , person-identifier * , contact * , uri ? }
80
+ fullname = element name { prefix * , forename * , initial * , surname , addition * }
81
+ prefix = element prefix { LocalizedString }
82
+ initial = element initial { LocalizedString }
83
+ addition = element addition { LocalizedString }
84
+ surname = element surname { LocalizedString }
85
+ forename = element forename { LocalizedString }
86
+ affiliation = element affiliation { affiliationname ? , affiliationdescription * , organization }
87
+ affiliationname = element name { LocalizedString }
88
+ affiliationdescription = element description { FormattedString }
89
+ organization = element organization { orgname , uri ? , org-identifier * , contact * , technical-committee ? , subcommittee ? , workgroup ? , secretariat ? }
90
+ orgname = element name { LocalizedString }
91
+ uri = element uri { xsd:anyURI }
92
+ contact = ( address | phone | email | uri ) phone = element phone { text }
93
+ email = element email { text }
94
+ address = element address { street + , city , state ? , country , postcode ? }
95
+ street = element street { text }
96
+ city = element city { text }
97
+ state = element state { text }
98
+ country = element country { text }
99
+ postcode = element postcode { text }
100
+ person-identifier = element identifier { attribute type { ( "isni" | "uri" ) } , text }
101
+ org-identifier = element identifier { attribute type { ( "orcid" | "uri" ) } , text }
102
+ citation = element citation { CitationType }
103
+ CitationType = attribute bibitemid { xsd:IDREF } , locality * , date ? date = element date { ( xsd:gYear | xsd:date ) }
104
+ locality = element locality { attribute type { ( "section" | "clause" | "part" | "paragraph" | "chapter" | "page" | "whole" ) } , localityreference * }
105
+ localityreference = element reference { text }
106
+ bibitem = element bibitem { attribute id { xsd:ID } , BibliographicItem }
107
+ BibliographicItem = attribute type { "article" | "book" | "booklet" | "conference" | "manual" | "proceedings" | "presentation" | "thesis" | "techreport" | "standard" | "unpublished" } ? , ( btitle + | formattedref ) , source ? , docidentifier * , bdate * , contributor * , edition ? , biblionote * , partof * , language * , script * , abstract ? , status ? , copyright ? btitle = element title { text | ( title-intro ? , title-main , title-part ? ) }
108
+ formattedref = element formattedref { TextElement + }
109
+ source = element source { xsd:anyURI }
110
+ bdate = element date { attribute type { ( "published" | "accessed" | "created" | "activated" | "obsoleted" ) } , ( xsd:gYear | xsd:date ) }
111
+ docidentifier = element docidentifier { ( text | documentnumber | tc-documentnumber ) }
112
+ biblionote = element note { FormattedString }
113
+ abstract = element abstract { FormattedString }
114
+ partof = element partof { BibliographicItem }
115
+ copyright = element copyright { from , to ? , owner }
116
+ from = element from { xsd:gYear }
117
+ to = element to { xsd:gYear }
118
+ owner = element owner { ContributorInfo }
119
+ Anycontents = mixed { ( attribute * { text } | Any ) * }
120
+ Any = element * { Anycontents }
121
+ iso-standard = element iso-standard { bibdata , version ? , sections + }
122
+ draft = element draft { text }
123
+ stage = element stage { ( "00" | "10" | "20" | "30" | "40" | "50" | "60" | "90" | "95" ) }
124
+ substage = element substage { ( "00" | "20" | "60" | "90" | "92" | "93" | "98" | "99" ) }
125
+ documentnumber = element project-number { attribute part { xsd:int } ? , xsd:int }
126
+ tc-documentnumber = element tc-document-number { xsd:int }
127
+ technical-committee = element technical-committee { attribute number { xsd:int } ? , text }
128
+ subcommittee = element subcommittee { attribute number { xsd:int } ? , text }
129
+ workgroup = element workgroup { attribute number { xsd:int } ? , text }
130
+ secretariat = element secretariat { text }
131
+ title-intro = element title-intro { text }
132
+ title-main = element title-main { text }
133
+ title-part = element title-part { text }
134
+ clause-hanging-paragraph-with-footnote = element subsection { attribute id { xsd:ID } ? , attribute inline-header { xsd:boolean } ? , section-title ? , BasicBlock * , clause-hanging-paragraph-with-footnote * }
135
+
136
+ }
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
@@ -0,0 +1,1001 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar ns="http://riboseinc.com/isoxml" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="isodoc.rng">
4
+ <start>
5
+ <ref name="iso-standard"/>
6
+ </start>
7
+ <define name="language">
8
+ <element name="language">
9
+ <choice>
10
+ <value>en</value>
11
+ <value>fr</value>
12
+ </choice>
13
+ </element>
14
+ </define>
15
+ <define name="script">
16
+ <element name="script">
17
+ <value>Latn</value>
18
+ </element>
19
+ </define>
20
+ <!-- add type to docidentifier in isodoc? -->
21
+ <define name="docidentifier">
22
+ <element name="docidentifier">
23
+ <choice>
24
+ <text/>
25
+ <group>
26
+ <ref name="documentnumber"/>
27
+ <optional>
28
+ <ref name="tc-documentnumber"/>
29
+ </optional>
30
+ </group>
31
+ </choice>
32
+ </element>
33
+ </define>
34
+ <define name="organization">
35
+ <element name="organization">
36
+ <ref name="orgname"/>
37
+ <optional>
38
+ <ref name="abbreviation"/>
39
+ </optional>
40
+ <optional>
41
+ <ref name="uri"/>
42
+ </optional>
43
+ <zeroOrMore>
44
+ <ref name="org-identifier"/>
45
+ </zeroOrMore>
46
+ <zeroOrMore>
47
+ <ref name="contact"/>
48
+ </zeroOrMore>
49
+ <optional>
50
+ <ref name="technical-committee"/>
51
+ </optional>
52
+ <optional>
53
+ <ref name="subcommittee"/>
54
+ </optional>
55
+ <optional>
56
+ <ref name="workgroup"/>
57
+ </optional>
58
+ <optional>
59
+ <ref name="secretariat"/>
60
+ </optional>
61
+ </element>
62
+ </define>
63
+ <define name="BibliographicItem">
64
+ <optional>
65
+ <attribute name="type">
66
+ <ref name="BibItemType"/>
67
+ </attribute>
68
+ </optional>
69
+ <choice>
70
+ <oneOrMore>
71
+ <ref name="btitle"/>
72
+ </oneOrMore>
73
+ <ref name="formattedref"/>
74
+ </choice>
75
+ <zeroOrMore>
76
+ <ref name="bsource"/>
77
+ </zeroOrMore>
78
+ <zeroOrMore>
79
+ <ref name="docidentifier"/>
80
+ </zeroOrMore>
81
+ <zeroOrMore>
82
+ <ref name="bdate"/>
83
+ </zeroOrMore>
84
+ <zeroOrMore>
85
+ <ref name="contributor"/>
86
+ </zeroOrMore>
87
+ <optional>
88
+ <ref name="edition"/>
89
+ </optional>
90
+ <zeroOrMore>
91
+ <ref name="biblionote"/>
92
+ </zeroOrMore>
93
+ <zeroOrMore>
94
+ <ref name="language"/>
95
+ </zeroOrMore>
96
+ <zeroOrMore>
97
+ <ref name="script"/>
98
+ </zeroOrMore>
99
+ <zeroOrMore>
100
+ <ref name="abstract"/>
101
+ </zeroOrMore>
102
+ <optional>
103
+ <ref name="status"/>
104
+ </optional>
105
+ <optional>
106
+ <ref name="copyright"/>
107
+ </optional>
108
+ <zeroOrMore>
109
+ <ref name="docrelation"/>
110
+ </zeroOrMore>
111
+ <optional>
112
+ <ref name="editorialgroup"/>
113
+ </optional>
114
+ <zeroOrMore>
115
+ <ref name="ics"/>
116
+ </zeroOrMore>
117
+ <optional>
118
+ <ref name="allParts"/>
119
+ </optional>
120
+ </define>
121
+ <define name="BibData">
122
+ <optional>
123
+ <attribute name="type">
124
+ <ref name="BibItemType"/>
125
+ </attribute>
126
+ </optional>
127
+ <oneOrMore>
128
+ <ref name="btitle"/>
129
+ </oneOrMore>
130
+ <optional>
131
+ <ref name="formattedref"/>
132
+ </optional>
133
+ <zeroOrMore>
134
+ <ref name="bsource"/>
135
+ </zeroOrMore>
136
+ <zeroOrMore>
137
+ <ref name="docidentifier"/>
138
+ </zeroOrMore>
139
+ <zeroOrMore>
140
+ <ref name="bdate"/>
141
+ </zeroOrMore>
142
+ <zeroOrMore>
143
+ <ref name="contributor"/>
144
+ </zeroOrMore>
145
+ <optional>
146
+ <ref name="edition"/>
147
+ </optional>
148
+ <zeroOrMore>
149
+ <ref name="biblionote"/>
150
+ </zeroOrMore>
151
+ <zeroOrMore>
152
+ <ref name="language"/>
153
+ </zeroOrMore>
154
+ <zeroOrMore>
155
+ <ref name="script"/>
156
+ </zeroOrMore>
157
+ <zeroOrMore>
158
+ <ref name="abstract"/>
159
+ </zeroOrMore>
160
+ <optional>
161
+ <ref name="status"/>
162
+ </optional>
163
+ <ref name="copyright"/>
164
+ <zeroOrMore>
165
+ <ref name="docrelation"/>
166
+ </zeroOrMore>
167
+ <ref name="editorialgroup"/>
168
+ <zeroOrMore>
169
+ <ref name="ics"/>
170
+ </zeroOrMore>
171
+ <optional>
172
+ <ref name="allParts"/>
173
+ </optional>
174
+ </define>
175
+ <define name="bdate">
176
+ <element name="date">
177
+ <attribute name="type">
178
+ <choice>
179
+ <value>published</value>
180
+ <value>accessed</value>
181
+ <value>created</value>
182
+ <value>implemented</value>
183
+ <value>obsoleted</value>
184
+ <value>confirmed</value>
185
+ <value>updated</value>
186
+ <value>issued</value>
187
+ </choice>
188
+ </attribute>
189
+ <!-- ( ( bfrom, bto? ) | date_on ) -->
190
+ <choice>
191
+ <group>
192
+ <element name="from">
193
+ <choice>
194
+ <data type="gYear"/>
195
+ <data type="date"/>
196
+ </choice>
197
+ </element>
198
+ <optional>
199
+ <element name="to">
200
+ <choice>
201
+ <data type="gYear"/>
202
+ <data type="date"/>
203
+ </choice>
204
+ </element>
205
+ </optional>
206
+ </group>
207
+ <element name="on">
208
+ <choice>
209
+ <data type="gYear"/>
210
+ <data type="date"/>
211
+ <value>--</value>
212
+ </choice>
213
+ </element>
214
+ </choice>
215
+ </element>
216
+ </define>
217
+ <define name="biblionote">
218
+ <element name="note">
219
+ <optional>
220
+ <!-- Biblio date notes can be footnoted -->
221
+ <attribute name="reference"/>
222
+ </optional>
223
+ <ref name="FormattedString"/>
224
+ </element>
225
+ </define>
226
+ <define name="status">
227
+ <element name="status">
228
+ <choice>
229
+ <ref name="FormattedString"/>
230
+ <group>
231
+ <ref name="stage"/>
232
+ <optional>
233
+ <ref name="substage"/>
234
+ </optional>
235
+ <optional>
236
+ <ref name="iteration"/>
237
+ </optional>
238
+ </group>
239
+ </choice>
240
+ </element>
241
+ </define>
242
+ <define name="btitle">
243
+ <element name="title">
244
+ <choice>
245
+ <ref name="FormattedString"/>
246
+ <group>
247
+ <optional>
248
+ <ref name="title-intro"/>
249
+ </optional>
250
+ <ref name="title-main"/>
251
+ <optional>
252
+ <ref name="title-part"/>
253
+ </optional>
254
+ </group>
255
+ </choice>
256
+ </element>
257
+ </define>
258
+ <define name="sections">
259
+ <element name="sections">
260
+ <ref name="clause"/>
261
+ <choice>
262
+ <ref name="term-clause"/>
263
+ <ref name="terms"/>
264
+ </choice>
265
+ <optional>
266
+ <ref name="definitions"/>
267
+ </optional>
268
+ <oneOrMore>
269
+ <ref name="clause"/>
270
+ </oneOrMore>
271
+ </element>
272
+ </define>
273
+ <define name="Basic-Section">
274
+ <optional>
275
+ <attribute name="id">
276
+ <data type="ID"/>
277
+ </attribute>
278
+ </optional>
279
+ <optional>
280
+ <attribute name="obligation">
281
+ <choice>
282
+ <value>normative</value>
283
+ <value>informative</value>
284
+ </choice>
285
+ </attribute>
286
+ </optional>
287
+ <optional>
288
+ <ref name="section-title"/>
289
+ </optional>
290
+ <group>
291
+ <oneOrMore>
292
+ <ref name="BasicBlock"/>
293
+ </oneOrMore>
294
+ <zeroOrMore>
295
+ <ref name="note"/>
296
+ </zeroOrMore>
297
+ </group>
298
+ </define>
299
+ <define name="Content-Section">
300
+ <optional>
301
+ <attribute name="id">
302
+ <data type="ID"/>
303
+ </attribute>
304
+ </optional>
305
+ <optional>
306
+ <attribute name="obligation">
307
+ <choice>
308
+ <value>normative</value>
309
+ <value>informative</value>
310
+ </choice>
311
+ </attribute>
312
+ </optional>
313
+ <optional>
314
+ <ref name="section-title"/>
315
+ </optional>
316
+ <choice>
317
+ <group>
318
+ <oneOrMore>
319
+ <ref name="BasicBlock"/>
320
+ </oneOrMore>
321
+ <zeroOrMore>
322
+ <ref name="note"/>
323
+ </zeroOrMore>
324
+ </group>
325
+ <oneOrMore>
326
+ <ref name="content-subsection"/>
327
+ </oneOrMore>
328
+ </choice>
329
+ </define>
330
+ <define name="Clause-Section">
331
+ <optional>
332
+ <attribute name="id">
333
+ <data type="ID"/>
334
+ </attribute>
335
+ </optional>
336
+ <optional>
337
+ <attribute name="inline-header">
338
+ <data type="boolean"/>
339
+ </attribute>
340
+ </optional>
341
+ <optional>
342
+ <attribute name="obligation">
343
+ <choice>
344
+ <value>normative</value>
345
+ <value>informative</value>
346
+ </choice>
347
+ </attribute>
348
+ </optional>
349
+ <optional>
350
+ <ref name="section-title"/>
351
+ </optional>
352
+ <choice>
353
+ <group>
354
+ <oneOrMore>
355
+ <ref name="BasicBlock"/>
356
+ </oneOrMore>
357
+ <zeroOrMore>
358
+ <ref name="note"/>
359
+ </zeroOrMore>
360
+ </group>
361
+ <oneOrMore>
362
+ <ref name="clause-subsection"/>
363
+ </oneOrMore>
364
+ </choice>
365
+ </define>
366
+ <define name="references">
367
+ <element name="references">
368
+ <optional>
369
+ <attribute name="id">
370
+ <data type="ID"/>
371
+ </attribute>
372
+ </optional>
373
+ <optional>
374
+ <attribute name="obligation">
375
+ <choice>
376
+ <value>normative</value>
377
+ <value>informative</value>
378
+ </choice>
379
+ </attribute>
380
+ </optional>
381
+ <optional>
382
+ <ref name="section-title"/>
383
+ </optional>
384
+ <zeroOrMore>
385
+ <ref name="bibitem"/>
386
+ </zeroOrMore>
387
+ <zeroOrMore>
388
+ <ref name="references"/>
389
+ </zeroOrMore>
390
+ </element>
391
+ </define>
392
+ <define name="definitions">
393
+ <element name="definitions">
394
+ <optional>
395
+ <attribute name="id">
396
+ <data type="ID"/>
397
+ </attribute>
398
+ </optional>
399
+ <optional>
400
+ <attribute name="obligation">
401
+ <choice>
402
+ <value>normative</value>
403
+ <value>informative</value>
404
+ </choice>
405
+ </attribute>
406
+ </optional>
407
+ <ref name="dl"/>
408
+ </element>
409
+ </define>
410
+ <define name="terms">
411
+ <element name="terms">
412
+ <optional>
413
+ <attribute name="id">
414
+ <data type="ID"/>
415
+ </attribute>
416
+ </optional>
417
+ <optional>
418
+ <attribute name="obligation">
419
+ <choice>
420
+ <value>normative</value>
421
+ <value>informative</value>
422
+ </choice>
423
+ </attribute>
424
+ </optional>
425
+ <optional>
426
+ <ref name="section-title"/>
427
+ </optional>
428
+ <choice>
429
+ <oneOrMore>
430
+ <ref name="term"/>
431
+ </oneOrMore>
432
+ <group>
433
+ <zeroOrMore>
434
+ <ref name="terms"/>
435
+ </zeroOrMore>
436
+ <optional>
437
+ <ref name="definitions"/>
438
+ </optional>
439
+ </group>
440
+ </choice>
441
+ </element>
442
+ </define>
443
+ <define name="term">
444
+ <element name="term">
445
+ <optional>
446
+ <attribute name="id">
447
+ <data type="ID"/>
448
+ </attribute>
449
+ </optional>
450
+ <ref name="preferred"/>
451
+ <zeroOrMore>
452
+ <ref name="admitted"/>
453
+ </zeroOrMore>
454
+ <zeroOrMore>
455
+ <ref name="deprecates"/>
456
+ </zeroOrMore>
457
+ <optional>
458
+ <ref name="termdomain"/>
459
+ </optional>
460
+ <ref name="definition"/>
461
+ <zeroOrMore>
462
+ <ref name="termnote"/>
463
+ </zeroOrMore>
464
+ <zeroOrMore>
465
+ <ref name="termexample"/>
466
+ </zeroOrMore>
467
+ <zeroOrMore>
468
+ <ref name="termsource"/>
469
+ </zeroOrMore>
470
+ </element>
471
+ </define>
472
+ <define name="definition">
473
+ <element name="definition">
474
+ <oneOrMore>
475
+ <choice>
476
+ <ref name="paragraph"/>
477
+ <ref name="figure"/>
478
+ <ref name="formula"/>
479
+ </choice>
480
+ </oneOrMore>
481
+ </element>
482
+ </define>
483
+ <define name="annex">
484
+ <element name="annex">
485
+ <optional>
486
+ <attribute name="id">
487
+ <data type="ID"/>
488
+ </attribute>
489
+ </optional>
490
+ <optional>
491
+ <attribute name="inline-header">
492
+ <data type="boolean"/>
493
+ </attribute>
494
+ </optional>
495
+ <optional>
496
+ <attribute name="obligation">
497
+ <choice>
498
+ <value>normative</value>
499
+ <value>informative</value>
500
+ </choice>
501
+ </attribute>
502
+ </optional>
503
+ <optional>
504
+ <ref name="section-title"/>
505
+ </optional>
506
+ <zeroOrMore>
507
+ <!--
508
+ allow hanging paragraps in annexes: they introduce lists
509
+ ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
510
+ -->
511
+ <ref name="BasicBlock"/>
512
+ </zeroOrMore>
513
+ <zeroOrMore>
514
+ <ref name="note"/>
515
+ </zeroOrMore>
516
+ <zeroOrMore>
517
+ <ref name="clause-hanging-paragraph-with-footnote"/>
518
+ </zeroOrMore>
519
+ <zeroOrMore>
520
+ <ref name="annex-appendix"/>
521
+ </zeroOrMore>
522
+ </element>
523
+ </define>
524
+ <define name="figure">
525
+ <element name="figure">
526
+ <attribute name="id">
527
+ <data type="ID"/>
528
+ </attribute>
529
+ <optional>
530
+ <ref name="tname"/>
531
+ </optional>
532
+ <choice>
533
+ <ref name="image"/>
534
+ <oneOrMore>
535
+ <ref name="subfigure"/>
536
+ </oneOrMore>
537
+ </choice>
538
+ <zeroOrMore>
539
+ <ref name="fn"/>
540
+ </zeroOrMore>
541
+ <optional>
542
+ <ref name="dl"/>
543
+ </optional>
544
+ <zeroOrMore>
545
+ <ref name="note"/>
546
+ </zeroOrMore>
547
+ </element>
548
+ </define>
549
+ <define name="li">
550
+ <element name="li">
551
+ <oneOrMore>
552
+ <!-- ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | quote | sourcecode | review | example )+ -->
553
+ <ref name="BasicBlock"/>
554
+ </oneOrMore>
555
+ <!-- exclude figures? -->
556
+ </element>
557
+ </define>
558
+ <define name="dd">
559
+ <element name="dd">
560
+ <zeroOrMore>
561
+ <!--
562
+ ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | quote | sourcecode | review | example )*
563
+ exclude figures?
564
+ -->
565
+ <ref name="BasicBlock"/>
566
+ </zeroOrMore>
567
+ </element>
568
+ </define>
569
+ <define name="admonition">
570
+ <element name="admonition">
571
+ <attribute name="id">
572
+ <data type="ID"/>
573
+ </attribute>
574
+ <attribute name="type">
575
+ <choice>
576
+ <value>danger</value>
577
+ <value>caution</value>
578
+ <value>warning</value>
579
+ <value>important</value>
580
+ <value>safety precautions</value>
581
+ </choice>
582
+ </attribute>
583
+ <oneOrMore>
584
+ <ref name="paragraph-with-footnote"/>
585
+ </oneOrMore>
586
+ <zeroOrMore>
587
+ <ref name="note"/>
588
+ </zeroOrMore>
589
+ </element>
590
+ </define>
591
+ <define name="xref">
592
+ <element name="xref">
593
+ <attribute name="target">
594
+ <data type="IDREF"/>
595
+ </attribute>
596
+ <text/>
597
+ </element>
598
+ </define>
599
+ <define name="hyperlink">
600
+ <element name="link">
601
+ <attribute name="target">
602
+ <data type="anyURI"/>
603
+ </attribute>
604
+ <text/>
605
+ </element>
606
+ </define>
607
+ <define name="thead">
608
+ <element name="thead">
609
+ <oneOrMore>
610
+ <ref name="tr"/>
611
+ </oneOrMore>
612
+ </element>
613
+ </define>
614
+ <define name="td">
615
+ <element name="td">
616
+ <optional>
617
+ <attribute name="colspan"/>
618
+ </optional>
619
+ <optional>
620
+ <attribute name="rowspan"/>
621
+ </optional>
622
+ <optional>
623
+ <attribute name="align">
624
+ <choice>
625
+ <value>left</value>
626
+ <value>right</value>
627
+ <value>center</value>
628
+ </choice>
629
+ </attribute>
630
+ </optional>
631
+ <choice>
632
+ <zeroOrMore>
633
+ <choice>
634
+ <ref name="TextElement"/>
635
+ <ref name="fn"/>
636
+ </choice>
637
+ </zeroOrMore>
638
+ <oneOrMore>
639
+ <ref name="paragraph-with-footnote"/>
640
+ </oneOrMore>
641
+ </choice>
642
+ </element>
643
+ </define>
644
+ <define name="th">
645
+ <element name="th">
646
+ <optional>
647
+ <attribute name="colspan"/>
648
+ </optional>
649
+ <optional>
650
+ <attribute name="rowspan"/>
651
+ </optional>
652
+ <optional>
653
+ <attribute name="align">
654
+ <choice>
655
+ <value>left</value>
656
+ <value>right</value>
657
+ <value>center</value>
658
+ </choice>
659
+ </attribute>
660
+ </optional>
661
+ <choice>
662
+ <zeroOrMore>
663
+ <choice>
664
+ <ref name="TextElement"/>
665
+ <ref name="fn"/>
666
+ </choice>
667
+ </zeroOrMore>
668
+ <oneOrMore>
669
+ <ref name="paragraph-with-footnote"/>
670
+ </oneOrMore>
671
+ </choice>
672
+ </element>
673
+ </define>
674
+ <define name="table-note">
675
+ <element name="note">
676
+ <optional>
677
+ <attribute name="id">
678
+ <data type="ID"/>
679
+ </attribute>
680
+ </optional>
681
+ <ref name="paragraph"/>
682
+ </element>
683
+ </define>
684
+ <define name="preface">
685
+ <element name="preface">
686
+ <ref name="foreword"/>
687
+ <optional>
688
+ <ref name="introduction"/>
689
+ </optional>
690
+ </element>
691
+ </define>
692
+ </include>
693
+ <!-- end overrides -->
694
+ <!--
695
+ We display the Normative References between scope and terms; but to keep the
696
+ grammar simple, we keep the references together
697
+ -->
698
+ <define name="iso-standard">
699
+ <element name="iso-standard">
700
+ <ref name="bibdata"/>
701
+ <optional>
702
+ <ref name="version"/>
703
+ </optional>
704
+ <zeroOrMore>
705
+ <ref name="termdocsource"/>
706
+ </zeroOrMore>
707
+ <ref name="preface"/>
708
+ <oneOrMore>
709
+ <ref name="sections"/>
710
+ </oneOrMore>
711
+ <zeroOrMore>
712
+ <ref name="annex"/>
713
+ </zeroOrMore>
714
+ <ref name="bibliography"/>
715
+ </element>
716
+ </define>
717
+ <define name="bibliography">
718
+ <element name="bibliography">
719
+ <oneOrMore>
720
+ <choice>
721
+ <ref name="references"/>
722
+ <ref name="reference-clause"/>
723
+ </choice>
724
+ </oneOrMore>
725
+ </element>
726
+ </define>
727
+ <define name="BibItemType" combine="choice">
728
+ <choice>
729
+ <value>international-standard</value>
730
+ <value>technical-specification</value>
731
+ <value>technical-report</value>
732
+ <value>publicly-available-specification</value>
733
+ <value>international-workshop-agreement</value>
734
+ <value>guide</value>
735
+ </choice>
736
+ </define>
737
+ <define name="editorialgroup">
738
+ <element name="editorialgroup">
739
+ <ref name="technical-committee"/>
740
+ <optional>
741
+ <ref name="subcommittee"/>
742
+ </optional>
743
+ <optional>
744
+ <ref name="workgroup"/>
745
+ </optional>
746
+ <optional>
747
+ <ref name="secretariat"/>
748
+ </optional>
749
+ </element>
750
+ </define>
751
+ <define name="foreword">
752
+ <element name="foreword">
753
+ <ref name="Basic-Section"/>
754
+ </element>
755
+ </define>
756
+ <define name="introduction">
757
+ <element name="introduction">
758
+ <ref name="Content-Section"/>
759
+ </element>
760
+ </define>
761
+ <define name="stage">
762
+ <element name="stage">
763
+ <choice>
764
+ <value>00</value>
765
+ <value>10</value>
766
+ <value>20</value>
767
+ <value>30</value>
768
+ <value>40</value>
769
+ <value>50</value>
770
+ <value>60</value>
771
+ <value>90</value>
772
+ <value>95</value>
773
+ </choice>
774
+ </element>
775
+ </define>
776
+ <define name="substage">
777
+ <element name="substage">
778
+ <choice>
779
+ <value>00</value>
780
+ <value>20</value>
781
+ <value>60</value>
782
+ <value>90</value>
783
+ <value>92</value>
784
+ <value>93</value>
785
+ <value>98</value>
786
+ <value>99</value>
787
+ </choice>
788
+ </element>
789
+ </define>
790
+ <define name="iteration">
791
+ <element name="iteration">
792
+ <data type="int"/>
793
+ </element>
794
+ </define>
795
+ <define name="documentnumber">
796
+ <element name="project-number">
797
+ <optional>
798
+ <attribute name="part">
799
+ <data type="int"/>
800
+ </attribute>
801
+ </optional>
802
+ <optional>
803
+ <attribute name="subpart">
804
+ <data type="int"/>
805
+ </attribute>
806
+ </optional>
807
+ <text/>
808
+ </element>
809
+ </define>
810
+ <define name="tc-documentnumber">
811
+ <element name="tc-document-number">
812
+ <data type="int"/>
813
+ </element>
814
+ </define>
815
+ <define name="technical-committee">
816
+ <element name="technical-committee">
817
+ <ref name="IsoWorkgroup"/>
818
+ </element>
819
+ </define>
820
+ <define name="subcommittee">
821
+ <element name="subcommittee">
822
+ <ref name="IsoWorkgroup"/>
823
+ </element>
824
+ </define>
825
+ <define name="workgroup">
826
+ <element name="workgroup">
827
+ <ref name="IsoWorkgroup"/>
828
+ </element>
829
+ </define>
830
+ <define name="IsoWorkgroup">
831
+ <optional>
832
+ <attribute name="number">
833
+ <data type="int"/>
834
+ </attribute>
835
+ </optional>
836
+ <optional>
837
+ <attribute name="type"/>
838
+ </optional>
839
+ <text/>
840
+ </define>
841
+ <define name="secretariat">
842
+ <element name="secretariat">
843
+ <text/>
844
+ </element>
845
+ </define>
846
+ <define name="title-intro">
847
+ <element name="title-intro">
848
+ <ref name="FormattedString"/>
849
+ </element>
850
+ </define>
851
+ <define name="title-main">
852
+ <element name="title-main">
853
+ <ref name="FormattedString"/>
854
+ </element>
855
+ </define>
856
+ <define name="title-part">
857
+ <element name="title-part">
858
+ <ref name="FormattedString"/>
859
+ </element>
860
+ </define>
861
+ <define name="allParts">
862
+ <element name="allParts">
863
+ <data type="boolean"/>
864
+ </element>
865
+ </define>
866
+ <define name="clause-hanging-paragraph-with-footnote">
867
+ <element name="clause">
868
+ <optional>
869
+ <attribute name="id">
870
+ <data type="ID"/>
871
+ </attribute>
872
+ </optional>
873
+ <optional>
874
+ <attribute name="inline-header">
875
+ <data type="boolean"/>
876
+ </attribute>
877
+ </optional>
878
+ <optional>
879
+ <attribute name="obligation">
880
+ <choice>
881
+ <value>normative</value>
882
+ <value>informative</value>
883
+ </choice>
884
+ </attribute>
885
+ </optional>
886
+ <optional>
887
+ <ref name="section-title"/>
888
+ </optional>
889
+ <zeroOrMore>
890
+ <!-- allow hanging paragraphs in annexes: they introduce lists -->
891
+ <ref name="BasicBlock"/>
892
+ </zeroOrMore>
893
+ <zeroOrMore>
894
+ <ref name="note"/>
895
+ </zeroOrMore>
896
+ <zeroOrMore>
897
+ <ref name="clause-hanging-paragraph-with-footnote"/>
898
+ </zeroOrMore>
899
+ </element>
900
+ </define>
901
+ <define name="subfigure">
902
+ <element name="figure">
903
+ <attribute name="id">
904
+ <data type="ID"/>
905
+ </attribute>
906
+ <optional>
907
+ <ref name="tname"/>
908
+ </optional>
909
+ <ref name="image"/>
910
+ </element>
911
+ </define>
912
+ <define name="termdocsource">
913
+ <element name="termdocsource">
914
+ <ref name="CitationType"/>
915
+ </element>
916
+ </define>
917
+ <define name="ics">
918
+ <element name="ics">
919
+ <element name="code">
920
+ <text/>
921
+ </element>
922
+ <element name="text">
923
+ <text/>
924
+ </element>
925
+ </element>
926
+ </define>
927
+ <define name="term-clause">
928
+ <element name="clause">
929
+ <optional>
930
+ <attribute name="id">
931
+ <data type="ID"/>
932
+ </attribute>
933
+ </optional>
934
+ <optional>
935
+ <attribute name="inline-header">
936
+ <data type="boolean"/>
937
+ </attribute>
938
+ </optional>
939
+ <optional>
940
+ <attribute name="obligation">
941
+ <choice>
942
+ <value>normative</value>
943
+ <value>informative</value>
944
+ </choice>
945
+ </attribute>
946
+ </optional>
947
+ <optional>
948
+ <ref name="section-title"/>
949
+ </optional>
950
+ <choice>
951
+ <oneOrMore>
952
+ <ref name="term-clause"/>
953
+ </oneOrMore>
954
+ <zeroOrMore>
955
+ <choice>
956
+ <ref name="terms"/>
957
+ <ref name="definitions"/>
958
+ </choice>
959
+ </zeroOrMore>
960
+ </choice>
961
+ </element>
962
+ </define>
963
+ <define name="reference-clause">
964
+ <element name="clause">
965
+ <optional>
966
+ <attribute name="id">
967
+ <data type="ID"/>
968
+ </attribute>
969
+ </optional>
970
+ <optional>
971
+ <attribute name="inline-header">
972
+ <data type="boolean"/>
973
+ </attribute>
974
+ </optional>
975
+ <optional>
976
+ <attribute name="obligation">
977
+ <choice>
978
+ <value>normative</value>
979
+ <value>informative</value>
980
+ </choice>
981
+ </attribute>
982
+ </optional>
983
+ <optional>
984
+ <ref name="section-title"/>
985
+ </optional>
986
+ <choice>
987
+ <oneOrMore>
988
+ <ref name="reference-clause"/>
989
+ </oneOrMore>
990
+ <zeroOrMore>
991
+ <ref name="references"/>
992
+ </zeroOrMore>
993
+ </choice>
994
+ </element>
995
+ </define>
996
+ <define name="annex-appendix">
997
+ <element name="appendix">
998
+ <ref name="Clause-Section"/>
999
+ </element>
1000
+ </define>
1001
+ </grammar>