@Test public void xpath() { String BAZ = "BAZ"; String XYZZY1 = "xyzzy1"; String XYZZY2 = "xyzzy2"; Element control = doc.createElement(FOO); Element bar = doc.createElement(BAR); control.appendChild(bar); Element baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY1)); baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY2)); Element test = doc.createElement(FOO); bar = doc.createElement(BAR); test.appendChild(bar); baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY2)); baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY1)); Element test2 = doc.createElement(FOO); bar = doc.createElement(BAR); test2.appendChild(bar); baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY2)); baz = doc.createElement(BAZ); bar.appendChild(baz); baz.appendChild(doc.createTextNode(XYZZY2)); assertTrue(ElementSelectors.byXPath(". .canBeCompared(control, test)); assertFalse(ElementSelectors.byXPath(". .canBeCompared(control, test2)); }
public static ElementSelector byXPath(String xpath, ElementSelector childSelector) { return byXPath(xpath, null, childSelector); }
ElementSelectors { public static ElementSelector byXPath(String xpath, ElementSelector childSelector) { return byXPath(xpath, null, childSelector); } }
ElementSelectors { public static ElementSelector byXPath(String xpath, ElementSelector childSelector) { return byXPath(xpath, null, childSelector); } private  ElementSelectors(); }
ElementSelectors { public static ElementSelector byXPath(String xpath, ElementSelector childSelector) { return byXPath(xpath, null, childSelector); } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); }
ElementSelectors { public static ElementSelector byXPath(String xpath, ElementSelector childSelector) { return byXPath(xpath, null, childSelector); } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); static final ElementSelector Default; static final ElementSelector byName; static final ElementSelector byNameAndText; static final ElementSelector byNameAndAllAttributes; }