I notice Basex has a util:eval function similar to the eXist db one<http://demo.exist-db.org/exist/functions/util/eval>however it is not clear for the BaseX version what the inherited context, if any, is. The example on the eXist site: let $a := "Hello" return util:eval("$a") Fails with an undefined variable $a with BaseX 7.0.1 /Andy
Hi Andy, as you already guessed, and to reduce side effects, the util:eval() function in BaseX uses its very own context. Hope this helps, Christian _______________________________________ On Mon, Oct 31, 2011 at 1:20 PM, Andy Bunce <bunce.andy@gmail.com> wrote:
I notice Basex has a util:eval function similar to the eXist db one however it is not clear for the BaseX version what the inherited context, if any, is. The example on the eXist site:
let $a := "Hello" return util:eval("$a")
Fails with an undefined variable $a with BaseX 7.0.1
/Andy
Ok, I understand, but a bit of a shame. The functionality I want is just functx:dynamic-path <http://www.xqueryfunctions.com/xq/functx_dynamic-path.html> Is just using the functx library via the repo likely to be the most efficient approach for BaseX? /Andy On Mon, Oct 31, 2011 at 5:02 PM, Christian Grün <christian.gruen@gmail.com>wrote:
Hi Andy,
as you already guessed, and to reduce side effects, the util:eval() function in BaseX uses its very own context.
Hope this helps, Christian _______________________________________
On Mon, Oct 31, 2011 at 1:20 PM, Andy Bunce <bunce.andy@gmail.com> wrote:
I notice Basex has a util:eval function similar to the eXist db one however it is not clear for the BaseX version what the inherited context, if any, is. The example on the eXist site:
let $a := "Hello" return util:eval("$a")
Fails with an undefined variable $a with BaseX 7.0.1
/Andy
Hi Andy, it sure is the most comfortable approach, I myself use the functx library via our repository extension.
REPO INSTALL http://files.basex.org/xar/functx-1.0.xar
Hope this helps :-) Michael Am 31.10.2011 um 18:19 schrieb Andy Bunce:
Is just using the functx library via the repo likely to be the most efficient approach for BaseX?
Michael Seiferle wrote:
it sure is the most comfortable approach, I myself use the functx library via our repository extension. REPO INSTALL http://files.basex.org/xar/functx-1.0.xar
You can even find it directly from CXAN ;-) http://cxan.org/pkg/functx -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
There seems to be a namespace issue when using nested modules... This works.. import module namespace functx="http://www.functx.com"; functx:capitalize-first("test") I define foo.xy.. module namespace foo = "http://example.org/module1"; import module namespace functx="http://www.functx.com"; declare function foo:first($s){ functx:capitalize-first($s) }; Then execute import module namespace foo = "http://example.org/module1" at "foo.xq"; foo:first("aa") I get the error Query: import module namespace foo = "http://example.org/module1" at "foo.xq"; foo:first("aa") Error: [FONS0004] Namespace prefix not declared: "functx:Different_number_of_names". This works: import module namespace foo = "http://example.org/module1" at "foo.xq"; declare namespace functx="http://www.functx.com"; foo:first("aa") But surely I should not be required to define the functx namespace here? /Andy On Mon, Oct 31, 2011 at 7:19 PM, Florent Georges <lists@fgeorges.org> wrote:
Michael Seiferle wrote:
it sure is the most comfortable approach, I myself use the functx library via our repository extension. REPO INSTALL http://files.basex.org/xar/functx-1.0.xar
You can even find it directly from CXAN ;-)
-- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
Thanks Andy, this problem seems to be related with GitHib issue 133.. https://github.com/BaseXdb/basex/issues/133 ..which is why I have added your observation to this bug entry. Christian ___________________________ On Tue, Nov 1, 2011 at 1:17 PM, Andy Bunce <bunce.andy@gmail.com> wrote:
There seems to be a namespace issue when using nested modules... This works..
import module namespace functx="http://www.functx.com"; functx:capitalize-first("test")
I define foo.xy..
module namespace foo = "http://example.org/module1"; import module namespace functx="http://www.functx.com"; declare function foo:first($s){ functx:capitalize-first($s) };
Then execute import module namespace foo = "http://example.org/module1" at "foo.xq"; foo:first("aa")
I get the error Query: import module namespace foo = "http://example.org/module1" at "foo.xq";
foo:first("aa") Error: [FONS0004] Namespace prefix not declared: "functx:Different_number_of_names".
This works: import module namespace foo = "http://example.org/module1" at "foo.xq"; declare namespace functx="http://www.functx.com"; foo:first("aa")
But surely I should not be required to define the functx namespace here?
/Andy
On Mon, Oct 31, 2011 at 7:19 PM, Florent Georges <lists@fgeorges.org> wrote:
Michael Seiferle wrote:
it sure is the most comfortable approach, I myself use the functx library via our repository extension. REPO INSTALL http://files.basex.org/xar/functx-1.0.xar
You can even find it directly from CXAN ;-)
-- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
participants (4)
-
Andy Bunce -
Christian Grün -
Florent Georges -
Michael Seiferle