<xsd:redefine> Element

Allows simple and complex types, groups, and attribute groups that are obtained from external schema files to be redefined in the current schema.

  id = ID
  schemaLocation = anyURI
  {any attributes with non-schema Namespace}...>
Content: (annotation | (simpleType | complexType | group | 


  • id
    The ID of this element. The id value must be of type ID and be unique within the document containing this element.


  • schemaLocation
    A URI reference to the location of a schema document.


Element Information

Number of occurrences


Parent elements



annotation, attributeGroup, complexType, group, simpleType


The redefine element requires that the external elements exist in the same target namespace as the redefining schema. Schemas without a namespace can also be redefined using the redefine element and the redefined components become part of the schema's target namespace.

The definitions within the redefine element itself must use their current definitions as the base type definition. Attribute group definitions and model group definitions must include exactly one reference to themselves. Not all of the definitions of the redefined schema document must be redefined.

Redefining elements can cause unexpected results, such as ill-formed definitions, on other type definitions that are based on the redefined definitions.


The following example shows a schema, v2.xsd, with elements specified by the v1.xsd. The personName type is redefined. According to this schema, elements constrained by the personName type may end with a generation element.

<xs:complexType name="personName">
  <xs:element name="title" minOccurs="0"/>
  <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/>

<xs:element name="addressee" type="personName"/>
<xs:redefine schemaLocation="v1.xsd">
 <xs:complexType name="personName">
   <xs:extension base="personName">
     <xs:element name="generation" minOccurs="0"/>

<xs:element name="author" type="personName"/>

Other Resources

For more information see the W3C XML Schema Part 1: Structures Recommendation at www.w3.org/TR/2001/REC-xmlschema-1-20010502/\#element-al.

See Also


XML Schemas (XSD) Reference
XML Schema Elements