Update Gramps XML Import/Export to support Citations

svn: r18086
This commit is contained in:
Nick Hall
2011-08-30 12:34:46 +00:00
parent 5a3cef062c
commit afef197a57
5 changed files with 306 additions and 194 deletions

View File

@@ -5,7 +5,7 @@
#
# Copyright (C) 2001 Graham J. Williams
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2010-2011 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,15 +25,15 @@
-->
<!--
This is the Document Type Definition file for v1.4.0
This is the Document Type Definition file for v1.5.0
of the GRAMPS XML genealogy data format.
Please use the following formal public identifier to identify it:
"-//GRAMPS//DTD GRAMPS XML V1.4.0//EN"
"-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
For example:
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.4.0//EN"
"http://gramps-project.org/xml/1.4.0/grampsxml.dtd"
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
"http://gramps-project.org/xml/1.5.0/grampsxml.dtd"
[...]>
-->
@@ -48,6 +48,7 @@ DATABASE
families
events
places
citations
sources
objects
repositories
@@ -59,9 +60,9 @@ DATABASE
-->
<!ELEMENT database (header, name-formats?, tags?, events?, people?, families?,
sources?, places?, objects?, repositories?, notes?,
bookmarks?, namemaps?)>
<!ATTLIST database xmlns CDATA #FIXED "http://gramps-project.org/xml/1.4.0/">
citations?, sources?, places?, objects?, repositories?,
notes?, bookmarks?, namemaps?)>
<!ATTLIST database xmlns CDATA #FIXED "http://gramps-project.org/xml/1.5.0/">
<!-- ************************************************************
@@ -105,12 +106,11 @@ PEOPLE
<!ELEMENT person (gender, name*, eventref*, lds_ord*,
objref*, address*, attribute*, url*, childof*,
parentin*, personref*, noteref*, sourceref*, tagref*)>
parentin*, personref*, noteref*, citationref*, tagref*)>
<!ATTLIST person
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -119,8 +119,9 @@ GENDER has values of M, F, or U.
-->
<!ELEMENT gender (#PCDATA)>
<!ELEMENT name (first?, call?, surname*, nick?, familynick?, suffix?, title?, group?
(daterange|datespan|dateval|datestr)?, noteref*, sourceref*)>
<!ELEMENT name (first?, call?, surname*, nick?, familynick?, suffix?, title?,
group?, (daterange|datespan|dateval|datestr)?, noteref*,
citationref*)>
<!ATTLIST name
alt (0|1) #IMPLIED
type CDATA #IMPLIED
@@ -151,7 +152,7 @@ GENDER has values of M, F, or U.
<!ELEMENT parentin EMPTY>
<!ATTLIST parentin hlink IDREF #REQUIRED>
<!ELEMENT personref (sourceref*, noteref*)>
<!ELEMENT personref (citationref*, noteref*)>
<!ATTLIST personref
hlink IDREF #REQUIRED
priv (0|1) #IMPLIED
@@ -160,7 +161,7 @@ GENDER has values of M, F, or U.
<!ELEMENT address ((daterange|datespan|dateval|datestr)?, street?, city?,
county?, state?, country?, postal?, phone?, noteref*,
sourceref*)>
citationref*)>
<!ATTLIST address priv (0|1) #IMPLIED>
<!ELEMENT street (#PCDATA)>
@@ -180,12 +181,11 @@ FAMILY
<!ELEMENT families (family)*>
<!ELEMENT family (rel?, father?, mother?, eventref*, lds_ord*, objref*,
childref*, attribute*, noteref*, sourceref*, tagref*)>
childref*, attribute*, noteref*, citationref*, tagref*)>
<!ATTLIST family
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -195,7 +195,7 @@ FAMILY
<!ELEMENT mother EMPTY>
<!ATTLIST mother hlink IDREF #REQUIRED>
<!ELEMENT childref (sourceref*,noteref*)>
<!ELEMENT childref (citationref*,noteref*)>
<!ATTLIST childref
hlink IDREF #REQUIRED
priv (0|1) #IMPLIED
@@ -214,12 +214,11 @@ EVENT
<!ELEMENT events (event)*>
<!ELEMENT event (type?, (daterange|datespan|dateval|datestr)?, place?, cause?,
description?, attribute*, noteref*, sourceref*, objref*)>
description?, attribute*, noteref*, citationref*, objref*)>
<!ATTLIST event
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -234,7 +233,6 @@ SOURCES
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
<!ELEMENT stitle (#PCDATA)>
@@ -249,12 +247,11 @@ PLACES
<!ELEMENT places (placeobj)*>
<!ELEMENT placeobj (ptitle?, coord?, location*, objref*, url*, noteref*,
sourceref*)>
citationref*)>
<!ATTLIST placeobj
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -285,12 +282,11 @@ OBJECTS
<!ELEMENT objects (object)*>
<!ELEMENT object (file, attribute*, noteref*,
(daterange|datespan|dateval|datestr)?, sourceref*, tagref*)>
(daterange|datespan|dateval|datestr)?, citationref*, tagref*)>
<!ATTLIST object
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -312,7 +308,6 @@ REPOSITORIES
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
>
@@ -329,7 +324,6 @@ NOTES
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
marker CDATA #IMPLIED
change CDATA #REQUIRED
format (0|1) #IMPLIED
type CDATA #REQUIRED
@@ -365,6 +359,21 @@ TAGS
change CDATA #REQUIRED
>
<!-- ************************************************************
CITATIONS
-->
<!ELEMENT citations (citation)*>
<!ELEMENT citation ((daterange|datespan|dateval|datestr)?, page?, confidence?,
noteref*, objref*, data_item*, sourceref)>
<!ATTLIST citation
id CDATA #IMPLIED
handle ID #REQUIRED
priv (0|1) #IMPLIED
change CDATA #REQUIRED
>
<!-- ************************************************************
BOOKMARKS
-->
@@ -436,11 +445,14 @@ SHARED ELEMENTS
<!ELEMENT datestr EMPTY>
<!ATTLIST datestr val CDATA #REQUIRED>
<!ELEMENT sourceref (spage? ,noteref*, (daterange|datespan|dateval|datestr)?)>
<!ELEMENT citationref EMPTY>
<!ATTLIST citationref
hlink IDREF #REQUIRED
>
<!ELEMENT sourceref EMPTY>
<!ATTLIST sourceref
hlink IDREF #REQUIRED
priv (0|1) #IMPLIED
conf CDATA #IMPLIED
>
<!ELEMENT eventref (attribute*, noteref*)>
@@ -468,9 +480,10 @@ SHARED ELEMENTS
hlink IDREF #REQUIRED
>
<!ELEMENT spage (#PCDATA)>
<!ELEMENT page (#PCDATA)>
<!ELEMENT confidence (#PCDATA)>
<!ELEMENT attribute (sourceref*, noteref*)>
<!ELEMENT attribute (citationref*, noteref*)>
<!ATTLIST attribute
priv (0|1) #IMPLIED
type CDATA #REQUIRED
@@ -491,7 +504,7 @@ SHARED ELEMENTS
description CDATA #IMPLIED
>
<!ELEMENT objref (region?, attribute*, sourceref*, noteref*)>
<!ELEMENT objref (region?, attribute*, citationref*, noteref*)>
<!ATTLIST objref
hlink IDREF #REQUIRED
priv (0|1) #IMPLIED
@@ -512,7 +525,7 @@ SHARED ELEMENTS
>
<!ELEMENT lds_ord ((daterange|datespan|dateval|datestr)?, temple?, place?,
status?, sealed_to?, noteref*, sourceref*)>
status?, sealed_to?, noteref*, citationref*)>
<!ATTLIST lds_ord
priv (0|1) #IMPLIED
type CDATA #REQUIRED

View File

@@ -4,7 +4,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2010-2011 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
<grammar
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="http://gramps-project.org/xml/1.4.0/"
ns="http://gramps-project.org/xml/1.5.0/"
xmlns="http://relaxng.org/ns/structure/1.0">
<start><element name="database">
@@ -82,6 +82,12 @@
</element></zeroOrMore>
</element></optional>
<optional><element name="citations">
<zeroOrMore><element name="citation">
<ref name="citation-content"/>
</element></zeroOrMore>
</element></optional>
<optional><element name="sources">
<zeroOrMore><element name="source">
<ref name="source-content"/>
@@ -148,7 +154,6 @@
<value>0</value>
<value>1</value>
</choice></attribute></optional>
<optional><attribute name="marker"><text/></attribute></optional>
</define>
<define name="person-content">
@@ -195,8 +200,8 @@
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="tagref">
<ref name="tagref-content"/>
@@ -234,20 +239,20 @@
<optional><attribute name="display"><text/></attribute></optional>
<optional><element name="first"><text/></element></optional>
<optional><element name="call"><text/></element></optional>
<zeroOrMore>
<ref name="surname-content"/>
</zeroOrMore>
<optional><element name="suffix"><text/></element></optional>
<optional><element name="title"><text/></element></optional>
<optional><element name="nick"><text/></element></optional>
<optional><element name="familynick"><text/></element></optional>
<optional><element name="group"><text/></element></optional>
<zeroOrMore><element name="surname">
<ref name="surname-content"/>
</element></zeroOrMore>
<optional><element name="suffix"><text/></element></optional>
<optional><element name="title"><text/></element></optional>
<optional><ref name="date-content"/></optional>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
</define>
@@ -284,8 +289,8 @@
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
</define>
@@ -379,8 +384,8 @@
<ref name="noteref-content"/>
</element></zeroOrMore>
<optional><ref name="date-content"/></optional>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="tagref">
<ref name="tagref-content"/>
@@ -401,14 +406,34 @@
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="objref">
<ref name="objref-content"/>
</element></zeroOrMore>
</define>
<define name="citation-content">
<ref name="primary-object"/>
<optional><ref name="date-content"/></optional>
<optional><element name="page"><text/></element></optional>
<optional><element name="confidence"><text/></element></optional>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="objref">
<ref name="objref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="data_item">
<attribute name="key"><text/></attribute>
<attribute name="value"><text/></attribute>
</element></zeroOrMore>
<element name="sourceref">
<ref name="sourceref-content"/>
</element>
</define>
<define name="source-content">
<ref name="primary-object"/>
<optional><element name="stitle"><text/></element></optional>
@@ -456,8 +481,8 @@
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
</define>
@@ -475,8 +500,8 @@
<ref name="noteref-content"/>
</element></zeroOrMore>
<optional><ref name="date-content"/></optional>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="tagref">
<ref name="tagref-content"/>
@@ -564,19 +589,14 @@
</element></zeroOrMore>
</define>
<define name="citationref-content">
<attribute name="hlink"><data type="IDREF"/></attribute>
</define>
<define name="sourceref-content">
<attribute name="hlink"><data type="IDREF"/></attribute>
<optional><attribute name="priv">
<ref name="priv-content"/>
</attribute></optional>
<optional><attribute name="conf"><text/></attribute></optional>
<optional><element name="spage"><text/></element></optional>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>
<optional><ref name="date-content"/></optional>
</define>
<define name="eventref-content">
<attribute name="hlink"><data type="IDREF"/></attribute>
<optional><attribute name="priv">
@@ -620,8 +640,8 @@
</attribute></optional>
<attribute name="type"><text/></attribute>
<attribute name="value"><text/></attribute>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
@@ -648,8 +668,8 @@
<zeroOrMore><element name="attribute">
<ref name="attribute-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
@@ -678,8 +698,8 @@
<ref name="noteref-content"/>
</element></zeroOrMore>
<optional><ref name="date-content"/></optional>
<zeroOrMore><element name="sourceref">
<ref name="sourceref-content"/>
<zeroOrMore><element name="citationref">
<ref name="citationref-content"/>
</element></zeroOrMore>
</define>