1 datatypes w = "http://whattf.org/datatype-draft"
3 # #####################################################################
4 ## RELAX NG Schema for HTML 5: Web Forms 2.0 markup #
5 # #####################################################################
7 ## Shared attributes for form controls
10 ( common-form.attrs.form? )
12 common-form.attrs.form |=
17 shared-form.attrs.formaction =
18 attribute formaction {
19 common.data.uri.non-empty
22 shared-form.attrs.formenctype =
23 attribute formenctype {
24 shared-form.attrs.formenctype.data
26 shared-form.attrs.formenctype.data =
27 ( w:string "application/x-www-form-urlencoded"
28 | w:string "multipart/form-data"
29 | w:string "text/plain"
32 shared-form.attrs.formmethod =
33 attribute formmethod {
34 shared-form.attrs.formmethod.data
36 shared-form.attrs.formmethod.data =
41 shared-form.attrs.formtarget =
42 attribute formtarget {
43 common.data.browsing-context-or-keyword
46 shared-form.attrs.formnovalidate =
47 attribute formnovalidate {
48 w:string "formnovalidate" | w:string ""
51 shared-form.attrs.autofocus =
53 w:string "autofocus" | w:string ""
56 shared-form.attrs.pattern =
61 shared-form.attrs.template =
66 shared-form.attrs.required =
68 w:string "required" | w:string ""
71 shared-form.attrs.placeholder =
72 attribute placeholder {
73 form.data.stringwithoutlinebreaks
76 shared-form.attrs.dirname =
78 form.data.nonemptystring
81 shared-form.attrs.inputmode =
86 shared-form.attrs.minlength =
88 common.data.integer.non-negative
91 ## Shared attributes for <input>
94 ( input.attrs.autocomplete?
95 & shared-form.attrs.autofocus?
97 & shared-form.attrs.maxlength?
98 & shared-form.attrs.minlength?
99 & shared-form.attrs.pattern?
100 & shared-form.attrs.placeholder?
101 & shared-form.attrs.readonly?
102 & shared-form.attrs.required?
103 & shared-form.attrs.size?
106 input.attrs.autocomplete =
107 attribute autocomplete {
108 w:string "on" | w:string "off"
116 input.attrs.step.float =
118 w:string "any" | common.data.float.positive
121 input.attrs.step.integer =
123 w:string "any" | common.data.integer.positive
126 input.attrs.multiple =
128 w:string "multiple" | w:string ""
131 ## Text Field: <input type='text'>, Extensions
134 ( input.attrs.autocomplete?
135 & shared-form.attrs.autofocus?
136 & shared-form.attrs.dirname?
138 & shared-form.attrs.pattern?
139 & shared-form.attrs.required?
140 & shared-form.attrs.placeholder?
141 & shared-form.attrs.inputmode?
142 & shared-form.attrs.minlength?
145 ## Password Field: <input type='password'>, Extensions
147 input.password.attrs &=
148 ( input.attrs.autocomplete?
149 & shared-form.attrs.autofocus?
151 & shared-form.attrs.pattern?
152 & shared-form.attrs.placeholder?
153 & shared-form.attrs.required?
154 & shared-form.attrs.minlength?
157 ## Checkbox <input type='checkbox'>, Extensions
159 input.checkbox.attrs &=
160 ( shared-input.attrs )
162 ## Radiobutton: <input type='radio'>, Extensions
165 ( shared-input.attrs )
167 ## Scripting Hook Button: <input type='button'>, Extensions
169 input.button.attrs &=
170 ( shared-input.attrs )
172 ## Submit Button: <input type='submit'>, Extensions
174 input.submit.attrs &=
176 & shared-form.attrs.formaction?
177 & shared-form.attrs.formenctype?
178 & shared-form.attrs.formmethod?
179 & shared-form.attrs.formtarget?
180 & shared-form.attrs.formnovalidate?
183 ## Reset Button: <input type='reset'>, Extensions
186 ( shared-input.attrs )
188 ## File Upload: <input type='file'>, Extensions
192 & input.attrs.multiple?
195 ## Image Submit Button: <input type='image'>, Extensions
199 & shared-form.attrs.formaction?
200 & shared-form.attrs.formenctype?
201 & shared-form.attrs.formmethod?
202 & shared-form.attrs.formtarget?
203 & shared-form.attrs.formnovalidate?
204 & input.image.attrs.height?
205 & input.image.attrs.width?
207 input.image.attrs.height =
209 common.data.integer.non-negative
211 input.image.attrs.width =
213 common.data.integer.non-negative
216 ## Global Date and Time: <input type='datetime'>
218 input.datetime.elem =
219 element input { input.datetime.attrs }
220 input.datetime.attrs =
224 & input.datetime.attrs.type
225 & input.datetime.attrs.min?
226 & input.datetime.attrs.max?
227 & input.attrs.step.float?
228 & input.datetime.attrs.value?
231 input.datetime.attrs.type =
235 input.datetime.attrs.min =
239 input.datetime.attrs.max =
243 input.datetime.attrs.value =
245 w:string "" | common.data.datetime
248 input.elem |= input.datetime.elem
250 ## Date and Time with No Time Zone Information: <input type='datetime-local'>
252 input.datetime-local.elem =
253 element input { input.datetime-local.attrs }
254 input.datetime-local.attrs =
258 & input.datetime-local.attrs.type
259 & input.datetime-local.attrs.min?
260 & input.datetime-local.attrs.max?
261 & input.attrs.step.float?
262 & input.datetime-local.attrs.value?
265 input.datetime-local.attrs.type =
267 w:string "datetime-local"
269 input.datetime-local.attrs.min =
271 form.data.datetime-local
273 input.datetime-local.attrs.max =
275 form.data.datetime-local
277 input.datetime-local.attrs.value =
279 w:string "" | form.data.datetime-local
282 input.elem |= input.datetime-local.elem
284 ## Date: <input type='date'>
287 element input { input.date.attrs }
292 & input.date.attrs.type
293 & input.date.attrs.min?
294 & input.date.attrs.max?
295 & input.attrs.step.integer?
296 & input.date.attrs.value?
299 input.date.attrs.type =
303 input.date.attrs.min =
307 input.date.attrs.max =
311 input.date.attrs.value =
313 w:string "" | form.data.date
316 input.elem |= input.date.elem
318 ## Year and Month: <input type='month'>
321 element input { input.month.attrs }
326 & input.month.attrs.type
327 & input.month.attrs.min?
328 & input.month.attrs.max?
329 & input.attrs.step.integer?
330 & input.month.attrs.value?
333 input.month.attrs.type =
337 input.month.attrs.min =
341 input.month.attrs.max =
345 input.month.attrs.value =
347 w:string "" | form.data.month
350 input.elem |= input.month.elem
352 ## Time without Time Zone Information: <input type='time'>
355 element input { input.time.attrs }
360 & input.time.attrs.type
361 & input.time.attrs.min?
362 & input.time.attrs.max?
363 & input.attrs.step.float?
364 & input.time.attrs.value?
367 input.time.attrs.type =
371 input.time.attrs.min =
375 input.time.attrs.max =
379 input.time.attrs.value =
381 w:string "" | form.data.time
384 input.elem |= input.time.elem
386 ## Year and Week: <input type='week'>
389 element input { input.week.attrs }
394 & input.week.attrs.type
395 & input.week.attrs.min?
396 & input.week.attrs.max?
397 & input.attrs.step.integer?
398 & input.week.attrs.value?
401 input.week.attrs.type =
405 input.week.attrs.min =
409 input.week.attrs.max =
413 input.week.attrs.value =
415 w:string "" | form.data.week
418 input.elem |= input.week.elem
420 ## Number: <input type='number'>
423 element input { input.number.attrs }
428 & input.number.attrs.type
429 & input.number.attrs.min?
430 & input.number.attrs.max?
431 & input.attrs.step.float?
432 & input.number.attrs.value?
433 & ( common.attrs.aria.implicit.spinbutton
434 | common.attrs.aria.role.spinbutton
437 input.number.attrs.type =
441 input.number.attrs.min =
445 input.number.attrs.max =
449 input.number.attrs.value =
451 w:string "" | common.data.float
454 input.elem |= input.number.elem
456 ## Imprecise Number: <input type='range'>
459 element input { input.range.attrs }
464 & input.range.attrs.type
465 & input.range.attrs.min?
466 & input.range.attrs.max?
467 & input.attrs.step.float?
468 & input.range.attrs.value?
469 & ( common.attrs.aria.implicit.slider
470 | common.attrs.aria.role.slider
473 input.range.attrs.type =
477 input.range.attrs.min =
481 input.range.attrs.max =
485 input.range.attrs.value =
490 input.elem |= input.range.elem
492 ## Email Address: <input type='email'>
495 element input { input.email.attrs }
500 & input.email.attrs.type
501 & ( ( input.attrs.multiple
502 & input.email.attrs.value.multiple?
504 | input.email.attrs.value.single?
506 & ( common.attrs.aria.implicit.textbox
507 | common.attrs.aria.implicit.combobox
508 | common.attrs.aria.role.textbox
509 | common.attrs.aria.role.combobox
512 input.email.attrs.type =
516 input.email.attrs.value.single =
518 form.data.emailaddress
520 input.email.attrs.value.multiple =
522 form.data.emailaddresslist
525 input.elem |= input.email.elem
527 ## IRI: <input type='url'>
530 element input { input.url.attrs }
535 & input.url.attrs.type
536 & input.url.attrs.value?
537 & ( common.attrs.aria.implicit.textbox
538 | common.attrs.aria.implicit.combobox
539 | common.attrs.aria.role.textbox
540 | common.attrs.aria.role.combobox
543 input.url.attrs.type =
547 input.url.attrs.value =
549 w:string "" | common.data.uri.absolute
552 input.elem |= input.url.elem
554 ## Search: <input type='search'>
557 element input { input.search.attrs }
562 & input.search.attrs.type
563 & input.search.attrs.value?
564 & shared-form.attrs.dirname?
565 & ( common.attrs.aria.implicit.textbox
566 | common.attrs.aria.implicit.combobox
567 | common.attrs.aria.role.textbox
568 | common.attrs.aria.role.combobox
571 input.search.attrs.type =
575 input.search.attrs.value =
577 form.data.stringwithoutlinebreaks
580 input.elem |= input.search.elem
582 ## Telephone Number: <input type='tel'>
585 element input { input.tel.attrs }
590 & input.tel.attrs.type
591 & input.tel.attrs.value?
592 & ( common.attrs.aria.implicit.textbox
593 | common.attrs.aria.implicit.combobox
594 | common.attrs.aria.role.textbox
595 | common.attrs.aria.role.combobox
598 input.tel.attrs.type =
602 input.tel.attrs.value =
604 form.data.stringwithoutlinebreaks
607 input.elem |= input.tel.elem
609 ## Color: <input type='color'>
612 element input { input.color.attrs }
616 & input.color.attrs.type
617 & input.color.attrs.value?
621 input.color.attrs.type =
625 input.color.attrs.value =
627 w:string "" | form.data.color
630 input.elem |= input.color.elem
632 ## Form Output: <output>
635 element output { output.inner & output.attrs }
638 & common-form.attrs.name?
639 & common-form.attrs.form?
641 & ( common.attrs.aria.implicit.status
647 common.data.idrefs #REVISIT spec says space--not whitespace
650 ( common.inner.phrasing )
652 common.elem.phrasing |= output.elem
654 ## Text Area: <textarea>, extensions
656 textarea.attrs.rows-and-cols-wf1.inner &=
658 textarea.attrs.rows-and-cols-wf1 |=
661 ( shared-form.attrs.maxlength?
662 & shared-form.attrs.minlength?
663 & shared-form.attrs.autofocus?
664 & shared-form.attrs.required?
665 & shared-form.attrs.placeholder?
666 & shared-form.attrs.dirname?
667 & textarea.attrs.rows?
668 & ( ( textarea.attrs.wrap.hard
669 & textarea.attrs.cols
671 | ( textarea.attrs.wrap.soft?
672 & textarea.attrs.cols?
675 & shared-form.attrs.inputmode?
677 textarea.attrs.wrap.hard =
681 textarea.attrs.wrap.soft =
686 ## List of Prefill Data: <datalist>
688 #REVISIT should the options in datalist be non-selectable?
691 element datalist { datalist.inner & datalist.attrs }
693 ( option.elem* & common.inner.phrasing )
696 & ( common.attrs.aria.role.listbox # aria-multiselectable must be false; check by assertions
697 | common.attrs.aria.role.presentation
698 | common.attrs.aria.role.menuitem
702 common.elem.phrasing |= datalist.elem
704 ## Complex Submit Button: <button type='submit'>, extensions
706 button.submit.attrs &=
707 ( shared-form.attrs.formaction?
708 & shared-form.attrs.autofocus?
709 & shared-form.attrs.formenctype?
710 & shared-form.attrs.formmethod?
711 & shared-form.attrs.formtarget?
712 & shared-form.attrs.formnovalidate?
715 ## Complex Reset Button: <button type='reset'>, extensions
717 button.reset.attrs &=
718 ( shared-form.attrs.autofocus? )
720 ## Complex Push Button: <button type='button'>, extensions
722 button.button.attrs &=
723 ( shared-form.attrs.autofocus? )
725 ## Form: <form>, extensions
727 ( form.attrs.novalidate?
729 & form.attrs.autocomplete?
731 form.attrs.novalidate =
732 attribute novalidate {
733 w:string "novalidate" | w:string ""
737 common.data.browsing-context-or-keyword
739 form.attrs.autocomplete =
740 attribute autocomplete {
741 w:string "on" | w:string "off"
743 # REVISIT should this be case-insensitive in conforming XHTML documents?
744 form.attrs.enctype.data |=
745 ( w:string "text/plain" )
747 ## Fieldset: <fieldset>, extensions
750 ( common-form.attrs )
752 ## Label: <label>, extensions
755 ( common-form.attrs.form? )
757 ## Key-pair generator/input control: <keygen>
760 element keygen { keygen.inner & keygen.attrs }
763 & keygen.attrs.challenge?
764 & keygen.attrs.keytype?
765 & shared-form.attrs.autofocus?
767 & ( common.attrs.aria.role.presentation
768 | common.attrs.aria.role.menuitem
771 keygen.attrs.challenge =
772 attribute challenge {
775 keygen.attrs.keytype =
782 common.elem.phrasing |= keygen.elem
784 ## Selection Menu: <select>, Extensions
787 ( shared-form.attrs.autofocus?
788 & shared-form.attrs.required?