in reply to Indent XML data

Have you tried xml_pp in the XML-Twig distribution?

Replies are listed 'Best First'.
Re^2: Indent XML data
by LexPl (Beadle) on Jan 23, 2025 at 13:50 UTC

    First of all, thanks to all colleagues for your helpful feedback!

    XML::Twig does work, but it doesn't preserve the order of attributes.

    I'm well aware that the order of attributes is typically not significant, as the content doesn't change. In my case, this is an issue because indentation is a preparatory step before diffing so that there would be a large number of false diffs caused by a changed order of attributes. What could I do?

    Besides that XML entities in attribute values are simply deleted (and I could not use UTF-8 in my environment).

Re^2: Indent XML data
by LexPl (Beadle) on Jan 22, 2025 at 16:45 UTC

    How would that be done?

      xml_pp lists usage examples, linked from the module above...