title: validation error [ There is no ID/IDREF binding for IDREF ]
body: <p>I am getting this error message when validating my XML file against its Schema. Can anyone suggest what might be wrong? The XML file is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;family-tree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="ftree.xsd"&gt;
  
  &lt;person id="p5"&gt;
  &lt;name&gt;
  &lt;given&gt;Al Frank&lt;/given&gt;
  &lt;surname&gt;Smith&lt;/surname&gt;
  &lt;/name&gt;
  &lt;/person&gt;
  
  &lt;person id="p6"&gt;
  &lt;name&gt;
  &lt;given&gt;Henry&lt;/given&gt;
  &lt;surname&gt;Smith&lt;/surname&gt;
  &lt;/name&gt;
  &lt;father ref="p5"/&gt;
  &lt;/person&gt;
  
  &lt;/family-tree&gt;
  </code></pre>
  
  <p>The schema is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;
  
  &lt;xsd:element name="family-tree"&gt;
  &lt;xsd:complexType&gt;
  &lt;xsd:sequence&gt;
  &lt;xsd:element name="person" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  
  &lt;xsd:element name="person"&gt;
  &lt;xsd:complexType&gt;
  &lt;xsd:sequence&gt;
  &lt;xsd:element name="name" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;xsd:element name="father" minOccurs="0"/&gt;
  &lt;/xsd:sequence&gt;
  &lt;xsd:attribute name="id" use="required" type="xsd:ID"/&gt;
  &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  
  &lt;xsd:element name="name"&gt;
  &lt;xsd:complexType&gt;
  &lt;xsd:sequence&gt;
  &lt;xsd:element minOccurs="0" name="given"/&gt;
  &lt;xsd:element minOccurs="0" name="surname"/&gt;
  &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  
  &lt;xsd:element name="given" type="xsd:string"/&gt;
  &lt;xsd:element name="surname" type="xsd:string"/&gt;
  
  &lt;xsd:element name="father"&gt;
  &lt;xsd:complexType&gt;
  &lt;xsd:attribute name="ref" use="required" type="xsd:IDREF"/&gt;
  &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  
  &lt;/xsd:schema&gt;
  </code></pre>