Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Testing Document Equivalence  RSS feed

 
Michael Zellmann
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such tools exist; google for "xmldiff".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!