CSharp examples for System.Xml:XML Element
Get XML Attribute from XElement
using System.Xml.Linq; using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;//www .j ava2 s.com public class Main{ public static string GetAttribute(XElement _this, string name) { if (_this != null) return _this.Attribute(name) != null ? _this.Attribute(name).Value : GetAttribute(_this.Parent, name); else return null; } }