Bugs item #1653037, was opened at 2007-02-06 08:25
Message generated for change (Comment added) made by raananzvi
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1653037&group_id=16035

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Raanan Zvi (raananzvi)
Assigned to: Nobody/Anonymous (nobody)
Summary: XMLWriter addes unnecessary new lines

Initial Comment:
Hi,
I'm using this code to write my XML file (in Eclipse)

Write code:
-----------
OutputFormat outformat = new OutputFormat("\t", true, "UTF_8");
ByteArrayOutputStream oStream = new ByteArrayOutputStream();
XMLWriter writer = new XMLWriter(oStream, outformat);
writer.write(doc);

When I write a code created document (created from scratch) this code writes 
the file OK. I have new lines after each element and it is OK.

The problem is when I read a file that was created with this format, and just 
add to the read document a new element and saves it again using this code, the 
old elements are appended with newline again, thus now they will have two new 
lines. The new element that was added is ok. If I continue with this, I get a 
lot of newlines in the old elements (as the times that this process occures).

I read the file with this code:
-------------------------------
SAXReader xmlReader = new SAXReader();
Document doc = xmlReader.read(iStream);
iStream.close();
root = doc.getRootElement();

----------------------------------------------------------------------

>Comment By: Raanan Zvi (raananzvi)
Date: 2007-02-06 08:27

Message:
Logged In: YES 
user_id=1711798
Originator: YES

P.S I'm using the latest 1.6.1 release. Which supposed to fix the bug
"Fixed a problem with XMLWriter that was causing too many new lines to be
written to the resulting XML. Thanks to Thomas Fromm"

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1653037&group_id=16035

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to