Gramps XML

From Gramps
Revision as of 03:33, 18 August 2015 by Sam888 (talk | contribs) (Gramps XML Resources)
Jump to: navigation, search

Gramps XML is the Extensible Markup Language XML format designed for storing Gramps data. The goal is to have a fully portable, human- and machine-readable XML format so that the data can be read and written without any loss. In addition, XML format allows for smaller files (if compressed) and for using the version control system for tracking the changes (if uncompressed).

The reason XML is not used by Gramps as the working database ("internal") format is performance, specifically memory considerations.

Gramps XML Resources

Starting with Gramps XML 1.0

Each revision of Gramps XML has its own resource page, with references to that version's DTD and RELAX NG schema.
The resource pages are listed at

Gramps release XML version Imports XML version Database Example Changes/Note
master no change against 4.2 yet >= 1.0.0 - best 1.7 18 Unreleased

Gramps release XML version Imports XML version Database Example Changes/Note
4.2.x 1.7.0 - 1.7.1 >= 1.0.0 - 1.7 18 [1] added PlaceNames (with Date and Language) Place
4.1.x 1.6.0 >= 1.0.0 - best 1.5.1 17 [2] added Tags to Event, Place, Repository, Source, and Citation

Source/ became SourceAttributes
added optional support for checksum on Media object
added PlaceRef and Place Hierarchies

4.0.x 1.5.0 - 1.5.1 >= 1.0.0 - best 1.4.0 16 [3] -
3.4.x 1.5.0 - 1.5.1 >= 1.0.0 - best 1.4.0 16 [4] Citations support

Gramps XML is now idempotent[5].4365
Exporter does not change records order any more, making it easier to look at differences between versions/revisions.

3.3.x 1.4.0 >= 1.0.0 - best 1.3.0 15 [6] Added new field "locality" to the Place schema

Added surnames to the Name schema (surnames is a list of surnames / prefix and patronymic are moved to the surname)
Replaced Markers with Tags ( marker removed from all / tags added to Person, Media, Family, and Notes)
Improvements on Import/Export file formats (vcard, gedcom, xml)
Gramps_3.3_Wiki_Manual_-_What's_new?#Database Changes

3.1.x 1.3.0 >= 1.0.0 - best 1.1.0 15 [7] Added lat/long to places
3.0.x 1.2.0 >= 1.1.0 14 [8] added newyear to Dates
Replace plain text with StyledText in Notes
2.2.x 1.1.0-1.1.4 >= 0.0.0 [9]
2.0.x 1.0.0 >= 0.0.0 13 [10] changed name formats
1.0.x no official version (0.0.0) - [11]
0.0.x beta software (0.0.0) Unsupported Unsupported Unsupported

To convert an old Gramps XML file you could use VirtualBox or Vmware and the old lgenealogy images from:

DTD generation

Tool like xml2dtd could help people not familiar with DTD grammar by generating a DTD file from a XML file. New content on Gramps XML could be tested with the tool and be merged on current Gramps DTD.

RELAX NG generation

Tools like trang or NekoDTD could help to convert a Gramps DTD file to a RELAX NG file. Some others tools and up-to-date informations are listed on this page.

Validating Gramps XML file

To validate the Gramps XML file against its DTD, use xmllint program (comes with the libxml2-utils package):

xmllint --noout filename.gramps
If the Gramps XML file does not validate

this indicates an error in either the DTD or the XML Writer.
Please file the bug report at in that case.

Parsing Gramps XML file

See also