[jdom-interest] Writing on a file stream element by element

NP nicola.padovano at gmail.com
Thu Oct 4 02:07:24 PDT 2007


I have a document so:
mydoc = new Document();
a root element:
rootElement = new Element(....);

Now i create a new element:
Element myel = new Element(.....);

addin' it to the root:

Now i must add the new information (myel) on a file. The code that i 
wrote was:
XMLOutputter out = new XMLOutputter(....);
out.output(mydoc, new File(....));

But in this way, everytime, i write the whole document in the file 
(delete file and rewrite the updated document).
My problem, instead, is write the new element one by one, everytime that 
i create it.

More information about the jdom-interest mailing list