Skip to content
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

[xpath3.1] Lookup operator: restriction to maps and arrays #46

Open
michaelhkay opened this issue Dec 19, 2022 · 0 comments
Open

[xpath3.1] Lookup operator: restriction to maps and arrays #46

michaelhkay opened this issue Dec 19, 2022 · 0 comments

Comments

@michaelhkay
Copy link
Contributor

michaelhkay commented Dec 19, 2022

The title of section §3.11.3 ("The Lookup Operator ("?") for Maps and Arrays") strongly suggests that the operator is intended only to apply to maps and arrays. The rules for unary lookup state this explicitly, in §3.11.3.1. The rules for postfix lookup in §3.11.3.2 impose the same rule in the case where the the KeySpecifier is an NCName, IntegerLiteral, or Wildcard ("*"). But where the RHS is a parenthesised expression, the rules say

the expression E?(S) is equivalent to
for $e in E, $s in fn:data(S) return $e($s)

with no explicit check that $e is a map or array. The rules could therefore be interpreted as allowing the LHS to be a function item other than a map or array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@michaelhkay and others