cancel
Showing results for 
Search instead for 
Did you mean: 

Serializing a dom4j-Document to an XML

Former Member
0 Kudos

Hello everybody,

I'm trying to serialize a dom4j-Document that I created to an XML-document using an XMLWriter.

The problem is, the Document got an element with a whitespace/blank as value ( <element> </element>)

The xmlWriter trimms the blank and so the gets lost.

How can I keep this whitespace in my XMLWriter?

best regards

Adnane

Edited by: Adnane Elgoute on Jun 17, 2008 8:38 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adnane,

as I told you:

a)

convert the document to string

b)

OutputStream os = null;
os.write(yourString.getBytes());

Regards Mario

Answers (0)