Smart    Lucky

Smart Lucky

  • NA
  • 555
  • 640.5k

XMLDocument reading CDATA and Commnets

Aug 11 2011 5:49 AM
Hi
can i read CDATA in This way ....................? 

 
   XmlDocument doc = new XmlDocument();
  doc.Load(Server.MapPath("~/App_Data/XMLFile.xml"));
        XmlNodeList listnode = doc.GetElementsByTagName("book");
        foreach (XmlNode node in listnode)
        {
            if (node is XmlCDataSection)
            {
                Response.Write("CDATA i s"+node.innerText);
            }
        }

And

Can i read Commnets in this way.................?

   foreach (XmlNode node in listnode)
        {
            if (node is XmlComment)
            {
                Response.Write("Commnets are"+node.InnerText);
            }
        }














Answers (1)