Have you tried Node.isEqualNode() [1]? [1] http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/Node.html#isEqualNode(org.w3c.dom.Node)
Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] Rob Davis-5 <[EMAIL PROTECTED]> wrote on 12/05/2008 10:57:29 AM: > I want to compare two Document objects. > > That is compare their contents to see if they are exactly the same. This > would mean recursively traversing through each node in the Document and > comparing it with the other Document. > > Is there are routine, method or library to do this already? > > If not then I could write my own, using a DOMTreeWalker for each Document, > they would be iterated through and as soon as an inequality encountered then > the code would indicating not equal. > > Another way might be to generate a checksum and compare, or perhaps even use > the checksum available from the file that the Document is created from. > > I've already searched google and this forum using the terms compare and > comparison. The closest I got was: > http://www.nabble.com/Node-equals()---to7319083.html#a7319083 > > Which seems to be what I'm looking for in the original post of this thread > but the responses seem off topic and talk about "serializing entity defs > with quotes". > > Thoughts? Thanks in advance. > > -- > View this message in context: http://www.nabble.com/How-to-compare- > Documents--Existing-library-method-available--or-use-DOMTreeWalker-- > tp20856968p20856968.html > Sent from the Xerces - J - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]