David Thielen wrote:
I have the following xml:
<root>
<name>abc "123" xyz</name>
</root>
When I get an XPathNavigator to root and then call navigator.Evaluate("name
= \"abc \\\"123\\\" xyz"), I get an XPathException. I also tried \\" and " -
all throw an exception.
XPath allows both ' and " as the delimiters to string literals so in C#
a string literal like
"name = 'abc \"123\" xyz'"
should do, the outer " delimits the C#/.NET string, the ' delimits the
XPath string and \" is necessary to escape the double quote in the C#
string literal.
But there can be ugly situations with both ' and " used where you need
to split strings and use concat to build your XPath expression in a
syntactically correct way.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/