XMLスキーマインポート要素
❮完全なXMLスキーマリファレンス
定義と使用法
import要素は、ターゲット名前空間が異なる複数のスキーマをドキュメントに追加するために使用されます。
要素情報
- 親要素:スキーマ
構文
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(?記号は、要素がインポート要素内で0回または1回発生する可能性があることを宣言します)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
namespace | Optional. Specifies the URI of the namespace to import |
schemaLocation | Optional. Specifies the URI to the schema for the imported namespace |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
例1
次の例は、ネームスペースをインポートする方法を示しています。
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="https://www.w3schools.com/schema"/>
..
..
..
</xs:schema>
❮完全なXMLスキーマリファレンス