CSharp examples for System.Xml:XML Element
Get Text from XMLElement
using System.Xml; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from www .j a v a2s . c om*/ public class Main{ public static XmlText GetText(this XmlElement element) { foreach (XmlNode child in element.ChildNodes) { if (child is XmlText) { XmlText text = (XmlText)child; if (text.Data.Trim().Length > 0) return text; } } return null; } }