Posted By

danfsmith on 07/19/11


Tagged

xml Linq


Versions (?)

LINQ to XML - Query multiple elements and attributes


 / Published in: C#
 

  1. var loginQuery = from results in xdoc.Descendants("IODATA")
  2. select new
  3. {
  4. Name = results.Element("USER").Attribute("fullname").Value,
  5. ReturnedLoginGuid = results.Element("LOGIN").Attribute("guid").Value,
  6. ReturnedProjects = results.Element("USER").Element("LASTMODULES").Descendants("MODULE")
  7. };

Report this snippet  

You need to login to post a comment.