Mega Code Archive

 
Categories / VB.Net / XML LINQ
 

Extensions Descendants

Imports System Imports System.Xml Imports System.Xml.XPath Public Class MainClass     Public Shared Sub Main()         Dim xmlTree As XElement = _             <Root>                 <Para>                     <t>This is some text </t>                     <b>                         <t>where</t>                     </b>                     <t>test</t>                 </Para>                          <Para>                     <t>This is a second sentence.</t>                 </Para>             </Root>                  Dim elList = From el In xmlTree.<Para>.Descendants _                                 Select el                  For Each el As XElement In elList             Console.WriteLine(el)         Next     End Sub End Class