Read Namespace from XElement : Namespace « XML LINQ « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;

    public class MainClass
    {
        public static void Main()
        {
            XElement root = XElement.Load(Application.StartupPath + @"\employees.xml");
            Console.WriteLine(root.Name.NamespaceName);
            Console.WriteLine(root.Name.LocalName);
            Console.WriteLine(root.Name.ToString());
        }

    }








31.5.Namespace
31.5.1.Namespace Construction
31.5.2.Read Namespace from XElement