Sample : Simple All
This sample shows an element containing an 'all' group of simple elements. All the elements must appear, but in any order.
The Element 'Name' has 2 child elements FirstName and Surname, both are based on primitives, and thus both are represented as primitive in the generated code. Both elements must be specified, however in the XML they may appear in any order.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="Name"> <xs:complexType> <xs:all> <xs:element name="Firstname" type="xs:string"/> <xs:element name="Surname" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
|Setting Elements||The sample demonstrates that the order that elements are held within an 'all' group does not make a difference when it is re-read.|