Yes, you can use any of the bindXXX methods in the XQDynamicContext interface, which is implemented by XQExpression and XQPreparedExpression. For example
XQPreparedExpression exp = ...
exp.bindString(new QName("user"), "myusername", null);
Michael Kay

From: [] On Behalf Of Peter
Sent: 11 December 2007 12:00
Subject: [saxon] XQuery XQJ and Java objects as external variables



I am trying to use XQJ to pass in a Java object as an external variable


E.g. this could be the query


declare namespace u="java:package.User";

declare variable $user external;



I have a way of doing this using Saxon’s “proprietary” API, but can this be done using XQJ?


Any guidance warmly welcomed,