Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » schema error(xs:complexType positioning problem)
schema error [message #894978] Wed, 11 July 2012 06:24 Go to next message
Luca Dev is currently offline Luca Dev
Messages: 2
Registered: June 2012
Junior Member
Hi All,
I have built this schema:



<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema erstellt mit XMLSpy v2008 rel. 2 sp2 -->
<xs:schema .. xmlns:pc=...." targetNamespace="....">
	<xs:include schemaLocation="OTA_Profile.xsd"/>
	<xs:element name="PotsdamCache">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="pc:Content"/>
			</xs:sequence>
		</xs:complexType>

		<xs:complexType>
			<xs:element name="Errors" type="ErrorsType">
				<xs:annotation>
					<xs:documentation xml:lang="en-us">Standard way to indicate that an error occurred during the processing of an OTA message.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:complexType>
		
	</xs:element>
	<xs:element name="Content" type="xs:string"/>
</xs:schema>




the inclusion of the 2nd "xs:complexType" for "ErrorsType" is giving me problems.

I get the error: </xs:complexType> is at this position under element not allowed.

I have the schema reference included:
<xs:include schemaLocation="OTA_Profile.xsd"/>



which contains the definition of "ErrorsType".

Could someone please help?

Thanks.
Re: schema error [message #894985 is a reply to message #894978] Wed, 11 July 2012 06:48 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25919
Registered: July 2009
Senior Member
Luca,

Comments below.

On 11/07/2012 12:24 PM, Luca Dev wrote:
> Hi All,
> I have built this schema:
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!--W3C Schema erstellt mit XMLSpy v2008 rel. 2 sp2 -->
> <xs:schema .. xmlns:pc=...." targetNamespace="....">
> <xs:include schemaLocation="OTA_Profile.xsd"/>
> <xs:element name="PotsdamCache">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="pc:Content"/>
> </xs:sequence>
> </xs:complexType>
>
Your element has an anonymous complex type...
> <xs:complexType>
> <xs:element name="Errors" type="ErrorsType">
> <xs:annotation>
> <xs:documentation xml:lang="en-us">Standard way to
> indicate that an error occurred during the processing of an OTA
> message.</xs:documentation>
> </xs:annotation>
> </xs:element>
> </xs:complexType>
But it can only have one complex type, so this has to go. It doesn't
belong here.
>
> </xs:element>
> <xs:element name="Content" type="xs:string"/>
> </xs:schema>
>
>
>
>
> the inclusion of the 2nd "xs:complexType" for "ErrorsType" is giving
> me problems.
>
> I get the error: </xs:complexType> is at this position under element
> not allowed.
>
> I have the schema reference included: <xs:include
> schemaLocation="OTA_Profile.xsd"/>
>
>
> which contains the definition of "ErrorsType".
>
> Could someone please help?
>
> Thanks.
Previous Topic:Defining type for specific Occrrance of the element.
Next Topic:org.eclipse.xsd.XSDSchema
Goto Forum:
  


Current Time: Sat Jul 26 11:22:37 EDT 2014

Powered by FUDForum. Page generated in 0.03215 seconds