Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / January 2004

Tip: Looking for answers? Try searching our database.

Using Variables in XPath Expression

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rustyfancy - 29 Jan 2004 02:59 GMT
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
Daniel Cazzulino - 30 Jan 2004 18:36 GMT
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
> ---=
=---

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.