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

    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByNameAndTextRecSelector

        public ByNameAndTextRecSelector()
    • 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 interface ElementSelector
      • 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)