El Anyattribute
# XML Schema anyAttribute Element
* * Complete XML Schema Reference](#)
* * *
## Definition and Usage
The anyAttribute element enables the author to extend the XML document with attributes not specified by the schema.
### Element Information
* **Parent Elements:** complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent), attributeGroup
### Syntax
(annotation?)
(The ? symbol declares that this element can occur zero or one time inside the anyAttribute element.)
| Attribute | Description |
| --- | --- |
| id | Optional. Specifies a unique ID for this element. |
| namespace | Optional. Specifies the namespace containing 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. * ##any - Elements from any namespace can occur (default). * ##other - Elements from any namespace that is not the target namespace of the parent element can occur. * ##local - Elements without a namespace can occur. * ##targetNamespace - Elements from the target namespace of the parent element containing this element can occur. * A list of {URI references of namespaces, ##targetNamespace, ##local} - Elements from the namespace list separated by spaces can occur. This list can contain the following: URI references of namespaces, ##targetNamespace, and ##local. |
| processContents | Optional. An indicator that specifies how the application or XML processor should handle validation of the XML document for 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. * strict - The XML processor must obtain the schema for the required namespace and must validate all elements from those namespaces. (default) * lax - Same as strict; however, no error occurs even if the schema cannot be obtained. * skip - The XML processor does not attempt to validate all elements from the specified namespaces. |
| _any attributes_ | Optional. Specifies any other attributes with a non-schema namespace. |
### Example 1
The following example shows a declaration for the "person" element. By using the element, the author is able to add any number of attributes to the "person" element:
* * Complete XML Schema Reference](#)
YouTip