Removed some leftovers from media.xsl.
[enkel.git] / enkel / rngdata / xhtml-formgen.rng
bloba7bf593e2301bf949a93ad2230edec8aafb07b84
1 <?xml version="1.0" encoding="utf-8"?>
3 <!-- Defines the xhtml produced by enkel.xhtml.formgen. -->
5 <grammar xmlns="http://relaxng.org/ns/structure/1.0"
6 ns="http://www.w3.org/1999/xhtml">
8 <define name="common-field-attr">
9 <attribute name="name">
10 <text/>
11 </attribute>
12 <attribute name="id">
13 <text/>
14 </attribute>
15 <optional>
16 <attribute name="disabled">
17 <value>disabled</value>
18 </attribute>
19 </optional>
20 </define>
22 <define name="fields">
23 <zeroOrMore>
24 <element name="div">
25 <attribute name="class">
26 <text/>
27 </attribute>
28 <element name="label">
29 <attribute name="for">
30 <text/>
31 </attribute>
32 <text/>
33 </element>
34 <choice>
35 <element name="input">
36 <choice>
37 <group>
38 <attribute name="type">
39 <value>text</value>
40 </attribute>
41 <attribute name="value">
42 <text/>
43 </attribute>
44 <optional>
45 <attribute name="maxlength">
46 <text/>
47 </attribute>
48 </optional>
49 </group>
50 <group>
51 <attribute name="type">
52 <value>checkbox</value>
53 </attribute>
54 <attribute name="value">
55 <value>yes</value>
56 </attribute>
57 <optional>
58 <attribute name="checked">
59 <value>checked</value>
60 </attribute>
61 </optional>
62 </group>
63 </choice>
64 <ref name="common-field-attr"/>
65 </element>
66 <element name="textarea">
67 <attribute name="cols">
68 <text/>
69 </attribute>
70 <attribute name="rows">
71 <text/>
72 </attribute>
73 <ref name="common-field-attr"/>
74 </element>
75 <element name="select">
76 <attribute name="size">
77 <text/>
78 </attribute>
79 <optional>
80 <attribute name="multiple">
81 <value>multiple</value>
82 </attribute>
83 </optional>
84 <ref name="common-field-attr"/>
85 <zeroOrMore>
86 <element name="option">
87 <attribute name="value">
88 <text/>
89 </attribute>
90 <optional>
91 <attribute name="selected">
92 <value>selected</value>
93 </attribute>
94 </optional>
95 <text/>
96 </element>
97 </zeroOrMore>
98 </element>
99 </choice>
100 <element name="div"> <!-- help -->
101 <attribute name="class">
102 <text/>
103 </attribute>
104 <text/>
105 </element>
106 <optional>
107 <element name="div"> <!-- error -->
108 <attribute name="class">
109 <text/>
110 </attribute>
111 <text/>
112 </element>
113 </optional>
114 </element>
115 </zeroOrMore>
116 </define>
119 <define name="hidden-elements">
120 <zeroOrMore>
121 <choice>
122 <element name="input">
123 <attribute name="type">
124 <value>hidden</value>
125 </attribute>
126 <attribute name="name">
127 <text/>
128 </attribute>
129 <attribute name="value">
130 <text/>
131 </attribute>
132 </element>
134 <!-- This will only appear once at the bottom of the form,
135 but I could not manage to express that in relax-ng. -->
136 <element name="input">
137 <attribute name="type">
138 <value>submit</value>
139 </attribute>
140 <attribute name="value">
141 <text/>
142 </attribute>
143 </element>
144 </choice>
145 </zeroOrMore>
146 </define>
149 <start>
150 <element name="form">
151 <attribute name="action">
152 <text/>
153 </attribute>
154 <attribute name="method">
155 <text/>
156 </attribute>
157 <optional>
158 <attribute name="enctype">
159 <text/>
160 </attribute>
161 </optional>
162 <optional>
163 <attribute name="id">
164 <text/>
165 </attribute>
166 </optional>
167 <interleave>
168 <zeroOrMore>
169 <element name="fielset">
170 <element name="legend">
171 <text/>
172 </element>
173 <ref name="fields"/>
174 <ref name="hidden-elements"/>
175 </element>
176 </zeroOrMore>
177 <ref name="fields"/>
178 <ref name="hidden-elements"/>
179 </interleave>
180 </element>
181 </start>
183 </grammar>