Ejemplo n.º 1
0
 /**
  * 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();
 }
Ejemplo n.º 2
0
 /**
  * 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();
 }
Ejemplo n.º 3
0
 /**
  * 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();
 }