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
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
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")
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