use of org.exist.xquery.AncestorSelector in project exist by eXist-db.
the class BasicNodeSetTest method ancestorSelector_self.
@Test
public void ancestorSelector_self() throws XPathException, EXistException {
NodeSet ns = seqSpeech.toNodeSet();
NodeSelector selector = new AncestorSelector(ns, -1, true, true);
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());
}
}
use of org.exist.xquery.AncestorSelector in project exist by eXist-db.
the class BasicNodeSetTest method ancestorSelector.
@Test
public void ancestorSelector() throws XPathException, EXistException {
NodeSelector selector = new AncestorSelector(seqSpeech.toNodeSet(), -1, false, true);
NameTest test = new NameTest(Type.ELEMENT, new QName("ACT", ""));
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(15, set.getLength());
}
}
Aggregations