xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: FORM is to HTML, as ? is to XML
Date Tue, 21 Dec 1999 20:07:56 GMT
I'm not sure how relevant this is to the original question (which was...
what?) but I've had some experience generating HTML forms from XML and a
technique that I've found very useful is to define a slightly augmented
XML representation of an HTML form, such that a good XSLT stylesheet can
transform the XML representation into a nice looking HTML form. My
'canonical' XML form looks almost like an XHTML form, but for the
following differences:

1. <select name="foo"> --> <input type="select" name="foo"/>

why would this have ever been a seperately named element anyway? Grr.

2. Input elements can have a label attribute, which indicates a nice human
readable label for the form element.

3. Input elements can have a required attribute, which indicates whether
or not the element is required to have a value for proper form submission.
I use this to do automatic javascript form validation.

4. Input elements can have a conforms-to attribute which contains a
regular expression which the value should, well, conform to. I use this to
do automatic javascript form validation.

Note that if supporting dumb clients is mandatory, you could, instead of
doing client-side javascript form validation, include a hidden reference
to the XML form that generated the client's version of the form and do the
verification on the server side after the client has submitted the form.

Note there are a couple of proposals for a standardized XML form
representation, notable XFDL (http://www.w3.org/TR/NOTE-XFDL) and
Formsheets (http://www8.org/w8-papers/1c-xml/formsheets/formsheets.html),
but a comprehensive and useful standard has yet to emerge.

- donald

View raw message