how to compare ?

C

C# newbie

Hi,

I've written a small program which using xpath finds some items into an xml
file. since I've used a query like
"//*[contains(translate(.,\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",
\"abcdefghijklmnopqrstuvwxyz\")," + "\"" + "Item I'm looking for" + "\")]

Long story short, the above query searches all sections of the xml file.
But I need to capture only paths which item has been found, of course there
are so many paths among that the item has not been within them but are
traversed anyway.
I tried to use substring to compare entered item (by user) with found item
as below but didn't give me what I was expecting:

if (xnode.Name.Substring(0, txtItemLookingFor.Text.Length) ==
txtItemLookingFor.Text)


How can I captrue only those paths which item has been encoutered ? and
ignore the rest ?


Your help would be appreciated greatly
Newbie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top