The moose likes XML and Related Technologies and the fly likes Testing Document Equivalence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Testing Document Equivalence" Watch "Testing Document Equivalence" New topic

Testing Document Equivalence

Michael Zellmann

Joined: Dec 17, 2004
Posts: 18
I would like to compare two XML Documents to determine if they are equivalent. I am trying to rewrite software that crates the documents and want to see if I am achieving the same results as the former approach. I know my approach will have different white space and also a different order of attributes within an element. However, I want to assure that each node has the same parent, children and siblings, and that each element has the same attributes.

I can imagine writing my own code to traverse the tree and determine equivalence, but I was hoping there to use existing code to achieve this.

Is anything like this available ?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41083
Such tools exist; google for "xmldiff".

Ping & DNS - my free Android networking tools app
I agree. Here's the link: http://aspose.com/file-tools
subject: Testing Document Equivalence
Similar Threads
Discrepancies between an XML file and the XSD it was generated from (via JAXB)
Showing a List of Maps in a dataTable
XHTML documents vs. XHTML syntax in HTML documents
Extract a unique identifier for any given Element
Resusing GUI code, different Events