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

VisitAttribute() protected method

Generate code for for QilNodeType.Attribute.
protected VisitAttribute ( QilBinary ndAttr ) : QilNode
ndAttr System.Xml.Xsl.Qil.QilBinary
return QilNode
        protected override QilNode VisitAttribute(QilBinary ndAttr) {
            QilName ndName = ndAttr.Right as QilName;
            Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument");

            // XPathNavigator navAttr;
            LocalBuilder locNav = this.helper.DeclareLocal("$$$navAttr", typeof(XPathNavigator));

            // navAttr = SyncToNavigator(navAttr, navCtxt);
            SyncToNavigator(locNav, ndAttr.Left);

            // if (!navAttr.MoveToAttribute(localName, namespaceUri)) goto LabelNextCtxt;
            this.helper.Emit(OpCodes.Ldloc, locNav);
            this.helper.CallGetAtomizedName(this.helper.StaticData.DeclareName(ndName.LocalName));
            this.helper.CallGetAtomizedName(this.helper.StaticData.DeclareName(ndName.NamespaceUri));
            this.helper.Call(XmlILMethods.NavMoveAttr);
            this.helper.Emit(OpCodes.Brfalse, this.iterCurr.GetLabelNext());

            this.iterCurr.Storage = StorageDescriptor.Local(locNav, typeof(XPathNavigator), false);
            return ndAttr;
        }
XmlILVisitor