System.Xml.Xsl.XsltOld.TemplateManager.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) {
            if (this.templates == null) {
                return null;
            }

            Debug.Assert(this.templates != null);
            for (int templateIndex = this.templates.Count - 1; templateIndex >= 0 ; templateIndex --) {
                TemplateAction action = (TemplateAction) this.templates[templateIndex];
                int matchKey = action.MatchKey;

                if (matchKey != Compiler.InvalidQueryKey) {
                    if (processor.Matches(navigator, matchKey)) {
                        return action;
                    }
                }
            }

            return null;
        }
    }

Usage Example

Ejemplo n.º 1
0
        internal TemplateAction FindTemplate(Processor processor, XPathNavigator navigator)
        {
            Debug.Assert(processor != null && navigator != null);
            Debug.Assert(_templates == null && _modeManagers == null || _templates == _modeManagers[XmlQualifiedName.Empty]);

            TemplateAction action = null;

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

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

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

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

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