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);
}