Use this below code to get the list of all namespaces.
XPathDocument xdoc = new XPathDocument(string.Format(@ " {0}\[filename].xml",Environment.CurrentDirectory));
XPathNavigator nav = xdoc.CreateNavigator();
XPathNodeIterator nodes = (XPathNodeIterator)nav.Evaluate("//namespace::*");
while (nodes.MoveNext())
{
Console.WriteLine(string.Format("{0} : {1}", nodes.Current.Name, nodes.Current.Value));
}
No comments:
Post a Comment