XML-skema anyAttribute Element
❮ Voltooi XML-skemaverwysing
Definisie en gebruik
Die anyAttribute-element stel die skrywer in staat om die XML-dokument uit te brei met eienskappe wat nie deur die skema gespesifiseer is nie.
Elementinligting
- Ouerelemente : kompleksTipe, beperking (beide eenvoudigInhoud en kompleksInhoud), uitbreiding (beide eenvoudigInhoud en kompleksInhoud), kenmerkGroep
Sintaksis
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(Die ? teken verklaar dat die element nul of een keer binne die anyAttribute element kan voorkom)
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 |
Voorbeeld 1
Die volgende voorbeeld toon 'n verklaring vir 'n element genaamd "persoon". Deur die <anyAttribute>-element te gebruik, kan die skrywer enige aantal eienskappe by die "persoon"-element voeg:
<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>
❮ Voltooi XML-skemaverwysing