Skip to Content.
Sympa Menu

xom-interest - Re: [Fwd: Re: [XOM-interest] need ideas for HTML manipulation]

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Luca Passani <passani AT eunet.no>
  • Cc: Elliotte Harold <elharo AT metalab.unc.edu>, xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [Fwd: Re: [XOM-interest] need ideas for HTML manipulation]
  • Date: Thu, 5 May 2005 14:31:27 -0700

If you detach (i.e. remove from a list) you can't count on the list size staying constant in the loop. One approach is to iterate backwards as in for (int i=element.getChildCount(); --i >=0; ) { ... detach ...}

Wolfgang.

On May 5, 2005, at 2:21 PM, Luca Passani wrote:
for (int i=0;i<td_els_count;i++) {
child = element.getChild(i);
child.detach();
nds.append(child);
}





Archive powered by MHonArc 2.6.24.

Top of Page