all groups > dotnet xml > december 2003 >
You're in the

dotnet xml

group:

Writing CDATA data to XML


Re: Writing CDATA data to XML name
12/27/2003 4:58:49 AM
dotnet xml: That is what native "DataSet.WriteXML()" got you ?

The MS coders must have had a day off.



[quoted text, click to view]
Re: Writing CDATA data to XML Oleg Tkachenko
12/27/2003 2:21:39 PM
[quoted text, click to view]

I don't think you can do that. Use XmlDataDocument instead.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Writing CDATA data to XML Yasutaka Ito
12/27/2003 3:14:47 PM
Hi folks!

I have a DataSet, which I'm writing into XML using the DataSet.WriteXML()
method. Now, I want to write the cell's data/text as CDATA, when it is
written into an XML. For example, I want the XML output as follows:

<root>
<myElement><![CDATA[abc]]></myElement>
</root>

but not...

<root>
<myElement>&lt;![CDATA[abc]]&gt;</myElement>
</root>

Is this possible?

thanks!
-Yasutaka
Re: Writing CDATA data to XML Chris Lovett
12/28/2003 4:38:03 PM
You could use my XmlNodeWriter which is available in the User Samples on =
www.gotdotnet.com to write the DataSet to an XmlDocument, then you could =
either change this XmlNodeWriter to convert that particular cell to a =
call to WriteCData, or you could walk the XmlDocument and convert those =
XmlText nodes to XmlCDataSection nodes.


[quoted text, click to view]
AddThis Social Bookmark Button