How to avoid .fodt file attributes changing on every save?

I’m version controlling every formatted text document I have in OpenDocument Flat XML Document (FODT) format to have a chance at seeing the history and possibly doing some automated cleanup. However, any change to the document causes attributes elsewhere in the file to change. For example (trimmed some irrelevant attributes to avoid line wrap):

-   <text:h text:style-name="P78">Foo</text:h>
-   <text:list xml:id="list221802702260507">
+   <text:h text:style-name="P73">Foo</text:h>
+   <text:list xml:id="list125802385019052">

In case of the xml:id attributes I can probably simply remove them without issue, but the style names still have to line up with the actual style names in the metadata. How do I work around this issue so that diffs are as small as possible?

Using LibreOffice

1 Like

There is a Similar Question on StackOverflow:

1 Like