I have a textBox that contains a string values. I need to take this
string and use it as criteria for an XPath Expression. Here's what I
have. Why isn't it working???
string s = textBox1.Text;
XPathExpression expr;
expr = myXPathNavigator.Compile("/NewDataSet/note[@to=$s]");
----Matt
You can't retrieve variables values from inside an XPath expression like
that. the $var syntax works for XSLT only, in principle. In order to pass
variables (and at the same time gain a 50% perfm. boost), you can use the
approach explained in this post:
http://weblogs.asp.net/cazzu/archive/2003/10/07/30888.aspx
HTH,

Signature
Daniel Cazzulino
Lagash Systems SA
http://weblogs.asp.net/cazzu
> I have a textBox that contains a string values. I need to take this
> string and use it as criteria for an XPath Expression. Here's what I
[quoted text clipped - 7 lines]
>
> ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==----
> http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
> ---=
=---