System.Xml.Xsl.XsltOld.Processor.GetCompiledQuery C# (CSharp) 메소드

GetCompiledQuery() 개인적인 메소드

private GetCompiledQuery ( int key ) : Query
key int
리턴 Query
        internal Query GetCompiledQuery(int key) {
            Debug.Assert(key != Compiler.InvalidQueryKey);
            TheQuery theQuery = this.queryStore[key];
            theQuery.CompiledQuery.CheckErrors();
            Query expr = Query.Clone(this.queryList[key]);
            expr.SetXsltContext(new XsltCompileContext(theQuery._ScopeManager, this));
            return expr;
        }

Usage Example

예제 #1
0
        internal void SortNewNodeSet(Processor proc, ArrayList sortarray)
        {
            Debug.Assert(0 < sortarray.Count);
            int numSorts = sortarray.Count;
            XPathSortComparer comparer = new XPathSortComparer(numSorts);

            for (int i = 0; i < numSorts; i++)
            {
                Sort  sort = (Sort)sortarray[i] !;
                Query expr = proc.GetCompiledQuery(sort.select);

                comparer.AddSort(expr, new XPathComparerHelper(sort.order, sort.caseOrder, sort.lang, sort.dataType));
            }
            List <SortKey> results = new List <SortKey>();

            Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame");

            while (NewNextNode(proc))
            {
                XPathNodeIterator?savedNodeset = _nodeSet;
                _nodeSet = _newNodeSet;              // trick proc.Current node

                SortKey key = new SortKey(numSorts, /*originalPosition:*/ results.Count, _newNodeSet !.Current !.Clone());

                for (int j = 0; j < numSorts; j++)
                {
                    key[j] = comparer.Expression(j).Evaluate(_newNodeSet);
                }
                results.Add(key);

                _nodeSet = savedNodeset;                 // restore proc.Current node
            }
            results.Sort(comparer);
            _newNodeSet = new XPathSortArrayIterator(results);
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Processor::GetCompiledQuery