initial commit
[emacs-init.git] / nxhtml / etc / schema / genshi.rnc
1 default namespace = "http://genshi.edgewall.org/"
2 namespace py = "http://genshi.edgewall.org/"
3
4 include "xinclude.rnc"
5
6 # There's no way to just match the text part against a Genshi Python expression
7 # See: http://relaxng.org/compact-tutorial-20030326.html#id2814737
8 python.expression = text
9
10 genshi.expr-type = xsd:string { minLength = "1" }
11 genshi.xpath-type = xsd:anyURI
12
13 genshi.attrib =
14    attribute py:if { genshi.expr-type }?,
15    attribute py:choose { text }?,
16    attribute py:when { genshi.expr-type }?,
17    attribute py:otherwise { text }?,
18    attribute py:for { genshi.expr-type }?,
19    attribute py:def { genshi.expr-type }?,
20    attribute py:match { genshi.xpath-type}?,
21    attribute py:with { genshi.expr-type }?,
22    attribute py:attrs { genshi.expr-type }?,
23    attribute py:content { text }?,
24    attribute py:replace { genshi.expr-type }?,
25    attribute py:strip { text }?
26
27 genshi.if.attlist  = attribute test { genshi.expr-type }
28 genshi.choose.attlist = attribute test { text }
29 genshi.when.attlist = attribute test { genshi.expr-type }
30 genshi.for.attlist = attribute each { genshi.expr-type }
31 genshi.def.attlist = attribute function { genshi.expr-type }
32 genshi.with.attlist = attribute vars { genshi.expr-type }
33 genshi.replace.attlist = attribute value { genshi.expr-type }
34 genshi.match.attlist =
35    attribute path { genshi.xpath-type },
36    attribute buffer { "true" | "false" }?,
37    attribute once { "true" | "false" }?,
38    attribute recursive { "true" | "false" }?
39
40 genshi.choose =
41    element py:choose { genshi.choose.attlist,
42       genshi.model
43    }
44 genshi.when =
45    element py:when { genshi.when.attlist,
46       genshi.model
47    }
48 genshi.otherwise =
49    element py:otherwise {
50       genshi.model
51    }
52 genshi.if =
53    element py:if { genshi.if.attlist,
54       genshi.model
55    }
56 genshi.for =
57    element py:for { genshi.for.attlist,
58       genshi.model
59    }
60 genshi.def =
61    element py:def { genshi.def.attlist,
62       genshi.model
63    }
64 genshi.with =
65    element py:with { genshi.with.attlist,
66       genshi.model
67    }
68 genshi.match =
69    element py:match { genshi.match.attlist,
70       genshi.model
71    }
72 genshi.replace =
73    element py:replace { genshi.replace.attlist,
74       genshi.model
75    }
76
77 genshi.allowed.children = text
78
79 genshi.class = genshi.if | genshi.choose | genshi.when | genshi.otherwise
80  | genshi.for | genshi.def | genshi.with | genshi.match | genshi.replace
81  | python.expression
82  | xi.include
83
84 genshi.model = genshi.class* | genshi.allowed.children*