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

FindTemplate() private method

private FindTemplate ( Processor processor, XPathNavigator navigator ) : TemplateAction
processor Processor
navigator System.Xml.XPath.XPathNavigator
return TemplateAction
        internal TemplateAction FindTemplate(Processor processor, XPathNavigator navigator) {
            Debug.Assert(processor != null && navigator != null);
            Debug.Assert(this.templates == null && this.modeManagers == null || this.templates == this.modeManagers[XmlQualifiedName.Empty]);

            TemplateAction action = null;

            //
            // Try to find template within this stylesheet first
            //

            if (this.templates != null) {
                action = this.templates.FindTemplate(processor, navigator);
            }

            //
            // If unsuccessful, search in imported documents from backwards
            //

            if (action == null) {
                action = FindTemplateImports(processor, navigator);
            }

            return action;
        }

Same methods

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

Usage Example

Ejemplo n.º 1
0
        internal TemplateAction FindTemplateImports(Processor processor, XPathNavigator navigator)
        {
            TemplateAction action = null;

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

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

                    //
                    // Search in imported stylesheet
                    //

                    action = stylesheet.FindTemplate(processor, navigator);

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

            return(action);
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Stylesheet::FindTemplate