XQExpression or XQPreparedExpression object. The following XQuery Static Context Components are supported through the XQStaticContext interface:
In addition XQStaticContext includes the static XQJ properties for an XQExpression or XQPreparedExpression object:
Note that XQStaticContext is a value object, changing attributes in such object doesn't affect any existing XQExpression or XQPreparedExpression object.
In order to take effect, the application needs to explicitly change the XQConnection default values, or specify an XQStaticContext object when creating an XQExpression or XQPreparedExpression.
XQConnection conn = XQDatasource.getConnection(); // get the default values from the implementation XQStaticContext cntxt = conn.getStaticContext(); // change the base uri cntxt.setBaseURI("http://www.foo.com/xml/"); // change the implementation defaults conn.setStaticContext(cntxt); // create an XQExpression using the new defaults XQExpression expr1 = conn.createExpression(); // creat an XQExpression, using BaseURI "file:///root/user/john/" cntxt.setBaseURI("file:///root/user/john/"); XQExpression expr2 = conn.createExpression(cntxt); ...
| |