Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


"redefine" attribute allowed when deriving by extension?

From: "Gert Driesen" <gert.driesen@-------.-->
To: <xmlschema-dev@--.--->
Date: 5/22/2009 6:14:00 AM
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 XMLSpy">XMLSpy 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





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent