XPath query exception with Root node and namespacehttp://forums.asp.net/t/1770805.aspx/1?XPath+query+exception+with+Root+node+and+namespaceMon, 20 Feb 2012 03:00:35 -050017708054837799http://forums.asp.net/p/1770805/4837799.aspx/1?XPath+query+exception+with+Root+node+and+namespaceXPath query exception with Root node and namespace <p>I get an XPathException : &quot;namespace&quot; has an invalid token.</p> <p>I have the following XML:</p> <p><span>&lt;ArrayOfResponse xmlns:i=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://schemas.datacontract.org/2004/07/Blah.Blah&quot;&gt;</span><br> <span>&nbsp; &lt;Response&gt;</span><br> <span>&nbsp; &nbsp; &lt;Number&gt;396&lt;/Number&gt;</span><br> <span>&nbsp; &nbsp; &lt;ID&gt;33&lt;/ID&gt;</span><br> <span>&nbsp; &nbsp; &lt;UID&gt;1&lt;/UID&gt;</span><br> <span>&nbsp; &nbsp; &lt;VariableName&gt;Comments&lt;/VariableName&gt;</span><br> <span>&nbsp; &lt;/Response&gt;</span><br> <span>&lt;Response&gt;</span><br> <span>&nbsp; &nbsp; &lt;Number&gt;396&lt;/Number&gt;</span><br> <span>&nbsp; &nbsp; &lt;ID&gt;33&lt;/ID&gt;</span><br> <span>&nbsp; &nbsp; &lt;UID&gt;1&lt;/UID&gt;</span><br> <span>&nbsp; &nbsp; &lt;VariableName&gt;Comments&lt;/VariableName&gt;</span><br> <span>&nbsp; &lt;/Response&gt;</span><br> <span>&lt;Response&gt;</span><br> <span>&nbsp; &nbsp; &lt;Number&gt;396&lt;/Number&gt;</span><br> <span>&nbsp; &nbsp; &lt;ID&gt;33&lt;/ID&gt;</span><br> <span>&nbsp; &nbsp; &lt;UID&gt;1&lt;/UID&gt;</span><br> <span>&nbsp; &nbsp; &lt;VariableName&gt;Comments&lt;/VariableName&gt;</span><br> <span>&nbsp; &lt;/Response&gt;</span><br> <span>&lt;/ArrayOfResponse&gt;</span></p> <p><span><br> </span></p> <p><span>If I don't have the namespace in the root node it works just fine. But with the namespace it doesn't work. How can i get this XPath query to work?</span></p> <p></p> 2012-02-17T14:55:30-05:004839269http://forums.asp.net/p/1770805/4839269.aspx/1?Re+XPath+query+exception+with+Root+node+and+namespaceRe: XPath query exception with Root node and namespace <p>So what do you want to do now</p> 2012-02-19T01:32:43-05:004840121http://forums.asp.net/p/1770805/4840121.aspx/1?Re+XPath+query+exception+with+Root+node+and+namespaceRe: XPath query exception with Root node and namespace <p>Hi tripower,</p> <p>&nbsp; &nbsp; &nbsp; &nbsp;May i get to know why you have put namespaces there in &quot;<span>ArrayOfResponse</span>&quot; Node ? Any Specific reason to put them over there ?</p> 2012-02-20T03:00:35-05:00