Search in sources :

Example 1 with ChildSelector

use of org.exist.xquery.ChildSelector in project exist by eXist-db.

the class BasicNodeSetTest method childSelector.

@Test
public void childSelector() throws XPathException, EXistException {
    NodeSelector selector = new ChildSelector(seqSpeech.toNodeSet(), -1);
    NameTest test = new NameTest(Type.ELEMENT, new QName("LINE", ""));
    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(9492, set.getLength());
    }
}
Also used : ChildSelector(org.exist.xquery.ChildSelector) NameTest(org.exist.xquery.NameTest) DBBroker(org.exist.storage.DBBroker) QName(org.exist.dom.QName) NodeSelector(org.exist.xquery.NodeSelector) Test(org.junit.Test) NameTest(org.exist.xquery.NameTest)

Aggregations

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