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.onstorage?
72 & body.attrs.onunload?
77 body.attrs.onafterprint =
78 attribute onafterprint { common.data.functionbody }
79 body.attrs.onbeforeprint =
80 attribute onbeforeprint { common.data.functionbody }
81 body.attrs.onbeforeunload =
82 attribute onbeforeunload { common.data.functionbody }
83 body.attrs.onhashchange =
84 attribute onhashchange { common.data.functionbody }
85 body.attrs.onmessage =
86 attribute onmessage { common.data.functionbody }
87 body.attrs.onoffline =
88 attribute onoffline { common.data.functionbody }
90 attribute ononline { common.data.functionbody }
91 body.attrs.onpopstate =
92 attribute onpopstate { common.data.functionbody }
93 body.attrs.onpagehide =
94 attribute onpagehide { common.data.functionbody }
95 body.attrs.onpageshow =
96 attribute onpageshow { common.data.functionbody }
98 attribute onredo { common.data.functionbody }
100 attribute onresize { common.data.functionbody }
101 body.attrs.onstorage =
102 attribute onstorage { common.data.functionbody }
104 attribute onundo { common.data.functionbody }
105 body.attrs.onunload =
106 attribute onunload { common.data.functionbody }
108 ## Document Title: <title>
111 element title { title.inner & title.attrs }
114 & ( common.attrs.aria.role.presentation
115 | common.attrs.aria.role.menuitem
124 element base { base.inner & base.attrs }
128 & common.attrs.present
130 & ( ( base.attrs.href
135 & ( common.attrs.aria.role.presentation
136 | common.attrs.aria.role.menuitem
145 common.data.browsing-context-or-keyword
150 ## Global Relationships: <link>
153 element link { link.inner & link.attrs }
157 & common.attrs.present
161 & link.attrs.integrity?
162 & shared-hyperlink.attrs.hreflang?
163 & shared-hyperlink.attrs.media?
164 & shared-hyperlink.attrs.type?
166 # link.attrs.title included in common.attrs
167 & embedded.content.attrs.crossorigin?
168 & ( common.attrs.aria.role.link
169 | common.attrs.aria.role.presentation
170 | common.attrs.aria.role.menuitem
175 common.data.uri.non-empty
181 link.attrs.integrity =
182 attribute integrity {
183 common.data.integrity
187 w:string "any" | common.data.sizes
192 common.elem.metadata |= link.elem
194 ## Global Style: <style>
197 element style { style.inner & style.attrs }
202 # style.attrs.title included in common.attrs
203 & ( common.attrs.aria.role.presentation
204 | common.attrs.aria.role.menuitem
213 common.data.mediaquery
216 ( common.inner.anything )
218 common.elem.metadata |= style.elem
220 ## Scoped Style: <style scoped>
223 element style { style.inner & style.scoped.attrs }
229 # style.attrs.title included in common.attrs
230 & ( common.attrs.aria.role.presentation
231 | common.attrs.aria.role.menuitem
236 w:string "scoped" | w:string ""
239 ## Name-Value Metadata: <meta name>
242 element meta { meta.inner & meta.name.attrs }
246 & common.attrs.present
248 & meta.name.attrs.name
249 & meta.name.attrs.content
250 & ( common.attrs.aria.role.presentation
251 | common.attrs.aria.role.menuitem
254 meta.name.attrs.name =
258 meta.name.attrs.content =
265 common.elem.metadata |= meta.name.elem
267 ## "refresh" pragma directive: <meta http-equiv='refresh'>
269 meta.http-equiv.refresh.elem =
270 element meta { meta.inner & meta.http-equiv.refresh.attrs }
271 meta.http-equiv.refresh.attrs =
274 & common.attrs.present
276 & meta.http-equiv.attrs.http-equiv.refresh
277 & meta.http-equiv.attrs.content.refresh
278 & ( common.attrs.aria.role.presentation
279 | common.attrs.aria.role.menuitem
282 meta.http-equiv.attrs.http-equiv.refresh =
283 attribute http-equiv {
286 meta.http-equiv.attrs.content.refresh =
290 common.elem.metadata |= meta.http-equiv.refresh.elem # not quite right per spec
291 # if the definition is
292 # reused in another language
294 ## "default-style" pragma directive: <meta http-equiv='default-style'>
296 meta.http-equiv.default-style.elem =
297 element meta { meta.inner & meta.http-equiv.default-style.attrs }
298 meta.http-equiv.default-style.attrs =
301 & common.attrs.present
303 & meta.http-equiv.attrs.http-equiv.default-style
304 & meta.http-equiv.attrs.content.default-style
305 & ( common.attrs.aria.role.presentation
306 | common.attrs.aria.role.menuitem
309 meta.http-equiv.attrs.http-equiv.default-style =
310 attribute http-equiv {
311 w:string "default-style"
313 meta.http-equiv.attrs.content.default-style =
315 common.data.default-style
318 common.elem.metadata |= meta.http-equiv.default-style.elem # not quite right per spec
319 # if the definition is
320 # reused in another language
322 ## "x-ua-compatible" pragma directive: <meta http-equiv='x-ua-compatible'>
324 meta.http-equiv.x-ua-compatible.elem =
325 element meta { meta.inner & meta.http-equiv.x-ua-compatible.attrs }
326 meta.http-equiv.x-ua-compatible.attrs =
329 & common.attrs.present
331 & meta.http-equiv.attrs.http-equiv.x-ua-compatible
332 & meta.http-equiv.attrs.content.x-ua-compatible
333 & ( common.attrs.aria.role.presentation
334 | common.attrs.aria.role.menuitem
337 meta.http-equiv.attrs.http-equiv.x-ua-compatible =
338 attribute http-equiv {
339 w:string "x-ua-compatible"
341 meta.http-equiv.attrs.content.x-ua-compatible =
343 common.data.x-ua-compatible
345 common.elem.metadata |= meta.http-equiv.x-ua-compatible.elem
347 ## Inline Character Encoding Statement for HTML: <meta charset>
350 element meta { meta.inner & meta.charset.attrs }
354 & common.attrs.present
356 & meta.charset.attrs.charset
357 & ( common.attrs.aria.role.presentation
358 | common.attrs.aria.role.menuitem
361 meta.charset.attrs.charset =
363 (common.data.charset & HTMLonly)
365 pattern = "[uU][tT][fF]-8"
369 ## Inline Character Encoding Statement for HTML: <meta http-equiv='content-type'>
371 meta.http-equiv.content-type.elem =
372 element meta { meta.inner & meta.http-equiv.content-type.attrs }
374 meta.http-equiv.content-type.attrs =
377 & common.attrs.present
379 & meta.http-equiv.attrs.http-equiv.content-type
380 & meta.http-equiv.attrs.content.content-type
381 & ( common.attrs.aria.role.presentation
382 | common.attrs.aria.role.menuitem
385 meta.http-equiv.attrs.http-equiv.content-type =
386 attribute http-equiv {
387 w:string "content-type"
389 meta.http-equiv.attrs.content.content-type =
391 common.data.meta-charset
394 common.elem.metadata |= ( meta.charset.elem | meta.http-equiv.content-type.elem )