XML Schema anyAttribute要素
完全な XML Schema リファレンス
定義と使い方
anyAttribute 要素により、作成者はスキーマで定義されていない属性を使用して XML 文書を拡張できます。
要素情報
- 親要素: complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent), attributeGroup
構文
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(? 記号は、この要素が anyAttribute 要素内に 0 回または 1 回出現できることを宣言します。)
| 属性 | 説明 |
|---|---|
| id | 任意。この要素の一意の ID を指定します。 |
| namespace | 任意。使用可能な要素を含む名前空間を指定します。名前空間が指定されていない場合は、##any がデフォルトです。名前空間を指定する場合は、次のいずれかの値でなければなりません。
|
| processContents | 任意。アプリケーションまたは XML プロセッサが、この any 要素で指定された要素に従って XML 文書の検証をどのように処理するかを示す指示子。processContents 属性が指定されていない場合、デフォルトは strict です。processContents を指定する場合は、次のいずれかの値でなければなりません。
|
| any attributes | 任意。non-schema 名前空間を持つその他の属性を指定します。 |
例 1
以下の例は、"person" 要素の宣言を示しています。
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
完全な XML Schema リファレンス その他の拡張