rst-mode got installed.
[emacs.git] / etc / schema / relaxng.rnc
blob08686ac559886ffa06a10b19408383190e2e6efe
1 # RELAX NG XML syntax expressed in RELAX NG Compact syntax.
3 default namespace rng = "http://relaxng.org/ns/structure/1.0"
4 namespace local = ""
5 datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
7 start = pattern
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* }
21 param = element param { commonAttributes, nameNCName, xsd:string }
23 exceptPattern = element except { common & pattern+ }
25 grammarContent = 
26   definition
27   | element div { common & grammarContent* }
28   | element include { href, (common & includeContent*) }
30 includeContent =
31   definition
32   | element div { common & includeContent* }
34 definition =
35   element start { combine?, (common & pattern+) }
36   | element define { nameNCName, combine?, (common & pattern+) }
38 combine = attribute combine { "choice" | "interleave" }
40 nameClass = 
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*
55 commonAttributes = 
56   attribute ns { xsd:string }?,
57   attribute datatypeLibrary { xsd:anyURI }?,
58   foreignAttribute*
60 foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
61 foreignAttribute = attribute * - (rng:*|local:*) { text }
62 anyElement = element * { (anyAttribute | text | anyElement)* }
63 anyAttribute = attribute * { text }