Create XAttribute class from the specified name and value.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim dbl As Double = 12.345
Dim attArray As XAttribute() = { _
New XAttribute("Att4", 1), _
New XAttribute("Att5", 2), _
New XAttribute("Att6", 3) _
}
Dim dt As DateTime = New DateTime(2010, 10, 6, 12, 30, 0)
Dim root As XElement = <Root Att1="Some text"
Att2=<%= dbl %>
Att3=<%= dt %>
<%= attArray %>
/>
Console.WriteLine(root)
End Sub
End Class
Related examples in the same category