This section describes a tutorial example on how to redefine datatypes defined in other schema documents.
Some you may want to revise some datatype definitions in an existing schema and make a newer version.
The new version of the schema document can use the "redefine" component to include the old schema document
and redefine one or more datatypes defined in the old schema document.
To use the "redefine" component, you need to remember the following rules:
Rule 1. The XML representation of an "redefine" component is an "redefine" element.
Rule 2. The "redefine" element must have the "schemaLocation" attribute to specify where to fetch the old schema document.
Rule 3. The "redefine" element must have one or more datatype definition components that redefine datatypes from the old schema document.
Rule 4. A redefined datatypes must have same name as the base datatype.
Rule 3. The "redefine" element must appear before any element declarations or type definitions.
Below is a tutorial sample schema named address_us_redefine.xsd
that redefines the datatype "addressUsType" using the "redefine" component:
As you can see, in this new version of the US address schema, we redefined the "addressUsType" datatype.
We did not add any new element declaration. The "addressUs" element declaration in the old schema document is still valid.
But it will take the new definition of "addressUsType.
See the next section for examples of XML documents that conform to this new schema.