From everything I have read, the schema I have defined below should work (emphasis on alternatives). I get the following error: The 'http://www.w3.org/2001/XMLSchema:alternative' element is not supported in this context.Could you please point out what I did wrong?Here is my current schema:\[code\]<?xml version="1.0" encoding="utf-8"?><xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="object"> <xs:complexType> <xs:choice maxOccurs="unbounded" minOccurs="0"> <xs:element name="property" type="xs:string"> <xs:alternative test="@name='VIN'" type="VinType"/> <xs:alternative test="@name='Year'" type="YearType"/> <xs:alternative test="@name='Make'" type="MakeType"/> </xs:element> </xs:choice> <xs:attribute name="type" type="xs:string" use="required" /> </xs:complexType> </xs:element> <!-- Vehicle Identification number (VIN) --> <xs:simpleType name="VinRestriction"> <xs:restriction base="xs:string"> <xs:length fixed="true" value="http://stackoverflow.com/questions/14593284/17"/> </xs:restriction> </xs:simpleType> <xs:complexType name="VinType" mixed="true"> <xs:simpleContent> <xs:extension base="VinRestriction"> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xsattern value="http://stackoverflow.com/questions/14593284/VIN" /> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> <!-- Vehicle Year --> <xs:simpleType name="YearRestriction"> <xs:restriction base="xs:gYear"/> </xs:simpleType> <xs:complexType name="YearType" mixed="true"> <xs:simpleContent> <xs:extension base="YearRestriction"> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xsattern value="http://stackoverflow.com/questions/14593284/Year" /> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> <!-- Vehicle Make --> <xs:simpleType name="MakeRestriction"> <xs:restriction base="xs:string"> <xs:enumeration value="http://stackoverflow.com/questions/14593284/Chevrolet"/> <xs:enumeration value="http://stackoverflow.com/questions/14593284/Ford"/> <xs:enumeration value="http://stackoverflow.com/questions/14593284/Mazda"/> </xs:restriction> </xs:simpleType> <xs:complexType name="MakeType" mixed="true"> <xs:simpleContent> <xs:extension base="MakeRestriction"> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xsattern value="http://stackoverflow.com/questions/14593284/Make" /> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType></xs:schema>\[/code\]