title: XSD - how to define relationship between two elements
body: <p>I have a XSD file like below:</p>
  
  <pre><code>&lt;element name="finder-def" minOccurs="0" maxOccurs="unbounded"&gt;
      &lt;complexType&gt;
           &lt;attribute name="name" type="string" use="required"&gt;&lt;/attribute&gt;
           &lt;attribute name="description" type="string"&gt;&lt;/attribute&gt;
           &lt;attribute name="class" type="string" use="required"&gt;&lt;/attribute&gt;
      &lt;/complexType&gt;
  &lt;/element&gt;
  
  &lt;complexType name="Dimension"&gt;
      &lt;sequence&gt;
          &lt;element name="finder" type="Finder" minOccurs="0" maxOccurs="1"/&gt;
      &lt;/sequence&gt;
  &lt;/complexType&gt;
  
  &lt;complexType name="Finder"&gt;
      &lt;attribute name="name" type="String" use="required"/&gt;
  &lt;/complexType&gt; 
  </code></pre>
  
  <p>XML file corresponds to above XSD file is below:</p>
  
  <pre><code>&lt;finder-def name="circleFinder" description="Finds circle based on msisdn" class="com.onmobile.reporting.etl.processor.common.propertyplugins.CircleIdPropertyPlugin" /&gt;
  
  &lt;dimension name="circleId"&gt;
      &lt;finder name="circleFinder" /&gt;
  &lt;/dimension&gt;
  </code></pre>
  
  <p>So, here I have defined one <code>finder-def</code> i.e. <code>circleFinder</code> and then want to refer to this <code>finder-def</code> through <code>finder</code> element.</p>
  
  <p>So the question is How can I validate that <code>finder</code> <code>circleFinder</code> has its defination defined above in <code>finder-def</code></p>