Get Namespace URI, Prefix and LocalName : Xml Namespace « XML « C# / CSharp Tutorial






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


    public class MainClass
    {
        public static void Main()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(Application.StartupPath + @"\employees.xml");
            Console.WriteLine(doc.DocumentElement.NamespaceURI);
            Console.WriteLine(doc.DocumentElement.Prefix);
            Console.WriteLine(doc.DocumentElement.LocalName);
        }
    }








30.15.Xml Namespace
30.15.1.Select Nodes By Namespace
30.15.2.Get Namespace URI, Prefix and LocalName