CSharp examples for System.Xml:XML Attribute
Get XML Attribute Value For Property
using System.Xml; using System.Runtime.Remoting.Messaging; using System.Linq; using System;//from ww w . j a v a2 s . c o m public class Main{ public static string GetAttributeValueForProperty(this XmlElement element, string propertyName) { return element.HasAttributeForProperty(propertyName) ? element.GetAttribute(propertyName.ToCamelCase()) : String.Empty; } public static bool HasAttributeForProperty(this XmlElement element, string propertyName) { return element.HasAttribute(propertyName.ToCamelCase()); } }