W3C home > Mailing lists > Public > www-forms-editor@w3.org > September 2007

Re: Structural schema validation and datatype validation of first text node (PR#82)

From: John Boyer <xforms-issues@mn.aptest.com>
Date: Tue, 11 Sep 2007 04:48:55 -0500
Message-Id: <200709110948.l8B9mtYC032198@htmlwg.mn.aptest.com>
To: ebruchez@orbeon.com
CC: www-forms-editor@w3.org

Hi Erik,

For part 1, the spec currently says in revalidate (section 4) that validation
of all instance data occurs, not just datatype node, so we don't believe the
spec implies that structural validation never occurs.

For part 2, you identified a disconnect between schema validation and the first
text node choice made by UI controls (8.1.1) and setvalue action (section 10). 
This has been a long-standing problem that has now been fixed. The real problem
is the choice made in UI controls and setvalue, both of which should just bind
to the content of the referenced node.  UI controls already having data binding
exception if not bound to simpletype content, and setvalue should produce the
same exception.

There are several problems with binding to the first text node, most notably the
following:

<a></a> has no first text node child in xpath data model, yet a UI control
should not fail to bind to a node just because it is empty

<b>1<!-- -->B</b> would show '1' to the user but be schema invalid as integer
content because 1B is considered

In short, the UI bindings should bind to the content of the referenced node,
not its first text node child for consistency.

The spec changes needed to implement this behavioral change have been made in
the editor's draft available from the working group home page.

Best regards,
John Boyer

> 
> All,
> 
> If I understand sections "4.3.5 The xforms-revalidate Event" and
> "6.1.1 The type Property" of XForms 1.1, XForms only considers
> datatypes during revalidation.
> 
> A few questions then:
> 
> 1. Does this mean that in XForms, we never perform full structural
>      validation, even before submission? If so, where is this specified?
> 
> 2. 6.1.1 says "The type model item property is not applied to instance
>      nodes that contain child elements.". However, controls bound to
>      elements store and retrieve data as the first child text node of
>      the element, see 8.1.1:
> 
>        "returns the string-value of the first text child node"
> 
>      and 10.8:
> 
>        "the first text node is replaced with one corresponding to the
>         new value"
> 
>      Wouldn't it make sense, for consistency, to say that type
>      validation applies to the first child text node (empty string if
>      none) of an element?
> 
>      I don't have a very strong opinion on this. Maybe doing so would
>      violate expectations of schema validation? But here, we are only
>      using datatypes to validate captured data, not validating
>      structure, so I am not sure if this is a concern.
> 
>      I am wondering if this was considered at all.
> 
> -Erik
> 
> -- 
> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
> http://www.orbeon.com/
> 
> 
Received on Tuesday, 11 September 2007 09:50:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:16 GMT