fr.inria.ketuk
Class XmlTreeDiff

java.lang.Object
  |
  +--fr.inria.ketuk.XmlTreeDiff

public class XmlTreeDiff
extends java.lang.Object

Utilities to differenciates two DOM trees

Author:
Claude Pasquier

Constructor Summary
XmlTreeDiff(org.w3c.dom.Document firstDoc, org.w3c.dom.Document secondDoc)
          Consructor accepting DOM documents as both trees to diff
XmlTreeDiff(org.w3c.dom.Node firstTree, org.w3c.dom.Node secondTree)
          Consructor accepting DOM nodes as roots for thetrees to diff
 
Method Summary
 boolean diff(org.w3c.dom.Node n1, org.w3c.dom.Node n2)
          Performs a diff between two DOM trees
 java.util.Vector getChanges()
          The changes representing the differences between trees
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlTreeDiff

public XmlTreeDiff(org.w3c.dom.Document firstDoc,
                   org.w3c.dom.Document secondDoc)
Consructor accepting DOM documents as both trees to diff
Parameters:
firstDoc - the first document to diff
secondDoc - the second document to diff

XmlTreeDiff

public XmlTreeDiff(org.w3c.dom.Node firstTree,
                   org.w3c.dom.Node secondTree)
Consructor accepting DOM nodes as roots for thetrees to diff
Parameters:
firstTree - the first tree to diff
secondTree - the second tree to diff
Method Detail

getChanges

public java.util.Vector getChanges()
The changes representing the differences between trees

diff

public boolean diff(org.w3c.dom.Node n1,
                    org.w3c.dom.Node n2)
Performs a diff between two DOM trees
Parameters:
n1 - the first node
n2 - the second node
Returns:
true if the nodes are different, false otherwise