Difficulties with Flat XML under source control

Michael Meeks michael.meeks at suse.com
Tue Jun 19 01:48:41 PDT 2012


Hi Johannes,

On Sun, 2012-06-17 at 22:10 +0200, Johannes Sixt wrote:
> I want to place a software manual under source control. It seems most
> feasible to use a flat XML format, in particular, .fodt.

	Yes - that's a good plan :-)

> But I have some difficulties because when LO 3.5.4 opens a .fodt and
> saves it again without making any changes, the resulting file changes
> nevertheless.

	Right - this is a regular annoyance ! :-)

> I'm writing a small tool that transforms the XML into a canonical format
> so that only substantial changes remain. The question is: Which
> transformations are allowed?

	Oh - so ... why write an external tool to do this, and not just fix it
in LibreOffice ! ? :-)

	We'd be -very- interested in some patches that we can apply that will
sort the automatic styles, and generate them with consistent naming in a
sensible order :-)

> (This seems to work so far.)

	The style rendering sounds sensible.

> But there are other changes:
> 
> - <office:meta> changes. It's not a problem, I don't care about this.

	Some level of sorting here might help too.

> - <office:settings> changes. I don't know, yet, whether I mind or not.
> 
> - The <draw:frame draw:z-index="251"> attribute changes. Can I just
> replace the z-index with 1 or 2? What will happen?

	Odd :-) perhaps when we have smaller changes we can chase these
oddnesses down better.

> - The <text:list xml:id="list533178598"> changes. That xml:id does not
> seem to be used anywhere. Can I just remove it? What will I lose?

	No idea; if it's unused just try removing it and see what happens.

> - Measurements change. E.g. (just to pick one case), in
> <style:graphic-properties> the draw:visible-area-width changes from
> 6.088cm to 6.089cm. Is there a remedy to avoid changes of this kind?

	Ah; nasty, some rounding problem / internal representation issue -
possibly again looking at the code we could do better here to make it
more predictable; possibly using more precision we could do better
(doubles instead of floats) ?

> Any insights are welcome!

	So - the best place to fix this stuff is inside LibreOffice itself :-)
then it is permanently fixed for everyone: you are not the only problem
with this pain - soon we'll be using flat odf for our templates and will
suffer the same way :-) 

	The code to poke at is in:

	xmloff/
and
	sw/source/filter/xml/

	It's not too hard to build libreoffice, checkout:

	http://www.libreoffice.org/developers-2/

	Patches are very much more than welcome ! :-)

	Thanks !

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list