[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Doubt in non-deterministic content model

From: Bharath Kumar Reddy T <bharathkr@huawei.com>
Date: Tue, 17 Feb 2009 15:44:36 +0530
To: xmlschema-dev@w3.org
Cc: ranjit@huawei.com, ashutosh_p@huawei.com
Message-id: <000001c990e8$8c7ffbe0$3a12120a@china.huawei.com>
Doubt in non-deterministic content model
Hi..
 
The following schema is non deterministic since the parser will not
determine whether it should compare the element in the instance document
with 1st element declaration or 2nd element declaration.
 
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:complexType name="foo">

        <xs:sequence>

                <xs:element name="a" maxOccurs="2"/>

                <xs:element name="a"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>

For the following schema also same scenario is present. But one of the xml
Parsers is not giving any error. Can any body tell me whether the following
schema is non-deterministic or not? 
Also please tell me in some detail about the non-deterministicity of a
content model.
 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- restriction xs:any to a sequence -->

    <xs:complexType name="base">

        <xs:sequence>

                <xs:any namespace="##any"/>

                <xs:sequence>

                    <xs:element name="a" minOccurs="0"/>

                </xs:sequence>

        </xs:sequence>

    </xs:complexType>

    <xs:complexType name="derived">

        <xs:complexContent>

            <xs:restriction base="base">

                <xs:sequence>

                    <xs:element name="a" type="xs:string"/>

                    <xs:element name="a" type="xs:string" minOccurs="0"/>

                </xs:sequence>

            </xs:restriction>

        </xs:complexContent>

    </xs:complexType>

</xs:schema>

 

Thanks and Regards,

Bharath.
Received on Tuesday, 17 February 2009 10:15:38 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.