Converts the current XAttribute object to a string representation. : XAttribute « XML LINQ « VB.Net






Converts the current XAttribute object to a string representation.

 


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

Public Class MainClass

    Public Shared Sub Main()
        Dim root As XElement = <Root Att1="content1" Att2="content2" Att3="content3"/>
        Dim att As XAttribute = root.Attribute("Att2")
        Console.WriteLine(att.ToString())
    End Sub

End Class

   
  








Related examples in the same category

1.Build an XML element in memory
2.FirstName tag's parent has attributes
3.Query elements by attribute value
4.Using Linq Xml to query attribute
5.The element axis property (<>) and the attribute axis property (@) are used to access the id attribute.
6.XAttribute Class represents an XML attribute.
7.Create XAttribute class from the specified name and value.
8.XAttribute.IsNamespaceDeclaration
9.XAttribute.Name Property gets the expanded name of this attribute.
10.XAttribute.NextAttribute Property gets the next attribute of the parent element.
11.XAttribute.NodeType Property gets the node type for this node.
12.XAttribute.PreviousAttribute Property gets the previous attribute of the parent element.
13.XAttribute.Remove removes this attribute from its parent element.
14.XAttribute.SetValue sets the value of this attribute.
15.XAttribute.Value Property gets or sets the value of this attribute.
16.XAttribute object content
17.XAttribute object array content
18.XElement.Attribute returns the XAttribute of this XElement that has the specified XName.
19.ReplaceAll with an XAttribute object
20.ReplaceAll with an array of XAttribute objects
21.Add XAttribute with namespace to XElement
22.XAttribute with namespace