System.Xml.Xsl.IlGen.XmlILVisitor.VisitDataSource C# (CSharp) Method

VisitDataSource() protected method

Generate code for QilNodeType.DataSource.
Generates code to retrieve a document using the XmlResolver.
protected VisitDataSource ( QilDataSource ndSrc ) : QilNode
ndSrc System.Xml.Xsl.Qil.QilDataSource
return QilNode
        protected override QilNode VisitDataSource(QilDataSource ndSrc) {
            LocalBuilder locNav;

            // XPathNavigator navDoc = runtime.ExternalContext.GetEntity(uri)
            this.helper.LoadQueryContext();
            NestedVisitEnsureStack(ndSrc.Name);
            NestedVisitEnsureStack(ndSrc.BaseUri);
            this.helper.Call(XmlILMethods.GetDataSource);

            locNav = this.helper.DeclareLocal("$$$navDoc", typeof(XPathNavigator));
            this.helper.Emit(OpCodes.Stloc, locNav);

            // if (navDoc == null) goto LabelNextCtxt;
            this.helper.Emit(OpCodes.Ldloc, locNav);
            this.helper.Emit(OpCodes.Brfalse, this.iterCurr.GetLabelNext());

            this.iterCurr.Storage = StorageDescriptor.Local(locNav, typeof(XPathNavigator), false);

            return ndSrc;
        }
XmlILVisitor