GetNamespaces() static private method

static private GetNamespaces ( IXmlNamespaceResolver resolver ) : XmlNamespaceManager
resolver IXmlNamespaceResolver
return System.Xml.XmlNamespaceManager
コード例 #1
0
        public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver)
        {
            bool              hasPrefix;
            Query             query = new QueryBuilder().Build(xpath, out hasPrefix);
            CompiledXpathExpr expr  = new CompiledXpathExpr(query, xpath, hasPrefix);

            if (null != nsResolver)
            {
                XmlNamespaceManager mngr = XPathNavigator.GetNamespaces(nsResolver);
                expr.SetContext(mngr);
            }
            return(expr);
        }