Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Two XML documents

Status
Not open for further replies.

suman55

Programmer
Feb 23, 2005
2
US
Hello All,

I am writing a java program(SAX) to compare two XML documents.I am comparing it only based on "elements structure", nothing to do with DTDs or XML schemas or entities.

I am collecting the start tags and end tags of both documents, and checking whether they are equal or not, in the particular order.The order of all start tags and end tags in both documents should be same.

Will this really work, or am I missing any complexity? Are there any other issues I have to look on?

Thank You.
 
Have you made a buy vs. build decision already?

Because Altova sells a XML differencing utility for only a few hundred dollars. If you're spending more than a couple days on this, it's not cost-effective.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi,

I want to build it myself.It is just preparation for an exam.
 
... the same? or only structurally equivalent?

What if the tag content is different?

And why would this help anyone.. (just thinking about its usefulness). I mean, if you've been asked to do "something in xml using SAX" for the exam there's alot more interesting and useful things you can do with it than this ;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top