W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

Re: Error: content model non-deterministic against ..

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Sun, 11 Mar 2007 12:53:34 -0000
Message-ID: <000e01c763dc$4d43c370$5900a8c0@Codalogic>
To: "Swayam Vemuri -X (swvemuri - WIPRO at Cisco)" <swvemuri@cisco.com>, <xmlschema-dev@w3.org>

I don't think there is a way this can be solved by just re-arranging the 
components.

One suggestion is a variation on the extensbile schema patterns suggested by 
David Orchard in one of the xml.com articles 
(http://www.xml.com/lpt/a/1329), along the lines of:

    <xs:sequence>
        <xs:element name="description"
                 type="xs:string" minOccurs="0"/>
        <xs:element ref="assert" minOccurs="0"
                 maxOccurs="unbounded"/>
        <xs:element ref="database:Set"
                 minOccurs="1" />
        <xs:element name="extension" minOccurs="0">
             <xs:any namespace=" ##other"
                    processContents=" lax" minOccurs="1"/>
        </xs:element>
    </xs:sequence>

(I tend to put extensions at the end!)

If you're going that route, you might want to implement David's full 
pattern.

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================

----- Original Message ----- 
From: "Swayam Vemuri -X (swvemuri - WIPRO at Cisco)" <swvemuri@cisco.com>
To: <xmlschema-dev@w3.org>
Sent: Sunday, March 11, 2007 3:51 AM
Subject: Error: content model non-deterministic against ..


Hi,



I have a schema base1.xsd a snippet of which is as shown below.



base1.xsd

---------------

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns="http://www.cisco.com/abc/def"
xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:java="http://www.cisco.com/abc/def/java"

xmlns:database="http://www.cisco.com/abc/def/database"

targetNamespace="http://www.cisco.com/abc/def"
elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:import namespace="http://www.cisco.com/abc/def/java"
schemaLocation="def_Java_1.xsd"/>

            <xs:import namespace="http://www.cisco.com/abc/def/database"
schemaLocation="def_DB_3.xsd"/>



..............................

<xs:complexType name="referenceType">

                        <xs:sequence>

                                    <xs:any namespace=" ##other"
processContents=" lax" minOccurs="0"/>

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

                                    <xs:element ref="assert"
minOccurs="0" maxOccurs="unbounded"/>

                                    <xs:element ref="database:Set"
minOccurs="1" />

                        </xs:sequence>

 ...............

</xs:complexType>



I have another schema def_DB_3.xsd a database schema which I am
importing into base1.xsd

In the database schema that is in def_DB_3.xsd, I have below



            <database:complexType name="CollectionType" abstract="true"
>

                        <database:complexContent>

                                    <database:restriction
base="database:anyType">

                                                <database:attribute
name="KeyColumn" type="database:string" use="required"/>

                                                <database:attribute
name="OneToManyClassName" type="database:string" use="required"/>

                                    </database:restriction>

                        </database:complexContent>

            </database:complexType>

            <database:element name="Set">

                        <database:complexType >

                                    <database:complexContent>

                                                <database:extension
base="CollectionType"/>

                                    </database:complexContent>

                        </database:complexType>

            </database:element>



Now when I try to validate base1.xsd Iam getting below error



<xs:any namespace=" ##other" processContents=" lax" minOccurs="0"/>
makes the content model non-deterministic against

<xs:element ref=Set> Possible causes : name equality etc etc



Can any one please let me know how to solve this problem. ?

What are the various options in solving the problem ?

If I comment out <xs:any namespace=" ##other" processContents=" lax"
minOccurs="0"/>,

then validation of base1.xsd is successful.Otherwise it fails.



Thanks and regards

Swayam
Received on Sunday, 11 March 2007 12:54:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:12 UTC