Is there a way to identify what the return type of an XPath evaluation would be? I want XPath to match as generically as possible. It should match a nodelist, and if can’t, a node, and if can’t, a value. Is there an easy way to implement this in Java?
Share
There are many difficulties with the design of the JAXP XPath API and this is one of them. Consider using Saxon as your XPath processor, which will (a) enable you to use XPath 2.0, and (b) give you the benefits of the much richer s9api API. [Shameless plug]