XSD Complex Types- XSD ANY - XSD

What is the use of XSD <any>?

<any> element is used for extending the XSD functionality and for extending a complexType element defined in one XSD by an element which is not defined in the schema.

Consider an example − person.xsd has defined person complexType element. address.xsd has defined address complexType element.

person.xsd

address.xsd

If we want to define a person with address in XML, then the following declaration will be invalid.

person.xml

Use <xs:any>

In order to validate above person.xml, add <xs:any> to person element in person.xsd.

person.xsd

Now person.xml will be validated against person.xsd and address.xsd.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XSD Topics