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.
- 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 +602 -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 +6 -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 +7 -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,376 @@
|
|
|
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="bipm-standard"/>
|
|
11
|
+
</start>
|
|
12
|
+
<define name="xref">
|
|
13
|
+
<element name="xref">
|
|
14
|
+
<attribute name="target">
|
|
15
|
+
<data type="string">
|
|
16
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
|
17
|
+
</data>
|
|
18
|
+
</attribute>
|
|
19
|
+
<optional>
|
|
20
|
+
<attribute name="to">
|
|
21
|
+
<data type="string">
|
|
22
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
|
23
|
+
</data>
|
|
24
|
+
</attribute>
|
|
25
|
+
</optional>
|
|
26
|
+
<optional>
|
|
27
|
+
<attribute name="type">
|
|
28
|
+
<ref name="ReferenceFormat"/>
|
|
29
|
+
</attribute>
|
|
30
|
+
</optional>
|
|
31
|
+
<optional>
|
|
32
|
+
<attribute name="alt"/>
|
|
33
|
+
</optional>
|
|
34
|
+
<optional>
|
|
35
|
+
<attribute name="case">
|
|
36
|
+
<choice>
|
|
37
|
+
<value>capital</value>
|
|
38
|
+
<value>lowercase</value>
|
|
39
|
+
</choice>
|
|
40
|
+
</attribute>
|
|
41
|
+
</optional>
|
|
42
|
+
<optional>
|
|
43
|
+
<attribute name="droploc">
|
|
44
|
+
<data type="boolean"/>
|
|
45
|
+
</attribute>
|
|
46
|
+
</optional>
|
|
47
|
+
<optional>
|
|
48
|
+
<attribute name="pagenumber">
|
|
49
|
+
<data type="boolean"/>
|
|
50
|
+
</attribute>
|
|
51
|
+
</optional>
|
|
52
|
+
<optional>
|
|
53
|
+
<attribute name="nosee">
|
|
54
|
+
<data type="boolean"/>
|
|
55
|
+
</attribute>
|
|
56
|
+
</optional>
|
|
57
|
+
<optional>
|
|
58
|
+
<attribute name="nopage">
|
|
59
|
+
<data type="boolean"/>
|
|
60
|
+
</attribute>
|
|
61
|
+
</optional>
|
|
62
|
+
<ref name="XrefBody"/>
|
|
63
|
+
</element>
|
|
64
|
+
</define>
|
|
65
|
+
<define name="Clause-Section">
|
|
66
|
+
<optional>
|
|
67
|
+
<attribute name="id">
|
|
68
|
+
<data type="ID"/>
|
|
69
|
+
</attribute>
|
|
70
|
+
</optional>
|
|
71
|
+
<optional>
|
|
72
|
+
<attribute name="language"/>
|
|
73
|
+
</optional>
|
|
74
|
+
<optional>
|
|
75
|
+
<attribute name="script"/>
|
|
76
|
+
</optional>
|
|
77
|
+
<optional>
|
|
78
|
+
<attribute name="inline-header">
|
|
79
|
+
<data type="boolean"/>
|
|
80
|
+
</attribute>
|
|
81
|
+
</optional>
|
|
82
|
+
<optional>
|
|
83
|
+
<attribute name="obligation">
|
|
84
|
+
<choice>
|
|
85
|
+
<value>normative</value>
|
|
86
|
+
<value>informative</value>
|
|
87
|
+
</choice>
|
|
88
|
+
</attribute>
|
|
89
|
+
</optional>
|
|
90
|
+
<optional>
|
|
91
|
+
<attribute name="type"/>
|
|
92
|
+
</optional>
|
|
93
|
+
<optional>
|
|
94
|
+
<attribute name="unnumbered">
|
|
95
|
+
<data type="boolean"/>
|
|
96
|
+
</attribute>
|
|
97
|
+
</optional>
|
|
98
|
+
<optional>
|
|
99
|
+
<ref name="section-title"/>
|
|
100
|
+
</optional>
|
|
101
|
+
<group>
|
|
102
|
+
<choice>
|
|
103
|
+
<zeroOrMore>
|
|
104
|
+
<ref name="BasicBlock"/>
|
|
105
|
+
</zeroOrMore>
|
|
106
|
+
<ref name="amend"/>
|
|
107
|
+
</choice>
|
|
108
|
+
<zeroOrMore>
|
|
109
|
+
<choice>
|
|
110
|
+
<ref name="clause-subsection"/>
|
|
111
|
+
<ref name="terms"/>
|
|
112
|
+
<ref name="definitions"/>
|
|
113
|
+
<ref name="floating-title"/>
|
|
114
|
+
</choice>
|
|
115
|
+
</zeroOrMore>
|
|
116
|
+
</group>
|
|
117
|
+
</define>
|
|
118
|
+
<define name="Annex-Section">
|
|
119
|
+
<optional>
|
|
120
|
+
<attribute name="id">
|
|
121
|
+
<data type="ID"/>
|
|
122
|
+
</attribute>
|
|
123
|
+
</optional>
|
|
124
|
+
<optional>
|
|
125
|
+
<attribute name="language"/>
|
|
126
|
+
</optional>
|
|
127
|
+
<optional>
|
|
128
|
+
<attribute name="script"/>
|
|
129
|
+
</optional>
|
|
130
|
+
<optional>
|
|
131
|
+
<attribute name="inline-header">
|
|
132
|
+
<data type="boolean"/>
|
|
133
|
+
</attribute>
|
|
134
|
+
</optional>
|
|
135
|
+
<optional>
|
|
136
|
+
<attribute name="obligation">
|
|
137
|
+
<choice>
|
|
138
|
+
<value>normative</value>
|
|
139
|
+
<value>informative</value>
|
|
140
|
+
</choice>
|
|
141
|
+
</attribute>
|
|
142
|
+
</optional>
|
|
143
|
+
<optional>
|
|
144
|
+
<attribute name="unnumbered">
|
|
145
|
+
<data type="boolean"/>
|
|
146
|
+
</attribute>
|
|
147
|
+
</optional>
|
|
148
|
+
<optional>
|
|
149
|
+
<ref name="section-title"/>
|
|
150
|
+
</optional>
|
|
151
|
+
<group>
|
|
152
|
+
<zeroOrMore>
|
|
153
|
+
<ref name="BasicBlock"/>
|
|
154
|
+
</zeroOrMore>
|
|
155
|
+
<zeroOrMore>
|
|
156
|
+
<choice>
|
|
157
|
+
<ref name="annex-subsection"/>
|
|
158
|
+
<ref name="terms"/>
|
|
159
|
+
<ref name="definitions"/>
|
|
160
|
+
<ref name="references"/>
|
|
161
|
+
<ref name="floating-title"/>
|
|
162
|
+
</choice>
|
|
163
|
+
</zeroOrMore>
|
|
164
|
+
</group>
|
|
165
|
+
</define>
|
|
166
|
+
<define name="ol">
|
|
167
|
+
<element name="ol">
|
|
168
|
+
<attribute name="id">
|
|
169
|
+
<data type="ID"/>
|
|
170
|
+
</attribute>
|
|
171
|
+
<optional>
|
|
172
|
+
<attribute name="keep-with-next">
|
|
173
|
+
<data type="boolean"/>
|
|
174
|
+
</attribute>
|
|
175
|
+
</optional>
|
|
176
|
+
<optional>
|
|
177
|
+
<attribute name="keep-lines-together">
|
|
178
|
+
<data type="boolean"/>
|
|
179
|
+
</attribute>
|
|
180
|
+
</optional>
|
|
181
|
+
<optional>
|
|
182
|
+
<attribute name="tag"/>
|
|
183
|
+
</optional>
|
|
184
|
+
<optional>
|
|
185
|
+
<attribute name="multilingual-rendering">
|
|
186
|
+
<ref name="MultilingualRenderingType"/>
|
|
187
|
+
</attribute>
|
|
188
|
+
</optional>
|
|
189
|
+
<attribute name="type">
|
|
190
|
+
<choice>
|
|
191
|
+
<value>roman</value>
|
|
192
|
+
<value>alphabet</value>
|
|
193
|
+
<value>arabic</value>
|
|
194
|
+
<value>roman_upper</value>
|
|
195
|
+
<value>alphabet_upper</value>
|
|
196
|
+
</choice>
|
|
197
|
+
</attribute>
|
|
198
|
+
<optional>
|
|
199
|
+
<attribute name="start"/>
|
|
200
|
+
</optional>
|
|
201
|
+
<oneOrMore>
|
|
202
|
+
<ref name="li"/>
|
|
203
|
+
</oneOrMore>
|
|
204
|
+
<zeroOrMore>
|
|
205
|
+
<ref name="note"/>
|
|
206
|
+
</zeroOrMore>
|
|
207
|
+
</element>
|
|
208
|
+
</define>
|
|
209
|
+
<define name="DocumentType">
|
|
210
|
+
<choice>
|
|
211
|
+
<value>brochure</value>
|
|
212
|
+
<value>mise-en-pratique</value>
|
|
213
|
+
<value>rapport</value>
|
|
214
|
+
<value>monographie</value>
|
|
215
|
+
<value>guide</value>
|
|
216
|
+
<value>meeting-report</value>
|
|
217
|
+
<value>technical-report</value>
|
|
218
|
+
<value>working-party-note</value>
|
|
219
|
+
<value>strategy</value>
|
|
220
|
+
<value>cipm-mra</value>
|
|
221
|
+
<value>resolution</value>
|
|
222
|
+
</choice>
|
|
223
|
+
</define>
|
|
224
|
+
<define name="editorialgroup">
|
|
225
|
+
<element name="editorialgroup">
|
|
226
|
+
<oneOrMore>
|
|
227
|
+
<ref name="committee"/>
|
|
228
|
+
</oneOrMore>
|
|
229
|
+
<zeroOrMore>
|
|
230
|
+
<ref name="workgroup"/>
|
|
231
|
+
</zeroOrMore>
|
|
232
|
+
</element>
|
|
233
|
+
</define>
|
|
234
|
+
<define name="structuredidentifier">
|
|
235
|
+
<element name="structuredidentifier">
|
|
236
|
+
<element name="docnumber">
|
|
237
|
+
<text/>
|
|
238
|
+
</element>
|
|
239
|
+
<optional>
|
|
240
|
+
<element name="part">
|
|
241
|
+
<text/>
|
|
242
|
+
</element>
|
|
243
|
+
</optional>
|
|
244
|
+
<optional>
|
|
245
|
+
<element name="appendix">
|
|
246
|
+
<text/>
|
|
247
|
+
</element>
|
|
248
|
+
</optional>
|
|
249
|
+
</element>
|
|
250
|
+
</define>
|
|
251
|
+
<define name="BibDataExtensionType">
|
|
252
|
+
<optional>
|
|
253
|
+
<ref name="doctype"/>
|
|
254
|
+
</optional>
|
|
255
|
+
<optional>
|
|
256
|
+
<ref name="docsubtype"/>
|
|
257
|
+
</optional>
|
|
258
|
+
<ref name="editorialgroup"/>
|
|
259
|
+
<optional>
|
|
260
|
+
<ref name="comment-period"/>
|
|
261
|
+
</optional>
|
|
262
|
+
<optional>
|
|
263
|
+
<ref name="si-aspect"/>
|
|
264
|
+
</optional>
|
|
265
|
+
<optional>
|
|
266
|
+
<ref name="meeting-note"/>
|
|
267
|
+
</optional>
|
|
268
|
+
<ref name="structuredidentifier"/>
|
|
269
|
+
</define>
|
|
270
|
+
</include>
|
|
271
|
+
<define name="comment-period">
|
|
272
|
+
<element name="comment-period">
|
|
273
|
+
<element name="from">
|
|
274
|
+
<ref name="ISO8601Date"/>
|
|
275
|
+
</element>
|
|
276
|
+
<element name="to">
|
|
277
|
+
<ref name="ISO8601Date"/>
|
|
278
|
+
</element>
|
|
279
|
+
</element>
|
|
280
|
+
</define>
|
|
281
|
+
<define name="si-aspect">
|
|
282
|
+
<element name="si-aspect">
|
|
283
|
+
<choice>
|
|
284
|
+
<value>A_e_deltanu</value>
|
|
285
|
+
<value>A_e</value>
|
|
286
|
+
<value>cd_Kcd_h_deltanu</value>
|
|
287
|
+
<value>cd_Kcd</value>
|
|
288
|
+
<value>full</value>
|
|
289
|
+
<value>K_k_deltanu</value>
|
|
290
|
+
<value>K_k</value>
|
|
291
|
+
<value>kg_h_c_deltanu</value>
|
|
292
|
+
<value>kg_h</value>
|
|
293
|
+
<value>m_c_deltanu</value>
|
|
294
|
+
<value>m_c</value>
|
|
295
|
+
<value>mol_NA</value>
|
|
296
|
+
<value>s_deltanu</value>
|
|
297
|
+
</choice>
|
|
298
|
+
</element>
|
|
299
|
+
</define>
|
|
300
|
+
<define name="committee">
|
|
301
|
+
<element name="committee">
|
|
302
|
+
<attribute name="acronym">
|
|
303
|
+
<choice>
|
|
304
|
+
<value>CGPM</value>
|
|
305
|
+
<value>CIPM</value>
|
|
306
|
+
<value>BIPM</value>
|
|
307
|
+
<value>CCAUV</value>
|
|
308
|
+
<value>CCEM</value>
|
|
309
|
+
<value>CCL</value>
|
|
310
|
+
<value>CCM</value>
|
|
311
|
+
<value>CCPR</value>
|
|
312
|
+
<value>CCQM</value>
|
|
313
|
+
<value>CCRI</value>
|
|
314
|
+
<value>CCT</value>
|
|
315
|
+
<value>CCTF</value>
|
|
316
|
+
<value>CCU</value>
|
|
317
|
+
<value>CCL-CCTF-WGFS</value>
|
|
318
|
+
<value>JCGM</value>
|
|
319
|
+
<value>JCRB</value>
|
|
320
|
+
<value>JCTLM</value>
|
|
321
|
+
<value>INetQI</value>
|
|
322
|
+
</choice>
|
|
323
|
+
</attribute>
|
|
324
|
+
<ref name="LocalizedString"/>
|
|
325
|
+
</element>
|
|
326
|
+
</define>
|
|
327
|
+
<define name="workgroup">
|
|
328
|
+
<element name="workgroup">
|
|
329
|
+
<optional>
|
|
330
|
+
<attribute name="acronym"/>
|
|
331
|
+
</optional>
|
|
332
|
+
<text/>
|
|
333
|
+
</element>
|
|
334
|
+
</define>
|
|
335
|
+
<define name="meeting-note">
|
|
336
|
+
<element name="meeting-note">
|
|
337
|
+
<text/>
|
|
338
|
+
</element>
|
|
339
|
+
</define>
|
|
340
|
+
<define name="bipm-standard">
|
|
341
|
+
<element name="bipm-standard">
|
|
342
|
+
<attribute name="version"/>
|
|
343
|
+
<attribute name="type">
|
|
344
|
+
<choice>
|
|
345
|
+
<value>semantic</value>
|
|
346
|
+
<value>presentation</value>
|
|
347
|
+
</choice>
|
|
348
|
+
</attribute>
|
|
349
|
+
<ref name="bibdata"/>
|
|
350
|
+
<zeroOrMore>
|
|
351
|
+
<ref name="termdocsource"/>
|
|
352
|
+
</zeroOrMore>
|
|
353
|
+
<optional>
|
|
354
|
+
<ref name="misccontainer"/>
|
|
355
|
+
</optional>
|
|
356
|
+
<optional>
|
|
357
|
+
<ref name="boilerplate"/>
|
|
358
|
+
</optional>
|
|
359
|
+
<optional>
|
|
360
|
+
<ref name="preface"/>
|
|
361
|
+
</optional>
|
|
362
|
+
<oneOrMore>
|
|
363
|
+
<ref name="sections"/>
|
|
364
|
+
</oneOrMore>
|
|
365
|
+
<zeroOrMore>
|
|
366
|
+
<ref name="annex"/>
|
|
367
|
+
</zeroOrMore>
|
|
368
|
+
<optional>
|
|
369
|
+
<ref name="bibliography"/>
|
|
370
|
+
</optional>
|
|
371
|
+
<zeroOrMore>
|
|
372
|
+
<ref name="indexsect"/>
|
|
373
|
+
</zeroOrMore>
|
|
374
|
+
</element>
|
|
375
|
+
</define>
|
|
376
|
+
</grammar>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#default namespace = "https://www.metanorma.com/ns/bsi"
|
|
2
|
+
|
|
3
|
+
include "isostandard.rnc" {
|
|
4
|
+
|
|
5
|
+
start = bsi-standard
|
|
6
|
+
|
|
7
|
+
DocumentType =
|
|
8
|
+
"british-standard" | "draft-for-development" | "published-document" |
|
|
9
|
+
"privately-subscribed-standard" | "publicly-available-specification" |
|
|
10
|
+
"flex-standard" | "international-standard" | "technical-specification" |
|
|
11
|
+
"technical-report" | "guide" | "international-workshop-agreement" |
|
|
12
|
+
"industry-technical-agreement" | "standard" | "european-workshop-agreement"
|
|
13
|
+
|
|
14
|
+
DocumentSubtype = "specification" | "method-of-test" | "method-of-specifying" |
|
|
15
|
+
"vocabulary" | "code-of-practice"
|
|
16
|
+
|
|
17
|
+
BibDataExtensionType =
|
|
18
|
+
doctype, docsubtype?, editorialgroup, ics*, structuredidentifier,
|
|
19
|
+
stagename?, coverimages*
|
|
20
|
+
|
|
21
|
+
admonition =
|
|
22
|
+
element admonition {
|
|
23
|
+
attribute type { AdmonitionType },
|
|
24
|
+
attribute class { text }?,
|
|
25
|
+
attribute id { xsd:ID },
|
|
26
|
+
attribute target { xsd:IDREF }?,
|
|
27
|
+
attribute uri { xsd:anyURI }?,
|
|
28
|
+
tname?,
|
|
29
|
+
paragraph-with-footnote*,
|
|
30
|
+
note*
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Clause-Section =
|
|
34
|
+
attribute id { xsd:ID }?,
|
|
35
|
+
attribute language { text }?,
|
|
36
|
+
attribute script { text }?,
|
|
37
|
+
attribute inline-header { xsd:boolean }?,
|
|
38
|
+
attribute obligation { "normative" | "informative" }?,
|
|
39
|
+
attribute type { text }?,
|
|
40
|
+
section-title?,
|
|
41
|
+
(
|
|
42
|
+
( ( BasicBlock+ ) | amend) | (clause-subsection | floating-title)+
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
annex =
|
|
46
|
+
element annex {
|
|
47
|
+
attribute id { xsd:ID }?,
|
|
48
|
+
attribute language { text }?,
|
|
49
|
+
attribute script { text }?,
|
|
50
|
+
attribute inline-header { xsd:boolean }?,
|
|
51
|
+
attribute obligation { "normative" | "informative" }?,
|
|
52
|
+
section-title?,
|
|
53
|
+
# allow hanging paragraps in annexes: they introduce lists
|
|
54
|
+
#( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
|
|
55
|
+
BasicBlock*,
|
|
56
|
+
(clause-hanging-paragraph-with-footnote | floating-title)*,
|
|
57
|
+
annex-appendix*
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
clause-hanging-paragraph-with-footnote =
|
|
61
|
+
element clause {
|
|
62
|
+
attribute id { xsd:ID }?,
|
|
63
|
+
attribute language { text }?,
|
|
64
|
+
attribute script { text }?,
|
|
65
|
+
attribute inline-header { xsd:boolean } ? ,
|
|
66
|
+
attribute obligation { "normative" | "informative" }?,
|
|
67
|
+
section-title?,
|
|
68
|
+
# allow hanging paragraphs in annexes: they introduce lists
|
|
69
|
+
BasicBlock*,
|
|
70
|
+
(clause-hanging-paragraph-with-footnote | floating-title)*
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
sections =
|
|
74
|
+
element sections {
|
|
75
|
+
(note | admonition)*, (floating-title | floating-section-title)?, clause, (floating-title | floating-section-title)?,
|
|
76
|
+
(term-clause | terms)?, (floating-title | floating-section-title)?, definitions?, (floating-title | floating-section-title)?,
|
|
77
|
+
(clause | term-clause | terms | floating-title | floating-section-title)+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# end overrides
|
|
83
|
+
|
|
84
|
+
floating-section-title =
|
|
85
|
+
element section-title {
|
|
86
|
+
attribute id { xsd:ID },
|
|
87
|
+
attribute depth { xsd:int },
|
|
88
|
+
TextElement*
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
AdmonitionType |= "commentary"
|
|
93
|
+
|
|
94
|
+
coverimages = element coverimages { image+ }
|
|
95
|
+
|
|
96
|
+
# We display the Normative References between scope and terms; but to keep the
|
|
97
|
+
# grammar simple, we keep the references together
|
|
98
|
+
bsi-standard =
|
|
99
|
+
element bsi-standard {
|
|
100
|
+
attribute version { text },
|
|
101
|
+
attribute type { "semantic" | "presentation" },
|
|
102
|
+
bibdata, termdocsource*, misccontainer?, boilerplate?, preface, sections+, annex*, bibliography, indexsect*
|
|
103
|
+
}
|
|
104
|
+
|