RSS 2.0
Sign In
# Saturday, November 3, 2018

Recently we observed how we solved the same task in different versions of XPath: 2.0, 3.0, and 3.1.

Consider, you have a sequence $items, and you want to call some function over each item of the sequence, and to return combined result.

In XPath 2.0 this was solved like this:

for $item in $items return

In XPath 3.0 this was solved like this:


And now with XPath 3.1 that defined an arrow operator => we attempted to write something as simple as:


That is definitely not working, as it is the same as f:func($items).

Next attempt was:


That even does not compile.

So, finally, working expression using => looks like this:


This looks like a step back comparing to XPath 3.0 variant.

More than that, XPath grammar of arrow operator forbids the use of predictes, axis or mapping operators, so this won't compile:


Our conclusion is that arrow operator is rather confusing addition to XPath.

Saturday, November 3, 2018 8:59:28 PM UTC  #    Comments [0] -
Thinking aloud | xslt
Comments are closed.
<November 2018>
Total Posts: 387
This Year: 3
This Month: 0
This Week: 0
Comments: 1289
Locations of visitors to this page
The opinions expressed herein are our own personal opinions and do not represent our employer's view in anyway.

© 2024, Nesterovsky bros
All Content © 2024, Nesterovsky bros
DasBlog theme 'Business' created by Christoph De Baene (delarou)