<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://ns.cafeconleche.org/genealogy/"
  targetNamespace="http://ns.cafeconleche.org/genealogy/"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified"
>

  <xsd:annotation>
    <xsd:documentation>
      This schema describes a FAMILY_TREE element intended for
      as the root element genealogy documents. It was developed
      as an example for Chapter 38 of the XML Bible, Gold 
      Edition, by Elliotte Rusty Harold (elharo@metalab.unc.edu)
      Published by Hungry Minds 2001. ISBN 0-7645-4819-0.
      
      This schema is placed in the public domain. Please feel 
      free to use it or adapt it in any way you like. 
    </xsd:documentation>
  </xsd:annotation>
  
  <xsd:include schemaLocation="source.xsd"/>  

  <xsd:include schemaLocation="family.xsd"/>  

  <xsd:redefine schemaLocation="person.xsd">
    <!-- Since all referenced persons will now be included
         in this document, we can switch the pointer attributes
         from name tokens to ID references. -->
         
    <xsd:complexType name="PersonRefType">
      <xsd:complexContent>
        <xsd:restriction base="PersonRefType">
          <xsd:attribute name="PERSON" type="xsd:IDREF"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="ReferenceType">
      <xsd:complexContent>
        <xsd:restriction base="ReferenceType">
          <xsd:attribute name="SOURCE" type="xsd:IDREF"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>

  </xsd:redefine>  

  <xsd:complexType name="FamilyTreeType">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element ref="PERSON"/>
      <xsd:element ref="FAMILY"/>
      <xsd:element ref="SOURCE"/>
    </xsd:choice>
  </xsd:complexType>

  <xsd:element name="FAMILY_TREE" type="FamilyTreeType"/>

</xsd:schema>  
  
  