XML 스키마 anyAttribute 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
anyAttribute 요소를 사용하면 작성자가 스키마에서 지정하지 않은 속성으로 XML 문서를 확장할 수 있습니다.
요소 정보
- 상위 요소: complexType, 제한(simpleContent 및 complexContent 모두), 확장(simpleContent 및 complexContent 모두), attributeGroup
통사론
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(? 기호는 요소가 anyAttribute 요소 내에서 0번 또는 1번 발생할 수 있음을 선언합니다.)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
namespace | Optional. Specifies the namespaces containing the
attributes
that can be used. Can be set to one of the following:
|
processContents | Optional. Specifies how the XML processor should handle
validation against the elements specified by this any element. Can be set to
one of the following:
|
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
다음 예는 "person"이라는 요소에 대한 선언을 보여줍니다. <anyAttribute> 요소를 사용하여 작성자는 "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>
❮ 완전한 XML 스키마 참조