You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Celano, Luigi" <lu...@lehman.com> on 2005/06/09 19:24:21 UTC

Validation Problem with schema

I have the following schema which I am using to generate the
corresponding classes.


<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:api="http://esmmw.lehman.com/api"
targetNamespace="http://esmmw.lehman.com/api">
	<annotation>
		<documentation xml:lang="en">Product</documentation>
	</annotation>
	<element name="products" type="api:products"/>
	<complexType name="products">
		<sequence>
			<element name="product" type="api:product"
minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="product">
		<sequence>
			<element name="concepts" type="api:concepts"/>
		</sequence>
		<attribute name="id" type="xsd:string"/>
		<attribute name="code" type="xsd:string"/>
		<attribute name="type" type="xsd:string"/>
		<attribute name="version" type="xsd:string"/>
	</complexType>
	<complexType name="concepts">
		<sequence>
			<element name="concept" type="api:concept"
minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="concept">
		<sequence>
			<element name="recs" type="api:recs"/>
		</sequence>
		<attribute name="cname" type="xsd:string"/>
	</complexType>
	<complexType name="recs">
		<sequence>
			<element name="rec" type="api:rec" minOccurs="0"
maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="rec">
		<sequence>
			<element name="attributes"
type="api:attributes"/>
		</sequence>
	</complexType>
	<complexType name="attributes">
		<sequence>
			<element name="attribute" type="api:attribute"
minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="attribute">
		<simpleContent>
			<extension base="xsd:string">
				<attribute name="name"
type="xsd:string"/>
			</extension>
		</simpleContent>
	</complexType>
</schema>


When I run the schema compiler I get the following erroprs:

C:\cvsdevel\esm\esmw_cache>scomp -src src -out lib\xmlproduct.jar
xml\products.xsd
products.xsd:22: error: cvc-complex-type.2.4a: Expected elements
'attribute@http://www.w3.org/2001/X
MLSchema attributeGroup@http://www.w3.org/2001/XMLSchema
anyAttribute@http://www.w3.org/2001/XMLSche
ma' instead of 'sequence@http://www.w3.org/2001/XMLSchema' here in
element complexType@http://www.w3
.org/2001/XMLSchema
products.xsd:35: error: cvc-complex-type.2.4a: Expected elements
'attribute@http://www.w3.org/2001/X
MLSchema attributeGroup@http://www.w3.org/2001/XMLSchema
anyAttribute@http://www.w3.org/2001/XMLSche
ma' instead of 'sequence@http://www.w3.org/2001/XMLSchema' here in
element complexType@http://www.w3
.org/2001/XMLSchema
products.xsd:60: error: cvc-complex-type.2.4a: Expected elements
'attribute@http://www.w3.org/2001/X
MLSchema attributeGroup@http://www.w3.org/2001/XMLSchema
anyAttribute@http://www.w3.org/2001/XMLSche
ma' instead of 'simpleContent@http://www.w3.org/2001/XMLSchema' here in
element complexType@http://w
ww.w3.org/2001/XMLSchema
Time to build schema type system: 2.094 seconds
BUILD FAILED

Any ideas?


Thanks a lot


------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org