XML Schema import element
Definition and usage
The import element is used to add multiple schemas with different target namespaces to a document.
Element information
Occurrence | Unrestricted |
Parent element | schema |
Content | annotation |
Syntax
<import id=ID namespace=anyURI schemaLocation=anyURI any attributes > (annotation?) </import>
Attributes | Description |
---|---|
id | Optional. Specifies the unique ID of the element. |
namespace | Required. Specifies the URI of the namespace to be imported. |
schemaLocation | Optional. Specifies the URI of the imported namespace. |
any attributes | Optional. Specifies any other attributes with non-schema namespaces. |
(The ? symbol declaration is in the import element, which can occur zero or once.)
Example
The following example demonstrates importing a namespace:
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.codew3c.com/schema"/> .. .. .. </xs:schema>