Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

XML files compare

by mecrazycoder (Sexton)
on Aug 17, 2009 at 11:50 UTC ( [id://789138]=perlquestion: print w/replies, xml ) Need Help??

mecrazycoder has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, Is there any best way to check given two XML files are same or not. Contents in two XML will be same but shuffled,say for example Input1.xml:
<Job> <Category>Engineer</Category> <Description>SystemsEngineer</Description> </JobId> <JobId> <Category>Cook</CategoryCode> <Description>Chef</Description> </JobId>
Input2.xml
<JobId> <Category>Cook</CategoryCode> <Description>Chef</Description> </JobId> <Job> <Category>Engineer</Category> <Description>SystemsEngineer</Description> </JobId>
Input1.xml and Input2.xml are same though content shuffled. Please help me

Replies are listed 'Best First'.
Re: XML files compare
by Anonymous Monk on Aug 17, 2009 at 12:13 UTC
    normalize (sort) first, then compare
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://789138]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found