first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

C# Code: GetNamespaceManager() Member for Static XPathDocument Helper Class; Songhay.Xml.XmlUtility

/// <summary> /// Returns an <see cref="System.Xml.XmlNamespaceManager"/> /// with respect to the scope element of the specified node. /// </summary> /// <param name="XpNode"> /// The <see cref="System.Xml.XPath.XPathNavigator"/> node. /// </param> public static XmlNamespaceManager GetNamespaceManager(XPathNavigator XpNode) { XmlNamespaceManager nsman = new XmlNamespaceManager(XpNode.NameTable); IDictionary<String, String> names = XpNode.GetNamespacesInScope(XmlNamespaceScope.Local); foreach (KeyValuePair<String, String> kv in names) { nsman.AddNamespace(kv.Key, kv.Value); }

return nsman;

}

mod date: 2006-05-08T19:41:06.000Z