Solved

xpath select from variable xpath

Posted on 2011-02-18
1
328 Views
Last Modified: 2012-05-11
I don't understand why the following gives results
myNavigator.Select("myrun/exe/item[type='cett']/group/grouping[@itemval='e:\\eel.exe']/..")

but this doesn't
myNavigator.Select(myClass.xpathVal)
myClass.xpathVal equals exactly the same value.


edit: I think I just found out its because in the variable the escaped backslash each are escaped again so in my string variable its
e:\\\\ instead of e:\\
how do I resolve this? I'm getting the xpath string from a file and its needed to it to have \\
0
Comment
Question by:NewtonianB
1 Comment
 
LVL 8

Accepted Solution

by:
crysallus earned 500 total points
ID: 34931120
You could try putting an @ before the string when you assign it to the variable so it doesn't process escape sequences. Read this for more:

http://msdn.microsoft.com/en-us/library/362314fe%28v=vs.71%29.aspx
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Webform example, External Authentication Services, OAUTH, asp.net 4.6.2 1 31
XML SQL 8 25
MediaHelp 4 23
Can I command line build a C# application? 6 32
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question