W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2010

RE: Implementing the DOM3 Val Spec in Javascript, problem with UPA and creating PSVI.

From: Michael Kay <mike@saxonica.com>
Date: Sat, 1 May 2010 11:45:44 +0100
To: "'Casey Jordan'" <casey.jordan@jorsek.com>, <xmlschema-dev@w3.org>
Message-ID: <FF56C381C4A74F6B956748DB403F9AFD@Sealion>

 > Suppose I have a schema with a type like this:

<xs:complexType name="my.type" mixed="false">
        <xs:sequence>
            <xs:element ref="h"/>
            <xs:choice>
                <xs:element ref="h-sub" maxOccurs="unbounded" />
                <xs:element ref="section" />
            </xs:choice>
            <xs:element ref="section" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType> 
 
 > When using finite automata, and the above pattern, while you can
determine if a document is valid, it would be impossible to determine if a
"section" element belonged to the xs:choice or the xs:sequence making it
also impossible to provide a complete PSVI.  
 
I'm having difficulty seeing the problem. A <section> that immediately
follows the <h> can only satisfy the choice. A <section> that immediately
follows an <h-sub> or another <section> can only satisfy the final particle.


If the choice were optional or repeatable, this content model would violate
UPA. (Though Saxon would actually allow it through, since Saxon only
attributes element instances to declarations, not to particles, and in this
case the two particles refer to the same element declaration.) 
 
Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
Received on Saturday, 1 May 2010 10:46:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:20 GMT