How do we determine if an XPath expression results in a node-set?

682 Views Asked by At

Given that any type other than a node-set cannot be coerced into a node-set, how do we determine,at runtime, if the result of an XPath expression is a node-set? Although I guess it shouldn't matter, I'm using Sablotron for processing. Thanks in advance.

1

There are 1 best solutions below

0
On

You can ask for the maximum position. If it is greater than 1 the result is a list:

max(some/path/position())