/** * Compare two Documents for doctype and then element differences * @param control * @param test * @param listener * @param elementQualifier * @throws DifferenceFoundException */ protected void compareDocument(Document control, Document test, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException { DocumentType controlDoctype = control.getDoctype(); DocumentType testDoctype = test.getDoctype(); compare(getNullOrNotNull(controlDoctype), getNullOrNotNull(testDoctype), controlDoctype, testDoctype, listener, HAS_DOCTYPE_DECLARATION); if (controlDoctype!=null && testDoctype!=null) { compareNode(controlDoctype, testDoctype, listener, elementQualifier); } }
/** * Compare two Documents for doctype and then element differences * @param control * @param test * @param listener * @param elementQualifier * @throws DifferenceFoundException */ protected void compareDocument(Document control, Document test, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException { DocumentType controlDoctype = control.getDoctype(); DocumentType testDoctype = test.getDoctype(); compare(getNullOrNotNull(controlDoctype), getNullOrNotNull(testDoctype), controlDoctype, testDoctype, listener, HAS_DOCTYPE_DECLARATION); if (controlDoctype!=null && testDoctype!=null) { compareNode(controlDoctype, testDoctype, listener, elementQualifier); } }
/** * Entry point for Node comparison testing. * @param control Control XML to compare * @param test Test XML to compare * @param listener Notified of any {@link Difference differences} detected * during node comparison testing * @param elementQualifier Used to determine which elements qualify for * comparison e.g. when a node has repeated child elements that may occur * in any sequence and that sequence is not considered important. */ public void compare(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier) { controlTracker.reset(); testTracker.reset(); try { compare(getNullOrNotNull(control), getNullOrNotNull(test), control, test, listener, NODE_TYPE); if (control!=null) { compareNode(control, test, listener, elementQualifier); } } catch (DifferenceFoundException e) { // thrown by the protected compare() method to terminate the // comparison and unwind the call stack back to here } }
/** * Entry point for Node comparison testing. * @param control Control XML to compare * @param test Test XML to compare * @param listener Notified of any {@link Difference differences} detected * during node comparison testing * @param elementQualifier Used to determine which elements qualify for * comparison e.g. when a node has repeated child elements that may occur * in any sequence and that sequence is not considered important. */ public void compare(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier) { controlTracker.reset(); testTracker.reset(); try { compare(getNullOrNotNull(control), getNullOrNotNull(test), control, test, listener, NODE_TYPE); if (control!=null) { compareNode(control, test, listener, elementQualifier); } } catch (DifferenceFoundException e) { // thrown by the protected compare() method to terminate the // comparison and unwind the call stack back to here } }