Trying to write 
 into XML document

J

JM

Hi,

I am trying to write the string
into a UTF-16 XML document using
javax.xml.parsers.DocumentBuilder and I can't get it to work. I have
googled for a few days but cannot seem to find the solution. I am
hoping someone here can point me in the right direction.

Basically, I have a string containing /r/n that I am trying to write
into a UTF-16 document as



So far I have only got it to come out as actual carriage returns/line
feeds or as 


I must be missing something somewhere :(

Any help would be greatly appreciated.

Cheers,
JM
 
G

Gorf

Hi,

I am trying to write the string
into a UTF-16 XML document using
javax.xml.parsers.DocumentBuilder and I can't get it to work. I have
googled for a few days but cannot seem to find the solution. I am
hoping someone here can point me in the right direction.

Basically, I have a string containing /r/n that I am trying to write
into a UTF-16 document as



So far I have only got it to come out as actual carriage returns/line
feeds or as 


I must be missing something somewhere :(

Any help would be greatly appreciated.

CDATA?
 
J

JM


Thanks for the reply.

Sensible idea, but unfortunately that won't do. I have this
application that stores its data as XML, and text entered in the
application has it's /r/n's translated to

, they don't use
CDATA sections.

I want to create the XML data files for that application via an
automated import process, and therefore I am stuck with using the
format they chose to use, i.e. with the converted newlines.

Cheers,
JM
 
C

Chris Smith

JM said:
I am trying to write the string
into a UTF-16 XML document using
javax.xml.parsers.DocumentBuilder and I can't get it to work.

DocumentBuilder is for parsing an XML file into a document, not for
creating an XML file from a document. What are you really trying?

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top