FindTemplate() приватный Метод

private FindTemplate ( Processor processor, XPathNavigator navigator ) : TemplateAction
processor Processor
navigator System.Xml.XPath.XPathNavigator
Результат TemplateAction
Пример #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);
        }
Пример #2
0
        internal TemplateAction FindTemplate(Processor processor, XPathNavigator navigator, XmlQualifiedName mode)
        {
            Debug.Assert(processor != null && navigator != null);
            Debug.Assert(mode != null);
            TemplateAction action = null;

            //
            // Try to find template within this stylesheet first
            //
            if (_modeManagers != null)
            {
                TemplateManager manager = (TemplateManager)_modeManagers[mode];

                if (manager != null)
                {
                    Debug.Assert(manager.Mode.Equals(mode));
                    action = manager.FindTemplate(processor, navigator);
                }
            }

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

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

            return(action);
        }