Solved

xpath select from variable xpath

Posted on 2011-02-18
1
331 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
array not updating 8 43
XSL for-each loop - Excluding specific text 4 33
What!!!??? 5 63
Of the three languages, C, C++ and C# is any one of them faster than the other? 3 73
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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!
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 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