-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrapping nodes using for-each after an arrow-operator #1960
Comments
I can confirm that BaseX and Saxon both produce the correct result as indicated by @line-o, whilst eXist-db returns the incorrect result |
Thanks for the edit @adamretter, looks much better. For example this will fail with a duplicate attribute exception err:XQDY0025: (<item n="1"/>, <item n="2"/>, <item n="3"/>)
=> for-each(function ($item as item()) as element(a) { <a>{$item/@n}</a> }) |
(1,2,3) => for-each(function ($a) {<a>{xs:string($a)}</a>}) does also trigger the behaviour while (1,2,3) => for-each(function ($a) {<a>{$a}</a>}) does not |
Added a test case for wrapping atomic values with explicit type conversion. |
Hint from @wolfgangmm
|
It turns out, that it is the context that is handed down to the called function. The spec clearly states that the focus (context etc.) must not be present in the called function. Also, more functions are affected:
|
What is the problem
Wrapping nodes in a function used in
fn:for-each
after an Arrow Operator incorrectly outputs one element per item in the source sequence.returns
What did you expect
Describe how to reproduce or add a test
2 tests:
ao:wrap-atomic-sequence
does workao:wrap-element-sequence
outputs 9 instead of 3Context information
The text was updated successfully, but these errors were encountered: