rng 0.1.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +63 -0
  3. data/.github/workflows/release.yml +8 -3
  4. data/.gitignore +11 -0
  5. data/.rubocop.yml +10 -7
  6. data/.rubocop_todo.yml +229 -23
  7. data/CHANGELOG.md +317 -0
  8. data/CLAUDE.md +139 -0
  9. data/Gemfile +11 -12
  10. data/README.adoc +1538 -11
  11. data/Rakefile +11 -3
  12. data/docs/Gemfile +8 -0
  13. data/docs/_config.yml +23 -0
  14. data/docs/getting-started/index.adoc +75 -0
  15. data/docs/guides/error-handling.adoc +137 -0
  16. data/docs/guides/external-references.adoc +128 -0
  17. data/docs/guides/index.adoc +24 -0
  18. data/docs/guides/parsing-rnc.adoc +141 -0
  19. data/docs/guides/parsing-rng-xml.adoc +81 -0
  20. data/docs/guides/rng-to-rnc.adoc +101 -0
  21. data/docs/guides/validation.adoc +85 -0
  22. data/docs/index.adoc +52 -0
  23. data/docs/reference/api.adoc +126 -0
  24. data/docs/reference/cli.adoc +182 -0
  25. data/docs/understanding/architecture.adoc +58 -0
  26. data/docs/understanding/rng-vs-rnc.adoc +118 -0
  27. data/exe/rng +5 -0
  28. data/lib/rng/any_name.rb +10 -8
  29. data/lib/rng/attribute.rb +28 -26
  30. data/lib/rng/choice.rb +24 -24
  31. data/lib/rng/cli.rb +607 -0
  32. data/lib/rng/data.rb +10 -10
  33. data/lib/rng/datatype_declaration.rb +26 -0
  34. data/lib/rng/define.rb +44 -41
  35. data/lib/rng/div.rb +36 -0
  36. data/lib/rng/documentation.rb +9 -0
  37. data/lib/rng/element.rb +39 -37
  38. data/lib/rng/empty.rb +7 -7
  39. data/lib/rng/except.rb +25 -25
  40. data/lib/rng/external_ref.rb +8 -8
  41. data/lib/rng/external_ref_resolver.rb +602 -0
  42. data/lib/rng/foreign_attribute.rb +26 -0
  43. data/lib/rng/foreign_element.rb +33 -0
  44. data/lib/rng/grammar.rb +14 -12
  45. data/lib/rng/group.rb +26 -24
  46. data/lib/rng/include.rb +5 -6
  47. data/lib/rng/include_processor.rb +461 -0
  48. data/lib/rng/interleave.rb +23 -23
  49. data/lib/rng/list.rb +22 -22
  50. data/lib/rng/mixed.rb +23 -23
  51. data/lib/rng/name.rb +6 -7
  52. data/lib/rng/namespace_declaration.rb +47 -0
  53. data/lib/rng/namespaces.rb +15 -0
  54. data/lib/rng/not_allowed.rb +7 -7
  55. data/lib/rng/ns_name.rb +9 -9
  56. data/lib/rng/one_or_more.rb +23 -23
  57. data/lib/rng/optional.rb +23 -23
  58. data/lib/rng/param.rb +7 -8
  59. data/lib/rng/parent_ref.rb +8 -8
  60. data/lib/rng/parse_tree_processor.rb +695 -0
  61. data/lib/rng/pattern.rb +7 -7
  62. data/lib/rng/ref.rb +8 -8
  63. data/lib/rng/rnc_builder.rb +927 -0
  64. data/lib/rng/rnc_parser.rb +605 -305
  65. data/lib/rng/rnc_to_rng_converter.rb +1408 -0
  66. data/lib/rng/schema_preamble.rb +73 -0
  67. data/lib/rng/schema_validator.rb +1622 -0
  68. data/lib/rng/start.rb +27 -25
  69. data/lib/rng/test_suite_parser.rb +168 -0
  70. data/lib/rng/text.rb +11 -8
  71. data/lib/rng/to_rnc.rb +4 -35
  72. data/lib/rng/value.rb +6 -7
  73. data/lib/rng/version.rb +1 -1
  74. data/lib/rng/zero_or_more.rb +23 -23
  75. data/lib/rng.rb +68 -17
  76. data/rng.gemspec +18 -19
  77. data/scripts/extract_spectest_resources.rb +96 -0
  78. data/spec/fixtures/compacttest.xml +2511 -0
  79. data/spec/fixtures/external/circular_a.rng +7 -0
  80. data/spec/fixtures/external/circular_b.rng +7 -0
  81. data/spec/fixtures/external/circular_main.rng +7 -0
  82. data/spec/fixtures/external/external_ref_lib.rng +7 -0
  83. data/spec/fixtures/external/external_ref_main.rng +7 -0
  84. data/spec/fixtures/external/include_lib.rng +7 -0
  85. data/spec/fixtures/external/include_main.rng +3 -0
  86. data/spec/fixtures/external/nested_chain.rng +6 -0
  87. data/spec/fixtures/external/nested_leaf.rng +7 -0
  88. data/spec/fixtures/external/nested_mid.rng +8 -0
  89. data/spec/fixtures/metanorma/3gpp.rnc +35 -0
  90. data/spec/fixtures/metanorma/3gpp.rng +105 -0
  91. data/spec/fixtures/metanorma/basicdoc.rnc +11 -0
  92. data/spec/fixtures/metanorma/bipm.rnc +148 -0
  93. data/spec/fixtures/metanorma/bipm.rng +376 -0
  94. data/spec/fixtures/metanorma/bsi.rnc +104 -0
  95. data/spec/fixtures/metanorma/bsi.rng +332 -0
  96. data/spec/fixtures/metanorma/csa.rnc +45 -0
  97. data/spec/fixtures/metanorma/csa.rng +131 -0
  98. data/spec/fixtures/metanorma/csd.rnc +43 -0
  99. data/spec/fixtures/metanorma/csd.rng +132 -0
  100. data/spec/fixtures/metanorma/gbstandard.rnc +99 -0
  101. data/spec/fixtures/metanorma/gbstandard.rng +316 -0
  102. data/spec/fixtures/metanorma/iec.rnc +49 -0
  103. data/spec/fixtures/metanorma/iec.rng +193 -0
  104. data/spec/fixtures/metanorma/ietf.rnc +275 -0
  105. data/spec/fixtures/metanorma/ietf.rng +925 -0
  106. data/spec/fixtures/metanorma/iho.rnc +58 -0
  107. data/spec/fixtures/metanorma/iho.rng +179 -0
  108. data/spec/fixtures/metanorma/isodoc.rnc +873 -0
  109. data/spec/fixtures/metanorma/isodoc.rng +2704 -0
  110. data/spec/fixtures/metanorma/isostandard-amd.rnc +43 -0
  111. data/spec/fixtures/metanorma/isostandard-amd.rng +108 -0
  112. data/spec/fixtures/metanorma/isostandard.rnc +166 -0
  113. data/spec/fixtures/metanorma/isostandard.rng +494 -0
  114. data/spec/fixtures/metanorma/itu.rnc +122 -0
  115. data/spec/fixtures/metanorma/itu.rng +377 -0
  116. data/spec/fixtures/metanorma/m3d.rnc +41 -0
  117. data/spec/fixtures/metanorma/m3d.rng +122 -0
  118. data/spec/fixtures/metanorma/mpfd.rnc +36 -0
  119. data/spec/fixtures/metanorma/mpfd.rng +95 -0
  120. data/spec/fixtures/metanorma/nist.rnc +77 -0
  121. data/spec/fixtures/metanorma/nist.rng +216 -0
  122. data/spec/fixtures/metanorma/ogc.rnc +51 -0
  123. data/spec/fixtures/metanorma/ogc.rng +151 -0
  124. data/spec/fixtures/metanorma/reqt.rnc +6 -0
  125. data/spec/fixtures/metanorma/rsd.rnc +36 -0
  126. data/spec/fixtures/metanorma/rsd.rng +95 -0
  127. data/spec/fixtures/metanorma/un.rnc +103 -0
  128. data/spec/fixtures/metanorma/un.rng +367 -0
  129. data/spec/fixtures/rnc/base.rnc +4 -0
  130. data/spec/fixtures/rnc/grammar_with_trailing.rnc +8 -0
  131. data/spec/fixtures/rnc/main_include_trailing.rnc +3 -0
  132. data/spec/fixtures/rnc/main_with_include.rnc +5 -0
  133. data/spec/fixtures/rnc/test_augment.rnc +10 -0
  134. data/spec/fixtures/rnc/test_isodoc_simple.rnc +9 -0
  135. data/spec/fixtures/rnc/top_level_include.rnc +8 -0
  136. data/spec/fixtures/spectest_external/case_10_4.7/x +3 -0
  137. data/spec/fixtures/spectest_external/case_10_4.7/y +7 -0
  138. data/spec/fixtures/spectest_external/case_11_4.7/x +3 -0
  139. data/spec/fixtures/spectest_external/case_12_4.7/x +3 -0
  140. data/spec/fixtures/spectest_external/case_13_4.7/x +3 -0
  141. data/spec/fixtures/spectest_external/case_13_4.7/y +3 -0
  142. data/spec/fixtures/spectest_external/case_14_4.7/x +7 -0
  143. data/spec/fixtures/spectest_external/case_15_4.7/x +7 -0
  144. data/spec/fixtures/spectest_external/case_16_4.7/x +5 -0
  145. data/spec/fixtures/spectest_external/case_17_4.7/x +5 -0
  146. data/spec/fixtures/spectest_external/case_18_4.7/x +7 -0
  147. data/spec/fixtures/spectest_external/case_19_4.7/level1.rng +9 -0
  148. data/spec/fixtures/spectest_external/case_19_4.7/level2.rng +7 -0
  149. data/spec/fixtures/spectest_external/case_1_4.5/sub1/x +3 -0
  150. data/spec/fixtures/spectest_external/case_1_4.5/sub3/x +3 -0
  151. data/spec/fixtures/spectest_external/case_1_4.5/x +3 -0
  152. data/spec/fixtures/spectest_external/case_20_4.6/x +3 -0
  153. data/spec/fixtures/spectest_external/case_2_4.5/x +3 -0
  154. data/spec/fixtures/spectest_external/case_3_4.6/x +3 -0
  155. data/spec/fixtures/spectest_external/case_4_4.6/x +3 -0
  156. data/spec/fixtures/spectest_external/case_5_4.6/x +1 -0
  157. data/spec/fixtures/spectest_external/case_6_4.6/x +5 -0
  158. data/spec/fixtures/spectest_external/case_7_4.6/x +1 -0
  159. data/spec/fixtures/spectest_external/case_7_4.6/y +1 -0
  160. data/spec/fixtures/spectest_external/case_8_4.7/x +7 -0
  161. data/spec/fixtures/spectest_external/case_9_4.7/x +7 -0
  162. data/spec/fixtures/spectest_external/resources.json +149 -0
  163. data/spec/rng/advanced_rnc_spec.rb +101 -0
  164. data/spec/rng/compacttest_spec.rb +197 -0
  165. data/spec/rng/datatype_declaration_spec.rb +28 -0
  166. data/spec/rng/div_spec.rb +207 -0
  167. data/spec/rng/external_ref_resolver_spec.rb +122 -0
  168. data/spec/rng/metanorma_conversion_spec.rb +159 -0
  169. data/spec/rng/namespace_declaration_spec.rb +60 -0
  170. data/spec/rng/namespace_support_spec.rb +199 -0
  171. data/spec/rng/rnc_parser_spec.rb +498 -22
  172. data/spec/rng/rnc_roundtrip_spec.rb +96 -82
  173. data/spec/rng/rng_generation_spec.rb +288 -0
  174. data/spec/rng/roundtrip_spec.rb +342 -0
  175. data/spec/rng/schema_preamble_spec.rb +145 -0
  176. data/spec/rng/schema_spec.rb +68 -64
  177. data/spec/rng/spectest_spec.rb +168 -90
  178. data/spec/rng_spec.rb +2 -2
  179. data/spec/spec_helper.rb +7 -42
  180. metadata +141 -8
@@ -0,0 +1,873 @@
1
+ # instantiations of this grammar may replace leaf strings
2
+ # with more elaborated types; e.g. title (text) replaced with
3
+ # title-main, title-intro, title-part; type replaced with
4
+ # enum.
5
+ #
6
+ # some renaming at leaf nodes is permissible
7
+ #
8
+ # obligations can change both from optional to mandatory,
9
+ # and from mandatory to optional; optional elements may
10
+ # be omitted; freely positioned alternatives may be replaced
11
+ # with strict ordering
12
+ #
13
+ # DO NOT introduce a namespace here. We do not want a distinct namespace
14
+ # for these elements, and a distinct namespace for any grammar inheriting
15
+ # these elements; we just want one namespace for any child grammars
16
+ # of this.
17
+
18
+ grammar {
19
+
20
+ include "reqt.rnc" { }
21
+
22
+ #include "biblio.rnc" { }
23
+
24
+ include "basicdoc.rnc" {
25
+
26
+ start = standard-document
27
+
28
+ doctype = element doctype {
29
+ attribute abbreviation { text }?,
30
+ DocumentType
31
+ }
32
+
33
+ index = element index {
34
+ attribute to { xsd:IDREF }?,
35
+ element primary { (PureTextElement|stem)+ },
36
+ element secondary { (PureTextElement|stem)+ }?,
37
+ element tertiary { (PureTextElement|stem)+ }?
38
+ }
39
+
40
+ bibitem =
41
+ element bibitem {
42
+ attribute id { xsd:ID },
43
+ attribute hidden { xsd:boolean }?,
44
+ BibliographicItem
45
+ }
46
+
47
+ section-title =
48
+ element title { TextElement* },
49
+ element variant-title { TypedTitleString }*
50
+
51
+ hyperlink =
52
+ element link {
53
+ attribute target { xsd:anyURI },
54
+ attribute type { ReferenceFormat }?,
55
+ attribute alt { text }?,
56
+ attribute update-type { xsd:boolean }?,
57
+ PureTextElement+
58
+ }
59
+
60
+ xref =
61
+ element xref {
62
+ attribute target { xsd:string { pattern = "\i\c*|\c+#\c+" }},
63
+ attribute to { xsd:string { pattern = "\i\c*|\c+#\c+" }}?,
64
+ attribute type { ReferenceFormat }?,
65
+ attribute alt { text }?,
66
+ attribute case { "capital" | "lowercase" }?,
67
+ attribute droploc { xsd:boolean }?,
68
+ XrefBody
69
+ }
70
+
71
+ erefType =
72
+ attribute normative { xsd:boolean }?,
73
+ attribute citeas { text },
74
+ attribute type { ReferenceFormat },
75
+ attribute alt { text }?,
76
+ attribute case { "capital" | "lowercase" }?,
77
+ attribute droploc { xsd:boolean }?,
78
+ CitationType,
79
+ PureTextElement+
80
+
81
+
82
+ localityStack =
83
+ element localityStack {
84
+ attribute connective { "and" | "or" | "from" | "to" | "" }?,
85
+ locality*
86
+ }
87
+
88
+ sourceLocalityStack =
89
+ element sourceLocalityStack {
90
+ attribute connective { "and" | "or" | "from" | "to" | "" }?,
91
+ sourceLocality*
92
+ }
93
+
94
+ ul =
95
+ element ul {
96
+ attribute id { xsd:ID },
97
+ attribute keep-with-next { xsd:boolean }?,
98
+ attribute keep-lines-together { xsd:boolean }?,
99
+ attribute tag { text }?,
100
+ attribute multilingual-rendering { MultilingualRenderingType }?,
101
+ ul_li+, note*
102
+ }
103
+
104
+ ol =
105
+ element ol {
106
+ attribute id { xsd:ID },
107
+ attribute keep-with-next { xsd:boolean }?,
108
+ attribute keep-lines-together { xsd:boolean }?,
109
+ attribute tag { text }?,
110
+ attribute multilingual-rendering { MultilingualRenderingType }?,
111
+ attribute type { ( "roman" | "alphabet" | "arabic" |
112
+ "roman_upper" | "alphabet_upper" ) }?,
113
+ li+, note*
114
+ }
115
+
116
+ dl =
117
+ element dl {
118
+ attribute id { xsd:ID },
119
+ attribute keep-with-next { xsd:boolean }?,
120
+ attribute keep-lines-together { xsd:boolean }?,
121
+ attribute key { xsd:boolean }?,
122
+ attribute tag { text }?,
123
+ attribute multilingual-rendering { MultilingualRenderingType }?,
124
+ (dt, dd)+, note*
125
+ }
126
+
127
+ dt =
128
+ element dt {
129
+ attribute id { xsd:ID }?,
130
+ TextElement*
131
+ }
132
+
133
+
134
+ example =
135
+ element example {
136
+ attribute id { xsd:ID },
137
+ attribute unnumbered { xsd:boolean }?,
138
+ attribute subsequence { text }?,
139
+ attribute number { text }?,
140
+ attribute keep-with-next { xsd:boolean }?,
141
+ attribute keep-lines-together { xsd:boolean }?,
142
+ attribute tag { text }?,
143
+ attribute multilingual-rendering { MultilingualRenderingType }?,
144
+ tname?,
145
+ ( formula | ul | ol | dl | quote | sourcecode | paragraph-with-footnote | figure )+,
146
+ note*
147
+ }
148
+
149
+ table =
150
+ element table {
151
+ attribute id { xsd:ID },
152
+ attribute unnumbered { xsd:boolean }?,
153
+ attribute number { text }?,
154
+ attribute subsequence { text }?,
155
+ attribute alt { text }?,
156
+ attribute summary { text }?,
157
+ attribute uri { xsd:anyURI }?,
158
+ attribute keep-with-next { xsd:boolean }?,
159
+ attribute keep-lines-together { xsd:boolean }?,
160
+ attribute width { text }?,
161
+ attribute tag { text }?,
162
+ attribute multilingual-rendering { MultilingualRenderingType }?,
163
+ colgroup?, tname?, thead?, tbody, tfoot?, table-note*, dl?
164
+ }
165
+
166
+ figure =
167
+ element figure {
168
+ attribute id { xsd:ID },
169
+ attribute unnumbered { xsd:boolean }?,
170
+ attribute number { text }?,
171
+ attribute subsequence { text }?,
172
+ attribute keep-with-next { xsd:boolean }?,
173
+ attribute keep-lines-together { xsd:boolean }?,
174
+ attribute class { text }?,
175
+ attribute tag { text }?,
176
+ attribute multilingual-rendering { MultilingualRenderingType }?,
177
+ source?, tname?, (image | video | audio | pre | paragraph-with-footnote+ | figure*), fn*, dl?, note*
178
+ }
179
+
180
+ sourcecode =
181
+ element sourcecode {
182
+ attribute id { xsd:ID },
183
+ attribute unnumbered { xsd:boolean }?,
184
+ attribute number { text }?,
185
+ attribute subsequence { text }?,
186
+ attribute keep-with-next { xsd:boolean }?,
187
+ attribute keep-lines-together { xsd:boolean }?,
188
+ attribute lang { text }?,
189
+ attribute tag { text }?,
190
+ attribute multilingual-rendering { MultilingualRenderingType }?,
191
+ tname?, ( text | callout )+, annotation*, note*
192
+ }
193
+
194
+ formula =
195
+ element formula {
196
+ attribute id { xsd:ID },
197
+ attribute unnumbered { xsd:boolean }?,
198
+ attribute number { text }?,
199
+ attribute subsequence { text }?,
200
+ attribute keep-with-next { xsd:boolean }?,
201
+ attribute keep-lines-together { xsd:boolean }?,
202
+ attribute inequality { xsd:boolean }?,
203
+ attribute tag { text }?,
204
+ attribute multilingual-rendering { MultilingualRenderingType }?,
205
+ stem, dl?, note*
206
+ }
207
+
208
+ ParagraphType =
209
+ attribute id { xsd:ID },
210
+ attribute align { Alignments }?,
211
+ attribute keep-with-next { xsd:boolean }?,
212
+ attribute keep-lines-together { xsd:boolean }?,
213
+ attribute tag { text }?,
214
+ attribute multilingual-rendering { MultilingualRenderingType }?,
215
+ ( TextElement )*, note*
216
+
217
+ paragraph-with-footnote =
218
+ element p {
219
+ attribute id { xsd:ID },
220
+ attribute align { Alignments }?,
221
+ attribute keep-with-next { xsd:boolean }?,
222
+ attribute keep-lines-together { xsd:boolean }?,
223
+ attribute tag { text }?,
224
+ attribute multilingual-rendering { MultilingualRenderingType }?,
225
+ ( TextElement | fn )*, note*
226
+ }
227
+
228
+ quote =
229
+ element quote {
230
+ attribute id { xsd:ID },
231
+ attribute alignment { Alignments }?,
232
+ attribute keep-with-next { xsd:boolean }?,
233
+ attribute keep-lines-together { xsd:boolean }?,
234
+ attribute tag { text }?,
235
+ attribute multilingual-rendering { MultilingualRenderingType }?,
236
+ quote-source?,
237
+ quote-author?,
238
+ paragraph-with-footnote+,
239
+ note*
240
+ }
241
+
242
+ BibDataExtensionType =
243
+ doctype,
244
+ docsubtype?,
245
+ editorialgroup?,
246
+ ics*,
247
+ structuredidentifier*
248
+
249
+ # TitleType = text
250
+
251
+ sections =
252
+ element sections {
253
+ ( clause | terms | term-clause | definitions | floating-title )+
254
+ }
255
+
256
+ references =
257
+ element references {
258
+ attribute id { xsd:ID }?,
259
+ attribute obligation { "normative" | "informative" }?,
260
+ attribute normative { xsd:boolean },
261
+ section-title?,
262
+ BasicBlock*,
263
+ (bibitem, note*)*,
264
+ references*
265
+ }
266
+
267
+ note = element note {
268
+ attribute id { xsd:ID },
269
+ attribute unnumbered { xsd:boolean }?,
270
+ attribute number { text }?,
271
+ attribute subsequence { text }?,
272
+ attribute keep-with-next { xsd:boolean }?,
273
+ attribute keep-lines-together { xsd:boolean }?,
274
+ attribute type { text }?,
275
+ attribute tag { text }?,
276
+ attribute multilingual-rendering { MultilingualRenderingType }?,
277
+ (paragraph | ul | ol | dl | formula | quote | sourcecode)+
278
+ }
279
+
280
+ Basic-Section =
281
+ attribute id { xsd:ID }?,
282
+ attribute language { text }?,
283
+ attribute script { text }?,
284
+ attribute obligation { "normative" | "informative" }?,
285
+ section-title?,
286
+ (BasicBlock+)
287
+
288
+ li =
289
+ element li {
290
+ attribute id { xsd:ID }?,
291
+ BasicBlock+
292
+ # exclude figures?
293
+ }
294
+
295
+ dd =
296
+ element dd {
297
+ # exclude figures?
298
+ BasicBlock*
299
+ }
300
+
301
+ thead = element thead { tr+ }
302
+
303
+ td =
304
+ element td {
305
+ attribute colspan { text }?,
306
+ attribute rowspan { text }?,
307
+ attribute align { "left" | "right" | "center" }?,
308
+ attribute valign { "top" | "middle" | "bottom" | "baseline" }?,
309
+ (
310
+ (TextElement | fn )* |
311
+ (paragraph-with-footnote | dl | ul | ol | figure)+
312
+ )
313
+ }
314
+
315
+ th =
316
+ element th {
317
+ attribute colspan { text }?,
318
+ attribute rowspan { text }?,
319
+ attribute align { "left" | "right" | "center" }?,
320
+ attribute valign { "top" | "middle" | "bottom" | "baseline" }?,
321
+ (
322
+ (TextElement | fn )* |
323
+ paragraph-with-footnote+
324
+ )
325
+ }
326
+
327
+ table-note = element note {
328
+ attribute id { xsd:ID }?,
329
+ paragraph
330
+ }
331
+
332
+ em = element em { (PureTextElement|stem|index|eref|xref|hyperlink)* }
333
+ strong = element strong { (PureTextElement|stem|index|eref|xref|hyperlink)* }
334
+ tt = element tt { (PureTextElement|index|eref|xref|hyperlink)* }
335
+ keyword = element keyword { (PureTextElement|index)* }
336
+ strike = element strike { (PureTextElement|index)* }
337
+ underline = element underline { (PureTextElement|index)* }
338
+ smallcap = element smallcap { (PureTextElement|index)* }
339
+ sub = element sub { (PureTextElement|stem)* }
340
+ sup = element sup { (PureTextElement|stem)* }
341
+
342
+ pagebreak = element pagebreak {
343
+ attribute orientation { "landscape" | "portrait" }?
344
+ }
345
+
346
+ }
347
+
348
+ # end overrides
349
+
350
+ image |=
351
+ element svg {
352
+ ( text | AnyElement )+
353
+ }
354
+
355
+
356
+ MultilingualRenderingType = "common" | "all-columns" | "parallel" | "tag"
357
+
358
+ docsubtype = element subdoctype { DocumentSubtype }
359
+
360
+ DocumentSubtype = text
361
+
362
+ colgroup = element colgroup { col+ }
363
+
364
+ col = element col {
365
+ attribute width { text }
366
+ }
367
+
368
+ BibItemType |= "internal"
369
+
370
+ TextElement |= concept | add | del
371
+
372
+ add = element add { PureTextElement | eref | stem | keyword | xref | hyperlink }
373
+ del = element del { PureTextElement | eref | stem | keyword | xref | hyperlink }
374
+
375
+ concept = element concept {
376
+ attribute ital { xsd:boolean }?,
377
+ attribute ref { xsd:boolean }?,
378
+ attribute linkmention { xsd:boolean }?,
379
+ attribute linkref { xsd:boolean }?,
380
+ element refterm { (PureTextElement|stem)* }?,
381
+ element renderterm { (PureTextElement|stem)* }?,
382
+ ( eref | xref | termref )
383
+ }
384
+
385
+ BasicBlock |= requirement | recommendation | permission | imagemap | svgmap | inputform | toc | passthrough
386
+
387
+ toc = element toc {
388
+ ( ul )
389
+ }
390
+
391
+ passthrough = element passthrough {
392
+ attribute formats { text }?,
393
+ text
394
+ }
395
+
396
+ inputform = element form {
397
+ attribute id { xsd:ID },
398
+ attribute name { text },
399
+ attribute action { text },
400
+ attribute class { text }?,
401
+ attribute tag { text }?,
402
+ attribute multilingual-rendering { MultilingualRenderingType }?,
403
+ ( TextElement | FormInput )*
404
+ }
405
+
406
+ FormInput = input | formlabel | select | textarea
407
+
408
+ InputType = "button" | "checkbox" | "date" | "file" | "password" | "radio" | "submit" | "text"
409
+
410
+ input = element input {
411
+ attribute type { InputType },
412
+ attribute checked { xsd:boolean }?,
413
+ attribute disabled { xsd:boolean }?,
414
+ attribute readonly { xsd:boolean }?,
415
+ attribute maxlength { xsd:int }?,
416
+ attribute minlength { xsd:int }?,
417
+ attribute name { text }?,
418
+ attribute value { text }?,
419
+ attribute id { xsd:ID }?
420
+ }
421
+
422
+ formlabel = element label {
423
+ attribute for { xsd:IDREF },
424
+ PureTextElement*
425
+ }
426
+
427
+ select = element select {
428
+ attribute name { text }?,
429
+ attribute value { text }?,
430
+ attribute id { xsd:ID }?,
431
+ attribute disabled { xsd:boolean }?,
432
+ attribute multiple { xsd:boolean }?,
433
+ attribute size { xsd:int }?,
434
+ option+
435
+ }
436
+
437
+ option = element option {
438
+ attribute disabled { xsd:boolean }?,
439
+ attribute value { text }?,
440
+ PureTextElement*
441
+ }
442
+
443
+ textarea = element textarea {
444
+ attribute name { text }?,
445
+ attribute value { text }?,
446
+ attribute id { xsd:ID }?,
447
+ attribute rows { xsd:int }?,
448
+ attribute cols { xsd:int }?
449
+ }
450
+
451
+ bibliography =
452
+ element bibliography {
453
+ (references | reference-clause)+
454
+ }
455
+
456
+ reference-clause =
457
+ element clause {
458
+ attribute id { xsd:ID }?,
459
+ attribute language { text }?,
460
+ attribute script { text }?,
461
+ attribute inline-header { xsd:boolean }?,
462
+ attribute number { text }?,
463
+ attribute obligation { "normative" | "informative" }?,
464
+ section-title?,
465
+ BasicBlock*,
466
+ (
467
+ reference-clause+ | references*
468
+ )
469
+ }
470
+
471
+ editorialgroup = element editorialgroup {
472
+ technical-committee+
473
+ }
474
+
475
+ technical-committee =
476
+ element technical-committee { IsoWorkgroup }
477
+
478
+ IsoWorkgroup =
479
+ attribute number { text }?,
480
+ attribute type { text }?,
481
+ attribute identifier { text }?,
482
+ attribute prefix { text }?,
483
+ text
484
+
485
+ ics = element ics {
486
+ element code { text },
487
+ element text { text }?
488
+ }
489
+
490
+ standard-document =
491
+ element standard-document {
492
+ attribute version { text },
493
+ attribute type { "semantic" | "presentation" },
494
+ bibdata, misccontainer?, boilerplate?, preface?, sections, annex*, bibliography?, indexsect*
495
+ }
496
+
497
+ misccontainer = element misc-container { AnyElement+ }
498
+
499
+ preface =
500
+ element preface { ( content | abstract | foreword | introduction | acknowledgements)+ }
501
+
502
+ foreword =
503
+ element foreword { Content-Section }
504
+
505
+ introduction =
506
+ element introduction { Content-Section }
507
+
508
+ indexsect = element indexsect { Content-Section }
509
+
510
+ boilerplate =
511
+ element boilerplate { copyright-statement?, license-statement?, legal-statement?, feedback-statement? }
512
+
513
+ copyright-statement =
514
+ element copyright-statement { Content-Section }
515
+
516
+ license-statement =
517
+ element license-statement { Content-Section }
518
+
519
+ legal-statement =
520
+ element legal-statement { Content-Section }
521
+
522
+ feedback-statement =
523
+ element feedback-statement { Content-Section }
524
+
525
+ definitions =
526
+ element definitions {
527
+ attribute id { xsd:ID }?,
528
+ attribute language { text }?,
529
+ attribute script { text }?,
530
+ attribute type { text }?,
531
+ attribute obligation { "normative" | "informative" }?,
532
+ section-title?,
533
+ (BasicBlock*,
534
+ dl)+
535
+ }
536
+
537
+ content =
538
+ element clause { Content-Section }
539
+
540
+ abstract =
541
+ element abstract { Content-Section }
542
+
543
+ acknowledgements =
544
+ element acknowledgements { Content-Section }
545
+
546
+ content-subsection =
547
+ element clause { Content-Section }
548
+
549
+ Content-Section =
550
+ attribute id { xsd:ID }?,
551
+ attribute language { text }?,
552
+ attribute script { text }?,
553
+ attribute inline-header { xsd:boolean }?,
554
+ attribute obligation { "normative" | "informative" }?,
555
+ attribute number { text }?,
556
+ attribute type { text }?,
557
+ section-title?,
558
+ ( (BasicBlock*),
559
+ content-subsection* )
560
+
561
+ clause =
562
+ element clause { Clause-Section }
563
+
564
+ Clause-Section =
565
+ attribute id { xsd:ID }?,
566
+ attribute language { text }?,
567
+ attribute script { text }?,
568
+ attribute inline-header { xsd:boolean }?,
569
+ attribute obligation { "normative" | "informative" }?,
570
+ attribute type { text }?,
571
+ attribute number { text }?,
572
+ section-title?,
573
+ (
574
+ ( ( BasicBlock+ ) | amend ) |
575
+ (clause-subsection | terms | definitions | floating-title )+
576
+ )
577
+
578
+ Annex-Section =
579
+ attribute id { xsd:ID }?,
580
+ attribute language { text }?,
581
+ attribute script { text }?,
582
+ attribute inline-header { xsd:boolean }?,
583
+ attribute obligation { "normative" | "informative" }?,
584
+ section-title?,
585
+ (
586
+ ( BasicBlock* ),
587
+ (annex-subsection | terms | definitions | references | floating-title )*
588
+ )
589
+
590
+ clause-subsection =
591
+ element clause { Clause-Section }
592
+
593
+ annex-subsection =
594
+ element clause { Annex-Section }
595
+
596
+ annex =
597
+ element annex { Annex-Section }
598
+
599
+ terms =
600
+ element terms {
601
+ attribute id { xsd:ID }?,
602
+ attribute language { text }?,
603
+ attribute script { text }?,
604
+ attribute type { text }?,
605
+ attribute number { text }?,
606
+ attribute obligation { "normative" | "informative" }?,
607
+ section-title?,
608
+ BasicBlock*,
609
+ (term+ | ( terms*, definitions?) )
610
+ }
611
+
612
+ term =
613
+ element term {
614
+ attribute id { xsd:ID }?,
615
+ attribute language { text }?,
616
+ attribute script { text }?,
617
+ attribute tag { text }?,
618
+ attribute multilingual-rendering { MultilingualRenderingType }?,
619
+ preferred+, admitted*, deprecates*, related*,
620
+ termdomain?, termsubject?,
621
+ termdefinition+, termnote*, termexample*, termsource*
622
+ }
623
+
624
+ preferred =
625
+ element preferred { Designation }
626
+
627
+ admitted =
628
+ element admitted { Designation }
629
+
630
+ related =
631
+ element related {
632
+ attribute type { RelatedTermType },
633
+ element preferred { Designation },
634
+ ( eref | xref | termref )
635
+ }
636
+
637
+ RelatedTermType =
638
+ "deprecates" | "supersedes" | "narrower" | "broader" | "equivalent" | "compare" | "contrast" | "see"
639
+
640
+ deprecates =
641
+ element deprecates { Designation }
642
+
643
+ Designation =
644
+ attribute absent { xsd:boolean }?,
645
+ attribute geographic-area { text }?,
646
+ (expression_designation | letter_symbol_designation | graphical_symbol_designation ),
647
+ fieldofapplication?, usageinfo?,
648
+ termsource*
649
+
650
+ fieldofapplication =
651
+ element field-of-application { PureTextElement+ }
652
+
653
+ usageinfo =
654
+ element usage-info { PureTextElement+ }
655
+
656
+ letter_symbol_designation =
657
+ element letter-symbol {
658
+ attribute isInternational { xsd:boolean }?,
659
+ element name { (PureTextElement | stem)+ }
660
+ }
661
+
662
+ graphical_symbol_designation =
663
+ element graphical-symbol {
664
+ attribute isInternational { xsd:boolean }?,
665
+ figure
666
+ }
667
+
668
+ expression_designation =
669
+ element expression {
670
+ ## ISO-639
671
+ attribute language { text }?,
672
+ ## ISO-15924
673
+ attribute script { text }?,
674
+ attribute type { ExpressionDesignationType }?,
675
+ attribute isInternational { xsd:boolean }?,
676
+ element name { (PureTextElement|stem|index)* },
677
+ element abbreviation-type { AbbreviationType }?,
678
+ element pronunciation { LocalizedString }?,
679
+ element grammar { Grammar }?
680
+ }
681
+
682
+ ExpressionDesignationType = "prefix" | "suffix" | "abbreviation" | "full"
683
+
684
+ AbbreviationType = "truncation" | "acronym" | "initialism"
685
+
686
+ Grammar =
687
+ element gender { GrammarGender }*,
688
+ element number { GrammarNumber }*,
689
+ element isPreposition { xsd:boolean }?,
690
+ element isParticiple { xsd:boolean }?,
691
+ element isAdjective { xsd:boolean }?,
692
+ element isVerb { xsd:boolean }?,
693
+ element isAdverb { xsd:boolean }?,
694
+ element isNoun { xsd:boolean }?,
695
+ element grammar-value { text }*
696
+
697
+ GrammarGender = "masculine" | "feminine" | "neuter" | "common"
698
+
699
+ GrammarNumber = "singular" | "dual" | "plural"
700
+
701
+ termdomain =
702
+ element domain { TextElement+ }
703
+
704
+ termsubject =
705
+ element subject { TextElement+ }
706
+
707
+ termdefinition =
708
+ element definition {
709
+ verbaldefinition | nonverbalrep | (verbaldefinition, nonverbalrep)
710
+ }
711
+
712
+ verbaldefinition = element verbal-definition {
713
+ (paragraph | dl | ol | ul | table | figure | formula)+,
714
+ termsource*
715
+ }
716
+
717
+ nonverbalrep =
718
+ element non-verbal-representation {
719
+ ( table | figure | formula )+,
720
+ termsource*
721
+ }
722
+
723
+ termnote =
724
+ element termnote {
725
+ attribute id { xsd:ID },
726
+ attribute unnumbered { xsd:boolean }?,
727
+ attribute number { text }?,
728
+ attribute subsequence { text }?,
729
+ attribute keep-with-next { xsd:boolean }?,
730
+ attribute keep-lines-together { xsd:boolean }?,
731
+ attribute tag { text }?,
732
+ attribute multilingual-rendering { MultilingualRenderingType }?,
733
+ (paragraph | ul | ol | dl | formula)+
734
+ }
735
+
736
+ termexample =
737
+ element termexample {
738
+ attribute id { xsd:ID },
739
+ attribute keep-with-next { xsd:boolean }?,
740
+ attribute keep-lines-together { xsd:boolean }?,
741
+ attribute tag { text }?,
742
+ attribute multilingual-rendering { MultilingualRenderingType }?,
743
+ ( formula | ul | ol | dl | quote | sourcecode | paragraph | figure )+
744
+ }
745
+
746
+ termsource =
747
+ element termsource {
748
+ attribute status { ( "identical" | "modified" ) },
749
+ attribute type { ( "authoritative" | "lineage" ) },
750
+ origin, modification?
751
+ }
752
+
753
+ origin =
754
+ element origin { erefType | termref }
755
+
756
+ modification =
757
+ element modification { paragraph }
758
+
759
+ termref = element termref {
760
+ attribute base { text },
761
+ attribute target { text },
762
+ text?
763
+ }
764
+
765
+ structuredidentifier = element structuredidentifier {
766
+ attribute type { text }?,
767
+ element agency { text }+,
768
+ element class { text }?,
769
+ element docnumber { text },
770
+ element partnumber { text }?,
771
+ element edition { text }?,
772
+ element version { text }?,
773
+ element supplementtype { text }?,
774
+ element supplementnumber { text }?,
775
+ element language { text }?,
776
+ element year { text }?
777
+ }
778
+
779
+ term-clause =
780
+ element clause {
781
+ attribute id { xsd:ID }?,
782
+ attribute language { text }?,
783
+ attribute script { text }?,
784
+ attribute inline-header { xsd:boolean }?,
785
+ attribute obligation { "normative" | "informative" }?,
786
+ section-title?,
787
+ BasicBlock*,
788
+ (
789
+ (term-clause | terms | definitions)*
790
+ )
791
+ }
792
+
793
+ termdocsource =
794
+ element termdocsource { CitationType }
795
+
796
+ amend =
797
+ element amend {
798
+ attribute id { xsd:ID }?,
799
+ attribute change { "add" | "modify" | "delete" | "replace" },
800
+ attribute path { text }?,
801
+ attribute path_end { text }?,
802
+ attribute title { text }?,
803
+ attribute tag { text }?,
804
+ attribute multilingual-rendering { MultilingualRenderingType }?,
805
+ element location { locality* }?,
806
+ autonumber*,
807
+ element description { BasicBlock* }?,
808
+ element newcontent {
809
+ attribute id { xsd:ID }?,
810
+ BasicBlock* }?,
811
+ element description { BasicBlock* }?
812
+ }
813
+
814
+ autonumber =
815
+ element autonumber {
816
+ attribute type { "requirement" | "recommendation" | "permission" | "table" | "figure" | "admonition" | "formula" | "sourcecode" | "example" | "note" },
817
+ text
818
+ }
819
+
820
+ imagemap = element imagemap {
821
+ attribute tag { text }?,
822
+ attribute multilingual-rendering { MultilingualRenderingType }?,
823
+ figure,
824
+ element area {
825
+ attribute type { "rect" | "circle" | "ellipse" | "poly" },
826
+ ( xref | hyperlink | eref ),
827
+ element coords {
828
+ attribute x { xsd:float },
829
+ attribute y { xsd:float }
830
+ }+,
831
+ element radius {
832
+ attribute x { xsd:float },
833
+ attribute y { xsd:float }?
834
+ }?
835
+ }*
836
+ }
837
+
838
+ svgmap = element svgmap {
839
+ attribute tag { text }?,
840
+ attribute multilingual-rendering { MultilingualRenderingType }?,
841
+ figure,
842
+ element target {
843
+ attribute href { xsd:anyURI },
844
+ ( xref | hyperlink | eref )
845
+ }*
846
+ }
847
+
848
+ ul_li =
849
+ element li {
850
+ attribute id { xsd:ID }?,
851
+ attribute uncheckedcheckbox { xsd:boolean }?,
852
+ attribute checkedcheckbox { xsd:boolean }?,
853
+ BasicBlock+
854
+ }
855
+
856
+ floating-title =
857
+ element floating-title {
858
+ attribute id { xsd:ID },
859
+ attribute depth { xsd:int },
860
+ TextElement*
861
+ }
862
+
863
+ XrefBody =
864
+ XrefTarget*,
865
+ PureTextElement+
866
+
867
+ XrefTarget =
868
+ element location {
869
+ attribute target { xsd:string { pattern = "\i\c*|\c+#\c+" }},
870
+ attribute connective { "and" | "or" | "from" | "to" | "" }
871
+ }
872
+
873
+ }