<?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 element intended for use
      in family tree documents. It was developed as an example
      for Chapter 34 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="person.xsd"/>  

  <xsd:complexType name="FamilyType">
    <xsd:annotation>
      <xsd:documentation>
        The FamilyType is used exclusively for FAMILY elements.
        Each such element can contains one father 
        (represented by a HUSBAND element for legacy reasons,
        though no marriage is implied), one mother 
        (represented by a WIFE element for legacy reasons,
        though no marriage is implied), and any number of 
        children represented by CHILD elements. All of these 
        elements reference PERSON elements elsewhere in the
        document and any or all of them may be omitted. 
        
        Family membership is not exclusive. A single person may
        be a member of multiple families.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="REFERENCE" type="ReferenceType"
                   minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="HUSBAND" type="PersonRefType" 
                   minOccurs="0" />
      <xsd:element name="WIFE"    type="PersonRefType" 
                   minOccurs="0" />
      <xsd:element name="CHILD"   type="PersonRefType"
                   minOccurs="0"  maxOccurs="unbounded"/>
      <xsd:element name="MARRIAGE" type="EventType"
                   minOccurs="0"  maxOccurs="unbounded"/>
      <xsd:element name="DIVORCE" type="EventType"
                   minOccurs="0"  maxOccurs="unbounded"/>
      <xsd:element name="NOTE"   type="NoteType"
                   minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="ID"  xsd:type="ID" use="required"/>
  </xsd:complexType>

  <xsd:element name="FAMILY" type="FamilyType"/>

</xsd:schema>
