Commit | Line | Data |
---|---|---|
8cd39fb3 MH |
1 | # RELAX NG XML syntax expressed in RELAX NG Compact syntax. |
2 | ||
3 | default namespace rng = "http://relaxng.org/ns/structure/1.0" | |
4 | namespace local = "" | |
5 | datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" | |
6 | ||
7 | start = pattern | |
8 | ||
9 | pattern = | |
10 | element element { (nameQName | nameClass), (common & pattern+) } | |
11 | | element attribute { (nameQName | nameClass), (common & pattern?) } | |
12 | | element group|interleave|choice|optional | |
13 | |zeroOrMore|oneOrMore|list|mixed { common & pattern+ } | |
14 | | element ref|parentRef { nameNCName, common } | |
15 | | element empty|notAllowed|text { common } | |
16 | | element data { type, param*, (common & exceptPattern?) } | |
17 | | element value { commonAttributes, type?, xsd:string } | |
18 | | element externalRef { href, common } | |
19 | | element grammar { common & grammarContent* } | |
20 | ||
21 | param = element param { commonAttributes, nameNCName, xsd:string } | |
22 | ||
23 | exceptPattern = element except { common & pattern+ } | |
24 | ||
25 | grammarContent = | |
26 | definition | |
27 | | element div { common & grammarContent* } | |
28 | | element include { href, (common & includeContent*) } | |
29 | ||
30 | includeContent = | |
31 | definition | |
32 | | element div { common & includeContent* } | |
33 | ||
34 | definition = | |
35 | element start { combine?, (common & pattern+) } | |
36 | | element define { nameNCName, combine?, (common & pattern+) } | |
37 | ||
38 | combine = attribute combine { "choice" | "interleave" } | |
39 | ||
40 | nameClass = | |
41 | element name { commonAttributes, xsd:QName } | |
42 | | element anyName { common & exceptNameClass? } | |
43 | | element nsName { common & exceptNameClass? } | |
44 | | element choice { common & nameClass+ } | |
45 | ||
46 | exceptNameClass = element except { common & nameClass+ } | |
47 | ||
48 | nameQName = attribute name { xsd:QName } | |
49 | nameNCName = attribute name { xsd:NCName } | |
50 | href = attribute href { xsd:anyURI } | |
51 | type = attribute type { xsd:NCName } | |
52 | ||
53 | common = commonAttributes, foreignElement* | |
54 | ||
55 | commonAttributes = | |
56 | attribute ns { xsd:string }?, | |
57 | attribute datatypeLibrary { xsd:anyURI }?, | |
58 | foreignAttribute* | |
59 | ||
60 | foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* } | |
61 | foreignAttribute = attribute * - (rng:*|local:*) { text } | |
62 | anyElement = element * { (anyAttribute | text | anyElement)* } | |
63 | anyAttribute = attribute * { text } |