Senacor Technologies Aktiengesellschaft - Sitz: Eschborn - Amtsgericht Frankfurt am Main - Reg.-Nr.: HRB 105546
Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender: Daniel Grözinger
Hi Giuseppe,
There has been some open discussion on the semantics of the XQuery
arrow operator in the W3 XML Query Group [1]. Back then, it was
decided that the left operand of the arrow operator is to be rewritten
as the first argument of the invoked function.
If your query returns a single item, you can use the simple map operator:
your query ! file:write("yourPath", .)
If not, you will have to use a FLWOR expression or similar constructs.
Cheers,
Christian
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=26889
On Wed, Jul 4, 2018 at 6:21 PM Giuseppe Celano
<celano@informatik.uni-leipzig.de> wrote:
Hi All,
I was wondering if there is a way to take full advantage of the arrow operator with file:write(). If I want to write the results of a query, it would be ideal, I think, if the first parameter of file:write() were the content to write and the second the path: in this case I could have: my query => file:write("myPath"), where I could easily comment out "=> file:write("myPath")", if needed. However, the first parameter of file:write() is the path, so I end up with using the function in the way I usually use all the other functions (this is not a big problem, but I was wondering if I could take advantage of the arrow operator here: wouldn't it be better to have the path as the second parameter in file:write()?).
Ciao,
Giuseppe