Mega Code Archive

 
Categories / VB.Net / XML LINQ
 

XAttribute NextAttribute Property gets the next attribute of the parent element

Imports System Imports System.Xml Imports System.Xml.XPath Public Class MainClass     Public Shared Sub Main()         Dim root As XElement = <Root Att1="1" Att2="2" Att3="3" Att4="4"/>         Dim att As XAttribute = root.FirstAttribute         Dim val As Boolean = True         Do             Console.WriteLine(att)             att = att.NextAttribute         Loop While (Not (att Is Nothing))     End Sub End Class