use of org.exist.xquery.DescendantOrSelfSelector in project exist by eXist-db.
the class BasicNodeSetTest method descendantOrSelfSelector.
@Test
public void descendantOrSelfSelector() throws XPathException, EXistException {
NodeSelector selector = new DescendantOrSelfSelector(seqSpeech.toNodeSet(), -1);
NameTest test = new NameTest(Type.ELEMENT, new QName("SPEECH", ""));
try (final DBBroker broker = existEmbeddedServer.getBrokerPool().get(Optional.of(existEmbeddedServer.getBrokerPool().getSecurityManager().getSystemSubject()))) {
NodeSet set = broker.getStructuralIndex().findElementsByTagName(ElementValue.ELEMENT, seqSpeech.getDocumentSet(), test.getName(), selector);
assertEquals(2628, set.getLength());
}
}
Aggregations