1 # RELAX NG XML syntax specified in compact syntax.
3 # Original version from http://relaxng.org/compact-20021121.html
5 # Fixed to allow foreignElement* before the nameClass of element and
8 default namespace rng = "http://relaxng.org/ns/structure/1.0"
10 datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
15 element element { foreignElement*, (nameQName | nameClass), (common & pattern+) }
16 | element attribute { foreignElement*, (nameQName | nameClass), (common & pattern?) }
17 | element group|interleave|choice|optional
18 |zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
19 | element ref|parentRef { nameNCName, common }
20 | element empty|notAllowed|text { common }
21 | element data { type, param*, (common & exceptPattern?) }
22 | element value { commonAttributes, type?, xsd:string }
23 | element externalRef { href, common }
24 | element grammar { common & grammarContent* }
26 param = element param { commonAttributes, nameNCName, xsd:string }
28 exceptPattern = element except { common & pattern+ }
32 | element div { common & grammarContent* }
33 | element include { href, (common & includeContent*) }
37 | element div { common & includeContent* }
40 element start { combine?, (common & pattern+) }
41 | element define { nameNCName, combine?, (common & pattern+) }
43 combine = attribute combine { "choice" | "interleave" }
46 element name { commonAttributes, xsd:QName }
47 | element anyName { common & exceptNameClass? }
48 | element nsName { common & exceptNameClass? }
49 | element choice { common & nameClass+ }
51 exceptNameClass = element except { common & nameClass+ }
53 nameQName = attribute name { xsd:QName }
54 nameNCName = attribute name { xsd:NCName }
55 href = attribute href { xsd:anyURI }
56 type = attribute type { xsd:NCName }
58 common = commonAttributes, foreignElement*
61 attribute ns { xsd:string }?,
62 attribute datatypeLibrary { xsd:anyURI }?,
65 foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
66 foreignAttribute = attribute * - (rng:*|local:*) { text }
67 anyElement = element * { (anyAttribute | text | anyElement)* }
68 anyAttribute = attribute * { text }