[jdom-interest] JDOM -> <CR LF> Problem in an Element as CDATA-> Solution
Schneider Aaron Marc
schneider at hiko.de
Thu Feb 8 23:52:12 PST 2001
-----BEGIN PGP SIGNED MESSAGE-----
Re Hi all,
thanks for your assistance.
I 've solved my Carrige Return Line Feed Problem.
I've triied to store E-Mails to an XML File.
Everytime a part of the eMail System restarts (the POPClient or the
SMTPServer) it rereads the mails.xml file.
The earliest version of the "Mailer System" stored the E-Mails to a
normal Element as String.
Than I realized that I do not know what data is to be send
Therefore I decided to take a CDATA Block for the received E-Mail
When I stored the DATA block as a CDATA I found several problems.
With the getText Method of Element I could get the CDATA without the
CDATA Tag (<![CDATA[ data ]]>).Thats fine.
BUT everytime I rewrite the Data to XML a new Line was added to the
top and bottom of the data.
I searched around for a while, took a look in the source of Element
and realized that, if you set the setNewLines() to false, no newlines
added to the pure DATA.
I thought NewLines was just for "pretty printing" of the XML File, to
grand better humanreadability, not for adding newlines to a CDATA
Block (witch is in turn a change of the Data the Element holds).
Now it all works the way I would like it to do.
Thank you much again.
I just wanted you to profit from my solution
Aaron Marc Schneider mailto:schneider at hiko.de
HIKO medical communication http://www.hiko.de
Teichstr. 15-19 Tel: +49 6331 5169 38
D-66953 Pirmasens Fax: +49 6331 5169 35
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
Comment: Wir sind die Toten (1984 G.Orwell)
-----END PGP SIGNATURE-----
More information about the jdom-interest