> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Thursday 17 June 2004 09:26 > To: [EMAIL PROTECTED] > Subject: Re: [dom4j-user] Removing Nodes > > > On Thursday 17 June 2004 00:26, Mike Skells wrote: > > This will not throw a NPE. The NPE gets throw ONLY in the > visitor code > > Yes it does. I tried it. Please provide a stack trace, and you configuration details > > > static class KillDivs extends VisitorSupport { > > public void visit( Element e ) { > > List content = e.elements(); > > for (int i = content.size()-1; i >= 0 ; i--) { > > That how I do it right now actually. > > for (Iterator iter = e.elementIterator(); ...) > { > if(iter.next().getName()...) > iter.remove(); > } > > > Element child = (Element)content.get(i); > > if (child.getName().equalsIgnoreCase("div")) { > > content.remove(i); > > } > > } > > } > > } > > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San > Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority > Code NWMGYKND > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user >
------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user