Thanks for the reply.

For my purposes, the order of elements does not matter. It is the contents of a snapshot of a directory (say), in a random order. The 'name' attribute is (say) the file name or a sub directory name (which contains its own elements).

I want to be able to compare two xml files describing a file system in this way, comparing all attributes and sub elements but using 'name' attribute as the primary key.

An element can be missing or added in either xml file, and I want to be able to flag it as such. Elements with the same 'name' attribute are to be compared for sub elements and attributes

I was hoping that getting them into a consistent ordering would help SemanticDiff cope with missing or new elements. But I think now I will have to write custom code that parses the XML to identify the elements that are new / missing between the two files, and uses SemanticDiff perhaps to compare just elements, not the whole document.


In reply to Re^2: Consistent xml formatting by Haloric
in thread Consistent xml formatting by Haloric

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.