Beispiel #1
0
        private void Compile(XPathNavigator stylesheet, System.Xml.XmlResolver resolver, Evidence evidence)
        {
            Compiler       compiler = (this.Debugger == null) ? new Compiler() : new DbgCompiler(this.Debugger);
            NavigatorInput input    = new NavigatorInput(stylesheet);

            compiler.Compile(input, resolver ?? XmlNullResolver.Singleton, evidence);
            this._CompiledStylesheet = compiler.CompiledStylesheet;
            this._QueryStore         = compiler.QueryStore;
            this._RootAction         = compiler.RootAction;
        }
Beispiel #2
0
        // Implementation

        private void Compile(XPathNavigator stylesheet, XmlResolver resolver)
        {
            Debug.Assert(stylesheet != null);

            Compiler       compiler = (Debugger == null) ? new Compiler() : new DbgCompiler(this.Debugger);
            NavigatorInput input    = new NavigatorInput(stylesheet);

            compiler.Compile(input, resolver ?? XmlNullResolver.Singleton);

            Debug.Assert(compiler.CompiledStylesheet != null);
            Debug.Assert(compiler.QueryStore != null);
            Debug.Assert(compiler.QueryStore != null);
            _CompiledStylesheet = compiler.CompiledStylesheet;
            _QueryStore         = compiler.QueryStore;
            _RootAction         = compiler.RootAction;
        }
Beispiel #3
0
        //
        // Implementation
        //

        private void StoreCompiledStylesheet(Stylesheet compiledStylesheet, ArrayList queryStore, RootAction rootAction)
        {
            Debug.Assert(queryStore != null);
            Debug.Assert(compiledStylesheet != null);
            Debug.Assert(rootAction != null);

            //
            // Set the new state atomically
            //

            // lock(this) {
            _CompiledStylesheet = compiledStylesheet;
            _QueryStore         = queryStore;
            _RootAction         = rootAction;
            //    }
        }
Beispiel #4
0
        internal void LoadCompiledStylesheet(out Stylesheet compiledStylesheet, out XPathExpression[] querylist, out ArrayList queryStore, out RootAction rootAction, XPathNavigator input) {
            //
            // Extract the state atomically
            //
            if (_CompiledStylesheet == null || _QueryStore == null || _RootAction == null) {
                throw new XsltException(Res.Xslt_NoStylesheetLoaded);
            }

            compiledStylesheet  = _CompiledStylesheet;
            queryStore          = _QueryStore;
            rootAction          = _RootAction;
            int queryCount      = _QueryStore.Count;
            querylist           = new XPathExpression[queryCount]; {
                bool canClone = input is DocumentXPathNavigator || input is XPathDocumentNavigator;
                for(int i = 0; i < queryCount; i ++) {
                    XPathExpression query = ((TheQuery)_QueryStore[i]).CompiledQuery;
                    querylist[i] = canClone ? query.Clone() : input.Compile(query.Expression);
                }
            }
        }
Beispiel #5
0
        //
        // Implementation
        //

        private void StoreCompiledStylesheet(Stylesheet compiledStylesheet, ArrayList queryStore, RootAction rootAction) {
            Debug.Assert(queryStore != null);
            Debug.Assert(compiledStylesheet != null);
            Debug.Assert(rootAction != null);

            //
            // Set the new state atomically
            //

           // lock(this) {
                _CompiledStylesheet = compiledStylesheet;
                _QueryStore         = queryStore;
                _RootAction         = rootAction;
            //    }
        }
Beispiel #6
0
        internal void LoadCompiledStylesheet(out Stylesheet compiledStylesheet, out XPathExpression[] querylist, out ArrayList queryStore, out RootAction rootAction, XPathNavigator input)
        {
            //
            // Extract the state atomically
            //
            if (_CompiledStylesheet == null || _QueryStore == null || _RootAction == null)
            {
                throw new XsltException(Res.Xslt_NoStylesheetLoaded);
            }

            compiledStylesheet = _CompiledStylesheet;
            queryStore         = _QueryStore;
            rootAction         = _RootAction;
            int queryCount = _QueryStore.Count;

            querylist = new XPathExpression[queryCount]; {
                bool canClone = input is DocumentXPathNavigator || input is XPathDocumentNavigator;
                for (int i = 0; i < queryCount; i++)
                {
                    XPathExpression query = ((TheQuery)_QueryStore[i]).CompiledQuery;
                    querylist[i] = canClone ? query.Clone() : input.Compile(query.Expression);
                }
            }
        }