Package org.xmlunit.diff
Class ByNameAndTextRecSelector
- java.lang.Object
-
- org.xmlunit.diff.ByNameAndTextRecSelector
-
- All Implemented Interfaces:
ElementSelector
public class ByNameAndTextRecSelector extends java.lang.Object implements ElementSelector
ElementSelector
that allows two elements to be compared if their name (including namespace URI, if any) and textual content is the same and the same is true for all child elements recursively.This
ElementSelector
helps with structures nested more deeply but may need to be combined inside aconditionalSelector
in order to be useful for the document as a whole.
-
-
Constructor Summary
Constructors Constructor Description ByNameAndTextRecSelector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeCompared(org.w3c.dom.Element controlElement, org.w3c.dom.Element testElement)
Determine whether the two elements from the control and test XML can be compared.private static java.util.Map.Entry<java.lang.Integer,org.w3c.dom.Node>
findNonText(org.w3c.dom.NodeList nl, int current, int len)
private static boolean
isText(org.w3c.dom.Node n)
-
-
-
Method Detail
-
canBeCompared
public boolean canBeCompared(org.w3c.dom.Element controlElement, org.w3c.dom.Element testElement)
Description copied from interface:ElementSelector
Determine whether the two elements from the control and test XML can be compared.- Specified by:
canBeCompared
in interfaceElementSelector
-
findNonText
private static java.util.Map.Entry<java.lang.Integer,org.w3c.dom.Node> findNonText(org.w3c.dom.NodeList nl, int current, int len)
-
isText
private static boolean isText(org.w3c.dom.Node n)
-
-