Extensions.Attributes returns a filtered collection of the attributes : XML Attribute « XML « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » XML » XML AttributeScreenshots 
Extensions.Attributes returns a filtered collection of the attributes
 

Imports System
Imports System.Xml
Imports System.Xml.XPath

Public Class MainClass

    Public Shared Sub Main()
        Dim xmlTree As XElement = _
            <Root Att1="content1" Att2="content2">
                <Child1 Att1="content3" Att2="content4">
                </Child1>
                <Child2 Att1="content5" Att2="content6">
                </Child2>
            </Root>
        
        Dim attList = From att In xmlTree.Elements.Attributes("Att1"_
                                  Select att
        
        For Each att As XAttribute In attList
            Console.WriteLine(att)
        Next

    End Sub
End Class

   
  
Related examples in the same category
1.Use XmlElementAttribute and XmlAttributeAttributeUse XmlElementAttribute and XmlAttributeAttribute
2.Get the value of the ISBN attribute.
3.Gets an XmlAttributeCollection containing the list of attributes for this node.
4.Returns the value for the attribute with the specified name.
5.Returns the XmlAttribute with the specified name.
6.Whether the current node has any attributes.
7.Removes all specified attributes and children of the current node.
8.Removes all specified attributes from the element. Default attributes are not removed.
9.Removes an attribute by name.
10.Removes an attribute with the specified local name and namespace URI
11.Removes the attribute node with the specified index from the element
12.Removes the XmlAttribute specified by the local name and namespace URI
13.Adds the specified XmlAttribute.
14.Gets an XmlAttributeCollection containing the attributes of this node.
15.Removes all the child nodes and/or attributes of the current node.
16.Writes an attribute with the specified local name, namespace URI, and value.
17.Extensions.Attributes returns a collection of the attributes of every element in the source collection.
18.Extensions.Remove removes every attribute in the source collection from its parent element.
19.Cast attribute value to nullable integer
20.Check Nothing for attribute getting
21.Get attribute and parse to Integer
22.Attributes are not nodes, so will not be returned by the descendants axis
23.Get attribute with namespace
24.Gets the first attribute of this element.
25.XName Class represents a name of an XML element or attribute.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.