[Fwd: More on datatype validation: what's a possible algorithm?]

Forwarding this to www-forms-editor.

-Erik

-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Forwarded message 1

  • From: Erik Bruchez <ebruchez@orbeon.com>
  • Date: Thu, 31 May 2007 15:26:29 -0700
  • Subject: More on datatype validation: what's a possible algorithm?
  • To: public-forms@w3.org
  • Message-ID: <465F4B95.5010006@orbeon.com>
  • X-Archived-At: http://www.w3.org/mid/465F4B95.5010006@orbeon.com
All,

Let's continue with some schema questions. As discussed in this
thread:

   http://lists.w3.org/Archives/Public/public-forms/2007May/0074.html

there is a pending action item to amend the spec so that "revalidate
only perform validation of datatypes, not structural validation,
*except* during submission".

Now I am just wondering how an implementation can do this. If you
assign datatypes with xforms:bind or xsi:type, then it is quite
easy.

Now if you don't have those, but the types come directly from the
schema, what do you do?

Let's say I define a simple type like this in a schema:

<xs:simpleType name="state">
         <xs:restriction base="xs:string">
             <xs:enumeration value="AL"/>
               ...

I just wouldn't know what nodes in the document have this type. Of
course, I know it if I write in my schema:

<xs:element name="state" type="dmv:state"/>

But this may or may not be a top-level definition in my schema. If it
is, then I can assume that any element called "state" will have type
state. So I validate the content of the element and there is no
problem.

What if this is not a top-level definition? Should an implementation
do the following:

1. Do a full validation.
2. While doing so, annotate nodes with appropriate type information.
3. Use that type information during revalidate.

But then, what happens if you do any of the following:

* xforms:insert
* submission with instance replacement

The newly created nodes won't have any type information associated
with them, unless you do a full revalidation. So should we expect that
full validation occurs "when needed" to determine node types?

Or am I missing something?

Feedback would be appreciated on this.

-Erik

-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Received on Thursday, 31 May 2007 22:28:01 UTC