Search in sources :

Example 1 with DescendantOrSelfSelector

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());
    }
}
Also used : NameTest(org.exist.xquery.NameTest) DBBroker(org.exist.storage.DBBroker) QName(org.exist.dom.QName) NodeSelector(org.exist.xquery.NodeSelector) DescendantOrSelfSelector(org.exist.xquery.DescendantOrSelfSelector) Test(org.junit.Test) NameTest(org.exist.xquery.NameTest)

Aggregations

QName (org.exist.dom.QName)1 DBBroker (org.exist.storage.DBBroker)1 DescendantOrSelfSelector (org.exist.xquery.DescendantOrSelfSelector)1 NameTest (org.exist.xquery.NameTest)1 NodeSelector (org.exist.xquery.NodeSelector)1 Test (org.junit.Test)1