Bug #2170
closedPassing down object reference to extension function not available
100%
Description
Bug issue initially reported by Gunther Rademacher:
Reports a migration problem between 9.5 and 9.6.
What I would like to do is pass down some object reference into an
XQueryEvaluator, and retrieve it from within an extension function used
by the query. The following worked with 9.5:
...when evaluating an XQuery:
XQueryEvaluator evaluator = executable.load();
evaluator.setExternalVariable(
new QName("data"),
XdmValue.wrap(new ObjectValue("hello world")));
...and in an extension function used by the query:
public Sequence call(XPathContext context, Sequence[]
arguments) throws XPathException
{
ObjectValue parameter = (ObjectValue)
context.getController().getParameter("data");
return new StringValue((String) parameter.getObject());
With 9.6, the getParameter method has disappeared, and it is unclear to
me how to properly adapt the above code. Some debugging shows that my
external variable shows up in
context.getController().getBindery().globalParameters
We need to think of a way of providing access to the global parameters including the defaulted values.
Files
Please register to edit this issue