in reply to comparing XML files

What do you mean by the "same physical configuration"? Can you give an XML example?
When I need to compare two XML files, I usually standardize them somehow (xmllint --c14n | xmllint --format) and then run a normal diff. You might need to replace the IDs on the standardized files.

Replies are listed 'Best First'.
Re^2: comparing XML files
by woland99 (Beadle) on Dec 15, 2011 at 01:55 UTC
    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).