Hi Jeff,
but in the code you create a new file for each currentElement so it isbehaving correctly.
You can write:(...)writer.newLine();writer.write("<title name ='words' />");writer.newLine();for (...) { ... wait for user click ... outputter.output...}writer.write("</word_list>");
Perhaps you will have to flush the writer too if you want to see theresults immediately after each iteration.
However if you have to have a correct XML file after each loopiteration I am afraid you will have to parse, modify and output theXML file again after each click. XML is not designed to support"appending" to the end. In such a situation I would suggest to createa simple text file, append to it and convert it to an XML documentafterwards.
Grzegorz
On 22/05/07, Jeff Garza <jeff.garza@(protected)!
ntword3" >> <def>currentdef3</def>> </entry>> </word_list>>> Here is my code:>> try {> BufferedWriter writer = new> BufferedWriter (> new OutputStreamWriter (> new FileOutputStream> (" words.txt"),> "UTF-8"));> Format format => Format.getPrettyFormat();> format.setEncoding("UTF-8");> XMLOutputter outputter = new> XMLOutputter(format);> writer.write("<word_list>");> writer.newLine();> writer.write("<title name ='words' />");> writer.newLine();> outputter.output(currentElement, writer);> writer.newLine();> writer.write("</word_list>");> writer.flush();> !
writer.close();> }>
catch (IOException io) {}>> I'm not sure what to do and I'd appreciate your help. Thanks!> _______________________________________________> To control your jdom-interest membership:> http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)>
-- "Cho? tyle wiemy w?asnym do?wiadczeniem:W nas jest Raj, Piek?o - i do obu - szlaki."J.K.
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)