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

Proper implementation of <redefine>

  • To: <xml-dev@l...>
  • Subject: Proper implementation of <redefine>
  • From: "Magick, Brian" <Brian.Magick@C...>
  • Date: Fri, 29 Mar 2002 13:24:19 -0600
  • Thread-index: AcHXV1LAVL5gq4iVQ7+aKMHJkZR4vg==
  • Thread-topic: Proper implementation of <redefine>

xml redefine
Question regarding the usage and implementation of redefine:

As I've read in numerous texts, and as is made clear (or as clear as
clear can be from the W3C) in Schema Primer Part 0, the <redefine>
element will actually "replace" the external definition of a type or

The redefined definition of the structure should take place anywhere the
original structure was defined as a type or group.  For example, (from
the W3C Primer) if you redefine and extend AddressType, the new
AddressType will occur anywhere the old AddressType was declared (within
the same namespace).  The Primer Part 0 states:  "Outside of the
redefine element, any such attempt to define a complex type with the
same name (and in the same namespace) as the base from which it is being
derived would cause an error. But in this case, there is no error, and
the extended definition of Address becomes the only definition of
Address."  The primer continues with "Now that Address has been
redefined, the extension applies to all schema components that make use
of Address."

This seems VERY clear to me that the new AddressType supercedes the old,

Unfortunately, a popular XML Schema editing tool with a very 007'ish
flair to the name, (ok, no need to protect the guilty...XML
Spy...Version 4.3 to be exact) seems to miss the proper implementation
of <redefine>.

Perhaps my understanding of <redefine> is flawed, or perhaps XML Spy has
got this wrong, but when I redefine a type such as AddressType, and in
another element in the new Schema set the type to "AddressType", it
retains the original type definition and does not include the extensions
that I've added to AddressType.

The following snippet of Schema displays the structure that I am using:

	<xs:redefine schemaLocation="Address.xsd">
		<xs:complexType name="AddressType">
				<xs:extension base="AddressType">
name="Mail_Stop" type="xs:string" minOccurs="0"/>
	<xs:element name="Address" type="AddressType"/>

The Address element within XML Spy does not have the Mail_Stop element
that was just added via the <redefine> element.  

Any suggestions as to whether I made an error or whether this is an
apparent implementation bug?

Brian Magick


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.