OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Proper implementation of <redefine>

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Proper implementation of <redefine>
  • From: "Magick, Brian" <Brian.Magick@COMPAQ.com>
  • Date: Fri, 29 Mar 2002 13:24:19 -0600
  • Thread-index: AcHXV1LAVL5gq4iVQ7+aKMHJkZR4vg==
  • Thread-topic: Proper implementation of <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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS