Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema anyAttribute Element

XML Schema anyAttribute Element


XML Schema Reference Manual Complete XML Schema Reference Manual


Definition and Usage

The anyAttribute element enables authors to extend an XML document with attributes not specified by the schema.

Element Information

Syntax

id=ID

namespace=namespace

processContents=lax|skip|strict

any attributes

(annotation?)

(The ? symbol declares that the element can appear zero or one time within the anyAttribute element.)

property Description
id Optional. Specifies a unique ID for the 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 appear (default).
  • ##other - elements from any namespace other than the target namespace of the element's parent element can appear.
  • ##local - elements not qualified by a namespace can appear.
  • ##targetNamespace - elements from the target namespace of the parent element containing this element can appear.
  • A list of {URI references of namespaces, ##targetNamespace, ##local} - elements from the space-separated list of namespaces can appear. The list can contain the following: URI references of the namespaces ##targetNamespace and ##local.
  • | | processContents |

    Optional. An indicator specifying how an application or XML processor should handle validation of the XML document with respect to the elements specified by the 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 a non-schema namespace.

    |

    Example 1

    The following example shows a declaration for the "person" element. By using the element, authors can add any number of attributes to the "person" element:

      xs:complexType

        xs:sequence

          

          

        

        xs:anyAttribute/

      


    XML Schema Reference Manual Complete XML Schema Reference Manual