Hello Jan On 26/02/14 18:23, Jan Techter wrote:
Dear basex people,
I am new to this mailing list. So 'hello' first of all.
Hello to you, too :) Always happy to have new users.
In my understanding of xquery the following expressions should be equivalent
/self::match/string()
/string(self::match)
But running
xquery count((<match>foo</match>, <test>test</test>, <match>bar</match>)/self::match/string())
xquery count((<match>foo</match>, <test>test</test>, <match>bar</match>)/string(self::match))
I don't think these two expressions are the same and hence this does not seem to be a bug. According to the spec, string($arg) returns a zero length string, if $arg is an empty sequence. As self::match will return an empty sequence for the second element in the sequence (the <test /> element), this will result to a string and thus will be counted in the resulting expression. Hope this helps. Cheers, Dirk -- 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