using XElement.Parse to load Xml from String : XML Load « XML LINQ « VB.Net






using XElement.Parse to load Xml from String

    

Imports System
Imports System.Reflection
Imports System.Xml

Module Module1

    Sub Main()
        Dim doc As String = "<people>" & _
                     "<!-- Person section -->" & _
                         "<person>" & _
                          "<id>1</id>" & _
                          "<firstname>A</firstname>" & _
                          "<lastname>B</lastname>" & _
                          "<idrole>1</idrole>" & _
                         "</person>" & _
                           "</people>"
        Dim xml As XElement = XElement.Parse(doc)
        Console.WriteLine(xml)

    End Sub
End Module

   
    
    
    
  








Related examples in the same category

1.XElement.Parse (String) Loads an XElement from a string that contains XML.
2.XElement.Parse Method (String, LoadOptions) Loads an XElement from a string that contains XML
3.XElement.Parse(String, LoadOptions.SetLineInfo)
4.Load the Employees.xml and store the contents into an XElement object.
5.XElement.Load (String) loads an XElement from a file.
6.XElement.Load (String, LoadOptions) loads an XElement from a file
7.XElement.Load("Order.xml", LoadOptions.SetBaseUri Or LoadOptions.SetLineInfo)
8.XElement.Load (TextReader) loads an XElement from a TextReader.
9.XElement.Load(TextReader, LoadOptions) loads an XElement from a TextReader
10.XElement.Load(TextReader, LoadOptions.SetLineInfo)