XML technologies / XML Schema / XML Schema element reference / xs:include
(Excerpt from “XML Schema” by Eric van der Vlist)
Inclusion of a W3C XML Schema for the same target namespace.
<xs:include
id = xs:ID
schemaLocation = xs:anyURI
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?)
</xs:include>May occur within: xs:schema
Description
xs:include simply includes a schema within another describing the same target namespace. However, a schema specifying no target namespace can also be included. It is treated as adopting the target namespace of the including schema. This capability, often called “chameleon design”, allows reuse of “transparent” schemas in different namespaces.
Schema inclusion merges the two schemas into a consolidated global schema. The included schema need not be complete on its own.
Restrictions
It is not possible to use xs:include to include a schema describing another namespace. For that, use xs:import.
Definitions in included schemas cannot be changed. For that, use xs:redefine.
Including only a schema fragment is impossible. For that, use general-purpose inclusion mechanisms such as XInclude.
Example
<xs:include schemaLocation="simple-types.xsd"/>
Attributes
id
Element ID according to W3C XML Schema.
schemaLocation
Location of the schema to include.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de