use of org.sirix.saxon.evaluator.XQueryEvaluator in project sirix by sirixdb.
the class TestNodeWrapperS9ApiXQuery method testWhereBooks.
@Test
public void testWhereBooks() throws Exception {
final XdmValue value = new XQueryEvaluator("for $x in /bookstore/book where $x/price>30 return $x/title", mHolder.getSession()).call();
final StringBuilder strBuilder = new StringBuilder();
for (final XdmItem item : value) {
strBuilder.append(item.toString());
}
assertEquals("<title lang=\"en\">XQuery Kick Start</title><title lang=\"en\">Learning XML</title>", strBuilder.toString());
}
use of org.sirix.saxon.evaluator.XQueryEvaluator in project sirix by sirixdb.
the class TestNodeWrapperS9ApiXQuery method testOrderByBooks.
@Test
public void testOrderByBooks() throws Exception {
final XdmValue value = new XQueryEvaluator("for $x in /bookstore/book where $x/price>30 order by $x/title return $x/title", mHolder.getSession()).call();
final StringBuilder strBuilder = new StringBuilder();
for (final XdmItem item : value) {
strBuilder.append(item.toString());
}
assertEquals("<title lang=\"en\">Learning XML</title><title lang=\"en\">XQuery Kick Start</title>", strBuilder.toString());
}
use of org.sirix.saxon.evaluator.XQueryEvaluator in project sirix by sirixdb.
the class TestNodeWrapperS9ApiXQuery method testFLOWR.
@Test
public void testFLOWR() throws Exception {
final XdmValue value = new XQueryEvaluator("for $x in /bookstore/book let $y := $x/price where $y>30 order by $x/title return $x/title", mHolder.getSession()).call();
final StringBuilder strBuilder = new StringBuilder();
for (final XdmItem item : value) {
strBuilder.append(item.toString());
}
assertEquals("<title lang=\"en\">Learning XML</title><title lang=\"en\">XQuery Kick Start</title>", strBuilder.toString());
}
Aggregations