protected void compareNodeChildren(Node control, Node test,
                                       DifferenceListener listener, ElementQualifier elementQualifier) 
        throws DifferenceFoundException {

        List<Node> controlChildren = nodeList2List(control.getChildNodes());
        List<Node> testChildren = nodeList2List(test.getChildNodes());

        Integer controlLength = new Integer(controlChildren.size());
        Integer testLength = new Integer(testChildren.size());
        compare(controlLength, testLength, control, test, listener,
                CHILD_NODELIST_LENGTH);

        if (control.hasChildNodes() || test.hasChildNodes()) {
            if (!control.hasChildNodes()) {
                for (Node aTestChildren : testChildren) {
                    missingNode(null, aTestChildren, listener);
                }
            } else if (!test.hasChildNodes()) {
                for (Node aControlChildren : controlChildren) {
                    missingNode(aControlChildren, null, listener);
                }
             } else {
                compareNodeList(controlChildren, testChildren,
                                controlLength.intValue(), listener, elementQualifier);
            }
        }
    }
protected void compareNodeChildren ( Node control , Node test , DifferenceListener listener , ElementQualifier elementQualifier ) throws DifferenceFoundException { List < Node > controlChildren = nodeList2List ( control . getChildNodes ( ) ) ; List < Node > testChildren = nodeList2List ( test . getChildNodes ( ) ) ; Integer controlLength = new Integer ( controlChildren . size ( ) ) ; Integer testLength = new Integer ( testChildren . size ( ) ) ; compare ( controlLength , testLength , control , test , listener , CHILD_NODELIST_LENGTH ) ; if ( control . hasChildNodes ( ) || test . hasChildNodes ( ) ) { if ( ! control . hasChildNodes ( ) ) { for ( Node aTestChildren : testChildren ) { missingNode ( null , aTestChildren , listener ) ; } } else if ( ! test . hasChildNodes ( ) ) { for ( Node aControlChildren : controlChildren ) { missingNode ( aControlChildren , null , listener ) ; } } else { compareNodeList ( controlChildren , testChildren , controlLength . intValue ( ) , listener , elementQualifier ) ; } } }
Compare the number of children, and if the same, compare the actual
children via their NodeLists.
@param control
@param test
@param listener
@param elementQualifier
@throws DifferenceFoundException