- From: Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\) <swvemuri@cisco.com>
- Date: Mon, 12 Mar 2007 09:34:20 +0530
- To: "Pete Cordell" <petexmldev@tech-know-ware.com>, <xmlschema-dev@w3.org>
Thanks Pete for your response. But I have below observations regarding your suggestion. (1) First of all in below snippet you have used xs:any inside xs:element. This is not allowed as element can not have xs:any under it. (2) Secondly even if I don't enclose that xs:any in an element and do the below <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:any namespace=" ##other" processContents=" lax" minOccurs="1"/> </xs:sequence> Iam getting below error Problems were detected while validating and converting the XML Schemas Error: XSD: The value '##other' of attribute 'namespace' must be of one of the members types of 'http://www.w3.org/2001/XMLSchema#namespaceList_._member_._1_._item' : URI file:/D:/swayam/PP/CustomAi2d/workspace/xyz/model/abcd_3.xsd Line 131 Column 4 Thanks Swayam -----Original Message----- From: Pete Cordell [mailto:petexmldev@tech-know-ware.com] Sent: Sunday, March 11, 2007 6:24 PM To: Swayam Vemuri -X (swvemuri - WIPRO at Cisco); xmlschema-dev@w3.org Subject: Re: Error: content model non-deterministic against .. 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 Monday, 12 March 2007 04:04:45 UTC