-
Notifications
You must be signed in to change notification settings - Fork 85
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
Converting an empty node set to a number should return NaN #96
Labels
Comments
the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The expression
number(//non-existent-node)
should evaluate toNaN
but it currently evaluates to0
: I verified this by adding the following two tests which should pass, but they fail:This creates issues for instance with a document as follows
The query
//item[@v = preceding-sibling::item/@v + 1]
should return only the second item, but returns both instead. See http://xpather.com/atHhzd0d for an interactive example confirming that only the second item should match.Looking at the spec, it says that
number(node-set)
should first convert the node set to a string,string(node-set)
should return the empty string if the node set is empty,number("")
should returnNaN
.The text was updated successfully, but these errors were encountered: