internal string GetStringQuery(int key) { Debug.Assert(key != Compiler.InvalidQueryKey); Debug.Assert(this.queryStore[key] is TheQuery); TheQuery theQuery = (TheQuery)this.queryStore[key]; return(theQuery.CompiledQuery.Expression); }
internal XPathExpression GetValueQuery(int key) { Debug.Assert(key != Compiler.InvalidQueryKey); Debug.Assert(this.queryStore[key] is TheQuery); TheQuery theQuery = (TheQuery)this.queryStore[key]; XPathExpression expr = this.queryList[key]; XsltCompileContext context = new XsltCompileContext(theQuery._ScopeManager, this); expr.SetContext(context); return(expr); }
internal int AddPatternQuery(string xpathQuery, bool allowVar, bool allowKey) { Debug.Assert(this.queryStore != null); try { TheQuery theQuery = new TheQuery(new CompiledXpathExpr(this.queryBuilder.BuildPatternQuery(xpathQuery, allowVar, allowKey), xpathQuery, false), this.scopeManager); int theKey = this.queryStore.Add(theQuery); Debug.Assert(this.queryStore[theKey] == theQuery); Debug.Assert(theKey == this.queryStore.Count - 1); return(theKey); } catch (XPathException e) { if (ForwardCompatibility) { return(InvalidQueryKey); } throw new XsltException(Res.Xslt_InvalidXPath, new string[] { xpathQuery }, e); } }
internal int AddPatternQuery(string xpathQuery, bool allowVar, bool allowKey) { Debug.Assert(this.queryStore != null); try { TheQuery theQuery = new TheQuery(new CompiledXpathExpr(this.queryBuilder.BuildPatternQuery(xpathQuery, allowVar, allowKey), xpathQuery, false) , this.scopeManager); int theKey = this.queryStore.Add(theQuery); Debug.Assert(this.queryStore[theKey] == theQuery); Debug.Assert(theKey == this.queryStore.Count - 1); return theKey; } catch (XPathException e) { if (ForwardCompatibility) { return InvalidQueryKey; } throw new XsltException(Res.Xslt_InvalidXPath, new string[] { xpathQuery }, e); } }