Hi Jean-Marc, external variables now have to be explicitly declared. You can do so by: declare variable $xml external; Cheers, Dirk On 01/02/14 09:16, jean-marc Mercier wrote:
Hi,
I am extensively using a function wrapping xquery:eval. My use case is roughly the following :
declare function local:eval_helper($exp, $args){xquery:eval('$xml'||$exp,map{'$xml' := $args})}; declare variable $test := <toto><tata>1</tata></toto>; local:eval_helper3('//tata', $test)
Since the following correction : [1] https://github.com/BaseXdb/basex/issues/833, the previous code raises now a [XPST0008] Undefined variable $xml.
I have tried several combinations to find a workaround, none are working :
- declare function local:eval_helper($exp, $args){xquery:eval(''||$exp,map{'' := $args})}; ([XPDY0050] Root of the context item must be a document node.). - declare function local:eval_helper($exp, $args){xquery:evaluate($arg||$exp)};
[XPTY0019] Steps within a path expression must yield nodes; xs:integer found. -- declare variable $xml external := "xml", : [XPST0008] Undefined variable $xml.
What is the correct workaround ?
Cheers
Jean-Marc
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22