Merge from emacs--rel--22
[bpt/emacs.git] / etc / schema / relaxng.rnc
CommitLineData
8cd39fb3
MH
1# RELAX NG XML syntax expressed in RELAX NG Compact syntax.
2
3default namespace rng = "http://relaxng.org/ns/structure/1.0"
4namespace local = ""
5datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
6
7start = pattern
8
9pattern =
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
21param = element param { commonAttributes, nameNCName, xsd:string }
22
23exceptPattern = element except { common & pattern+ }
24
25grammarContent =
26 definition
27 | element div { common & grammarContent* }
28 | element include { href, (common & includeContent*) }
29
30includeContent =
31 definition
32 | element div { common & includeContent* }
33
34definition =
35 element start { combine?, (common & pattern+) }
36 | element define { nameNCName, combine?, (common & pattern+) }
37
38combine = attribute combine { "choice" | "interleave" }
39
40nameClass =
41 element name { commonAttributes, xsd:QName }
42 | element anyName { common & exceptNameClass? }
43 | element nsName { common & exceptNameClass? }
44 | element choice { common & nameClass+ }
45
46exceptNameClass = element except { common & nameClass+ }
47
48nameQName = attribute name { xsd:QName }
49nameNCName = attribute name { xsd:NCName }
50href = attribute href { xsd:anyURI }
51type = attribute type { xsd:NCName }
52
53common = commonAttributes, foreignElement*
54
55commonAttributes =
56 attribute ns { xsd:string }?,
57 attribute datatypeLibrary { xsd:anyURI }?,
58 foreignAttribute*
59
60foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
61foreignAttribute = attribute * - (rng:*|local:*) { text }
62anyElement = element * { (anyAttribute | text | anyElement)* }
63anyAttribute = attribute * { text }