no value assigned to external variables in xq when running bxs->bxs->xq
Hello, I am using basex 9.0.1 and have this 3 files:
test.xq: declare variable $test external; $test
test.bxs:
<commands>
<set option="BINDINGS">test=foo</set>
<run file="test.xq"/>
</commands>run.bxs:
<commands>
<run file="test.bxs"/>
</commands>Running test.bxs is okay
basex -v test.bxs
BINDINGS: test=foo
foo
Query "test.xq" executed in 5.4 ms.
basex -v run.bxs
BINDINGS: test=foo
Stopped at test.xq, 1/18:
[XPDY0002] No value assigned to $test.
It look like the bindings in test.bxs get lost, when executing the superior run.bxs. Is there any solution solving this problem? 8.6.7 does not work as well.
regard Thomas
echo "declare variable \$test external; \$test" > test.xq;
echo "<commands><set option=\"BINDINGS\">test=foo</set><run
file=\"test.xq\"/></commands>" > test.bxs;
echo "<commands><run file=\"test.bxs\"/></commands>" > run.bxs;
basex -v test.bxs;
basex -v run.bxsHi Thomas,
Thanks for the reproducible example, always appreciated. I have added an issue for that [1], and I’ll look into it soon.
Best, Christian
Quoted text · Freihalter Thomas · 44 lines
On Fri, May 25, 2018 at 8:32 AM, Freihalter Thomas <thomas.freihalter at my-box.de> wrote: > Hello, > I am using basex 9.0.1 > and have this 3 files: > > test.xq: > declare variable $test external; $test > > test.bxs: > <commands> > <set option="BINDINGS">test=foo</set> > <run file="test.xq"/> > </commands> > > run.bxs: > <commands> > <run file="test.bxs"/> > </commands> > > Running test.bxs is okay > basex -v test.bxs > BINDINGS: test=foo > foo > Query "test.xq" executed in 5.4 ms. > > basex -v run.bxs > BINDINGS: test=foo > Stopped at test.xq, 1/18: > [XPDY0002] No value assigned to $test. > > It look like the bindings in test.bxs get lost, when executing the > superior run.bxs. Is there any solution solving this problem? > 8.6.7 does not work as well. > > regard > Thomas > > echo "declare variable \$test external; \$test" > test.xq; > echo "<commands><set option=\"BINDINGS\">test=foo</set><run > file=\"test.xq\"/></commands>" > test.bxs; > echo "<commands><run file=\"test.bxs\"/></commands>" > run.bxs; > basex -v test.bxs; > basex -v run.bxs
The issue could be resolved (variables specified via BINDINGS will now only be resolved at compile time); a new snapshot is available.
Quoted text · Christian Grün · 59 lines
On Fri, May 25, 2018 at 2:00 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Thomas, > > Thanks for the reproducible example, always appreciated. I have added > an issue for that [1], and I’ll look into it soon. > > Best, > Christian > > [1] https://github.com/BaseXdb/basex/issues/1572 > > > > On Fri, May 25, 2018 at 8:32 AM, Freihalter Thomas > <thomas.freihalter at my-box.de> wrote: > > Hello, > > I am using basex 9.0.1 > > and have this 3 files: > > > > test.xq: > > declare variable $test external; $test > > > > test.bxs: > > <commands> > > <set option="BINDINGS">test=foo</set> > > <run file="test.xq"/> > > </commands> > > > > run.bxs: > > <commands> > > <run file="test.bxs"/> > > </commands> > > > > Running test.bxs is okay > > basex -v test.bxs > > BINDINGS: test=foo > > foo > > Query "test.xq" executed in 5.4 ms. > > > > basex -v run.bxs > > BINDINGS: test=foo > > Stopped at test.xq, 1/18: > > [XPDY0002] No value assigned to $test. > > > > It look like the bindings in test.bxs get lost, when executing the > > superior run.bxs. Is there any solution solving this problem? > > 8.6.7 does not work as well. > > > > regard > > Thomas > > > > echo "declare variable \$test external; \$test" > test.xq; > > echo "<commands><set option=\"BINDINGS\">test=foo</set><run > > file=\"test.xq\"/></commands>" > test.bxs; > > echo "<commands><run file=\"test.bxs\"/></commands>" > run.bxs; > > basex -v test.bxs; > > basex -v run.bxs >
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.