rng 0.1.2 → 0.3.3
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.
- checksums.yaml +4 -4
- data/.github/workflows/docs.yml +63 -0
- data/.github/workflows/release.yml +8 -3
- data/.gitignore +11 -0
- data/.rubocop.yml +10 -7
- data/.rubocop_todo.yml +229 -23
- data/CHANGELOG.md +317 -0
- data/CLAUDE.md +139 -0
- data/Gemfile +11 -12
- data/README.adoc +1538 -11
- data/Rakefile +11 -3
- data/docs/Gemfile +8 -0
- data/docs/_config.yml +23 -0
- data/docs/getting-started/index.adoc +75 -0
- data/docs/guides/error-handling.adoc +137 -0
- data/docs/guides/external-references.adoc +128 -0
- data/docs/guides/index.adoc +24 -0
- data/docs/guides/parsing-rnc.adoc +141 -0
- data/docs/guides/parsing-rng-xml.adoc +81 -0
- data/docs/guides/rng-to-rnc.adoc +101 -0
- data/docs/guides/validation.adoc +85 -0
- data/docs/index.adoc +52 -0
- data/docs/reference/api.adoc +126 -0
- data/docs/reference/cli.adoc +182 -0
- data/docs/understanding/architecture.adoc +58 -0
- data/docs/understanding/rng-vs-rnc.adoc +118 -0
- data/exe/rng +5 -0
- data/lib/rng/any_name.rb +10 -8
- data/lib/rng/attribute.rb +28 -26
- data/lib/rng/choice.rb +24 -24
- data/lib/rng/cli.rb +607 -0
- data/lib/rng/data.rb +10 -10
- data/lib/rng/datatype_declaration.rb +26 -0
- data/lib/rng/define.rb +44 -41
- data/lib/rng/div.rb +36 -0
- data/lib/rng/documentation.rb +9 -0
- data/lib/rng/element.rb +39 -37
- data/lib/rng/empty.rb +7 -7
- data/lib/rng/except.rb +25 -25
- data/lib/rng/external_ref.rb +8 -8
- data/lib/rng/external_ref_resolver.rb +582 -0
- data/lib/rng/foreign_attribute.rb +26 -0
- data/lib/rng/foreign_element.rb +33 -0
- data/lib/rng/grammar.rb +14 -12
- data/lib/rng/group.rb +26 -24
- data/lib/rng/include.rb +5 -6
- data/lib/rng/include_processor.rb +461 -0
- data/lib/rng/interleave.rb +23 -23
- data/lib/rng/list.rb +22 -22
- data/lib/rng/mixed.rb +23 -23
- data/lib/rng/name.rb +7 -7
- data/lib/rng/namespace_declaration.rb +47 -0
- data/lib/rng/namespaces.rb +15 -0
- data/lib/rng/not_allowed.rb +7 -7
- data/lib/rng/ns_name.rb +9 -9
- data/lib/rng/one_or_more.rb +23 -23
- data/lib/rng/optional.rb +23 -23
- data/lib/rng/param.rb +8 -8
- data/lib/rng/parent_ref.rb +8 -8
- data/lib/rng/parse_tree_processor.rb +695 -0
- data/lib/rng/pattern.rb +7 -7
- data/lib/rng/ref.rb +8 -8
- data/lib/rng/rnc_builder.rb +927 -0
- data/lib/rng/rnc_parser.rb +605 -305
- data/lib/rng/rnc_to_rng_converter.rb +1408 -0
- data/lib/rng/schema_preamble.rb +73 -0
- data/lib/rng/schema_validator.rb +1622 -0
- data/lib/rng/start.rb +27 -25
- data/lib/rng/test_suite_parser.rb +168 -0
- data/lib/rng/text.rb +11 -8
- data/lib/rng/to_rnc.rb +4 -35
- data/lib/rng/value.rb +6 -7
- data/lib/rng/version.rb +1 -1
- data/lib/rng/zero_or_more.rb +23 -23
- data/lib/rng.rb +68 -17
- data/rng.gemspec +18 -19
- data/scripts/extract_spectest_resources.rb +96 -0
- data/spec/fixtures/compacttest.xml +2511 -0
- data/spec/fixtures/external/circular_a.rng +7 -0
- data/spec/fixtures/external/circular_b.rng +7 -0
- data/spec/fixtures/external/circular_main.rng +7 -0
- data/spec/fixtures/external/external_ref_lib.rng +7 -0
- data/spec/fixtures/external/external_ref_main.rng +7 -0
- data/spec/fixtures/external/include_lib.rng +7 -0
- data/spec/fixtures/external/include_main.rng +3 -0
- data/spec/fixtures/external/nested_chain.rng +6 -0
- data/spec/fixtures/external/nested_leaf.rng +7 -0
- data/spec/fixtures/external/nested_mid.rng +8 -0
- data/spec/fixtures/metanorma/3gpp.rnc +35 -0
- data/spec/fixtures/metanorma/3gpp.rng +105 -0
- data/spec/fixtures/metanorma/basicdoc.rnc +11 -0
- data/spec/fixtures/metanorma/bipm.rnc +148 -0
- data/spec/fixtures/metanorma/bipm.rng +376 -0
- data/spec/fixtures/metanorma/bsi.rnc +104 -0
- data/spec/fixtures/metanorma/bsi.rng +332 -0
- data/spec/fixtures/metanorma/csa.rnc +45 -0
- data/spec/fixtures/metanorma/csa.rng +131 -0
- data/spec/fixtures/metanorma/csd.rnc +43 -0
- data/spec/fixtures/metanorma/csd.rng +132 -0
- data/spec/fixtures/metanorma/gbstandard.rnc +99 -0
- data/spec/fixtures/metanorma/gbstandard.rng +316 -0
- data/spec/fixtures/metanorma/iec.rnc +49 -0
- data/spec/fixtures/metanorma/iec.rng +193 -0
- data/spec/fixtures/metanorma/ietf.rnc +275 -0
- data/spec/fixtures/metanorma/ietf.rng +925 -0
- data/spec/fixtures/metanorma/iho.rnc +58 -0
- data/spec/fixtures/metanorma/iho.rng +179 -0
- data/spec/fixtures/metanorma/isodoc.rnc +873 -0
- data/spec/fixtures/metanorma/isodoc.rng +2704 -0
- data/spec/fixtures/metanorma/isostandard-amd.rnc +43 -0
- data/spec/fixtures/metanorma/isostandard-amd.rng +108 -0
- data/spec/fixtures/metanorma/isostandard.rnc +166 -0
- data/spec/fixtures/metanorma/isostandard.rng +494 -0
- data/spec/fixtures/metanorma/itu.rnc +122 -0
- data/spec/fixtures/metanorma/itu.rng +377 -0
- data/spec/fixtures/metanorma/m3d.rnc +41 -0
- data/spec/fixtures/metanorma/m3d.rng +122 -0
- data/spec/fixtures/metanorma/mpfd.rnc +36 -0
- data/spec/fixtures/metanorma/mpfd.rng +95 -0
- data/spec/fixtures/metanorma/nist.rnc +77 -0
- data/spec/fixtures/metanorma/nist.rng +216 -0
- data/spec/fixtures/metanorma/ogc.rnc +51 -0
- data/spec/fixtures/metanorma/ogc.rng +151 -0
- data/spec/fixtures/metanorma/reqt.rnc +6 -0
- data/spec/fixtures/metanorma/rsd.rnc +36 -0
- data/spec/fixtures/metanorma/rsd.rng +95 -0
- data/spec/fixtures/metanorma/un.rnc +103 -0
- data/spec/fixtures/metanorma/un.rng +367 -0
- data/spec/fixtures/rnc/base.rnc +4 -0
- data/spec/fixtures/rnc/grammar_with_trailing.rnc +8 -0
- data/spec/fixtures/rnc/main_include_trailing.rnc +3 -0
- data/spec/fixtures/rnc/main_with_include.rnc +5 -0
- data/spec/fixtures/rnc/test_augment.rnc +10 -0
- data/spec/fixtures/rnc/test_isodoc_simple.rnc +9 -0
- data/spec/fixtures/rnc/top_level_include.rnc +8 -0
- data/spec/fixtures/spectest_external/case_10_4.7/x +3 -0
- data/spec/fixtures/spectest_external/case_10_4.7/y +7 -0
- data/spec/fixtures/spectest_external/case_11_4.7/x +3 -0
- data/spec/fixtures/spectest_external/case_12_4.7/x +3 -0
- data/spec/fixtures/spectest_external/case_13_4.7/x +3 -0
- data/spec/fixtures/spectest_external/case_13_4.7/y +3 -0
- data/spec/fixtures/spectest_external/case_14_4.7/x +7 -0
- data/spec/fixtures/spectest_external/case_15_4.7/x +7 -0
- data/spec/fixtures/spectest_external/case_16_4.7/x +5 -0
- data/spec/fixtures/spectest_external/case_17_4.7/x +5 -0
- data/spec/fixtures/spectest_external/case_18_4.7/x +7 -0
- data/spec/fixtures/spectest_external/case_19_4.7/level1.rng +9 -0
- data/spec/fixtures/spectest_external/case_19_4.7/level2.rng +7 -0
- data/spec/fixtures/spectest_external/case_1_4.5/sub1/x +3 -0
- data/spec/fixtures/spectest_external/case_1_4.5/sub3/x +3 -0
- data/spec/fixtures/spectest_external/case_1_4.5/x +3 -0
- data/spec/fixtures/spectest_external/case_20_4.6/x +3 -0
- data/spec/fixtures/spectest_external/case_2_4.5/x +3 -0
- data/spec/fixtures/spectest_external/case_3_4.6/x +3 -0
- data/spec/fixtures/spectest_external/case_4_4.6/x +3 -0
- data/spec/fixtures/spectest_external/case_5_4.6/x +1 -0
- data/spec/fixtures/spectest_external/case_6_4.6/x +5 -0
- data/spec/fixtures/spectest_external/case_7_4.6/x +1 -0
- data/spec/fixtures/spectest_external/case_7_4.6/y +1 -0
- data/spec/fixtures/spectest_external/case_8_4.7/x +7 -0
- data/spec/fixtures/spectest_external/case_9_4.7/x +7 -0
- data/spec/fixtures/spectest_external/resources.json +149 -0
- data/spec/rng/advanced_rnc_spec.rb +101 -0
- data/spec/rng/compacttest_spec.rb +197 -0
- data/spec/rng/datatype_declaration_spec.rb +28 -0
- data/spec/rng/div_spec.rb +207 -0
- data/spec/rng/external_ref_resolver_spec.rb +122 -0
- data/spec/rng/metanorma_conversion_spec.rb +159 -0
- data/spec/rng/namespace_declaration_spec.rb +60 -0
- data/spec/rng/namespace_support_spec.rb +199 -0
- data/spec/rng/rnc_parser_spec.rb +498 -22
- data/spec/rng/rnc_roundtrip_spec.rb +96 -82
- data/spec/rng/rng_generation_spec.rb +288 -0
- data/spec/rng/roundtrip_spec.rb +342 -0
- data/spec/rng/schema_preamble_spec.rb +145 -0
- data/spec/rng/schema_spec.rb +68 -64
- data/spec/rng/spectest_spec.rb +168 -90
- data/spec/rng_spec.rb +2 -2
- data/spec/spec_helper.rb +7 -42
- metadata +141 -8
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
3
|
+
<!-- default namespace = "https://www.metanorma.com/ns/bsi" -->
|
|
4
|
+
<include href="isostandard.rng">
|
|
5
|
+
<start>
|
|
6
|
+
<ref name="bsi-standard"/>
|
|
7
|
+
</start>
|
|
8
|
+
<define name="DocumentType">
|
|
9
|
+
<choice>
|
|
10
|
+
<value>british-standard</value>
|
|
11
|
+
<value>draft-for-development</value>
|
|
12
|
+
<value>published-document</value>
|
|
13
|
+
<value>privately-subscribed-standard</value>
|
|
14
|
+
<value>publicly-available-specification</value>
|
|
15
|
+
<value>flex-standard</value>
|
|
16
|
+
<value>international-standard</value>
|
|
17
|
+
<value>technical-specification</value>
|
|
18
|
+
<value>technical-report</value>
|
|
19
|
+
<value>guide</value>
|
|
20
|
+
<value>international-workshop-agreement</value>
|
|
21
|
+
<value>industry-technical-agreement</value>
|
|
22
|
+
<value>standard</value>
|
|
23
|
+
<value>european-workshop-agreement</value>
|
|
24
|
+
</choice>
|
|
25
|
+
</define>
|
|
26
|
+
<define name="DocumentSubtype">
|
|
27
|
+
<choice>
|
|
28
|
+
<value>specification</value>
|
|
29
|
+
<value>method-of-test</value>
|
|
30
|
+
<value>method-of-specifying</value>
|
|
31
|
+
<value>vocabulary</value>
|
|
32
|
+
<value>code-of-practice</value>
|
|
33
|
+
</choice>
|
|
34
|
+
</define>
|
|
35
|
+
<define name="BibDataExtensionType">
|
|
36
|
+
<ref name="doctype"/>
|
|
37
|
+
<optional>
|
|
38
|
+
<ref name="docsubtype"/>
|
|
39
|
+
</optional>
|
|
40
|
+
<ref name="editorialgroup"/>
|
|
41
|
+
<zeroOrMore>
|
|
42
|
+
<ref name="ics"/>
|
|
43
|
+
</zeroOrMore>
|
|
44
|
+
<ref name="structuredidentifier"/>
|
|
45
|
+
<optional>
|
|
46
|
+
<ref name="stagename"/>
|
|
47
|
+
</optional>
|
|
48
|
+
<zeroOrMore>
|
|
49
|
+
<ref name="coverimages"/>
|
|
50
|
+
</zeroOrMore>
|
|
51
|
+
</define>
|
|
52
|
+
<define name="admonition">
|
|
53
|
+
<element name="admonition">
|
|
54
|
+
<attribute name="type">
|
|
55
|
+
<ref name="AdmonitionType"/>
|
|
56
|
+
</attribute>
|
|
57
|
+
<optional>
|
|
58
|
+
<attribute name="class"/>
|
|
59
|
+
</optional>
|
|
60
|
+
<attribute name="id">
|
|
61
|
+
<data type="ID"/>
|
|
62
|
+
</attribute>
|
|
63
|
+
<optional>
|
|
64
|
+
<attribute name="target">
|
|
65
|
+
<data type="IDREF"/>
|
|
66
|
+
</attribute>
|
|
67
|
+
</optional>
|
|
68
|
+
<optional>
|
|
69
|
+
<attribute name="uri">
|
|
70
|
+
<data type="anyURI"/>
|
|
71
|
+
</attribute>
|
|
72
|
+
</optional>
|
|
73
|
+
<optional>
|
|
74
|
+
<ref name="tname"/>
|
|
75
|
+
</optional>
|
|
76
|
+
<zeroOrMore>
|
|
77
|
+
<ref name="paragraph-with-footnote"/>
|
|
78
|
+
</zeroOrMore>
|
|
79
|
+
<zeroOrMore>
|
|
80
|
+
<ref name="note"/>
|
|
81
|
+
</zeroOrMore>
|
|
82
|
+
</element>
|
|
83
|
+
</define>
|
|
84
|
+
<define name="Clause-Section">
|
|
85
|
+
<optional>
|
|
86
|
+
<attribute name="id">
|
|
87
|
+
<data type="ID"/>
|
|
88
|
+
</attribute>
|
|
89
|
+
</optional>
|
|
90
|
+
<optional>
|
|
91
|
+
<attribute name="language"/>
|
|
92
|
+
</optional>
|
|
93
|
+
<optional>
|
|
94
|
+
<attribute name="script"/>
|
|
95
|
+
</optional>
|
|
96
|
+
<optional>
|
|
97
|
+
<attribute name="inline-header">
|
|
98
|
+
<data type="boolean"/>
|
|
99
|
+
</attribute>
|
|
100
|
+
</optional>
|
|
101
|
+
<optional>
|
|
102
|
+
<attribute name="obligation">
|
|
103
|
+
<choice>
|
|
104
|
+
<value>normative</value>
|
|
105
|
+
<value>informative</value>
|
|
106
|
+
</choice>
|
|
107
|
+
</attribute>
|
|
108
|
+
</optional>
|
|
109
|
+
<optional>
|
|
110
|
+
<attribute name="type"/>
|
|
111
|
+
</optional>
|
|
112
|
+
<optional>
|
|
113
|
+
<ref name="section-title"/>
|
|
114
|
+
</optional>
|
|
115
|
+
<choice>
|
|
116
|
+
<choice>
|
|
117
|
+
<oneOrMore>
|
|
118
|
+
<ref name="BasicBlock"/>
|
|
119
|
+
</oneOrMore>
|
|
120
|
+
<ref name="amend"/>
|
|
121
|
+
</choice>
|
|
122
|
+
<oneOrMore>
|
|
123
|
+
<choice>
|
|
124
|
+
<ref name="clause-subsection"/>
|
|
125
|
+
<ref name="floating-title"/>
|
|
126
|
+
</choice>
|
|
127
|
+
</oneOrMore>
|
|
128
|
+
</choice>
|
|
129
|
+
</define>
|
|
130
|
+
<define name="annex">
|
|
131
|
+
<element name="annex">
|
|
132
|
+
<optional>
|
|
133
|
+
<attribute name="id">
|
|
134
|
+
<data type="ID"/>
|
|
135
|
+
</attribute>
|
|
136
|
+
</optional>
|
|
137
|
+
<optional>
|
|
138
|
+
<attribute name="language"/>
|
|
139
|
+
</optional>
|
|
140
|
+
<optional>
|
|
141
|
+
<attribute name="script"/>
|
|
142
|
+
</optional>
|
|
143
|
+
<optional>
|
|
144
|
+
<attribute name="inline-header">
|
|
145
|
+
<data type="boolean"/>
|
|
146
|
+
</attribute>
|
|
147
|
+
</optional>
|
|
148
|
+
<optional>
|
|
149
|
+
<attribute name="obligation">
|
|
150
|
+
<choice>
|
|
151
|
+
<value>normative</value>
|
|
152
|
+
<value>informative</value>
|
|
153
|
+
</choice>
|
|
154
|
+
</attribute>
|
|
155
|
+
</optional>
|
|
156
|
+
<optional>
|
|
157
|
+
<ref name="section-title"/>
|
|
158
|
+
</optional>
|
|
159
|
+
<zeroOrMore>
|
|
160
|
+
<!--
|
|
161
|
+
allow hanging paragraps in annexes: they introduce lists
|
|
162
|
+
( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
|
|
163
|
+
-->
|
|
164
|
+
<ref name="BasicBlock"/>
|
|
165
|
+
</zeroOrMore>
|
|
166
|
+
<zeroOrMore>
|
|
167
|
+
<choice>
|
|
168
|
+
<ref name="clause-hanging-paragraph-with-footnote"/>
|
|
169
|
+
<ref name="floating-title"/>
|
|
170
|
+
</choice>
|
|
171
|
+
</zeroOrMore>
|
|
172
|
+
<zeroOrMore>
|
|
173
|
+
<ref name="annex-appendix"/>
|
|
174
|
+
</zeroOrMore>
|
|
175
|
+
</element>
|
|
176
|
+
</define>
|
|
177
|
+
<define name="clause-hanging-paragraph-with-footnote">
|
|
178
|
+
<element name="clause">
|
|
179
|
+
<optional>
|
|
180
|
+
<attribute name="id">
|
|
181
|
+
<data type="ID"/>
|
|
182
|
+
</attribute>
|
|
183
|
+
</optional>
|
|
184
|
+
<optional>
|
|
185
|
+
<attribute name="language"/>
|
|
186
|
+
</optional>
|
|
187
|
+
<optional>
|
|
188
|
+
<attribute name="script"/>
|
|
189
|
+
</optional>
|
|
190
|
+
<optional>
|
|
191
|
+
<attribute name="inline-header">
|
|
192
|
+
<data type="boolean"/>
|
|
193
|
+
</attribute>
|
|
194
|
+
</optional>
|
|
195
|
+
<optional>
|
|
196
|
+
<attribute name="obligation">
|
|
197
|
+
<choice>
|
|
198
|
+
<value>normative</value>
|
|
199
|
+
<value>informative</value>
|
|
200
|
+
</choice>
|
|
201
|
+
</attribute>
|
|
202
|
+
</optional>
|
|
203
|
+
<optional>
|
|
204
|
+
<ref name="section-title"/>
|
|
205
|
+
</optional>
|
|
206
|
+
<zeroOrMore>
|
|
207
|
+
<!-- allow hanging paragraphs in annexes: they introduce lists -->
|
|
208
|
+
<ref name="BasicBlock"/>
|
|
209
|
+
</zeroOrMore>
|
|
210
|
+
<zeroOrMore>
|
|
211
|
+
<choice>
|
|
212
|
+
<ref name="clause-hanging-paragraph-with-footnote"/>
|
|
213
|
+
<ref name="floating-title"/>
|
|
214
|
+
</choice>
|
|
215
|
+
</zeroOrMore>
|
|
216
|
+
</element>
|
|
217
|
+
</define>
|
|
218
|
+
<define name="sections">
|
|
219
|
+
<element name="sections">
|
|
220
|
+
<zeroOrMore>
|
|
221
|
+
<choice>
|
|
222
|
+
<ref name="note"/>
|
|
223
|
+
<ref name="admonition"/>
|
|
224
|
+
</choice>
|
|
225
|
+
</zeroOrMore>
|
|
226
|
+
<optional>
|
|
227
|
+
<choice>
|
|
228
|
+
<ref name="floating-title"/>
|
|
229
|
+
<ref name="floating-section-title"/>
|
|
230
|
+
</choice>
|
|
231
|
+
</optional>
|
|
232
|
+
<ref name="clause"/>
|
|
233
|
+
<optional>
|
|
234
|
+
<choice>
|
|
235
|
+
<ref name="floating-title"/>
|
|
236
|
+
<ref name="floating-section-title"/>
|
|
237
|
+
</choice>
|
|
238
|
+
</optional>
|
|
239
|
+
<optional>
|
|
240
|
+
<choice>
|
|
241
|
+
<ref name="term-clause"/>
|
|
242
|
+
<ref name="terms"/>
|
|
243
|
+
</choice>
|
|
244
|
+
</optional>
|
|
245
|
+
<optional>
|
|
246
|
+
<choice>
|
|
247
|
+
<ref name="floating-title"/>
|
|
248
|
+
<ref name="floating-section-title"/>
|
|
249
|
+
</choice>
|
|
250
|
+
</optional>
|
|
251
|
+
<optional>
|
|
252
|
+
<ref name="definitions"/>
|
|
253
|
+
</optional>
|
|
254
|
+
<optional>
|
|
255
|
+
<choice>
|
|
256
|
+
<ref name="floating-title"/>
|
|
257
|
+
<ref name="floating-section-title"/>
|
|
258
|
+
</choice>
|
|
259
|
+
</optional>
|
|
260
|
+
<oneOrMore>
|
|
261
|
+
<choice>
|
|
262
|
+
<ref name="clause"/>
|
|
263
|
+
<ref name="term-clause"/>
|
|
264
|
+
<ref name="terms"/>
|
|
265
|
+
<ref name="floating-title"/>
|
|
266
|
+
<ref name="floating-section-title"/>
|
|
267
|
+
</choice>
|
|
268
|
+
</oneOrMore>
|
|
269
|
+
</element>
|
|
270
|
+
</define>
|
|
271
|
+
</include>
|
|
272
|
+
<!-- end overrides -->
|
|
273
|
+
<define name="floating-section-title">
|
|
274
|
+
<element name="section-title">
|
|
275
|
+
<attribute name="id">
|
|
276
|
+
<data type="ID"/>
|
|
277
|
+
</attribute>
|
|
278
|
+
<attribute name="depth">
|
|
279
|
+
<data type="int"/>
|
|
280
|
+
</attribute>
|
|
281
|
+
<zeroOrMore>
|
|
282
|
+
<ref name="TextElement"/>
|
|
283
|
+
</zeroOrMore>
|
|
284
|
+
</element>
|
|
285
|
+
</define>
|
|
286
|
+
<define name="AdmonitionType" combine="choice">
|
|
287
|
+
<value>commentary</value>
|
|
288
|
+
</define>
|
|
289
|
+
<define name="coverimages">
|
|
290
|
+
<element name="coverimages">
|
|
291
|
+
<oneOrMore>
|
|
292
|
+
<ref name="image"/>
|
|
293
|
+
</oneOrMore>
|
|
294
|
+
</element>
|
|
295
|
+
</define>
|
|
296
|
+
<!--
|
|
297
|
+
We display the Normative References between scope and terms; but to keep the
|
|
298
|
+
grammar simple, we keep the references together
|
|
299
|
+
-->
|
|
300
|
+
<define name="bsi-standard">
|
|
301
|
+
<element name="bsi-standard">
|
|
302
|
+
<attribute name="version"/>
|
|
303
|
+
<attribute name="type">
|
|
304
|
+
<choice>
|
|
305
|
+
<value>semantic</value>
|
|
306
|
+
<value>presentation</value>
|
|
307
|
+
</choice>
|
|
308
|
+
</attribute>
|
|
309
|
+
<ref name="bibdata"/>
|
|
310
|
+
<zeroOrMore>
|
|
311
|
+
<ref name="termdocsource"/>
|
|
312
|
+
</zeroOrMore>
|
|
313
|
+
<optional>
|
|
314
|
+
<ref name="misccontainer"/>
|
|
315
|
+
</optional>
|
|
316
|
+
<optional>
|
|
317
|
+
<ref name="boilerplate"/>
|
|
318
|
+
</optional>
|
|
319
|
+
<ref name="preface"/>
|
|
320
|
+
<oneOrMore>
|
|
321
|
+
<ref name="sections"/>
|
|
322
|
+
</oneOrMore>
|
|
323
|
+
<zeroOrMore>
|
|
324
|
+
<ref name="annex"/>
|
|
325
|
+
</zeroOrMore>
|
|
326
|
+
<ref name="bibliography"/>
|
|
327
|
+
<zeroOrMore>
|
|
328
|
+
<ref name="indexsect"/>
|
|
329
|
+
</zeroOrMore>
|
|
330
|
+
</element>
|
|
331
|
+
</define>
|
|
332
|
+
</grammar>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
|
2
|
+
# we cannot have a new default namespace: we will end up with a grammar with two different
|
|
3
|
+
# namespaces, one for isostandard and one for csand additions. And we do not want that.
|
|
4
|
+
|
|
5
|
+
include "isodoc.rnc" {
|
|
6
|
+
|
|
7
|
+
start = csand-standard
|
|
8
|
+
|
|
9
|
+
figure =
|
|
10
|
+
element figure {
|
|
11
|
+
attribute id { xsd:ID },
|
|
12
|
+
attribute unnumbered { xsd:boolean }?,
|
|
13
|
+
attribute number { text }?,
|
|
14
|
+
attribute subsequence { text }?,
|
|
15
|
+
attribute class { text }?,
|
|
16
|
+
source?, tname?, ( figure+ | ( (TextElement* | pre), note*, dl? ) )
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
DocumentType =
|
|
22
|
+
"guidance" | "proposal" | "standard" | "report" | "whitepaper" | "charter" | "policy" |
|
|
23
|
+
"glossary" | "case-study"
|
|
24
|
+
|
|
25
|
+
BibDataExtensionType =
|
|
26
|
+
doctype?, docsubtype?, editorialgroup, ics*
|
|
27
|
+
|
|
28
|
+
editorialgroup = element editorialgroup {
|
|
29
|
+
technical-committee+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
technical-committee = element committee {
|
|
33
|
+
attribute type { text }?,
|
|
34
|
+
text
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
csand-standard =
|
|
40
|
+
element csa-standard {
|
|
41
|
+
attribute version { text },
|
|
42
|
+
attribute type { "semantic" | "presentation" },
|
|
43
|
+
bibdata, termdocsource*, misccontainer?, boilerplate?, preface, sections+, annex*, bibliography, indexsect*
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
3
|
+
<!--
|
|
4
|
+
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
|
5
|
+
we cannot have a new default namespace: we will end up with a grammar with two different
|
|
6
|
+
namespaces, one for isostandard and one for csand additions. And we do not want that.
|
|
7
|
+
-->
|
|
8
|
+
<include href="isodoc.rng">
|
|
9
|
+
<start>
|
|
10
|
+
<ref name="csand-standard"/>
|
|
11
|
+
</start>
|
|
12
|
+
<define name="figure">
|
|
13
|
+
<element name="figure">
|
|
14
|
+
<attribute name="id">
|
|
15
|
+
<data type="ID"/>
|
|
16
|
+
</attribute>
|
|
17
|
+
<optional>
|
|
18
|
+
<attribute name="unnumbered">
|
|
19
|
+
<data type="boolean"/>
|
|
20
|
+
</attribute>
|
|
21
|
+
</optional>
|
|
22
|
+
<optional>
|
|
23
|
+
<attribute name="number"/>
|
|
24
|
+
</optional>
|
|
25
|
+
<optional>
|
|
26
|
+
<attribute name="subsequence"/>
|
|
27
|
+
</optional>
|
|
28
|
+
<optional>
|
|
29
|
+
<attribute name="class"/>
|
|
30
|
+
</optional>
|
|
31
|
+
<optional>
|
|
32
|
+
<ref name="source"/>
|
|
33
|
+
</optional>
|
|
34
|
+
<optional>
|
|
35
|
+
<ref name="tname"/>
|
|
36
|
+
</optional>
|
|
37
|
+
<choice>
|
|
38
|
+
<oneOrMore>
|
|
39
|
+
<ref name="figure"/>
|
|
40
|
+
</oneOrMore>
|
|
41
|
+
<group>
|
|
42
|
+
<choice>
|
|
43
|
+
<zeroOrMore>
|
|
44
|
+
<ref name="TextElement"/>
|
|
45
|
+
</zeroOrMore>
|
|
46
|
+
<ref name="pre"/>
|
|
47
|
+
</choice>
|
|
48
|
+
<zeroOrMore>
|
|
49
|
+
<ref name="note"/>
|
|
50
|
+
</zeroOrMore>
|
|
51
|
+
<optional>
|
|
52
|
+
<ref name="dl"/>
|
|
53
|
+
</optional>
|
|
54
|
+
</group>
|
|
55
|
+
</choice>
|
|
56
|
+
</element>
|
|
57
|
+
</define>
|
|
58
|
+
<define name="DocumentType">
|
|
59
|
+
<choice>
|
|
60
|
+
<value>guidance</value>
|
|
61
|
+
<value>proposal</value>
|
|
62
|
+
<value>standard</value>
|
|
63
|
+
<value>report</value>
|
|
64
|
+
<value>whitepaper</value>
|
|
65
|
+
<value>charter</value>
|
|
66
|
+
<value>policy</value>
|
|
67
|
+
<value>glossary</value>
|
|
68
|
+
<value>case-study</value>
|
|
69
|
+
</choice>
|
|
70
|
+
</define>
|
|
71
|
+
<define name="BibDataExtensionType">
|
|
72
|
+
<optional>
|
|
73
|
+
<ref name="doctype"/>
|
|
74
|
+
</optional>
|
|
75
|
+
<optional>
|
|
76
|
+
<ref name="docsubtype"/>
|
|
77
|
+
</optional>
|
|
78
|
+
<ref name="editorialgroup"/>
|
|
79
|
+
<zeroOrMore>
|
|
80
|
+
<ref name="ics"/>
|
|
81
|
+
</zeroOrMore>
|
|
82
|
+
</define>
|
|
83
|
+
<define name="editorialgroup">
|
|
84
|
+
<element name="editorialgroup">
|
|
85
|
+
<oneOrMore>
|
|
86
|
+
<ref name="technical-committee"/>
|
|
87
|
+
</oneOrMore>
|
|
88
|
+
</element>
|
|
89
|
+
</define>
|
|
90
|
+
<define name="technical-committee">
|
|
91
|
+
<element name="committee">
|
|
92
|
+
<optional>
|
|
93
|
+
<attribute name="type"/>
|
|
94
|
+
</optional>
|
|
95
|
+
<text/>
|
|
96
|
+
</element>
|
|
97
|
+
</define>
|
|
98
|
+
</include>
|
|
99
|
+
<define name="csand-standard">
|
|
100
|
+
<element name="csa-standard">
|
|
101
|
+
<attribute name="version"/>
|
|
102
|
+
<attribute name="type">
|
|
103
|
+
<choice>
|
|
104
|
+
<value>semantic</value>
|
|
105
|
+
<value>presentation</value>
|
|
106
|
+
</choice>
|
|
107
|
+
</attribute>
|
|
108
|
+
<ref name="bibdata"/>
|
|
109
|
+
<zeroOrMore>
|
|
110
|
+
<ref name="termdocsource"/>
|
|
111
|
+
</zeroOrMore>
|
|
112
|
+
<optional>
|
|
113
|
+
<ref name="misccontainer"/>
|
|
114
|
+
</optional>
|
|
115
|
+
<optional>
|
|
116
|
+
<ref name="boilerplate"/>
|
|
117
|
+
</optional>
|
|
118
|
+
<ref name="preface"/>
|
|
119
|
+
<oneOrMore>
|
|
120
|
+
<ref name="sections"/>
|
|
121
|
+
</oneOrMore>
|
|
122
|
+
<zeroOrMore>
|
|
123
|
+
<ref name="annex"/>
|
|
124
|
+
</zeroOrMore>
|
|
125
|
+
<ref name="bibliography"/>
|
|
126
|
+
<zeroOrMore>
|
|
127
|
+
<ref name="indexsect"/>
|
|
128
|
+
</zeroOrMore>
|
|
129
|
+
</element>
|
|
130
|
+
</define>
|
|
131
|
+
</grammar>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# default namespace = "http://riboseinc.com/csd"
|
|
2
|
+
# Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
|
3
|
+
# we cannot have a new default namespace: we will end up with a grammar with two different
|
|
4
|
+
# namespaces, one for isostandard and one for csd additions. And we do not want that.
|
|
5
|
+
|
|
6
|
+
include "isodoc.rnc" {
|
|
7
|
+
|
|
8
|
+
start = csd-standard
|
|
9
|
+
|
|
10
|
+
figure =
|
|
11
|
+
element figure {
|
|
12
|
+
attribute id { xsd:ID },
|
|
13
|
+
attribute unnumbered { xsd:boolean }?,
|
|
14
|
+
attribute number { text }?,
|
|
15
|
+
attribute subsequence { text }?,
|
|
16
|
+
attribute class { text }?,
|
|
17
|
+
source?, tname?, ( figure+ | ( (TextElement* | pre), note*, dl? ) )
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
DocumentType =
|
|
21
|
+
"directive" | "guide" | "specification" | "standard" | "report" | "administrative" | "amendment" | "technical corrigendum" | "advisory"
|
|
22
|
+
|
|
23
|
+
BibDataExtensionType =
|
|
24
|
+
doctype?, docsubtype?, editorialgroup, ics*
|
|
25
|
+
|
|
26
|
+
editorialgroup = element editorialgroup {
|
|
27
|
+
technical-committee+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
technical-committee = element committee {
|
|
31
|
+
attribute type { text }?,
|
|
32
|
+
text
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
csd-standard =
|
|
38
|
+
element csd-standard {
|
|
39
|
+
attribute version { text },
|
|
40
|
+
attribute type { "semantic" | "presentation" },
|
|
41
|
+
bibdata, termdocsource*, misccontainer?, boilerplate?, preface, sections+, annex*, bibliography, indexsect*
|
|
42
|
+
}
|
|
43
|
+
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
3
|
+
<!--
|
|
4
|
+
default namespace = "http://riboseinc.com/csd"
|
|
5
|
+
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
|
6
|
+
we cannot have a new default namespace: we will end up with a grammar with two different
|
|
7
|
+
namespaces, one for isostandard and one for csd additions. And we do not want that.
|
|
8
|
+
-->
|
|
9
|
+
<include href="isodoc.rng">
|
|
10
|
+
<start>
|
|
11
|
+
<ref name="csd-standard"/>
|
|
12
|
+
</start>
|
|
13
|
+
<define name="figure">
|
|
14
|
+
<element name="figure">
|
|
15
|
+
<attribute name="id">
|
|
16
|
+
<data type="ID"/>
|
|
17
|
+
</attribute>
|
|
18
|
+
<optional>
|
|
19
|
+
<attribute name="unnumbered">
|
|
20
|
+
<data type="boolean"/>
|
|
21
|
+
</attribute>
|
|
22
|
+
</optional>
|
|
23
|
+
<optional>
|
|
24
|
+
<attribute name="number"/>
|
|
25
|
+
</optional>
|
|
26
|
+
<optional>
|
|
27
|
+
<attribute name="subsequence"/>
|
|
28
|
+
</optional>
|
|
29
|
+
<optional>
|
|
30
|
+
<attribute name="class"/>
|
|
31
|
+
</optional>
|
|
32
|
+
<optional>
|
|
33
|
+
<ref name="source"/>
|
|
34
|
+
</optional>
|
|
35
|
+
<optional>
|
|
36
|
+
<ref name="tname"/>
|
|
37
|
+
</optional>
|
|
38
|
+
<choice>
|
|
39
|
+
<oneOrMore>
|
|
40
|
+
<ref name="figure"/>
|
|
41
|
+
</oneOrMore>
|
|
42
|
+
<group>
|
|
43
|
+
<choice>
|
|
44
|
+
<zeroOrMore>
|
|
45
|
+
<ref name="TextElement"/>
|
|
46
|
+
</zeroOrMore>
|
|
47
|
+
<ref name="pre"/>
|
|
48
|
+
</choice>
|
|
49
|
+
<zeroOrMore>
|
|
50
|
+
<ref name="note"/>
|
|
51
|
+
</zeroOrMore>
|
|
52
|
+
<optional>
|
|
53
|
+
<ref name="dl"/>
|
|
54
|
+
</optional>
|
|
55
|
+
</group>
|
|
56
|
+
</choice>
|
|
57
|
+
</element>
|
|
58
|
+
</define>
|
|
59
|
+
<define name="DocumentType">
|
|
60
|
+
<choice>
|
|
61
|
+
<value>directive</value>
|
|
62
|
+
<value>guide</value>
|
|
63
|
+
<value>specification</value>
|
|
64
|
+
<value>standard</value>
|
|
65
|
+
<value>report</value>
|
|
66
|
+
<value>administrative</value>
|
|
67
|
+
<value>amendment</value>
|
|
68
|
+
<value>technical corrigendum</value>
|
|
69
|
+
<value>advisory</value>
|
|
70
|
+
</choice>
|
|
71
|
+
</define>
|
|
72
|
+
<define name="BibDataExtensionType">
|
|
73
|
+
<optional>
|
|
74
|
+
<ref name="doctype"/>
|
|
75
|
+
</optional>
|
|
76
|
+
<optional>
|
|
77
|
+
<ref name="docsubtype"/>
|
|
78
|
+
</optional>
|
|
79
|
+
<ref name="editorialgroup"/>
|
|
80
|
+
<zeroOrMore>
|
|
81
|
+
<ref name="ics"/>
|
|
82
|
+
</zeroOrMore>
|
|
83
|
+
</define>
|
|
84
|
+
<define name="editorialgroup">
|
|
85
|
+
<element name="editorialgroup">
|
|
86
|
+
<oneOrMore>
|
|
87
|
+
<ref name="technical-committee"/>
|
|
88
|
+
</oneOrMore>
|
|
89
|
+
</element>
|
|
90
|
+
</define>
|
|
91
|
+
<define name="technical-committee">
|
|
92
|
+
<element name="committee">
|
|
93
|
+
<optional>
|
|
94
|
+
<attribute name="type"/>
|
|
95
|
+
</optional>
|
|
96
|
+
<text/>
|
|
97
|
+
</element>
|
|
98
|
+
</define>
|
|
99
|
+
</include>
|
|
100
|
+
<define name="csd-standard">
|
|
101
|
+
<element name="csd-standard">
|
|
102
|
+
<attribute name="version"/>
|
|
103
|
+
<attribute name="type">
|
|
104
|
+
<choice>
|
|
105
|
+
<value>semantic</value>
|
|
106
|
+
<value>presentation</value>
|
|
107
|
+
</choice>
|
|
108
|
+
</attribute>
|
|
109
|
+
<ref name="bibdata"/>
|
|
110
|
+
<zeroOrMore>
|
|
111
|
+
<ref name="termdocsource"/>
|
|
112
|
+
</zeroOrMore>
|
|
113
|
+
<optional>
|
|
114
|
+
<ref name="misccontainer"/>
|
|
115
|
+
</optional>
|
|
116
|
+
<optional>
|
|
117
|
+
<ref name="boilerplate"/>
|
|
118
|
+
</optional>
|
|
119
|
+
<ref name="preface"/>
|
|
120
|
+
<oneOrMore>
|
|
121
|
+
<ref name="sections"/>
|
|
122
|
+
</oneOrMore>
|
|
123
|
+
<zeroOrMore>
|
|
124
|
+
<ref name="annex"/>
|
|
125
|
+
</zeroOrMore>
|
|
126
|
+
<ref name="bibliography"/>
|
|
127
|
+
<zeroOrMore>
|
|
128
|
+
<ref name="indexsect"/>
|
|
129
|
+
</zeroOrMore>
|
|
130
|
+
</element>
|
|
131
|
+
</define>
|
|
132
|
+
</grammar>
|