Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Data Problem when loading a large string

Status
Not open for further replies.

rrsriram

Programmer
Nov 19, 2003
3
IN
Hi,

I am having a strange problem when creating a XML file. I am connecting to the Mainframe from Java using Websphere 3.5.7.

I am using the below mentioned code to create the XML file on the fly.

TagId.appendChild(doc.createTextNode(TagData));
ColHead.appendChild(TagId);
Template.ppendChild(ColHead);
root.appendChild(Template);
doc.appendChild(root)

The problem is the TagData which is the data for the XML is of length 110. When creating the XML, there is a new line charecter inserted into the data and the data also gets truncated.

Is there anyway i can resolve this issue?

I want the data as is from the database.

Please let me know. It is very urgent.

Thanks in advance.

Sriram
 
Hello Everyone,

Found out the answer to the problem.

I used CreateCDATASection instead of CreateTextNode. The code is given below.

If there are any issues regarding this usage, please let me know.

TagId.appendChild(doc.createCDATASection(TagData));
ColHead.appendChild(TagId);
Template.appendChild(ColHead);
root.appendChild(Template);
doc.appendChild(root);

Thanks in advance

Sriram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top