Assert that the evaluation of two Xpaths in two documents are equal
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument
@see XpathEngine
334957
public static void assertXpathValuesEqual(String controlXpath,
                                              Document controlDocument,
                                              String testXpath,
                                              Document testDocument)
        throws XpathException {
        XpathEngine xpath = XMLUnit.newXpathEngine();
        assertEquals(xpath.evaluate(controlXpath, controlDocument),
                     xpath.evaluate(testXpath, testDocument));
    }
1116762
public static void assertXpathsNotEqual(String controlXpath,
                                            String testXpath,
                                            Document document)
        throws XpathException {
        assertXpathsNotEqual(controlXpath, document, testXpath, document);
    }
917092
public static void assertXpathExists(String xPathExpression, 
                                         Document inDocument)
        throws XpathException {
        XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
        NodeList nodeList = simpleXpathEngine.getMatchingNodes(
                                                               xPathExpression, inDocument);
        int matches = nodeList.getLength();
        assertTrue("Expecting to find matches for Xpath " + 
                   xPathExpression, matches > 0);
    }
14311
public static Object executeXPath(Node document, XPathExpression expr, QName result) throws XPathException, MarshallingException
    {
        try
        {
            return expr.evaluate(document, result);
        }
        catch (Exception e)
        {
            throw new MarshallingException("Exception unmarshalling XML.", e);
        }
    }
485410
public static void assertXMLNotEqual(String err, Document control,
                                         Document test) {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, false);
    }
966014
public static void assertXpathsNotEqual(String controlXpath,
                                            Document controlDocument,
                                            String testXpath,
                                            Document testDocument)
        throws XpathException {
        assertXpathEquality(controlXpath, controlDocument, testXpath,
                            testDocument, false);
    }
776
protected void compareRecognizedXMLSchemaInstanceAttribute(Attr control,
                                                               Attr test,
                                                               DifferenceListener listener)
        throws DifferenceFoundException {
        Attr nonNullNode = control != null ? control : test;
        Difference d = 
            XMLConstants.W3C_XML_SCHEMA_INSTANCE_SCHEMA_LOCATION_ATTR
            .equals(nonNullNode.getLocalName())
            ? SCHEMA_LOCATION : NO_NAMESPACE_SCHEMA_LOCATION;

        if (control != null) {
            controlTracker.visited(control);
        }
        if (test != null) {
            testTracker.visited(test);
        }
        
        compare(control != null ? control.getValue() : ATTRIBUTE_ABSENT,
                test != null ? test.getValue() : ATTRIBUTE_ABSENT,
                control, test, listener, d);
    }
717546
public static void assertXMLNotEqual(InputSource control, InputSource test)
        throws SAXException, IOException {
        assertXMLNotEqual(null, control, test);
    }
643128
protected boolean similar(Text control, Text test) {
        if (control == null) {
            return test == null;
        } else if (test == null) {
            return false;
        }
        return control.getNodeValue().equals(test.getNodeValue());
    }
74461
protected boolean compareNodeBasics(Node control, Node test,
                                        DifferenceListener listener) throws DifferenceFoundException {
        controlTracker.visited(control);
        testTracker.visited(test);

        Short controlType = new Short(control.getNodeType());
        Short testType = new Short(test.getNodeType());

        boolean textAndCDATA = comparingTextAndCDATA(control.getNodeType(),
                                                     test.getNodeType());
        if (!textAndCDATA) {
            compare(controlType, testType, control, test, listener,
                    NODE_TYPE);
        }
        compare(control.getNamespaceURI(), test.getNamespaceURI(),
                control, test, listener, NAMESPACE_URI);
        compare(control.getPrefix(), test.getPrefix(),
                control, test, listener, NAMESPACE_PREFIX);
            
        return textAndCDATA || controlType.equals(testType);
    }
1278162
public static void assertXMLNotEqual(String err, Reader control, Reader test)
        throws SAXException, IOException {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, false);
    }
960564
protected XmlElement findMatchedElementIn(Document document, org.dom4j.Element element) {
    org.dom4j.Attribute id = element.attribute("id");
    String idName = id.getName();
    String idValue = id.getValue();
    for (Element me : document.getRootElement().getElements()) {
      if (me instanceof XmlElement) {
        XmlElement xe = (XmlElement) me;
        for (Attribute ab : xe.getAttributes()) {
          if (StringUtils.equals(idName, ab.getName()) && StringUtils.equals(idValue, ab.getValue())) {
            return xe;
          }
        }
      }
    }
    return null;
  }
304973
public static String xpathExtract(Node document, String xpathExpression, Map<String, String> namespaceMapping) throws XPathException,
                MarshallingException
    {
        return (String) executeXPath(document, xpathExpression, namespaceMapping, XPathConstants.STRING);
    }
1118049
public function assertEqualXMLStructure(\DOMElement $expectedElement, $checkAttributes = false) {
        $this->callAssertMethod(__FUNCTION__, [
            'expected' => $expectedElement,
            'options' => [
                $checkAttributes,
            ],
        ]);
    }
1056711
public static Diff compareXML(String control, Reader test)
        throws SAXException, IOException {
        return new Diff(new StringReader(control), test);
    }
421544
protected void compareElement(Element control, Element test,
                                  DifferenceListener listener) throws DifferenceFoundException {
        compare(getUnNamespacedNodeName(control), getUnNamespacedNodeName(test), 
                control, test, listener, ELEMENT_TAG_NAME);

        NamedNodeMap controlAttr = control.getAttributes();
        Integer controlNonXmlnsAttrLength =
            getNonSpecialAttrLength(controlAttr);
        NamedNodeMap testAttr = test.getAttributes();
        Integer testNonXmlnsAttrLength = getNonSpecialAttrLength(testAttr);
        compare(controlNonXmlnsAttrLength, testNonXmlnsAttrLength,
                control, test, listener, ELEMENT_NUM_ATTRIBUTES);

        compareElementAttributes(control, test, controlAttr, testAttr,
                                 listener);
    }
1091168
public boolean qualifyForComparison(Element control, Element test) {
        return ElementSelectors.byName.canBeCompared(control, test);
    }