summaryrefslogtreecommitdiffstats
path: root/emacs.d/nxhtml/etc/schema/genshi.rnc
blob: b9ddf76371ad03c0960b83c0c733ba761b9e6a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
default namespace = "http://genshi.edgewall.org/"
namespace py = "http://genshi.edgewall.org/"

include "xinclude.rnc"

# There's no way to just match the text part against a Genshi Python expression
# See: http://relaxng.org/compact-tutorial-20030326.html#id2814737
python.expression = text

genshi.expr-type = xsd:string { minLength = "1" }
genshi.xpath-type = xsd:anyURI

genshi.attrib =
   attribute py:if { genshi.expr-type }?,
   attribute py:choose { text }?,
   attribute py:when { genshi.expr-type }?,
   attribute py:otherwise { text }?,
   attribute py:for { genshi.expr-type }?,
   attribute py:def { genshi.expr-type }?,
   attribute py:match { genshi.xpath-type}?,
   attribute py:with { genshi.expr-type }?,
   attribute py:attrs { genshi.expr-type }?,
   attribute py:content { text }?,
   attribute py:replace { genshi.expr-type }?,
   attribute py:strip { text }?

genshi.if.attlist  = attribute test { genshi.expr-type }
genshi.choose.attlist = attribute test { text }
genshi.when.attlist = attribute test { genshi.expr-type }
genshi.for.attlist = attribute each { genshi.expr-type }
genshi.def.attlist = attribute function { genshi.expr-type }
genshi.with.attlist = attribute vars { genshi.expr-type }
genshi.replace.attlist = attribute value { genshi.expr-type }
genshi.match.attlist =
   attribute path { genshi.xpath-type },
   attribute buffer { "true" | "false" }?,
   attribute once { "true" | "false" }?,
   attribute recursive { "true" | "false" }?

genshi.choose =
   element py:choose { genshi.choose.attlist,
      genshi.model
   }
genshi.when =
   element py:when { genshi.when.attlist,
      genshi.model
   }
genshi.otherwise =
   element py:otherwise {
      genshi.model
   }
genshi.if =
   element py:if { genshi.if.attlist,
      genshi.model
   }
genshi.for =
   element py:for { genshi.for.attlist,
      genshi.model
   }
genshi.def =
   element py:def { genshi.def.attlist,
      genshi.model
   }
genshi.with =
   element py:with { genshi.with.attlist,
      genshi.model
   }
genshi.match =
   element py:match { genshi.match.attlist,
      genshi.model
   }
genshi.replace =
   element py:replace { genshi.replace.attlist,
      genshi.model
   }

genshi.allowed.children = text

genshi.class = genshi.if | genshi.choose | genshi.when | genshi.otherwise
 | genshi.for | genshi.def | genshi.with | genshi.match | genshi.replace
 | python.expression
 | xi.include

genshi.model = genshi.class* | genshi.allowed.children*