W3C home > Mailing lists > Public > www-forms@w3.org > August 2000

How would you solve?

From: Jonathan Hall <Jonathan.Hall@uk.uu.net>
Date: Thu, 17 Aug 2000 15:24:09 +0100
Message-ID: <9CEEB9B4233AD41185F800508B6F74125A5B09@camexch3.cam.uk.internal>
To: "'www-forms@w3.org'" <www-forms@w3.org>

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 

In the above scenario the registration page would 
be an XForm, perhaps something like the below:

   <string name="salutationTitle" required="true" range="closed">
      <value default="true">Select One</value> <!-- this becomes a user
prompt -->
   <string name="fullName" required="true" min="1" max="25" />

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>

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 
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 

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 

   <string name="salutationTitle" />
   <string name="fullName" ....
   <string name="username" ...
   <string name="password" ...

...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?:


Thanks in advance.
Received on Thursday, 17 August 2000 10:25:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:03 UTC