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

XML Schema any Element

XML Schema any Element


XML Schema Reference Manual Complete XML Schema Reference Manual


Definition and Usage

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

Element Information

Syntax

id=ID

maxOccurs=nonNegativeInteger|unbounded

minOccurs=nonNegativeInteger

namespace=namespace

processContents=lax|skip|strict

any attributes

(annotation?)

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

property Description
id Optional. Specifies a unique ID for the element.
maxOccurs Optional. Specifies the minimum number of times the any element can appear in the parent element. The value can be an integer greater than or equal to zero. To specify that the any group is optional, set this attribute to zero. The default is 1.
minOccurs Optional. Specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1
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 of the "person" element. By using the element, authors can extend the content of "person" with any element (after ):

      xs:complexType

        xs:sequence

          

          

          

        

      


    XML Schema Reference Manual Complete XML Schema Reference Manual