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


From: Joe Hewitt <joe@joehewitt.com>
Date: Wed, 19 Apr 2000 20:46:14 -0400
To: <www-forms@w3.org>
Message-ID: <000001bfaa61$d54df970$31cfb326@zenimax.com>
There is a bit of ambiguity in the WD about how to represent arrays in a
form, and handle multiple occurences of the same form path (the name
attribute).  The problem lies in the form element naming syntax, which
specifies a path to an element (such as "purchaseOrder.shipTo.name") but
does not specify which index into an array that it points to.

For example, for this xform:

  <group name="contacts">
    <group name="person" maxoccurs="*">
      <string name="name" maxoccurs="*"/>

Say we had an XHTML form like this:

Person 1:
<input type="text" name="contacts.person.name"/><br/>
Person 2:
<input type="text" name="contacts.person.name"/><br/>
Person 3:
<input type="text" name="contacts.person.name"/><br/>

When generating an instance, how does the processor know where to put person
and name elements?  Due to this lack of specificity, the XForm could have
one of these possible resulting instances:


... OR


As you can see, the simple path "contacts.person.name" doesn't say when to
create a new element at each level of the path.  Would it make sense to give
more power to the path language than just separating levels by periods?
Could we add another operator such as "+" which indicates to create a new

So, for example, "contacts+person.name" would state that a new person
element should always be created, while "contacts.person.name" would state
that the last created person element (within contacts) should be used, and
one should be created if none exists.

Does this make any sense?

- Joe
Received on Wednesday, 19 April 2000 20:41:29 UTC

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