]> code.delx.au - gnu-emacs-elpa/blob - meta.rnc
Add the "integrity" attribute
[gnu-emacs-elpa] / meta.rnc
1 datatypes w = "http://whattf.org/datatype-draft"
2
3 # #####################################################################
4 ## RELAX NG Schema for HTML 5: Global Structure & Metadata #
5 # #####################################################################
6
7 ## Root Element: <html>
8
9 html.elem =
10 element html { html.inner & html.attrs }
11 html.attrs =
12 ( common.attrs
13 & ( common.attrs.aria.role.presentation
14 | common.attrs.aria.role.menuitem
15 )?
16 )
17 html.inner =
18 ( head.elem
19 , body.elem
20 )
21
22 ## Metadata Container: <head>
23
24 head.elem =
25 element head { head.inner & head.attrs }
26 head.attrs =
27 ( common.attrs
28 # & head.attrs.profile?
29 & ( common.attrs.aria.role.presentation
30 | common.attrs.aria.role.menuitem
31 )?
32 )
33 # head.attrs.profile =
34 # attribute profile {
35 # common.data.uris #REVISIT should these be absolute (zero or more)
36 # }
37 head.inner =
38 ( title.elem
39 & base.elem? # REVISIT need a non-schema checker or Schematron
40 & common.inner.metadata # Limit encoding decl position in Schematron
41 )
42 # head.inner =
43 # ( meta.elem.encoding?
44 # , ( title.elem
45 # & base.elem? # REVISIT need a non-schema checker or Schematron
46 # & common.inner.metadata
47 # )
48 # )
49
50 ## Content Container: <body>
51
52 body.elem =
53 element body { body.inner & body.attrs }
54 body.attrs =
55 ( common.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
60 )?
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?
74 )
75 body.inner =
76 ( common.inner.flow )
77
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 }
90 body.attrs.ononline =
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 }
98 body.attrs.onredo =
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 }
104 body.attrs.onundo =
105 attribute onundo { common.data.functionbody }
106 body.attrs.onunload =
107 attribute onunload { common.data.functionbody }
108
109 ## Document Title: <title>
110
111 title.elem =
112 element title { title.inner & title.attrs }
113 title.attrs =
114 ( common.attrs
115 & ( common.attrs.aria.role.presentation
116 | common.attrs.aria.role.menuitem
117 )?
118 )
119 title.inner =
120 ( text )
121
122 ## Base URI: <base>
123
124 base.elem =
125 element base { base.inner & base.attrs }
126 base.attrs =
127 ( common.attrs.basic
128 & common.attrs.i18n
129 & common.attrs.present
130 & common.attrs.other
131 & ( ( base.attrs.href
132 & base.attrs.target?
133 )
134 | base.attrs.target
135 )
136 & ( common.attrs.aria.role.presentation
137 | common.attrs.aria.role.menuitem
138 )?
139 )
140 base.attrs.href =
141 attribute href {
142 common.data.uri
143 }
144 base.attrs.target =
145 attribute target {
146 common.data.browsing-context-or-keyword
147 }
148 base.inner =
149 ( empty )
150
151 ## Global Relationships: <link>
152
153 link.elem =
154 element link { link.inner & link.attrs }
155 link.attrs =
156 ( common.attrs.basic
157 & common.attrs.i18n
158 & common.attrs.present
159 & common.attrs.other
160 & link.attrs.href
161 & link.attrs.rel
162 & link.attrs.integrity?
163 & shared-hyperlink.attrs.hreflang?
164 & shared-hyperlink.attrs.media?
165 & shared-hyperlink.attrs.type?
166 & link.attrs.sizes?
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
172 )?
173 )
174 link.attrs.href =
175 attribute href {
176 common.data.uri.non-empty
177 }
178 link.attrs.rel =
179 attribute rel {
180 w:link-rel
181 }
182 link.attrs.integrity =
183 attribute integrity {
184 common.data.integrity
185 }
186 link.attrs.sizes =
187 attribute sizes {
188 w:string "any" | common.data.sizes
189 }
190 link.inner =
191 ( empty )
192
193 common.elem.metadata |= link.elem
194
195 ## Global Style: <style>
196
197 style.elem =
198 element style { style.inner & style.attrs }
199 style.attrs =
200 ( common.attrs
201 & style.attrs.type?
202 & style.attrs.media?
203 # style.attrs.title included in common.attrs
204 & ( common.attrs.aria.role.presentation
205 | common.attrs.aria.role.menuitem
206 )?
207 )
208 style.attrs.type =
209 attribute type {
210 common.data.mimetype
211 }
212 style.attrs.media =
213 attribute media {
214 common.data.mediaquery
215 }
216 style.inner =
217 ( common.inner.anything )
218
219 common.elem.metadata |= style.elem
220
221 ## Scoped Style: <style scoped>
222
223 style.elem.scoped =
224 element style { style.inner & style.scoped.attrs }
225 style.scoped.attrs =
226 ( common.attrs
227 & style.attrs.type?
228 & style.attrs.media?
229 & style.attrs.scoped
230 # style.attrs.title included in common.attrs
231 & ( common.attrs.aria.role.presentation
232 | common.attrs.aria.role.menuitem
233 )?
234 )
235 style.attrs.scoped =
236 attribute scoped {
237 w:string "scoped" | w:string ""
238 }
239
240 ## Name-Value Metadata: <meta name>
241
242 meta.name.elem =
243 element meta { meta.inner & meta.name.attrs }
244 meta.name.attrs =
245 ( common.attrs.basic
246 & common.attrs.i18n
247 & common.attrs.present
248 & common.attrs.other
249 & meta.name.attrs.name
250 & meta.name.attrs.content
251 & ( common.attrs.aria.role.presentation
252 | common.attrs.aria.role.menuitem
253 )?
254 )
255 meta.name.attrs.name =
256 attribute name {
257 w:non-empty-string
258 }
259 meta.name.attrs.content =
260 attribute content {
261 string
262 }
263 meta.inner =
264 ( empty )
265
266 common.elem.metadata |= meta.name.elem
267
268 ## "refresh" pragma directive: <meta http-equiv='refresh'>
269
270 meta.http-equiv.refresh.elem =
271 element meta { meta.inner & meta.http-equiv.refresh.attrs }
272 meta.http-equiv.refresh.attrs =
273 ( common.attrs.basic
274 & common.attrs.i18n
275 & common.attrs.present
276 & common.attrs.other
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
281 )?
282 )
283 meta.http-equiv.attrs.http-equiv.refresh =
284 attribute http-equiv {
285 w:string "refresh"
286 }
287 meta.http-equiv.attrs.content.refresh =
288 attribute content {
289 common.data.refresh
290 }
291 common.elem.metadata |= meta.http-equiv.refresh.elem # not quite right per spec
292 # if the definition is
293 # reused in another language
294
295 ## "default-style" pragma directive: <meta http-equiv='default-style'>
296
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 =
300 ( common.attrs.basic
301 & common.attrs.i18n
302 & common.attrs.present
303 & common.attrs.other
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
308 )?
309 )
310 meta.http-equiv.attrs.http-equiv.default-style =
311 attribute http-equiv {
312 w:string "default-style"
313 }
314 meta.http-equiv.attrs.content.default-style =
315 attribute content {
316 common.data.default-style
317 }
318
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
322
323 ## "x-ua-compatible" pragma directive: <meta http-equiv='x-ua-compatible'>
324
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 =
328 ( common.attrs.basic
329 & common.attrs.i18n
330 & common.attrs.present
331 & common.attrs.other
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
336 )?
337 )
338 meta.http-equiv.attrs.http-equiv.x-ua-compatible =
339 attribute http-equiv {
340 w:string "x-ua-compatible"
341 }
342 meta.http-equiv.attrs.content.x-ua-compatible =
343 attribute content {
344 common.data.x-ua-compatible
345 }
346 common.elem.metadata |= meta.http-equiv.x-ua-compatible.elem
347
348 ## Inline Character Encoding Statement for HTML: <meta charset>
349
350 meta.charset.elem =
351 element meta { meta.inner & meta.charset.attrs }
352 meta.charset.attrs =
353 ( common.attrs.basic
354 & common.attrs.i18n
355 & common.attrs.present
356 & common.attrs.other
357 & meta.charset.attrs.charset
358 & ( common.attrs.aria.role.presentation
359 | common.attrs.aria.role.menuitem
360 )?
361 )
362 meta.charset.attrs.charset =
363 attribute charset {
364 (common.data.charset & HTMLonly)
365 | (xsd:string {
366 pattern = "[uU][tT][fF]-8"
367 } & XMLonly )
368 }
369
370 ## Inline Character Encoding Statement for HTML: <meta http-equiv='content-type'>
371
372 meta.http-equiv.content-type.elem =
373 element meta { meta.inner & meta.http-equiv.content-type.attrs }
374 & HTMLonly
375 meta.http-equiv.content-type.attrs =
376 ( common.attrs.basic
377 & common.attrs.i18n
378 & common.attrs.present
379 & common.attrs.other
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
384 )?
385 )
386 meta.http-equiv.attrs.http-equiv.content-type =
387 attribute http-equiv {
388 w:string "content-type"
389 }
390 meta.http-equiv.attrs.content.content-type =
391 attribute content {
392 common.data.meta-charset
393 }
394
395 common.elem.metadata |= ( meta.charset.elem | meta.http-equiv.content-type.elem )