How to determine if XPath expression leads to node-set?

Given that any type other than node-set cannot be forced into the node set, how do we determine at run time if the result of the XPath expression is node-set? Although, I think, it does not matter, I use Sablotron for processing. Thanks in advance.

+3
source share
1 answer

You can request a maximum position. If it is greater than 1, the result will be a list:

max(some/path/position())
+1
source

Source: https://habr.com/ru/post/1720299/


All Articles