- From: Jonathan Hall <Jonathan.Hall@uk.uu.net>
- Date: Thu, 17 Aug 2000 15:24:09 +0100
- To: "'www-forms@w3.org'" <www-forms@w3.org>
Hi,
How would you solve the below questions within the
current defined limits of XForms?
Scenario - A user registering for a free service of
some form.
The user is presented with a registration page with
two fields on it; one for salutation title and one
for full name. The user selects their salutation
title from some form of list that is fixed and then
enters their name.
The user submits the form and the server responds
by displaying a registration complete page which
displays the details entered by the user (salutation
and full name), along with a username and password
that the registration system has automatically
allocated.
In the above scenario the registration page would
be an XForm, perhaps something like the below:
<group>
<string name="salutationTitle" required="true" range="closed">
<value default="true">Select One</value> <!-- this becomes a user
prompt -->
<value>Mr</value>
<value>Mrs</value>
<value>Miss</value>
</string>
<string name="fullName" required="true" min="1" max="25" />
</group>
In a web environment, it is typical to have a prompt
in something like a drop-down listbox, e.g.:
<SELECT NAME="salutationTitle">
<OPTION VALUE="0">Select One</OPTION>
<OPTION VALUE="1">Mr</OPTION>
etc..
Q1) How can I embed the keys: 0, 1 etc.. along with the
textual elements in an XForm? Would I just introduce my
own attribute, perhaps key="0"?
Q2) How could I determine that although 'Select One' was
a valid value within the enumerated string, it is not
actually an acceptable answer? Would I need to do this
programmatically,
e.g. if (salutationTitle == 0) { // invalid } or can I
express it through the use of a particular facet that
the value if not allowed?
Q3) Would the resgistration complete page be defined as
an XForm, even though it is display only with no input
fields?
Q4) If the answer to the above is yes, would I need to
define another salutationTitle datatype, one which is
not an enumerated type, but simply a string for
displaying? So the registration complete XForm would
be:
<group>
<string name="salutationTitle" />
<string name="fullName" ....
<string name="username" ...
<string name="password" ...
</group>
...or would I need to program the XSL to simply display,
the salutation rather than create a prompt for input?
Q5) Could I introduce some form of namespace into the
XForm name attributes?
Perhaps: <string name="user:fullName" required="true" etc..
Would this be valid?
Q6) Would buttons (such as 'Back' and 'Next'), perhaps
defined as an enumerated type be regarded as presentation,
particulary as an XForm could be split over a number of
pages? If so, would you expect to see these in the XSL code?
Q7) How could I model some form of hierarchical validation,
for instance 'London' is only valid if the country is
'England'? Would I do this sort of validation through a
'Script Validation' call, which could perhaps check the
below XML?:
<countrySet>
<country>
<name>England</name>
<citySet>
<city>
<name>Cambridge</name>
<population>xxx</population>
</city>
<city>
<name>London</name>
<population>xxx</population>
</city>
</citySet>
</country>
<country>
etc...
</countrySet>
Thanks in advance.
Regards,
Jon.
Received on Thursday, 17 August 2000 10:25:06 UTC