c# - XMl Search and filter in windows phone -


<?xml version="1.0" encoding="utf-8"?>  <root>   <player>     <playerid>1234</playerid>     <playername>abcd</playername>     <line>       <studentid>5612</studentid>       <studentname>wxyz</studentname>    </line>    </player> </root> 

above shown xml,

i have show "studentname" xml filter "playername" so, how should it? thanks!

you can use linq2xml. try this:

string xml = @"<?xml version='1.0' encoding='utf-8'?> <root>   <player>     <playerid>1234</playerid>     <playername>abcd</playername>     <line>       <studentid>5612</studentid>       <studentname>wxyz</studentname>    </line>    </player> </root>";  var doc = xdocument.parse(xml);  string studentname = (string)doc.descendants("player")                .where(p => (string)p.element("playername") == "abcd")                .descendants("studentname").first(); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -