Re: [basex-talk] A question about the arrow operator and predicates

2021-03-31 Thread Christian Grün
> > As always, thank you so much! > As always, you're welcome! As a follow up, for my layman's thinking about XPath/XQuery, is this >> effectively creating a sequence > > It does. The expression is completely equivalent to, and just another writing for: tokenize($s, "/").

Re: [basex-talk] A question about the arrow operator and predicates

2021-03-31 Thread Bridger Dyson-Smith
Christian - As always, thank you so much! On Wed, Mar 31, 2021 at 10:35 AM Christian Grün wrote: > Dear Bridger, > > > I was wondering if anyone would have an insight for me as to why the > following expression is wrong: > > > > for $s in ("/a/b/c", "/1/2/3") > > let $t := $s =>

Re: [basex-talk] A question about the arrow operator and predicates

2021-03-31 Thread Christian Grün
Dear Bridger, > I was wondering if anyone would have an insight for me as to why the > following expression is wrong: > > for $s in ("/a/b/c", "/1/2/3") > let $t := $s => tokenize("/")[last()] > return $t This is due to the grammar rules of XQuery 3.1, which mandate that “=>” is followed by an

[basex-talk] A question about the arrow operator and predicates

2021-03-31 Thread Bridger Dyson-Smith
Hi all - I was wondering if anyone would have an insight for me as to why the following expression is wrong: ``` for $s in ("/a/b/c", "/1/2/3") let $t := $s => tokenize("/")[last()] return $t ``` This is because of the predicate filter, but I'm not clear on *why* it's because of that :) Thanks