IEnumerable with namespace : XNamespace « XML LINQ « VB.Net






IEnumerable with namespace

   


Imports System
Imports System.Xml
Imports System.Xml.XPath
Imports System.Collections
Imports System.Collections.Generic
        Imports <xmlns:aw="http://www.domain.com">
        
        Module Module1
            Sub Main()
                Dim xmlTree As XElement = <aw:Root aw:Att1="content1" aw:Att2="content2"/>
        
                Dim attList As IEnumerable(Of XAttribute) = _
                    From at In xmlTree.Attributes() _
                    Select at
        
                For Each att In attList
                    Console.WriteLine(att)
                Next
            End Sub
        End Module

   
    
    
  








Related examples in the same category

1.Using the Xml name space in the query
2.Import namespace
3.XNamespace Class represents an XML namespace.
4.Combines an XNamespace object with a local name to create an XName.
5.Returns a value indicating whether two instances of XNamespace are equal.
6.XNamespace.Equals determines whether the specified XNamespace is equal to the current XNamespace.
7.XNamespace.Get gets an XNamespace for the specified Uniform Resource Identifier (URI).
8.XNamespace.GetName returns an XName object created from this XNamespace and the specified local name.
9.XNamespace.Inequality Operator
10.XNamespace.NamespaceName Property gets the Uniform Resource Identifier (URI) of this namespace.
11.XNamespace.None Property gets the XNamespace object that corresponds to no namespace.
12.XNamespace.ToString returns the URI of this XNamespace.
13.XNamespace.Xml Property gets the XNamespace object that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace).
14.XNamespace.Xmlns Property gets the XNamespace object that corresponds to the xmlns URI (http://www.w3.org/2000/xmlns/).
15.XNamespace Implicit Conversion (String to XNamespace)
16.Selects an XElement using a XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.
17.Extensions.XPathSelectElement selects XElement using a XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.
18.XElement with namespace
19.XElement.GetDefaultNamespace gets the default XNamespace of this XElement.
20.XElement.GetNamespaceOfPrefix gets the namespace associated with a particular prefix for this XElement.
21.XElement.GetPrefixOfNamespace gets the prefix associated with a namespace for this XElement.
22.Imports namespace for XElement
23.Check for namespace for XElement
24.Add namespace to XElement
25.Reference namespace in XElement