]> code.delx.au - gnu-emacs-elpa/blob - packages/html5-schema/tables.rnc
Add 'packages/html5-schema/' from commit '6e7c7c331e7f6692be6c7d39fb9485792f0d3513'
[gnu-emacs-elpa] / packages / html5-schema / tables.rnc
1 datatypes w = "http://whattf.org/datatype-draft"
2
3 # #####################################################################
4 ## RELAX NG Schema for HTML 5: Tables #
5 # #####################################################################
6
7 # #####################################################################
8 ## Table Envelope
9
10 ## Table Datatypes
11
12 # tables.data.multilen =
13 # ( common.data.integer.positive
14 # | common.data.percent
15 # | xsd:token { pattern = "[0-9]+\*" } #REVISIT should this one be string?
16 # )
17
18 ## Table Alignment Attributes
19
20 tables.attrs.alignment =
21 ( tables.attrs.align?
22 & tables.attrs.char?
23 & tables.attrs.valign?
24 )
25 tables.attrs.align =
26 attribute align {
27 ( w:string "left"
28 | w:string "center"
29 | w:string "right"
30 | w:string "justify"
31 | w:string "char"
32 )
33 }
34 tables.attrs.char =
35 attribute char {
36 xsd:string { pattern = "." }
37 }
38 tables.attrs.valign =
39 attribute valign {
40 ( w:string "top"
41 | w:string "middle"
42 | w:string "bottom"
43 | w:string "baseline"
44 )
45 }
46
47 ## Data Table: <table>
48
49 table.elem =
50 element table { table.inner & table.attrs }
51 table.attrs =
52 ( common.attrs
53 & common.attrs.aria?
54 )
55 table.inner =
56 ( caption.elem?
57 , common.elem.script-supporting*
58 , colgroup.elem*
59 , common.elem.script-supporting*
60 , thead.elem?
61 , common.elem.script-supporting*
62 , ( ( tfoot.elem
63 , common.elem.script-supporting*
64 , ( tbody.elem* | tr.elem+ )
65 , common.elem.script-supporting*
66 )
67 | ( ( tbody.elem* | tr.elem+ )
68 , common.elem.script-supporting*
69 , tfoot.elem?
70 )
71 )
72 )
73
74 common.elem.flow |= table.elem
75
76 ## Table Caption: <caption>
77
78 caption.elem =
79 element caption { caption.inner & caption.attrs }
80 caption.attrs =
81 ( common.attrs
82 & common.attrs.aria?
83 )
84 caption.inner =
85 ( common.inner.flow )
86
87 # #####################################################################
88 ## Table Super Structure
89
90 ## Table Column Group: <colgroup>
91
92 colgroup.elem =
93 element colgroup { colgroup.inner & colgroup.attrs }
94 colgroup.attrs =
95 ( common.attrs
96 & common.attrs.aria?
97 )
98 colgroup.attrs.span =
99 attribute span {
100 common.data.integer.positive
101 }
102 colgroup.inner =
103 ( ( col.elem*
104 & common.elem.script-supporting*
105 )
106 | colgroup.attrs.span?
107 )
108
109 ## Table Column: <col>
110
111 col.elem =
112 element col { col.inner & col.attrs }
113 col.attrs =
114 ( common.attrs
115 & col.attrs.span?
116 & common.attrs.aria?
117 )
118 col.attrs.span =
119 attribute span {
120 common.data.integer.positive
121 }
122 col.inner =
123 ( empty )
124
125 ## Table Header Row Group
126
127 thead.elem =
128 element thead { thead.inner & thead.attrs }
129 thead.attrs =
130 ( common.attrs
131 & common.attrs.aria?
132 )
133 thead.inner =
134 ( tr.elem*
135 & common.elem.script-supporting*
136 )
137
138 ## Table Footer Row Group
139
140 tfoot.elem =
141 element tfoot { tfoot.inner & tfoot.attrs }
142 tfoot.attrs =
143 ( common.attrs
144 & common.attrs.aria?
145 )
146 tfoot.inner =
147 ( tr.elem*
148 & common.elem.script-supporting*
149 )
150
151 ## Table Row Group
152
153 tbody.elem =
154 element tbody { tbody.inner & tbody.attrs }
155 tbody.attrs =
156 ( common.attrs
157 & common.attrs.aria?
158 )
159 tbody.inner =
160 ( tr.elem*
161 & common.elem.script-supporting*
162 )
163
164 # #####################################################################
165 ## Cell Structure
166
167 ## Table Row
168
169 tr.elem =
170 element tr { tr.inner & tr.attrs }
171 tr.attrs =
172 ( common.attrs
173 & common.attrs.aria?
174 )
175 tr.inner =
176 ( ( td.elem | th.elem | common.elem.script-supporting )* )
177
178 ## Common Table Cell Attributes
179
180 tables.attrs.cell-structure =
181 ( tables.attrs.colspan?
182 & tables.attrs.rowspan?
183 )
184 tables.attrs.colspan =
185 attribute colspan {
186 common.data.integer.positive
187 }
188 tables.attrs.rowspan =
189 attribute rowspan {
190 common.data.integer.non-negative
191 }
192
193 tables.attrs.access-headers =
194 ( tables.attrs.headers? )
195 tables.attrs.headers =
196 attribute headers {
197 common.data.idrefs
198 }
199
200 tables.attrs.define-headers =
201 ( tables.attrs.scope? )
202 tables.attrs.scope =
203 attribute scope {
204 ( w:string "row"
205 | w:string "col"
206 | w:string "rowgroup"
207 | w:string "colgroup"
208 )
209 }
210 tables.attrs.abbr =
211 attribute abbr {
212 text
213 }
214
215 ## Table Data Cell: <td>
216
217 td.elem =
218 element td { td.inner & td.attrs }
219 td.attrs =
220 ( common.attrs
221 & tables.attrs.cell-structure
222 & tables.attrs.headers?
223 # & tables.attrs.alignment
224 & common.attrs.aria?
225 )
226 td.inner =
227 ( common.inner.flow )
228
229 ## Table Header Cells: <th>
230
231 th.elem =
232 element th { th.inner & th.attrs }
233 th.attrs =
234 ( common.attrs
235 & tables.attrs.cell-structure
236 & tables.attrs.scope?
237 & tables.attrs.headers?
238 # & tables.attrs.alignment
239 & ( common.attrs.aria?
240 | common.attrs.aria.implicit.column-or-row-header
241 )
242 )
243 th.inner =
244 ( common.inner.flow )