CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
suggestion on which xml module to use

 



user1
User

Nov 17, 2004, 11:49 AM

Post #1 of 2 (430 views)
suggestion on which xml module to use Can't Post

Hi,

I am using XML::SemanticDiff module to compare 2 xml documents. It works only if the two xml documents are in the same order. It compares line by line and if there is a difference it prints out. I need to be able to compare node by node.

For example i have one xml file with the following order.

<?xml version="1.0" encoding="utf-8"?>

<QueryResult xmlns="http://api.onesource.com/AppLink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<result>

<QueryResult xmlns="">

<
Company>

<Name>Clark Companies North America</Name>

</Company>

<
Company>

<Name>Ann Taylor Inc</Name>

</Company>

</
QueryResult>

</result>



I have another xml file having the same nodes in the reverse order.



<?xml version="1.0" encoding="utf-8"?>

<
QueryResult xmlns="http://api.onesource.com/AppLink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<result>

<QueryResult xmlns="">



<Company>

<Name>Ann Taylor Inc</Name>

</Company>


<Company>

<Name>Clark Companies North America</Name>

</Company>

</
QueryResult>

</result>



Can you suggest which module will be useful on how to compare both xml files in the above order.

Thanks,



davorg
Thaumaturge / Moderator

Nov 18, 2004, 1:41 AM

Post #2 of 2 (426 views)
Re: [user1] suggestion on which xml module to use [In reply to] Can't Post

If you want to compare things node by node, then that sounds like a good use of XML::SAX.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives