Re: [xml-dev] code challenge

From
Morten Primdahl <>
To
'Xml-Dev' <>
Date
2002-08-09T07:49:25Z
ID
<>
Thread
Re: [xml-dev] code challenge
Toivo \"Deutsch\" Lainevool wrote:
> Nope, that won't work, you can't construct a new loop in every call of
> the method.

By changing
   getChildren((Element) child);
to
   elements.addAll(getChildren((Element)child));

He should be fine though (not considering efficiency).

Hoping that not all getElementsByTagName* methods are broke, original
poster could try:

NodeList list = document.getElementsByTagName("*");

Or document.getDocumentElement().getElementsByTagName("*") as the 
original code did, but that doesn't include the top level element in the
list.

Morten