Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » schema error(xs:complexType positioning problem)
schema error [message #894978] Wed, 11 July 2012 10:24 Go to next message
Luca Dev is currently offline Luca DevFriend
Messages: 4
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 10:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Defining type for specific Occrrance of the element.
Next Topic:org.eclipse.xsd.XSDSchema
Goto Forum:
  


Current Time: Thu Apr 25 14:57:05 GMT 2024

Powered by FUDForum. Page generated in 0.02834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top