Query XML with Linq to xml -


how retrieve value of element customer, result , reason using linq access.

 <?xml version="1.0"?>  <!doctype createaccount>   <createaccount>   <customer>tonytsund</customer>    <result>failed</result>    <reason>reseller/password combination unknown</reason>    </createaccount> 

try this:

xelement xe = xelement.load(ur xml);     var cusvalue = in xe.elements("customer")                    select a.value;     var resultvalue= in xe.elements("result")                       select a.value;     var reasonvalue= in xe.elements("reason")                       select a.value; 

Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

ios - How to Rectify the Relationship Fault in CoreData While parsing RESTKIT? -