XML Schema import element
Definition and Usage
import element is used to add multiple schema with a different target namespace to a document.
Element Information
- Parent element: schema
grammar
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(? Sign declares that the import element, the element can occur zero or one time.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
namespace | 必需。规定要导入的命名空间的 URI。 |
schemaLocation | 可选。规定被导入的命名空间的 URI。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
Example 1
The following example shows import a namespace:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3cschool.cc/schema"/>
..
..
..
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3cschool.cc/schema"/>
..
..
..
</xs:schema>
Complete XML Schema Reference