[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

"redefine" attribute allowed when deriving by extension?

From: Gert Driesen <gert.driesen@telenet.be>
Date: Thu, 21 May 2009 11:41:53 +0200
To: <xmlschema-dev@w3.org>
Message-ID: <000501c9d9f8$5f924cb0$1eb6e610$@driesen@telenet.be>
"redefine" attribute allowed when deriving by extension?
Hi,

I'm sorry if this has been answered before (or if the answer should've been
obvious), but can someone tell me if the following XML Schema should be
considered valid:

<xs:schema xmlns="foo" xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="foo" id="foo">
	<xs:element name="Foo" type="FooType" />
	<xs:element name="Bar" type="BarType" />
	<xs:complexType name="FooType">
		<xs:attribute name="name" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:complexType name="BarType">
		<xs:complexContent>
			<xs:extension base="FooType">
				<xs:attribute name="name" type="xs:string"
use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>

Is it allowed to override/redefine an attribute of a base type when deriving
by extension?

The reason I'm asking this is because I've noticed that several
implementations expose a different behavior here:

Altova XML Spy 2009:
Does not allow attribute to be "redefined" in the derived type.

Mono:
Allows attribute to be "redefined" if its use and type match the attribute
in
the base type.

Microsoft .NET:
Allows attribute to be "redefined".

Oracle Service Bus:
Allows attribute to be "redefined".

Any feedback is appreciated.

Gert
Received on Friday, 22 May 2009 06:12:21 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.