[xsd-users] Problem with xs:extension

thomas.biedermann at ubs.com thomas.biedermann at ubs.com
Wed May 31 07:36:20 EDT 2006


Hi there,
I have encountered a problem with the schema below. xsd doesn't accept a
annotation within <xs:extension>. xsd emits the following errors:

error: unexpected element 'annotation'
error: expected 'attribute', 'anyAttribute', or 'attributeGroup' instead
of 'sequence'

If I remove the annotation tag, everything works fine.
According to w3.org an annotation is allowed within an extension
(although it's marked optional). It would be great if you could help me
here.
Many thanks in advance.
Cheers,
Thomas 


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.mycompany.com/ODI"
targetNamespace="http://www.mycompany.com/ODI"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0.0" id="ODI">
	<xs:complexType name="View_Type">
		<xs:attribute name="View_ID" type="xs:string"
use="required"/>
	</xs:complexType>

	<xs:complexType name="View_List_Type">
		<xs:complexContent>
			<xs:extension base="View_Type">
				<!-- PROBLEM IS HERE ! IF ANNOTATION IS
REMOVED EVERYTHING WORKS FINE. -->
				<xs:annotation><xs:documentation>static
information of a view</xs:documentation></xs:annotation>
				<xs:sequence>
					<xs:element name="Weig"
type="xs:string"/>
					<xs:element name="List"
type="xs:string"/>
				</xs:sequence>
				<xs:attribute
name="ThirdLevel_Classification_Code_Type" type="xs:string">
					<xs:annotation>
						<xs:documentation>code
type</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>

	</xs:complexType>
</xs:schema>





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060531/ad2bd9d9/attachment.htm


More information about the xsd-users mailing list