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 attributes for <input>
89 ( input.attrs.autocomplete?
90 & shared-form.attrs.autofocus?
92 & shared-form.attrs.maxlength?
93 & shared-form.attrs.pattern?
94 & shared-form.attrs.placeholder?
95 & shared-form.attrs.readonly?
96 & shared-form.attrs.required?
97 & shared-form.attrs.size?
100 input.attrs.autocomplete =
101 attribute autocomplete {
102 w:string "on" | w:string "off"
110 input.attrs.step.float =
112 w:string "any" | common.data.float.positive
115 input.attrs.step.integer =
117 w:string "any" | common.data.integer.positive
120 input.attrs.multiple =
122 w:string "multiple" | w:string ""
125 ## Text Field: <input type='text'>, Extensions
128 ( input.attrs.autocomplete?
129 & shared-form.attrs.autofocus?
130 & shared-form.attrs.dirname?
132 & shared-form.attrs.pattern?
133 & shared-form.attrs.required?
134 & shared-form.attrs.placeholder?
135 & shared-form.attrs.inputmode?
138 ## Password Field: <input type='password'>, Extensions
140 input.password.attrs &=
141 ( input.attrs.autocomplete?
142 & shared-form.attrs.autofocus?
144 & shared-form.attrs.pattern?
145 & shared-form.attrs.placeholder?
146 & shared-form.attrs.required?
149 ## Checkbox <input type='checkbox'>, Extensions
151 input.checkbox.attrs &=
152 ( shared-input.attrs )
154 ## Radiobutton: <input type='radio'>, Extensions
157 ( shared-input.attrs )
159 ## Scripting Hook Button: <input type='button'>, Extensions
161 input.button.attrs &=
162 ( shared-input.attrs )
164 ## Submit Button: <input type='submit'>, Extensions
166 input.submit.attrs &=
168 & shared-form.attrs.formaction?
169 & shared-form.attrs.formenctype?
170 & shared-form.attrs.formmethod?
171 & shared-form.attrs.formtarget?
172 & shared-form.attrs.formnovalidate?
175 ## Reset Button: <input type='reset'>, Extensions
178 ( shared-input.attrs )
180 ## File Upload: <input type='file'>, Extensions
184 & input.attrs.multiple?
187 ## Image Submit Button: <input type='image'>, Extensions
191 & shared-form.attrs.formaction?
192 & shared-form.attrs.formenctype?
193 & shared-form.attrs.formmethod?
194 & shared-form.attrs.formtarget?
195 & shared-form.attrs.formnovalidate?
196 & input.image.attrs.height?
197 & input.image.attrs.width?
199 input.image.attrs.height =
201 common.data.integer.non-negative
203 input.image.attrs.width =
205 common.data.integer.non-negative
208 ## Global Date and Time: <input type='datetime'>
210 input.datetime.elem =
211 element input { input.datetime.attrs }
212 input.datetime.attrs =
216 & input.datetime.attrs.type
217 & input.datetime.attrs.min?
218 & input.datetime.attrs.max?
219 & input.attrs.step.float?
220 & input.datetime.attrs.value?
223 input.datetime.attrs.type =
227 input.datetime.attrs.min =
231 input.datetime.attrs.max =
235 input.datetime.attrs.value =
237 w:string "" | common.data.datetime
240 input.elem |= input.datetime.elem
242 ## Date and Time with No Time Zone Information: <input type='datetime-local'>
244 input.datetime-local.elem =
245 element input { input.datetime-local.attrs }
246 input.datetime-local.attrs =
250 & input.datetime-local.attrs.type
251 & input.datetime-local.attrs.min?
252 & input.datetime-local.attrs.max?
253 & input.attrs.step.float?
254 & input.datetime-local.attrs.value?
257 input.datetime-local.attrs.type =
259 w:string "datetime-local"
261 input.datetime-local.attrs.min =
263 form.data.datetime-local
265 input.datetime-local.attrs.max =
267 form.data.datetime-local
269 input.datetime-local.attrs.value =
271 w:string "" | form.data.datetime-local
274 input.elem |= input.datetime-local.elem
276 ## Date: <input type='date'>
279 element input { input.date.attrs }
284 & input.date.attrs.type
285 & input.date.attrs.min?
286 & input.date.attrs.max?
287 & input.attrs.step.integer?
288 & input.date.attrs.value?
291 input.date.attrs.type =
295 input.date.attrs.min =
299 input.date.attrs.max =
303 input.date.attrs.value =
305 w:string "" | form.data.date
308 input.elem |= input.date.elem
310 ## Year and Month: <input type='month'>
313 element input { input.month.attrs }
318 & input.month.attrs.type
319 & input.month.attrs.min?
320 & input.month.attrs.max?
321 & input.attrs.step.integer?
322 & input.month.attrs.value?
325 input.month.attrs.type =
329 input.month.attrs.min =
333 input.month.attrs.max =
337 input.month.attrs.value =
339 w:string "" | form.data.month
342 input.elem |= input.month.elem
344 ## Time without Time Zone Information: <input type='time'>
347 element input { input.time.attrs }
352 & input.time.attrs.type
353 & input.time.attrs.min?
354 & input.time.attrs.max?
355 & input.attrs.step.float?
356 & input.time.attrs.value?
359 input.time.attrs.type =
363 input.time.attrs.min =
367 input.time.attrs.max =
371 input.time.attrs.value =
373 w:string "" | form.data.time
376 input.elem |= input.time.elem
378 ## Year and Week: <input type='week'>
381 element input { input.week.attrs }
386 & input.week.attrs.type
387 & input.week.attrs.min?
388 & input.week.attrs.max?
389 & input.attrs.step.integer?
390 & input.week.attrs.value?
393 input.week.attrs.type =
397 input.week.attrs.min =
401 input.week.attrs.max =
405 input.week.attrs.value =
407 w:string "" | form.data.week
410 input.elem |= input.week.elem
412 ## Number: <input type='number'>
415 element input { input.number.attrs }
420 & input.number.attrs.type
421 & input.number.attrs.min?
422 & input.number.attrs.max?
423 & input.attrs.step.float?
424 & input.number.attrs.value?
425 & ( common.attrs.aria.implicit.spinbutton
426 | common.attrs.aria.role.spinbutton
429 input.number.attrs.type =
433 input.number.attrs.min =
437 input.number.attrs.max =
441 input.number.attrs.value =
443 w:string "" | common.data.float
446 input.elem |= input.number.elem
448 ## Imprecise Number: <input type='range'>
451 element input { input.range.attrs }
456 & input.range.attrs.type
457 & input.range.attrs.min?
458 & input.range.attrs.max?
459 & input.attrs.step.float?
460 & input.range.attrs.value?
461 & ( common.attrs.aria.implicit.slider
462 | common.attrs.aria.role.slider
465 input.range.attrs.type =
469 input.range.attrs.min =
473 input.range.attrs.max =
477 input.range.attrs.value =
482 input.elem |= input.range.elem
484 ## Email Address: <input type='email'>
487 element input { input.email.attrs }
492 & input.email.attrs.type
493 & ( ( input.attrs.multiple
494 & input.email.attrs.value.multiple?
496 | input.email.attrs.value.single?
498 & ( common.attrs.aria.implicit.textbox
499 | common.attrs.aria.implicit.combobox
500 | common.attrs.aria.role.textbox
501 | common.attrs.aria.role.combobox
504 input.email.attrs.type =
508 input.email.attrs.value.single =
510 form.data.emailaddress
512 input.email.attrs.value.multiple =
514 form.data.emailaddresslist
517 input.elem |= input.email.elem
519 ## IRI: <input type='url'>
522 element input { input.url.attrs }
527 & input.url.attrs.type
528 & input.url.attrs.value?
529 & ( common.attrs.aria.implicit.textbox
530 | common.attrs.aria.implicit.combobox
531 | common.attrs.aria.role.textbox
532 | common.attrs.aria.role.combobox
535 input.url.attrs.type =
539 input.url.attrs.value =
541 w:string "" | common.data.uri.absolute
544 input.elem |= input.url.elem
546 ## Search: <input type='search'>
549 element input { input.search.attrs }
554 & input.search.attrs.type
555 & input.search.attrs.value?
556 & shared-form.attrs.dirname?
557 & ( common.attrs.aria.implicit.textbox
558 | common.attrs.aria.implicit.combobox
559 | common.attrs.aria.role.textbox
560 | common.attrs.aria.role.combobox
563 input.search.attrs.type =
567 input.search.attrs.value =
569 form.data.stringwithoutlinebreaks
572 input.elem |= input.search.elem
574 ## Telephone Number: <input type='tel'>
577 element input { input.tel.attrs }
582 & input.tel.attrs.type
583 & input.tel.attrs.value?
584 & ( common.attrs.aria.implicit.textbox
585 | common.attrs.aria.implicit.combobox
586 | common.attrs.aria.role.textbox
587 | common.attrs.aria.role.combobox
590 input.tel.attrs.type =
594 input.tel.attrs.value =
596 form.data.stringwithoutlinebreaks
599 input.elem |= input.tel.elem
601 ## Color: <input type='color'>
604 element input { input.color.attrs }
608 & input.color.attrs.type
609 & input.color.attrs.value?
613 input.color.attrs.type =
617 input.color.attrs.value =
619 w:string "" | form.data.color
622 input.elem |= input.color.elem
624 ## Form Output: <output>
627 element output { output.inner & output.attrs }
630 & common-form.attrs.name?
631 & common-form.attrs.form?
633 & ( common.attrs.aria.implicit.status
639 common.data.idrefs #REVISIT spec says space--not whitespace
642 ( common.inner.phrasing )
644 common.elem.phrasing |= output.elem
646 ## Text Area: <textarea>, extensions
648 textarea.attrs.rows-and-cols-wf1.inner &=
650 textarea.attrs.rows-and-cols-wf1 |=
653 ( shared-form.attrs.maxlength?
654 & shared-form.attrs.autofocus?
655 & shared-form.attrs.required?
656 & shared-form.attrs.placeholder?
657 & shared-form.attrs.dirname?
658 & textarea.attrs.rows?
659 & ( ( textarea.attrs.wrap.hard
660 & textarea.attrs.cols
662 | ( textarea.attrs.wrap.soft?
663 & textarea.attrs.cols?
666 & shared-form.attrs.inputmode?
668 textarea.attrs.wrap.hard =
672 textarea.attrs.wrap.soft =
677 ## List of Prefill Data: <datalist>
679 #REVISIT should the options in datalist be non-selectable?
682 element datalist { datalist.inner & datalist.attrs }
684 ( option.elem* & common.inner.phrasing )
687 & ( common.attrs.aria.role.listbox # aria-multiselectable must be false; check by assertions
688 | common.attrs.aria.role.presentation
689 | common.attrs.aria.role.menuitem
693 common.elem.phrasing |= datalist.elem
695 ## Complex Submit Button: <button type='submit'>, extensions
697 button.submit.attrs &=
698 ( shared-form.attrs.formaction?
699 & shared-form.attrs.autofocus?
700 & shared-form.attrs.formenctype?
701 & shared-form.attrs.formmethod?
702 & shared-form.attrs.formtarget?
703 & shared-form.attrs.formnovalidate?
706 ## Complex Reset Button: <button type='reset'>, extensions
708 button.reset.attrs &=
709 ( shared-form.attrs.autofocus? )
711 ## Complex Push Button: <button type='button'>, extensions
713 button.button.attrs &=
714 ( shared-form.attrs.autofocus? )
716 ## Form: <form>, extensions
718 ( form.attrs.novalidate?
720 & form.attrs.autocomplete?
722 form.attrs.novalidate =
723 attribute novalidate {
724 w:string "novalidate" | w:string ""
728 common.data.browsing-context-or-keyword
730 form.attrs.autocomplete =
731 attribute autocomplete {
732 w:string "on" | w:string "off"
734 # REVISIT should this be case-insensitive in conforming XHTML documents?
735 form.attrs.enctype.data |=
736 ( w:string "text/plain" )
738 ## Fieldset: <fieldset>, extensions
741 ( common-form.attrs )
743 ## Label: <label>, extensions
746 ( common-form.attrs.form? )
748 ## Key-pair generator/input control: <keygen>
751 element keygen { keygen.inner & keygen.attrs }
754 & keygen.attrs.challenge?
755 & keygen.attrs.keytype?
756 & shared-form.attrs.autofocus?
758 & ( common.attrs.aria.role.presentation
759 | common.attrs.aria.role.menuitem
762 keygen.attrs.challenge =
763 attribute challenge {
766 keygen.attrs.keytype =
773 common.elem.phrasing |= keygen.elem
775 ## Selection Menu: <select>, Extensions
778 ( shared-form.attrs.autofocus?
779 & shared-form.attrs.required?