xsd ambigious

Can anyone help with this XSD please? It doesnt seem to work?
Essentially i want to ensure that if "E" or "F" are populated then "D" is populated before them. The rest of the elements can appear in any order and any amount of times.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="element">
  <xsd:complexType>
   <xsd:choice maxOccurs="unbounded">
    <xsd:element ref="a" minOccurs="0"/>
    <xsd:element ref="b" minOccurs="0"/>
    <xsd:element ref="c" minOccurs="0"/>
    <xsd:sequence>
     <xsd:element ref="d"/>
     <xsd:element ref="e"/>
    </xsd:sequence>
    <xsd:sequence>
     <xsd:element ref="d"/>
     <xsd:element ref="f"/>
    </xsd:sequence>
   </xsd:choice>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="a"/>
 <xsd:element name="b"/>
 <xsd:element name="c"/>
 <xsd:element name="d"/>
 <xsd:element name="e"/>
 <xsd:element name="f"/>
</xsd:schema>

Many Thanks,
Andy

Received on Thursday, 8 October 2009 09:46:49 UTC