CSharp examples for System.Xml:XML Attribute
Get Float Elem
using System.Xml.Linq; using System;/*ww w . j ava 2s . c om*/ public class Main{ public static float GetFloatElem(this XElement elem, string name) { float.TryParse(elem.GetElemValue(name), out var v); return v; } public static string GetElemValue(this XElement elem, string elemName) { return elem.Element(elemName)?.Value; } }