org.custommonkey.xmlunit

Class ElementNameQualifier

public class ElementNameQualifier extends Object implements ElementQualifier

Simple interface implementation that tests two elements for name comparability. This class provides the default behaviour within a DifferenceEngine (for backwards compatibility)
Examples and more at xmlunit.sourceforge.net

See Also: DifferenceEngine overrideElementQualifier

Method Summary
protected booleanequalsNamespace(Node control, Node test)
Determine whether two nodes are defined by the same namespace URI
protected StringgetNonNamespacedNodeName(Node node)
Strip any namespace information off a node name
booleanqualifyForComparison(Element control, Element test)
Determine whether two elements qualify for further Difference comparison.

Method Detail

equalsNamespace

protected boolean equalsNamespace(Node control, Node test)
Determine whether two nodes are defined by the same namespace URI

Parameters: control test

Returns: true if the two nodes are both defined by the same namespace URI (including the default - empty - namespace), false otherwise

getNonNamespacedNodeName

protected String getNonNamespacedNodeName(Node node)
Strip any namespace information off a node name

Parameters: node

Returns: the localName if the node is namespaced, or the name otherwise

qualifyForComparison

public boolean qualifyForComparison(Element control, Element test)
Determine whether two elements qualify for further Difference comparison.

Parameters: control test

Returns: true if the two elements qualify for further comparison based on their similar namespace URI and non-namespaced tag name, false otherwise