1 datatypes w = "http://whattf.org/datatype-draft"
3 # #####################################################################
4 ## RELAX NG Schema for HTML 5: Global Structure & Metadata #
5 # #####################################################################
7 ## Root Element: <html>
10 element html { html.inner & html.attrs }
13 & ( common.attrs.aria.role.presentation
14 | common.attrs.aria.role.menuitem
22 ## Metadata Container: <head>
25 element head { head.inner & head.attrs }
28 # & head.attrs.profile?
29 & ( common.attrs.aria.role.presentation
30 | common.attrs.aria.role.menuitem
33 # head.attrs.profile =
35 # common.data.uris #REVISIT should these be absolute (zero or more)
39 & base.elem? # REVISIT need a non-schema checker or Schematron
40 & common.inner.metadata # Limit encoding decl position in Schematron
43 # ( meta.elem.encoding?
45 # & base.elem? # REVISIT need a non-schema checker or Schematron
46 # & common.inner.metadata
50 ## Content Container: <body>
53 element body { body.inner & body.attrs }
56 & ( common.attrs.aria.landmark.application
57 | common.attrs.aria.landmark.document
58 | common.attrs.aria.role.presentation
59 | common.attrs.aria.implicit.document
61 & body.attrs.onafterprint?
62 & body.attrs.onbeforeprint?
63 & body.attrs.onbeforeunload?
64 & body.attrs.onhashchange?
65 & body.attrs.onmessage?
66 & body.attrs.onoffline?
67 & body.attrs.ononline?
68 & body.attrs.onpagehide?
69 & body.attrs.onpageshow?
70 & body.attrs.onpopstate?
71 & body.attrs.onresize?
72 & body.attrs.onstorage?
73 & body.attrs.onunload?
78 body.attrs.onafterprint =
79 attribute onafterprint { common.data.functionbody }
80 body.attrs.onbeforeprint =
81 attribute onbeforeprint { common.data.functionbody }
82 body.attrs.onbeforeunload =
83 attribute onbeforeunload { common.data.functionbody }
84 body.attrs.onhashchange =
85 attribute onhashchange { common.data.functionbody }
86 body.attrs.onmessage =
87 attribute onmessage { common.data.functionbody }
88 body.attrs.onoffline =
89 attribute onoffline { common.data.functionbody }
91 attribute ononline { common.data.functionbody }
92 body.attrs.onpopstate =
93 attribute onpopstate { common.data.functionbody }
94 body.attrs.onpagehide =
95 attribute onpagehide { common.data.functionbody }
96 body.attrs.onpageshow =
97 attribute onpageshow { common.data.functionbody }
99 attribute onredo { common.data.functionbody }
100 body.attrs.onresize =
101 attribute onresize { common.data.functionbody }
102 body.attrs.onstorage =
103 attribute onstorage { common.data.functionbody }
105 attribute onundo { common.data.functionbody }
106 body.attrs.onunload =
107 attribute onunload { common.data.functionbody }
109 ## Document Title: <title>
112 element title { title.inner & title.attrs }
115 & ( common.attrs.aria.role.presentation
116 | common.attrs.aria.role.menuitem
125 element base { base.inner & base.attrs }
129 & common.attrs.present
131 & ( ( base.attrs.href
136 & ( common.attrs.aria.role.presentation
137 | common.attrs.aria.role.menuitem
146 common.data.browsing-context-or-keyword
151 ## Global Relationships: <link>
154 element link { link.inner & link.attrs }
158 & common.attrs.present
162 & link.attrs.integrity?
163 & shared-hyperlink.attrs.hreflang?
164 & shared-hyperlink.attrs.media?
165 & shared-hyperlink.attrs.type?
167 # link.attrs.title included in common.attrs
168 & embedded.content.attrs.crossorigin?
169 & ( common.attrs.aria.role.link
170 | common.attrs.aria.role.presentation
171 | common.attrs.aria.role.menuitem
176 common.data.uri.non-empty
182 link.attrs.integrity =
183 attribute integrity {
184 common.data.integrity
188 w:string "any" | common.data.sizes
193 common.elem.metadata |= link.elem
195 ## Global Style: <style>
198 element style { style.inner & style.attrs }
203 # style.attrs.title included in common.attrs
204 & ( common.attrs.aria.role.presentation
205 | common.attrs.aria.role.menuitem
214 common.data.mediaquery
217 ( common.inner.anything )
219 common.elem.metadata |= style.elem
221 ## Scoped Style: <style scoped>
224 element style { style.inner & style.scoped.attrs }
230 # style.attrs.title included in common.attrs
231 & ( common.attrs.aria.role.presentation
232 | common.attrs.aria.role.menuitem
237 w:string "scoped" | w:string ""
240 ## Name-Value Metadata: <meta name>
243 element meta { meta.inner & meta.name.attrs }
247 & common.attrs.present
249 & meta.name.attrs.name
250 & meta.name.attrs.content
251 & ( common.attrs.aria.role.presentation
252 | common.attrs.aria.role.menuitem
255 meta.name.attrs.name =
259 meta.name.attrs.content =
266 common.elem.metadata |= meta.name.elem
268 ## "refresh" pragma directive: <meta http-equiv='refresh'>
270 meta.http-equiv.refresh.elem =
271 element meta { meta.inner & meta.http-equiv.refresh.attrs }
272 meta.http-equiv.refresh.attrs =
275 & common.attrs.present
277 & meta.http-equiv.attrs.http-equiv.refresh
278 & meta.http-equiv.attrs.content.refresh
279 & ( common.attrs.aria.role.presentation
280 | common.attrs.aria.role.menuitem
283 meta.http-equiv.attrs.http-equiv.refresh =
284 attribute http-equiv {
287 meta.http-equiv.attrs.content.refresh =
291 common.elem.metadata |= meta.http-equiv.refresh.elem # not quite right per spec
292 # if the definition is
293 # reused in another language
295 ## "default-style" pragma directive: <meta http-equiv='default-style'>
297 meta.http-equiv.default-style.elem =
298 element meta { meta.inner & meta.http-equiv.default-style.attrs }
299 meta.http-equiv.default-style.attrs =
302 & common.attrs.present
304 & meta.http-equiv.attrs.http-equiv.default-style
305 & meta.http-equiv.attrs.content.default-style
306 & ( common.attrs.aria.role.presentation
307 | common.attrs.aria.role.menuitem
310 meta.http-equiv.attrs.http-equiv.default-style =
311 attribute http-equiv {
312 w:string "default-style"
314 meta.http-equiv.attrs.content.default-style =
316 common.data.default-style
319 common.elem.metadata |= meta.http-equiv.default-style.elem # not quite right per spec
320 # if the definition is
321 # reused in another language
323 ## "x-ua-compatible" pragma directive: <meta http-equiv='x-ua-compatible'>
325 meta.http-equiv.x-ua-compatible.elem =
326 element meta { meta.inner & meta.http-equiv.x-ua-compatible.attrs }
327 meta.http-equiv.x-ua-compatible.attrs =
330 & common.attrs.present
332 & meta.http-equiv.attrs.http-equiv.x-ua-compatible
333 & meta.http-equiv.attrs.content.x-ua-compatible
334 & ( common.attrs.aria.role.presentation
335 | common.attrs.aria.role.menuitem
338 meta.http-equiv.attrs.http-equiv.x-ua-compatible =
339 attribute http-equiv {
340 w:string "x-ua-compatible"
342 meta.http-equiv.attrs.content.x-ua-compatible =
344 common.data.x-ua-compatible
346 common.elem.metadata |= meta.http-equiv.x-ua-compatible.elem
348 ## Inline Character Encoding Statement for HTML: <meta charset>
351 element meta { meta.inner & meta.charset.attrs }
355 & common.attrs.present
357 & meta.charset.attrs.charset
358 & ( common.attrs.aria.role.presentation
359 | common.attrs.aria.role.menuitem
362 meta.charset.attrs.charset =
364 (common.data.charset & HTMLonly)
366 pattern = "[uU][tT][fF]-8"
370 ## Inline Character Encoding Statement for HTML: <meta http-equiv='content-type'>
372 meta.http-equiv.content-type.elem =
373 element meta { meta.inner & meta.http-equiv.content-type.attrs }
375 meta.http-equiv.content-type.attrs =
378 & common.attrs.present
380 & meta.http-equiv.attrs.http-equiv.content-type
381 & meta.http-equiv.attrs.content.content-type
382 & ( common.attrs.aria.role.presentation
383 | common.attrs.aria.role.menuitem
386 meta.http-equiv.attrs.http-equiv.content-type =
387 attribute http-equiv {
388 w:string "content-type"
390 meta.http-equiv.attrs.content.content-type =
392 common.data.meta-charset
395 common.elem.metadata |= ( meta.charset.elem | meta.http-equiv.content-type.elem )