<!--?xml version="1.0" encoding="UTF-8"?-->

<!-- A Document Type Definition for genealogy data (as produced by Gramps)

Copyright (c) 2001 Graham J. Williams

Time-stamp: <2001/09/14 09:54:20 Graham.Williams@cmis.csiro.au>

Freely Redistributable under the terms of the GNU General Public License.

Based on GEDCOM and conforming with Gramps XML encoding.

Information on Gramps is available from http://

-->

<!--

	Define an XML document which is a <database> consisting of a
	<header>, <people>, <families>, <sources>, <places> and <bookmarks>.

-->

<!ELEMENT database (header, people?, families?, sources?, places?, bookmarks?)>

<!--	************************************************************

HEADER

	A <header> consists of <created> (information about this
	genealogical database) and <researcher> (information about the
	person who created this genealogical database)

-->

<!ELEMENT header (created, researcher?)>

<!ELEMENT created EMPTY>
<!ATTLIST created
  date     CDATA #REQUIRED
  version  CDATA #REQUIRED
  people   CDATA #REQUIRED
  families CDATA #REQUIRED>

<!ELEMENT researcher (resname, resaddr?, rescity?, resstate?,
                      rescountry?, respostal?, resphone?, resemail?)>
<!ELEMENT resname    (#PCDATA)>
<!ELEMENT resaddr    (#PCDATA)>
<!ELEMENT rescity    (#PCDATA)>
<!ELEMENT resstate   (#PCDATA)>
<!ELEMENT rescountry (#PCDATA)>
<!ELEMENT respostal  (#PCDATA)>
<!ELEMENT resphone   (#PCDATA)>
<!ELEMENT resemail   (#PCDATA)>

<!--	************************************************************

PEOPLE

	The UID is a place holder for PAF UID's that are imported. PAF
	generates a unique ID for each person which is useful for
	merges. It is not used by Gramps otherwise.

-->

<!ELEMENT people (person)*>
<!ATTLIST people default CDATA #IMPLIED>

<!ELEMENT person (gender, name?, aka*, nick?, pos?, uid?, event*,
                  img*, url*, childof*, parentin*, address*,
                  sourceref?, attribute*, note?)>
<!ATTLIST person id ID #REQUIRED>

<!ELEMENT name    (first?, last?,suffix?)>
<!ATTLIST name    conf CDATA #IMPLIED
                  priv CDATA #IMPLIED>

<!ELEMENT aka     (first?, last?,suffix?,note?)>
<!ATTLIST aka     conf CDATA #IMPLIED
                  priv CDATA #IMPLIED>

<!ELEMENT gender  (#PCDATA)>
<!ELEMENT first   (#PCDATA)>
<!ELEMENT last    (#PCDATA)>
<!ELEMENT suffix  (#PCDATA)>
<!ELEMENT nick    (#PCDATA)>
<!ELEMENT uid     (#PCDATA)>

<!ELEMENT pos EMPTY>
<!ATTLIST pos x CDATA #REQUIRED
              y CDATA #REQUIRED>

<!ELEMENT childof EMPTY>
<!ATTLIST childof
  ref   IDREF  #REQUIRED
  mrel  (Birth|Adopted|Stepchild|Other|Unknown) #IMPLIED
  frel  (Birth|Adopted|Stepchild|Other|Unknown) #IMPLIED>

<!ELEMENT parentin EMPTY>
<!ATTLIST parentin
  ref    IDREF #REQUIRED>

<!ELEMENT address (date?,street?,city?,state?,country?,postal?,
                   note?,sourceref?)>
<!ATTLIST address conf CDATA #IMPLIED
                  priv CDATA #IMPLIED>

<!ELEMENT street  (#PCDATA)>
<!ELEMENT city    (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT postal  (#PCDATA)>
<!ELEMENT state   (#PCDATA)>

<!--	************************************************************

FAMILY

	An element to record information about a family.

-->

<!ELEMENT families (family)*>

<!ELEMENT family (father?,mother?,event*,img*,child*,attribute*,note?)>
<!ATTLIST family
  id        ID    #REQUIRED
  type      (Married|Unmarried|Partners|Other|Unkown) #IMPLIED>

<!ELEMENT father EMPTY>
<!ATTLIST father ref IDREF #REQUIRED>

<!ELEMENT mother EMPTY>
<!ATTLIST mother ref IDREF #REQUIRED>

<!ELEMENT child EMPTY>
<!ATTLIST child ref IDREF #REQUIRED>

<!--	************************************************************

SOURCES

-->

<!ELEMENT sources (source)*>
<!ELEMENT source (sauthor?,spubinfo?,scallno?)>
<!ATTLIST source id ID #REQUIRED>
<!ELEMENT sauthor  (#PCDATA)>
<!ELEMENT spubinfo (#PCDATA)>
<!ELEMENT scallno  (#PCDATA)>

<!--	************************************************************

PLACES

-->

<!ELEMENT places (placeobj)*>

<!ELEMENT placeobj (coord?,location*,img*,url*,note?)>
<!ATTLIST placeobj id ID #REQUIRED title CDATA #REQUIRED>

<!ELEMENT coord EMPTY>
<!ATTLIST coord long CDATA #REQUIRED lat CDATA #REQUIRED>

<!ELEMENT location EMPTY>
<!ATTLIST location
    city        CDATA #REQUIRED
    county      CDATA #REQUIRED
    state       CDATA #REQUIRED
    country     CDATA #REQUIRED
>


<!--	************************************************************

BOOKMARKS

-->

<!ELEMENT bookmarks (bookmark)*>
<!ELEMENT bookmark EMPTY>
<!ATTLIST bookmark ref IDREF #REQUIRED>

<!--	************************************************************

SHARED ELEMENTS

-->

<!ELEMENT attribute  (attr_type,attr_value,note?,sourceref?)>
<!ATTLIST attribute  conf CDATA #IMPLIED
                     priv CDATA #IMPLIED>

<!ELEMENT attr_type  (#PCDATA)>
<!ELEMENT attr_value (#PCDATA)>


<!ELEMENT event (date?,place?,description?,sourceref?,note?)>
<!ATTLIST event type
   (Birth|Death|Christening|Baptism|Engagement|Marriage|
   Occupation|Education|Degree|Immi|Burial|Cremation)
   #REQUIRED>

<!--

  We can enumerate all possibilities for an event and then this will
  not conform to Gramps as Gramps allows any type of events (i.e., a
  user can define their own type of event) . By allowing anything
  (CDATA) we no longer have automatic checking and in emacs no more
  automatic selection of event types.

  So decide to use the enumerated list for now unless there is a storm
  of protest.

-->

<!ELEMENT date        (#PCDATA)>
<!ELEMENT description (#PCDATA)>

<!ELEMENT note (#PCDATA)>

<!ELEMENT url EMPTY>
<!ATTLIST url href CDATA #REQUIRED
              conf CDATA #IMPLIED
              priv (0|1) #IMPLIED
              description CDATA #IMPLIED>

<!ELEMENT place EMPTY>
<!ATTLIST place ref IDREF #REQUIRED>

<!ELEMENT sourceref (spage?,scomments?,stext?,sdate?)>
<!ATTLIST sourceref ref IDREF #REQUIRED>

<!ELEMENT spage     (#PCDATA)>
<!ELEMENT scomments (#PCDATA)>
<!ELEMENT sdate     (#PCDATA)>
<!ELEMENT stext     (#PCDATA)>

<!ELEMENT img EMPTY>
<!ATTLIST img
  src     CDATA #REQUIRED
  description CDATA #IMPLIED
  display CDATA #IMPLIED>

