Hi Jeff,
below some notices:
1. you iterate over listIterator but the outputter outputscurrentElement and not listIterator.next() - so you output the sameelement multiple times
2. please note that advance() method always sets currentElement to thefirst element in wordList :). I am not sure if it is intended.
3. what is more, you can safely throw away the isWanted variable as itchanges nothing in the code you presented above.
4. you never call writer.close() so the writer cannot be closed. Thecode is unclear to me, I don't get the idea behind but this does notlook good.
I can take a look at it if you sent me the whole code (but to privateaddress, there is no point in spamming the discussion list). I am surethat the problem is not in JDOM but in improper usage of it.
Regards,Grzegorz
On 23/05/07, Jeff Garza <jeff.garza@(protected)!
("<word_list>");> writer.newLine();> writer.write("<title name ='words' />");> writer.newLine ();> if(isWanted == true){> while (listIterator.hasNext()){>> outputter.output(currentElement, writer);> writer.newLine();> }> }> else {> writer.write("</word_list>");> writer.flush();> writer.close();> }> }> catch (IOException io) {}> advance();> }> catch (NullPointerException ne) { }>> }> });>> public void advance() {> isWanted= false;> //begin, get and print element> if(listIte!
rator == null) {> listIterator = wordList.listIterator
();> if( listIterator.hasNext()) {> currentElement = (Element)listIterator.next();> txtWord.setText("<html>"+currentElement> .getAttribute("word").getValue());> }> }> //reached end, start over> else {> listIterator = wordList.listIterator();> currentElement = (Element)listIterator.next();> }> }>
-- "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)