The <anyAttribute> element enable us to extend the XML document with attributes not specified by the schema!
The <anyAttribute> Element
The <anyAttribute> element enable us to extend the XML
document with attributes not specified by the schema.
The
following example is the fragment from an XML schema called "family.xsd".
It shows a declaration for "person" element. By using the <anyAttribute>
element we can add any number of attributes to "person"
element:
Now we want to extend "person" element with a "gender"
attribute. In this case we can do so, even if the author of the
schema above never declared any "gender" attributes.
The XML file above is valid because the schema "family.xsd"
allow us to add an attribute to the "person" element.
The
<any> and <anyAttribute> elements are used to make EXTENSIBLE
document! They allow documents to contain additional elements
that are not declared in the main XML schemas.
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
XSD anyattribute element,xsd data types,xsd data type,visual studio xsd,xsd tutorial,xsd optional element,xsd attributes,xsd xml,xsd examples,cdata xsd