XpathNavigator giving System.Xml.XPath.XPathException because of a single quote



I have the following code



XPathNavigator nav = doc.CreateNavigator();
XPathExpression expr;
expr = nav.Compile("//somePath/FieldData[@Location='Payer's Name']/@Value");


The single quote gives the exception System.Xml.XPath.XPathException. I have tried escaping it with a slash ('\'), ('), double single quotes. Nothing seems to work though. Any idea how to resolve this?


No comments:

Post a Comment