Thursday, April 26, 2007

XSD Element

The any element enables us to extend the XML document with elements not specified by the schema!

The any element enables us to extend the XML document with elements not specified by the schema.
The following example is a fragment from an XML schema called "family.xsd". It shows a declaration for the "person" element. By using the element we can extend (after lastname) the content of "person" with any element:

[person - last name, firstname, any]
any can contain any additonal information (any other element from other schema as well)
So you can define another child.xsd and add it in your XML
Your XML can contain something like -
[person - lastname, firstname, [children - childname] ]
Its little difficult to format the XML output in this blog so please reference this link - http://www.w3schools.com/schema/schema_complex_any.asp

BTW, w3schools is the best site for all your questions regarding XML schema.
Cheers - Dj

No comments: