XML Schema anyAttributeElement
Complete XML Schema Reference Manual
Definition and Usage
The anyAttribute element enables authors to extend XML documents with attributes not specified by the schema.
Element Information
- Parent elements: complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent), attributeGroup
Syntax
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(The ? sign declares that the element can occur zero or one time inside the anyAttribute element.)
| Attributes | Description |
|---|---|
| id | Optional. Specifies a unique ID for the element. |
| namespace | Optional. Specifies the namespace that contains the elements that can be used. If no namespace is specified, ##any is the default. If a namespace is specified, it must be one of the following values.
|
| processContents | Optional. An indicator that instructs the application or XML processor how to handle validation of the XML document with respect to the elements specified by this any element. If the processContents attribute is not specified, the default is strict. If processContents is specified, it must be one of the following values.
|
| any attributes | Optional. Specifies any other attributes with non-schema namespaces. |
Example 1
The following example shows a declaration for the "person" element. By using the
<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>
Complete XML Schema Reference Manual Other Extensions