7.8. The include Element

Any given XML schema document may describe only a subset of an entire schema. An XML schema document may construct a larger subset of an entire schema, including the entire schema, by including other XML schema documents that contain different subsets of the components that comprise the schema. One XML schema document includes another via an include element.

Tip

An include element adds components from another schema, with a different namespace, to the current schema. An import element adds components from another schema, but associates them with the target namespace.

The schema in Listing 7.2 includes components from the file ffs_include.xsd:

 <xsd:include schemaLocation="http://www.XMLSchemaReference.com/examples/Ch07/ffs_include.xsd"/> ...

Get XML Schema Complete Reference, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.