# Gramps XML version format

**URL:** <https://gramps.discourse.group/t/gramps-xml-version-format/7495>\
**Category:** Development\
**Created:** [April 21, 2025, 6:52pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495 "2025-04-21T18:52:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 21, 2025, 6:52pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/1 "2025-04-21T18:52:17Z")

</div>

The Gramps XML version (1.7.2 as of Gramps 6.0.0) looks like it follows SemVer. Is that indeed the case?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [April 21, 2025, 8:26pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/2 "2025-04-21T20:26:18Z")

</div>

No. It has a similar structure, but the use of the individual elements is different.

---

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 21, 2025, 8:43pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/3 "2025-04-21T20:43:43Z")

</div>

Ah, glad I asked. Is the format documented somewhere?

Basically, somebody reported [Betty does not work with Gramps XML 1.7.2 · Issue #2560 · bartfeenstra/betty · GitHub](https://github.com/bartfeenstra/betty/issues/2560) and I want to solve this by parsing the version from the XML and checking if it’s compatible with 1.7.1 (the version Betty’s Gramps XML loading code was written against).

---

<div class="post-metadata">

**Author:** ![romjerome](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/romjerome/32/1489_2.png) [@romjerome](https://gramps.discourse.group/u/romjerome)\
**Post date:** [April 22, 2025, 3:35pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/4 "2025-04-22T15:35:12Z")

</div>

Change in on eventref (Person, Family) with a citation support.

> [@Example.gramps and 1.7.2 grampsxml.dtd](https://gramps.discourse.group/t/example-gramps-and-1-7-2-grampsxml-dtd/7204):
>
> On future Gramps 6.0, it seems that there is a minor schema update/upgrade around eventref and citationref. -\<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.7.1//EN" "http://gramps-project.org/xml/1.7.1/grampsxml.dtd" +\<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.7.2//EN" "http://gramps-project.org/xml/1.7.2/grampsxml.dtd" -\<!ELEMENT eventref (attribute\*, noteref\*)\> +\<!ELEMENT eventref (attribute\*, noteref\*, citationref\*)\> Maybe ‘example.gram…

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [April 22, 2025, 4:16pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/5 "2025-04-22T16:16:13Z")

</div>

Thanks for reminding us of this. I have updated the [Gramps XML](https://www.gramps-project.org/wiki/index.php/Gramps_XML) page in the wiki.

---

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 22, 2025, 4:30pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/6 "2025-04-22T16:30:33Z")

</div>

Thanks! As long as those are optional additions it should be BC with 1.7.1, but it’s helpful for me to be aware of these changes 🙂

@Nick-Hall What logic would I use to determine if two XML versions are compatible? Regular Python version comparison if not SemVer?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [April 22, 2025, 5:14pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/7 "2025-04-22T17:14:53Z")

</div>

It looks like we use the “X.Y.Z” format for versions. If only new features are added the we increment Z. If features are removed we increment Y.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [April 22, 2025, 5:33pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/8 "2025-04-22T17:33:36Z")

</div>

But they are intertwined a bit too, correct? So if you increment Y (removing features), then Z resets to zero but can still include new features.

(Otherwise, the Y and Z seem to be reversed.)

---

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 22, 2025, 5:43pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/9 "2025-04-22T17:43:38Z")

</div>

Ta. Does that mean the 1 prefix is considered static and without meaning?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [April 22, 2025, 5:47pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/10 "2025-04-22T17:47:15Z")

</div>

Yes. The version number increases in the usual way.

Unfortunately there are inconsistencies. I think that there has been a tendency to link the XML version to the Gramps version, so Y might have been incremented when not strictly necessary. There were also cases where the XML export was reporting the wrong version. This is why some Gramps versions have more than one XML version.

I don’t see the leading “1” changing unless we make some major change to the format.

---

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 22, 2025, 11:38pm UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/11 "2025-04-22T23:38:36Z")

</div>

Okay, so basically:

- if X is increased, Y and Z become 0
- if Y is increased, Z becomes 0
- X.Y.Z+n is compatible with X.Y.Z
- X.Y+n.x is incompatible with X.Y.x

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [April 23, 2025, 12:02am UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/12 "2025-04-23T00:02:04Z")

</div>

I’m not sure that there isn’t another level of compatibility.

I exported a 1.7.2 with Gramps 6.0.1 but Gramps 5.2.2 would not import that file. Even after manually changing the header to 1.7.1, the Gramps 6.0.1 version in the header caused it to refuse attempting to load.

The XML had only 2 objects (a Note and a Media with a URL path) And that data has been supported since at least 2015.

So if you are going to use the Gramps engine for Betty and its Importer/Exporter plugins, then make you should see if that is a compatibility limitation that you can override?[https://gramps.discourse.group/t/re-develop-download-media-addon-for-gramps-6-0/7492](https://gramps.discourse.group/t/re-develop-download-media-addon-for-gramps-6-0/7492)

---

<div class="post-metadata">

**Author:** ![bartfeenstra](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bartfeenstra](https://gramps.discourse.group/u/bartfeenstra)\
**Post date:** [April 23, 2025, 7:06am UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/13 "2025-04-23T07:06:21Z")

</div>

Interesting!

Betty will continue parsing Gramps XML itself until [Allow Gramps' core to be imported without requiring GObject by bartfeenstra · Pull Request #2016 · gramps-project/gramps · GitHub](https://github.com/gramps-project/gramps/pull/2016) is fixed, so I’ll have to code our own solution to handle XML versions for now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [May 23, 2025, 7:06am UTC](https://gramps.discourse.group/t/gramps-xml-version-format/7495/14 "2025-05-23T07:06:54Z")

</div>

Closed on May 23, 2025, 7:06am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
