Dear all,
Calling methods from a QueryModule works nicely, yet I can't seem to get a particular method signature to work from XQuery. The function in question should be passed a string and the result of a path expression, yielding attribute values as strings. For example:
ns:method($value, $context/ancestor-or-self::*/@some-attr/string())
Intuitively, I figure the signature for this method in the QueryModule should be:
public String method(Str previous, Value additionals) { ...
However, trying to use this method with BaseX won't work. The query editor accepts the syntax, but states "PXML:combine method: no empty sequence allowed".
Changing the signature to Seq, ItemSeq or even Empty changes nothing; it keeps telling me (I think) the expression *could* yield an empty sequence and the method does not support it (even tho Empty is a valid value for Value, is it not?).
How would I define my method so that BaseX will accept it?
Kind regards,
Mattijs Ugen
Hi Mattijs,
thanks for your mail. I removed a check for empty sequences in our code base that looked obsolete to me [1]. Feel free to check out the latest snapshot [2] and give us some feedback if the problem persists.
Christian
[1] https://github.com/BaseXdb/basex/commit/f98e6200bef66409f3a70a94b0352cc383eb... [2] http://files.basex.org/releases/latest/
___________________________
On Sun, Jun 17, 2012 at 1:50 PM, Mattijs Ugen m.ugen@student.utwente.nl wrote:
Dear all,
Calling methods from a QueryModule works nicely, yet I can't seem to get a particular method signature to work from XQuery. The function in question should be passed a string and the result of a path expression, yielding attribute values as strings. For example:
ns:method($value, $context/ancestor-or-self::*/@some-attr/string())
Intuitively, I figure the signature for this method in the QueryModule should be:
public String method(Str previous, Value additionals) { ...
However, trying to use this method with BaseX won't work. The query editor accepts the syntax, but states "PXML:combine method: no empty sequence allowed".
Changing the signature to Seq, ItemSeq or even Empty changes nothing; it keeps telling me (I think) the expression *could* yield an empty sequence and the method does not support it (even tho Empty is a valid value for Value, is it not?).
How would I define my method so that BaseX will accept it?
Kind regards,
Mattijs Ugen _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Thanks for your reply, I'll give it a go as soon as I get the chance.
Managed to work around the issue for now using a double join-string, curious what kind of performance impact that has had :)
Mattijs
On 06/17/2012 08:50 PM, Christian Grün wrote:
Hi Mattijs,
thanks for your mail. I removed a check for empty sequences in our code base that looked obsolete to me [1]. Feel free to check out the latest snapshot [2] and give us some feedback if the problem persists.
Christian
[1] https://github.com/BaseXdb/basex/commit/f98e6200bef66409f3a70a94b0352cc383eb... [2] http://files.basex.org/releases/latest/
On Sun, Jun 17, 2012 at 1:50 PM, Mattijs Ugenm.ugen@student.utwente.nl wrote:
Dear all,
Calling methods from a QueryModule works nicely, yet I can't seem to get a particular method signature to work from XQuery. The function in question should be passed a string and the result of a path expression, yielding attribute values as strings. For example:
ns:method($value, $context/ancestor-or-self::*/@some-attr/string())
Intuitively, I figure the signature for this method in the QueryModule should be:
public String method(Str previous, Value additionals) { ...
However, trying to use this method with BaseX won't work. The query editor accepts the syntax, but states "PXML:combine method: no empty sequence allowed".
Changing the signature to Seq, ItemSeq or even Empty changes nothing; it keeps telling me (I think) the expression *could* yield an empty sequence and the method does not support it (even tho Empty is a valid value for Value, is it not?).
How would I define my method so that BaseX will accept it?
Kind regards,
Mattijs Ugen _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Is it me or is the current latest build missing the package org.basex.query.item ?
Running the GUI from the commandline gives an healthy amount of spam stating classes from that packages cant be found. Builds for 7.2 do have this package included.
Using BaseX.jar from the root of the zip.
Mattijs
Is it me or is the current latest build missing the package org.basex.query.item ?
The "item" package has been renamed to "value".
My bad, i was importing a stale version of my module, compiled against BaseX.jar version 7.2.1.
Furthermore, I can confirm your fix works for me; using Value in the method signature now works as previously expected.
Thanks for your quick fix!
Mattijs
basex-talk@mailman.uni-konstanz.de