I need to see if a node exists within a particular XML document. If the node does not exist, then I would like to use another value. With XPath 1.0 this involves craziness using concat
. With XPath 2.0, I can get it to work with:
if (boolean(path-to-preferred-node)) then path-to-preferred-node else default-to-other-node
We need to use XPath 2.0 for this which rules out Nokogiri.
Any help would be greatly appreciated.