Solved

xpath select from variable xpath

Posted on 2011-02-18
1
326 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now