CSharp examples for System.Xml:XML Attribute
Get Attribute from XML
using System.Xml; using System.Text; using System.Linq; using System.Collections.Generic; using System;/* w ww.jav a 2 s . c om*/ public class Main{ public static string GetAttr(this XmlElement element, string attrName) { XmlAttribute attr = element.Attributes[attrName]; return (attr != null) ? attr.Value : string.Empty; } }