XAttribute.IsNamespaceDeclaration
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim root As XElement = <aw:Root xmlns:aw='http://www.domain.com'
aw:Att='content'/>
For Each att As XAttribute In root.Attributes()
If (att.IsNamespaceDeclaration) Then
Console.WriteLine("{0} is a namespace declaration", att.Name)
Else
Console.WriteLine("{0} is not a namespace declaration", att.Name)
End If
Next
End Sub
End Class
Related examples in the same category