473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Writing CDATA data to XML

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

Nov 12 '05 #1
3 9075
That is what native "DataSet.WriteXML()" got you ?

The MS coders must have had a day off.

"Yasutaka Ito" <no****@nonexistent.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
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


Nov 12 '05 #2
Yasutaka Ito wrote:
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:


I don't think you can do that. Use XmlDataDocument instead.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
Nov 12 '05 #3
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.
"Yasutaka Ito" <no****@nonexistent.com> wrote in message news:u2**************@TK2MSFTNGP09.phx.gbl...
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

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jimmy zhang | last post by:
Are they teh same thing in xml 1.0?
0
by: Yasutaka Ito | last post by:
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...
3
by: Balaras | last post by:
Hi, Can sombody here please help me a bit with a regular expression. I have a xml file where I need to strip the CDATA sections of any contained data. Eg. <xml> <tag><]></tag>...
1
by: Tomas Vera | last post by:
Hello All, I'm having trouble writing some special characters to an XML file. I need to output a XMLSS formatted file to be read by Excel. In some cells there will be some text that contains...
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString);...
1
by: soccerdad | last post by:
I've got a class hierarchy generated from a .xsd schema file using the XSD.EXE tool. One of the elements will have its "inner text" set to a CDATA block. The XSD.EXE tool exposed a "Value" property...
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
18
by: sim.sim | last post by:
Hi all. i'm faced to trouble using minidom: #i have a string (xml) within CDATA section, and the section includes "\r\n": iInStr = '<?xml version="1.0"?>\n<Data><!]></Data>\n' #After i...
0
by: anilnagthane | last post by:
Following is the xml which i want to convert in cdata format <Root> <Start> <One>Some Data 1</One> <Two>Some Data 1</Two> <Three>Some Data 1</Three> ...
1
by: anilnagthane | last post by:
Following is the xml which i want to convert in cdata format <Root> <Start> <One>Some Data 1</One> <Two>Some Data 1</Two> <Three>Some Data 1</Three> <Four>Some Data 1</Four> <Five>Some Data...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.