System.Xml.Xsl.XsltOld.Stylesheet.FindTemplateImports C# (CSharp) Method

FindTemplateImports() private method

private FindTemplateImports ( Processor processor, XPathNavigator navigator ) : TemplateAction
processor Processor
navigator System.Xml.XPath.XPathNavigator
return TemplateAction
        internal TemplateAction FindTemplateImports(Processor processor, XPathNavigator navigator) {
            TemplateAction action = null;

            //
            // Do we have imported stylesheets?
            //

            if (this.imports != null) {
                for (int importIndex = this.imports.Count - 1; importIndex >= 0; importIndex --) {
                    Debug.Assert(this.imports[importIndex] is Stylesheet);
                    Stylesheet stylesheet = (Stylesheet) this.imports[importIndex];
                    Debug.Assert(stylesheet != null);

                    //
                    // Search in imported stylesheet
                    //

                    action = stylesheet.FindTemplate(processor, navigator);

                    if (action != null) {
                        return action;
                    }
                }
            }

            return action;
        }

Same methods

Stylesheet::FindTemplateImports ( Processor processor, XPathNavigator navigator, XmlQualifiedName mode ) : TemplateAction

Usage Example

Ejemplo n.º 1
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);

            Action action = null;

            if (this.mode != null)
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node, this.mode);
            }
            else
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node)
                    : importsOf.FindTemplateImports(processor, frame.Node);
            }

            // Built-int template rules
            if (action == null)
            {
                action = BuiltInTemplate(frame.Node);
            }

            // Jump
            if (action != null)
            {
                frame.SetAction(action);
            }
            else
            {
                frame.Finished();
            }
        }