Class ByNameAndTextRecSelector

  • All Implemented Interfaces:
    ElementSelector

    public class ByNameAndTextRecSelector
    extends 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 a conditionalSelector in order to be useful for the document as a whole.

    • Constructor Detail

      • ByNameAndTextRecSelector

        public ByNameAndTextRecSelector()
    • Method Detail

      • canBeCompared

        public boolean canBeCompared​(Element controlElement,
                                     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 interface ElementSelector
        Parameters:
        controlElement - element of the control XML
        testElement - element of the test XML
        Returns:
        true if the two elements can be compared