Get CData Element - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Get CData Element

Demo Code


using System.Xml;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from w  ww .  ja va2 s  .  com

public class Main{
        public static XmlCDataSection GetCData(this XmlElement element)
        {
            foreach (XmlNode child in element.ChildNodes)
            {
                if (child is XmlCDataSection)
                    return (XmlCDataSection)child;
            }
            return null;
        }
}

Related Tutorials