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