Share via


<xsd:include> Element

Includes the specified schema document in the target namespace of the containing schema.

<include
  id = ID 
  schemaLocation = anyURI 
  {any attributes with non-schema Namespace}...>
Content: (annotation?)
</include>

Attributes

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

    Optional.

  • schemaLocation
    The URI reference to the location of a schema document to include in the target namespace of the containing schema.

    Required.

Element Information

Number of occurrences

Unlimited

Parent elements

schema

Child elements

annotation

Remarks

The included schema document must meet one of the following conditions.

  • It must have the same target namespace as the containing schema document.

  • It must not have a target namespace specified (no targetNamespace attribute).

The import element allows references to schema components from schema documents with different target namespaces; the include element adds the schema components from other schema documents that have the same target namespace (or no specified target namespace) to the containing schema. In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema.

Example

For an example, see import.

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-all.

See Also

Reference

XML Schemas (XSD) Reference
XML Schema Elements

Concepts

<xsd:import> Element