Element schématu XML anyAttribute
❮ Vyplňte odkaz na schéma XML
Definice a použití
Element anyAttribute umožňuje autorovi rozšířit dokument XML o atributy, které nejsou specifikovány schématem.
Informace o prvku
- Nadřazené prvky: complexType, omezení (jak simpleContent, tak complexContent), rozšíření (jak simpleContent, tak complexContent), atributGroup
Syntax
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(Znak ? deklaruje, že prvek se může vyskytovat nula nebo jednou v prvku 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 |
Příklad 1
Následující příklad ukazuje deklaraci pro prvek nazvaný "osoba". Pomocí prvku <anyAttribute> může autor přidat libovolný počet atributů do prvku „person“:
<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>
❮ Vyplňte odkaz na schéma XML