use of org.sirix.api.NodeReadTrx in project sirix by sirixdb.
the class TestNodeWrapperXPath method testDefaultNamespaceTextAll.
@SuppressWarnings("unchecked")
@Test
public void testDefaultNamespaceTextAll() throws Exception {
xpe.setNamespaceContext(new DocNamespaceContext());
final XPathExpression findLine = xpe.compile("//p:a/text()");
final NodeInfo doc = new DocumentWrapper(mHolder.getSession(), config);
// Execute XPath.
final ArrayList<NodeWrapper> result = (ArrayList<NodeWrapper>) findLine.evaluate(doc, XPathConstants.NODESET);
assertNotNull(result);
final NodeReadTrx rtx = mHolder.getSession().beginNodeReadTrx();
rtx.moveTo(result.get(0).getKey());
assertEquals("oops1", rtx.getValue());
rtx.moveTo(result.get(1).getKey());
assertEquals("oops2", rtx.getValue());
rtx.moveTo(result.get(2).getKey());
assertEquals("oops3", rtx.getValue());
rtx.close();
}
Aggregations