XML Schema redefine Element
β
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
XML Schema Tutorial
XML Schema TutorialIntroduction to XML SchemasWhy Use XML Schema?How to Use XML SchemaXML schema ElementXSD Simple ElementsXML Schema AttributesXML Schema Restrictions / FacetsXML Schema Complex ElementsXML Schema Complex Empty ElementsXML Schema Complex Types β Elements OnlyXML Schema Complex Elements β Text OnlyXML Schema Complex Types β Mixed ContentXML Schema IndicatorsXML Schema any ElementXML Schema anyAttribute ElementXML Schema Element SubstitutionXML Schema ExamplesXML Schema String Data TypesXML Schema Date/Time Data TypesXML Schema Numeric Data TypesXML Schema Miscellaneous Data TypesXML EditorsXML Schema SummaryXML Schema Reference Manual
XML Schema restriction Element
Deep Dive
- Programming
- Web Design & Development
- Software
- Programming Languages
- Web Services
- Search
- Development Tools
- Scripting Languages
- Computer Science
- Scripting
XML Schema redefine Element
Complete XML Schema Reference Manual
Definition and Usage
The redefine element allows redefining simple and complex types, groups, and attribute groups obtained from an external schema file within the current schema.
Element Information
- Parent element: schema
Syntax
<redefine
id=ID
schemaLocation=anyURI
_any attributes_
>
(annotation|(simpleType|complexType|group|attributeGroup))*
</redefine>
<redefine
id=ID
schemaLocation=anyURI
_any attributes_
>
(annotation|(simpleType|complexType|group|attributeGroup))*
</redefine>
| Attribute | Description |
|---|---|
| id | Optional. Specifies a unique ID for this element. |
| schemaLocation | Required. A URI reference to the location of the schema document. |
| any attributes | Optional. Specifies any additional attributes from non-schema namespaces. |
Example 1
The following example shows a schema, Myschama2.xsd, which contains elements defined in Myschama1.xsd. The pname type is redefined. According to this schema, elements constrained by pname must end with a "country" element:
Myschema1.xsd:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="pname">
<xs:sequence>
<xs:element name="firstname"/>
<xs:element name="lastname"/>
</xs:sequence>
</xs:complexType>
<xs:element name="customer" type="pname"/>
</xs:schema>
Myschema2
YouTip