Esquema XML elemento anyAttribute
❮ Referencia completa del esquema XML
Definición y uso
El elemento anyAttribute permite al autor ampliar el documento XML con atributos no especificados por el esquema.
Información del elemento
- Elementos principales: complexType, restricción (tanto simpleContent como complexContent), extensión (tanto simpleContent como complexContent), atributoGroup
Sintaxis
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(El signo ? declara que el elemento puede aparecer cero o una vez dentro del elemento anyAttribute)
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 |
Ejemplo 1
El siguiente ejemplo muestra una declaración para un elemento llamado "persona". Al usar el elemento <anyAttribute>, el autor puede agregar cualquier cantidad de atributos al elemento "persona":
<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>
❮ Referencia completa del esquema XML