Query in an XML file - C #

2

I have an application on windows phone 8.1 where an XML file is displayed in a listBox , and in that application it has a textbox for the user to search for content that is displayed by% with%.

My question is: how do I make this query, so that select covers all the tags in my document?

    
asked by anonymous 19.07.2015 / 09:21

2 answers

1

You can make a select using linq , as follows:

var query = from element in root.Elements
where (string)element.Attribute ("atr") == "search" 
select element;

My example is a very simple query, because as you did not post the code you already have, I do not know what your real need is.

    
19.07.2015 / 21:25
0

You can use an XPATH syntax you have a syntax tutorial here.

In C # you can get write XPATH query using XmlDocument.SelectNodes

    
11.06.2016 / 20:29