RE: [dom4j-user] java.util.ConcurrentModificationException

2004-02-19 Thread Mike Skells
esday 18 February 2004 13:19 To: Ray Grieselhuber Cc: [EMAIL PROTECTED] Subject: Re: [dom4j-user] java.util.ConcurrentModificationException Instead of using an iterator, try an object array list and iterate over the object array. Element root = doc.getRootElement(); List list = roo

Re: [dom4j-user] java.util.ConcurrentModificationException

2004-02-18 Thread David D. Lucas
Instead of using an iterator, try an object array list and iterate over the object array. Element root = doc.getRootElement(); List list = root.elements(); if (list!=null) { Element item=null; Object[] listArray = list.toArray(); for (int i = 0; i < listA

RE: [dom4j-user] java.util.ConcurrentModificationException

2004-02-17 Thread Ray Grieselhuber
I modified the code to do this: Element root = doc.getRootElement(); Iterator elementIterator = root.elementIterator(); while(elementIterator.hasNext()){ Element element = (Element)elementIterator.next(); String name = element.attributeValue("name")

RE: [dom4j-user] java.util.ConcurrentModificationException

2004-02-17 Thread Mike Skells
Hi Ray, Use remove() on the iterator The message is correct. You are modifying the collection while the iterator is operating. CME is thrown if any modification is make to the collection other than through the iterator Mike Skells -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL