Solved

xpath select from variable xpath

Posted on 2011-02-18
1
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 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