473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Comparing 2 xml's

Is there a way to compare 2 xml's in python? I am aware of the sax and dom parsers, but I think those are for parsing single files.

Thanks for the help,
Manny
Oct 16 '07 #1
2 2106
bartonc
6,596 Expert 4TB
Is there a way to compare 2 xml's in python? I am aware of the sax and dom parsers, but I think those are for parsing single files.

Thanks for the help,
Manny
Perhaps the difflib is what you are looking for.
Oct 16 '07 #2
I need to step through each element to do a comparison of the attributes on each file. So I don't think the difflib would help, but thanks though.

Manny
Oct 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Skip Montanaro | last post by:
I'd like to compare two xml.dom.minidom objects, but the naive attempt fails: >>> import xml.dom.minidom >>> d1 = xml.dom.minidom.parse("ES.xml") >>> d2 = xml.dom.minidom.parse("ES.xml") >>> d1...
1
by: Doug | last post by:
I need to compare two "address" structures within a document, and perform some action if they are not equal. The XML document is a purchase order, with an address at both the header and line...
8
by: Corno | last post by:
Hi all, Does anybody know a command line tool (linux or windows) that can compare 2 XML files. There's only 1 extra requirement that makes it a bit more complicated: the order of attributes or...
5
by: Donal McWeeney | last post by:
Hi, Does anyone know any good tools for performing a side by side comparison of 2 xml documents on an element by element and attribute by attribute basis. Thanks Donal
4
by: ddd | last post by:
I am trying to build a diff tool that allows me to compare two HTML files. I am looking for resources on how to achive this. The main problem is that I do not want to simply highlight the line of...
2
by: Ryan Adler | last post by:
I have a terrible headache from this problem. Perhaps someone can help. My XML is formatted like this: <events> <event> <starts-at>123456<starts-at/> <event> ... <events/>
0
by: Chris | last post by:
Hallo everybody, I have the following problem. There are two XML files: first one (FIRST.xml) includes all products definition, the second one (SECOND.xml) is a product instance. What do I need...
3
by: zeyais | last post by:
I am working on a migration project. There are two XML documents one in the old system and one in the new system. They both are identical but dynamically created from the datasource that is being...
1
by: Kevin Blount | last post by:
I'm getting data from an XML file using this method: $name = $xml->user_info->user; $nickname = $xml->user_info->user; & $age = $xml->user_info->user; $shoe_size = $xml->user_info->user;
0
by: Nick | last post by:
Hi, I need to compare two xml files. Which contain multiple xml datas based on a key. So for eg. I have two xmls A.xml and B.xml. A.xml : <?xml version="1.0" encoding="UTF-8"?> <Test >
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.