Get XML Nodes in a Specific XML Namespace : Namespace : XML C# Source Code


Custom Search

C# Source Code » XML » Namespace »

 

Get XML Nodes in a Specific XML Namespace








    
 

using System;
using System.Xml;

public class SelectNodesByNamespace {

    private static void Main() {

        XmlDocument doc = new XmlDocument();
        doc.Load("Order.xml");

        XmlNodeList matches = doc.GetElementsByTagName("*","http://mycompany/OrderML");

        foreach (XmlNode node in matches) {

            Console.Write(node.Name + "\t");
            foreach (XmlAttribute attribute in node.Attributes) {
                Console.Write(attribute.Value + "  ");
            }
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo XML
» Namespace