473,396 Members | 1,894 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,396 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 9077
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.