Re: FW: How would you solve?

On Mon, 21 Aug 2000, Jonathan Hall wrote:

> Sorry to approach you directly, but unfortunately I've not
> received any response to my posting to the 
> www-forms group on Thursday.  If you have time to answer
> any (or all) of the below, it would be much appreciated.
> 
> I will be attending a meeting on Wednesday where XForms
> will be discussed, but I feel without answers to the below, 
> we do not fully understand the use of XForms.

It's late here in the UK, but I will do my best to answer
your questions:

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

You are using 0, 1, 2 etc. as data values, so thats what
you specify in the data model. The text shown to the
user would be given in the user interface markup and could
be changed as appropriate for different languages.

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

We haven't yet gotten to this level of detail. One idea
is to allow the field to be initialized to value that
isn't allowed in the data model. Another is to provide
a constraint as an boolean expression that precludes making
this choice. In the previous version of the data model
draft this would be possible using the validate attribute.

The working group is currently working on ways to allow
the use of XML Schema plus suitable annotations as an
alternative to the lightweight syntax. We plan to release
a new draft covering this in October.

> Q3) Would the resgistration complete page be defined as 
> an XForm, even though it is display only with no input 
> fields?

I would anticipate that you would need to define the
user interface as well as the data model. The text seen
by the user is defined in the user interface tather than
in the data model. Note that it may also be generated by
an expression, e.g. when the list of choices is dynamically
generated, perhaps based upon data previously entered into
the form.

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

We have discussed the need to specify namespaces in the
data model, but it is tool early to go into details.
In essence, you may want to specify the namespace for
the XML used to convey the form's data to the server.
The natural extension is to allow this to include elements
and attributes from more than one namespace.
 
> 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?

We have yet to work on the details for a multipage presentation
of a complex form, and hence can't really give you a good
answer on this. We are at the point where we have a good
grasp of the needs but have yet to work on how to meet these.

> Q7) How could I model some form of hierarchical validation, 
> for instance 'London' is only valid if the country is 
> 'England'?

This is the role of the expression language. You can add
a predicate to the data type that checks the city for
consistency with the country. This may even involve a call
out to a script method which in turn makes an RPC call to
a server to consult a database. It will sometimes be the case
that the database is too large to download as part of the form.

Best wishes,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 778 532 0444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)

Received on Tuesday, 29 August 2000 15:02:49 UTC