Gets the XNamespace object that corresponds to the xmlns URI (http://www.w3.org/2000/xmlns/).
using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass{
public static void Main(){
XNamespace aw = "http://www.domain.com";
XElement root = new XElement(aw + "Root",
new XAttribute(XNamespace.Xmlns + "aw", "http://www.domain.com"),
new XElement(aw + "Child", "content")
);
Console.WriteLine(root);
}
}
Related examples in the same category