CSharp examples for System.Xml:XML Attribute
Get S Byte Attr
using System.Xml.Linq; using System;/* ww w .j a v a 2 s. c o m*/ public class Main{ public static sbyte GetSByteAttr(this XElement elem, string name) { sbyte.TryParse(elem.GetAttrValue(name), out var v); return v; } public static string GetAttrValue(this XElement elem, string attrName) { return elem.Attribute(attrName)?.Value; } }