Hello
I am developing an application in C #, when I create an xml file.
My question : I wold like create an xml file with CDATA section like
<BALISE name="Atrubute"> data ]]> BALISE>
best regard
Hello
I am developing an application in C #, when I create an xml file.
My question : I wold like create an xml file with CDATA section like
<BALISE name="Atrubute"> data ]]> BALISE>
best regard
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
ido shahar24 reputationPosted May 18, 2009, 8:19 AM EDT
XmlDocument cxml = new XmlDocument();
cxml.CreateCDataSection("content of cdata");
????????????????????????
Posted May 18, 2009, 10:20 AM EDT
this function
cxml.CreateCDataSection("content of cdata");
does not exist in system.xml ?
ido shahar24 reputationPosted May 18, 2009, 11:27 PM EDT
it is!
look at the example that located in the MSDN: (http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.createcdatasection.aspx)
using System;
" +Pride And Prejudice " +
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("
"
"");
//Create a CData section.
XmlCDataSection CData;
CData = doc.CreateCDataSection("All Jane Austen novels 25% off starting 3/23!");
//Add the new node to the document.
XmlElement root = doc.DocumentElement;
root.AppendChild(CData);
Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
}