In XPath evaluation, some evaluated part is required to be a nodeset. If not, it should result in error.
#342 (comment)
Examples:
# Function argument that requires nodeset
local-name(1)
sum("string")
count(1 < 2)
# Path after function that doesn't return a nodeset
# id("a")/path id("a")[predicate] is valid
string(a/b)[predicate]
string(a/b)/path
# Path after non-nodeset variable
$x[predicate]
$x/path
# Path after literal
"string"[predicate]
42/path
# Path after neg
-number(a/b)[predicate]
-number(a/b)/path
# Path after parenthesized expression
(1)[predicate]
(1)/path
In XPath evaluation, some evaluated part is required to be a nodeset. If not, it should result in error.
#342 (comment)
Examples: