CSharp examples for System.Xml:XML Attribute
Get Long Elem
using System.Xml.Linq; using System;//from ww w. j a v a 2 s .c o m public class Main{ public static long GetLongElem(this XElement elem, string name) { long.TryParse(elem.GetElemValue(name), out var v); return v; } public static string GetElemValue(this XElement elem, string elemName) { return elem.Element(elemName)?.Value; } }