Response to your XForms comment (0164)

The XForms WG said [1]:

>>This is not a problem: 'required' says that a node must have a value of
>>length > 0, but not that the node must exist. To also ensure that a node
>> exists, use e.g. minOccurs="1".

Paul responded [Quoted Below]:
> You've just shifted the issue. How can I associate a 'minOccurs="1"'
> property with a node that doesn't exist?

Hi Paul,

In repeating nodesets, at least one of the repeated nodes MUST exist
initially, as a template. This allows a bind expression to exist, which
will refer to however many nodes exist during form execution, including
newly-inserted nodes.

In this example from 6.1.7:

<instance>
  <my:order>
    <my:item>
      <my:amount />
      <my:discount />
    <my:item>
  </my:order>
</instance>
<bind nodeset="my:item" minOccurs="1" maxOccurs="4" />

The <bind> selects the nodeset of "all my:item elements" and attaches the
minOccurs and maxOccurs properties. With a <repeat>/<insert>/<delete>
involved, the number of my:item elements can change, but the nodeset on the
bind continues to select all my:item elements.

> And reading the documentation for minOccurs, I have another issue.
>
> "for repeating structures, indicates the minimum number of allowed child
> elements."

We agree that this is an error, and have fixed it.
The property applies to the repeated nodes themselves.

Please respond to state that you agree with this Resolution.

Thanks!

[1] http://lists.w3.org/Archives/Public/www-forms-editor/2002Sep/0213.html

----- Original Message -----
From: "Paul Prescod" <paul@prescod.net>
To: "Thierry Michel" <tmichel@w3.org>
Sent: Thursday, September 26, 2002 8:52 PM
Subject: Re: 2002Sep/0164-Response to your issue sent to the XForms WG
about
the XForms Last Call WD


> Thierry Michel wrote:
> >
> > Your issue sent to the W3C XForms WG about the XForms Last Call Working
> > Draft 21 August 2002
> > http://www.w3.org/TR/2002/WD-xforms-20020821
> >
> > Your issue is archived at
> > http://lists.w3.org/Archives/Public/www-forms-editor/2002Sep/0164.html
> >
> >  XForms WG Resolution:
> > This is not a problem: 'required' says that a node must have a value of
> > length > 0, but not that the node must exist. To also ensure that a
node
> > exists, use e.g. minOccurs="1".
> >
> > Please respond to state that you agree with this Resolution.
>
> You've just shifted the issue. How can I associate a 'minOccurs="1"'
> property with a node that doesn't exist?
>
> And reading the documentation for minOccurs, I have another issue. It
says:
>
> "for repeating structures, indicates the minimum number of allowed child
> elements."
>
> I don't think that's what it is meant to handle. For instance, if I have:
>
> <foo>
>    <bar>
>      <baz>
>    </bar>
> </foo>
>
> And I want to require at least one "foo", I would expect to apply
> minOccurs to a path like "/foo". But "foo" is not a "child node". It is
> a node in the node list selected by the rule. If I take the bit about
> "child elements" seriously, I'd have to say that the path "/foo"
> expresses a constraint about how many "bar"s are allowed.
>
>   Paul Prescod
>
>

Received on Tuesday, 8 October 2002 15:41:43 UTC