/** * Runs a query with a bound context value. * * @throws IOException I/O exception */ @Test public void queryContextInt() throws IOException { final Query query = session.query(". * 2"); query.context("6", "xs:integer"); assertEqual("12", query.next()); query.close(); }
/** * Runs a query with a bound context value. * * @throws IOException I/O exception */ @Test public void queryContextVar() throws IOException { final Query query = session.query("declare variable $a := .; $a"); query.context("<a/>", "element()"); assertEqual("<a/>", query.next()); query.close(); }
/** * Runs a query with a bound context value. * * @throws IOException I/O exception */ @Test public void queryContext() throws IOException { final Query query = session.query("."); query.context("5"); assertEqual("5", query.next()); query.close(); }