Mega Code Archive

 
Categories / VB.Net / XML
 

Attributes are not nodes, so will not be returned by the descendants axis

Imports <xmlns:aw = "http://www.domain.com"> Module Module1     Sub Main()         Dim xmlTree As XElement = _              <aw:Root aw:Att1="AttributeContent">                  <aw:Child>Some text                      <aw:GrandChild>element</aw:GrandChild>                  </aw:Child>              </aw:Root>         Dim de = From el In xmlTree...<aw:Child> _                  Select el         For Each el In de             Console.WriteLine(el.Name)         Next     End Sub End Module