Actual data sample would not do a lot of good - the XML files I work with describe connection and placement of parts so are not too readable (way too complex). I think that Items/Containers example describes basic question well.
To make it slightly more complex lets assume that when an Item is ordered it has color so described by element Item_Color is created and when subsequently that item is placed in a Container it gets a reference to Item_Placement element that has reference pointing to that Container.
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Description>Items in Containers</Description> <Item_Color id="1" color="Blue"> <Reference refType="Placement Data" id="2"></Reference> </Item_Color> <Item_Placement id="2"> <Reference refType="Physical Placement" id="3"></Reference> </Item_Placement> <Container id="3" color="White"></Container> <Item_Color id="4" color="Red"> <Reference refType="Placement Data" id="6"></Reference> </Item_Color> <Item_Placement id="6"> <Reference refType="Physical Placement" id="3"></Reference> </Item_Placement> </Configuration>
So that means Blue and Red items sit in White container.
The same configuration can be described by a file that has different set of IDs - how do I decide it is stil "Blue and Red in White"?
Is there away to identify that some configuration contains some other as a subset - ie. in some more complex situation we still have "Red and Blue in White" (as part of bigger situation).

In reply to Re^2: comparing XML files by woland99
in thread comparing XML files by woland99

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.