How to fake a non-existent XML node using XPath?

ct2k7

New Member
I know it's a bizarre question!The requirement is due to the existing code which expects the result of the XPath query to be a single node. Unfortunately, we are unable to make code changes at this time due to factors outside of our control (unless no workaround exists, which would probably mean that we would have to delay our release).In my case, the XPath currently returns an integer value (count):\[code\]count(/someNode/node)\[/code\]The code uses \[code\]XPathNavigator.SelectSingleNode()\[/code\] method, which, of course, fails because the result is not a node.Instead, I need the XPath to return a node, albeit a fake one. Is it possible? Note that because .NET is used, the XPath would have to be 1.0 (not 2.0).P.S. And, yes, we'll look into refactoring the code in question ASAP!
 
Back
Top