Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 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);
     }
 }
Exemple #4
0
 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);
     }
 }