Inheritance: CompiledAction
 internal bool SetDefaultOutput(XsltOutput.OutputMethod method)
 {
     if (Output.Method != method)
     {
         this.output = this.output.CreateDerivedOutput(method);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        //
        // Construction
        //
        public Processor(
            XPathNavigator doc, XsltArgumentList args, XmlResolver resolver,
            Stylesheet stylesheet, List <TheQuery> queryStore, RootAction rootAction,
            IXsltDebugger debugger
            )
        {
            _stylesheet = stylesheet;
            _queryStore = queryStore;
            _rootAction = rootAction;
            _queryList  = new Query[queryStore.Count];
            {
                for (int i = 0; i < queryStore.Count; i++)
                {
                    _queryList[i] = Query.Clone(queryStore[i].CompiledQuery.QueryTree);
                }
            }

            _xsm         = new StateMachine();
            _document    = doc;
            _builder     = null;
            _actionStack = new HWStack(StackIncrement);
            _output      = _rootAction.Output;
            _resolver    = resolver ?? XmlNullResolver.Singleton;
            _args        = args ?? new XsltArgumentList();
            _debugger    = debugger;
            if (_debugger != null)
            {
                _debuggerStack  = new HWStack(StackIncrement, /*limit:*/ 1000);
                _templateLookup = new TemplateLookupActionDbg();
            }

            // Clone the compile-time KeyList
            if (_rootAction.KeyList != null)
            {
                _keyList = new Key[_rootAction.KeyList.Count];
                for (int i = 0; i < _keyList.Length; i++)
                {
                    _keyList[i] = _rootAction.KeyList[i].Clone();
                }
            }

            _scriptExtensions = new Hashtable(_stylesheet.ScriptObjectTypes.Count);
            {
                foreach (DictionaryEntry entry in _stylesheet.ScriptObjectTypes)
                {
                    string namespaceUri = (string)entry.Key;
                    if (GetExtensionObject(namespaceUri) != null)
                    {
                        throw XsltException.Create(SR.Xslt_ScriptDub, namespaceUri);
                    }
                    _scriptExtensions.Add(namespaceUri, Activator.CreateInstance((Type)entry.Value,
                                                                                 BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, null, null));
                }
            }

            this.PushActionFrame(_rootAction, /*nodeSet:*/ null);
        }
 private void CacheOuptutProps(XsltOutput output) {
     this.output        = output;
     this.isXmlOutput   = this.output.Method == XsltOutput.OutputMethod.Xml;
     this.isHtmlOutput  = this.output.Method == XsltOutput.OutputMethod.Html;
     this.cdataElements = this.output.CDataElements;
     this.indentOutput  = this.output.Indent;
     this.outputDoctype = this.output.DoctypeSystem != null || (this.isHtmlOutput && this.output.DoctypePublic != null);
     this.outputXmlDecl = this.isXmlOutput && ! this.output.OmitXmlDeclaration && ! this.omitXmlDeclCalled;
 }
Exemplo n.º 4
0
 private void CacheOuptutProps(XsltOutput output)
 {
     _output        = output;
     _isXmlOutput   = _output.Method == XsltOutput.OutputMethod.Xml;
     _isHtmlOutput  = _output.Method == XsltOutput.OutputMethod.Html;
     _cdataElements = _output.CDataElements;
     _indentOutput  = _output.Indent;
     _outputDoctype = _output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null);
     _outputXmlDecl = _isXmlOutput && !_output.OmitXmlDeclaration && !_omitXmlDeclCalled;
 }
 private void CacheOuptutProps(XsltOutput output)
 {
     this.output        = output;
     this.isXmlOutput   = this.output.Method == XsltOutput.OutputMethod.Xml;
     this.isHtmlOutput  = this.output.Method == XsltOutput.OutputMethod.Html;
     this.cdataElements = this.output.CDataElements;
     this.indentOutput  = this.output.Indent;
     this.outputDoctype = this.output.DoctypeSystem != null || (this.isHtmlOutput && this.output.DoctypePublic != null);
     this.outputXmlDecl = this.isXmlOutput && !this.output.OmitXmlDeclaration && !this.omitXmlDeclCalled;
 }
Exemplo n.º 6
0
 private void CacheOuptutProps(XsltOutput output)
 {
     _output = output;
     _isXmlOutput = _output.Method == XsltOutput.OutputMethod.Xml;
     _isHtmlOutput = _output.Method == XsltOutput.OutputMethod.Html;
     _cdataElements = _output.CDataElements;
     _indentOutput = _output.Indent;
     _outputDoctype = _output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null);
     _outputXmlDecl = _isXmlOutput && !_output.OmitXmlDeclaration && !_omitXmlDeclCalled;
 }
Exemplo n.º 7
0
        internal XsltOutput CreateDerivedOutput(OutputMethod method)
        {
            XsltOutput output = (XsltOutput)MemberwiseClone();

            output.method = method;
            if (method == OutputMethod.Html && this.indentSId == int.MaxValue)   // HTML output and Ident wasn't specified
            {
                output.indent = true;
            }
            return(output);
        }
Exemplo n.º 8
0
        //
        // Construction
        //
        public Processor(
            XPathNavigator doc, XsltArgumentList?args, XmlResolver?resolver,
            Stylesheet stylesheet, List <TheQuery> queryStore, RootAction rootAction,
            IXsltDebugger?debugger
            )
        {
            _stylesheet = stylesheet;
            _queryStore = queryStore;
            _rootAction = rootAction;
            _queryList  = new Query[queryStore.Count];
            {
                for (int i = 0; i < queryStore.Count; i++)
                {
                    _queryList[i] = Query.Clone(queryStore[i].CompiledQuery.QueryTree);
                }
            }

            _xsm         = new StateMachine();
            _document    = doc;
            _builder     = null;
            _actionStack = new HWStack(StackIncrement);
            _output      = _rootAction.Output;
            _resolver    = resolver ?? XmlNullResolver.Singleton;
            _args        = args ?? new XsltArgumentList();
            _debugger    = debugger;
            if (_debugger != null)
            {
                _debuggerStack  = new HWStack(StackIncrement, /*limit:*/ 1000);
                _templateLookup = new TemplateLookupActionDbg();
            }

            // Clone the compile-time KeyList
            if (_rootAction.KeyList != null)
            {
                _keyList = new Key[_rootAction.KeyList.Count];
                for (int i = 0; i < _keyList.Length; i++)
                {
                    _keyList[i] = _rootAction.KeyList[i].Clone();
                }
            }

            _scriptExtensions = new Hashtable(_stylesheet.ScriptObjectTypes.Count);
            {
                // Scripts are not supported on stylesheets
                if (_stylesheet.ScriptObjectTypes.Count > 0)
                {
                    throw new PlatformNotSupportedException(SR.CompilingScriptsNotSupported);
                }
            }

            this.PushActionFrame(_rootAction, /*nodeSet:*/ null);
        }
Exemplo n.º 9
0
 internal bool SetDefaultOutput(XsltOutput.OutputMethod method) {
     if(Output.Method != method) {
         this.output = this.output.CreateDerivedOutput(method);
         return true;
     }
     return false;
 }
Exemplo n.º 10
0
        //
        // Construction
        //
        public Processor(
            XPathNavigator doc, XsltArgumentList args, XmlResolver resolver,
            Stylesheet stylesheet, List<TheQuery> queryStore, RootAction rootAction,
            IXsltDebugger debugger
        ) {
            this.stylesheet = stylesheet;
            this.queryStore = queryStore;
            this.rootAction = rootAction;
            this.queryList  = new Query[queryStore.Count]; {
                for(int i = 0; i < queryStore.Count; i ++) {
                    queryList[i] = Query.Clone(queryStore[i].CompiledQuery.QueryTree);
                }
            }

            this.xsm                 = new StateMachine();
            this.document            = doc;
            this.builder             = null;
            this.actionStack         = new HWStack(StackIncrement);
            this.output              = this.rootAction.Output;
            this.permissions         = this.rootAction.permissions;
            this.resolver            = resolver ?? XmlNullResolver.Singleton;
            this.args                = args     ?? new XsltArgumentList();
            this.debugger            = debugger;
            if (this.debugger != null) {
                this.debuggerStack = new HWStack(StackIncrement, /*limit:*/1000);
                templateLookup     = new TemplateLookupActionDbg();
            }

            // Clone the compile-time KeyList
            if (this.rootAction.KeyList != null) {
                this.keyList = new Key[this.rootAction.KeyList.Count];
                for (int i = 0; i < this.keyList.Length; i ++) {
                    this.keyList[i] = this.rootAction.KeyList[i].Clone();
                }
            }

            this.scriptExtensions = new Hashtable(this.stylesheet.ScriptObjectTypes.Count); {
                foreach(DictionaryEntry entry in this.stylesheet.ScriptObjectTypes) {
                    string namespaceUri = (string)entry.Key;
                    if (GetExtensionObject(namespaceUri) != null) {
                        throw XsltException.Create(Res.Xslt_ScriptDub, namespaceUri);
                    }
                    scriptExtensions.Add(namespaceUri, Activator.CreateInstance((Type)entry.Value,
                        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null));
                }
            }

            this.PushActionFrame(this.rootAction, /*nodeSet:*/null);
        }