Select all Descendants : Descendants « XML LINQ « VB.Net






Select all Descendants

  
Module Program

  Sub Main()
    Dim doc As XElement = XElement.Load("Inventory.xml")

    Dim petNames = From pn In doc.Descendants("PetName") Select pn.Value

    For Each name In petNames
      Console.WriteLine("Name: {0}", name)
    Next

  End Sub
End Module

   
    
  








Related examples in the same category

1.Query all Ford cars
2.Getting Descendants
3.Using Linq to get default in a Office 2007 word document
4.Select nodes from Descendants