org.custommonkey.xmlunit

Class ElementNameAndTextQualifier

public class ElementNameAndTextQualifier extends ElementNameQualifier

More complex interface implementation that tests two elements for tag name and text content comparability.
Examples and more at xmlunit.sourceforge.net

See Also: DifferenceEngine overrideElementQualifier

Method Summary
protected TextextractText(Element fromElement)
Extract the normalized text from within an element
booleanqualifyForComparison(Element control, Element test)
Determine whether two elements qualify for further Difference comparison.
protected booleansimilar(Text control, Text test)
Determine whether the text nodes contain similar values

Method Detail

extractText

protected Text extractText(Element fromElement)
Extract the normalized text from within an element

Parameters: fromElement

Returns: extracted Text node (could be null)

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 both the superclass qualification (namespace URI and non- namespaced tag name), and the qualification of the text nodes contained within the elements; false otherwise

similar

protected boolean similar(Text control, Text test)
Determine whether the text nodes contain similar values

Parameters: control test

Returns: true if text nodes are similar, false otherwise