public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver) { bool flag; CompiledXpathExpr expr = new CompiledXpathExpr(new QueryBuilder().Build(xpath, out flag), xpath, flag); if (nsResolver != null) { expr.SetContext(nsResolver); } return(expr); }
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) { expr.SetContext(nsResolver); } return(expr); }