ecolabdata / ecospheres-isomorphe

Une application pour appliquer des transformations XML aux catalogues Geonetwork du MTECT.
0 stars 0 forks source link

Only apply update if different from original #28

Closed streino closed 2 weeks ago

streino commented 3 weeks ago

Apply same formatter to original and transform so we can diff cleanly. Maybe even apply sorting xslt (sort all nodes and attributes) ? But we'll have a mismatch between what we diff and what we show to the user (don't want to show the sorted XML), so it might not be such a good idea.

abulte commented 2 weeks ago

@streino Can you write a simple transformation that changes something? It's for the tests, with this change ⬆, noop won't create or duplicate records.

streino commented 2 weeks ago

Will do! And I just remembered you have to explicitly call etree.indent to format the XML, pretty_print isn't enough.

abulte commented 2 weeks ago

So util.xml_to_string not enough? Works in my tests.

streino commented 2 weeks ago

Ah maybe too. I was referring etree.tostring(pretty_print=True) which clearly isn't enough.

streino commented 2 weeks ago

Here you go: https://github.com/ecolabdata/ecospheres-migrator/pull/51