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
ElementSelectorthat 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
ElementSelectorhelps with structures nested more deeply but may need to be combined inside aconditionalSelectorin 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 booleancanBeCompared(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 booleanisText(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:ElementSelectorDetermine whether the two elements from the control and test XML can be compared.- Specified by:
canBeComparedin 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)
-
-