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
Post a Comment