1 # RELAX NG XML syntax expressed in RELAX NG Compact syntax.
3 default
namespace rng
= "http://relaxng.org/ns/structure/1.0"
5 datatypes xsd
= "http://www.w3.org/2001/XMLSchema-datatypes"
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*
}
21 param
= element param
{ commonAttributes, nameNCName, xsd:string
}
23 exceptPattern
= element except
{ common
& pattern
+ }
27 |
element div { common
& grammarContent*
}
28 |
element include { href, (common
& includeContent*)
}
32 |
element div { common
& includeContent*
}
35 element start
{ combine?, (common
& pattern
+)
}
36 |
element define
{ nameNCName, combine?, (common
& pattern
+)
}
38 combine
= attribute combine
{ "choice" |
"interleave" }
41 element name
{ commonAttributes, xsd:QName
}
42 |
element anyName
{ common
& exceptNameClass?
}
43 |
element nsName
{ common
& exceptNameClass?
}
44 |
element choice
{ common
& nameClass
+ }
46 exceptNameClass
= element except
{ common
& nameClass
+ }
48 nameQName
= attribute name
{ xsd:QName
}
49 nameNCName
= attribute name
{ xsd:NCName
}
50 href
= attribute href
{ xsd:anyURI
}
51 type
= attribute type
{ xsd:NCName
}
53 common
= commonAttributes, foreignElement*
56 attribute ns
{ xsd:string
}?,
57 attribute datatypeLibrary
{ xsd:anyURI
}?,
60 foreignElement
= element * - rng:*
{ (anyAttribute | text | anyElement)*
}
61 foreignAttribute
= attribute * - (rng:*|local:*)
{ text
}
62 anyElement
= element *
{ (anyAttribute | text | anyElement)*
}
63 anyAttribute
= attribute *
{ text
}