Use XElement.Parse to parse an element document : XElement : XML LINQ C# Source Code


Custom Search

C# Source Code » XML LINQ » XElement »

 

Use XElement.Parse to parse an element document








    
 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Reflection;
using System.Xml.Linq;

class Program {
    static void Main(string[] args) {
        string doc = @"<people>
                          <!-- Employee section -->
                          <person>
                            <id>1</id>
                            <firstname>C</firstname>
                            <lastname>L</lastname>
                            <idrole>1</idrole>
                          </person>
                           </people>";
        XElement xml = XElement.Parse(doc);
        Console.WriteLine(xml);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo XML LINQ
» XElement