[jdom-interest] size() of List.getChildren ??

Kyung Deuk Jin duke at syncront.com
Mon Oct 9 14:31:34 PDT 2000


To Whom it may concern

Whenever I try to retrieve all children of a specific element by using 
getChildren() method,
  the size() of returned List is exactly double of real value.
( For example, assume that there are 4 children for element 
"firstLevelElement".
          List secondLevelElement = firstLevelElement.getChildren();
          seconLevelElement.size()  is  8, not 4  )

Futhermore, when I fetch the each child of a specific element by hasnext() 
method, the processing will be done twice.
      (      List secondLevelElement = firstLevelElement.getChildren();
             Iterator ip = secondLevelElement.iterator();
             while(ip.hasNext()) {
              .............................................................. 
....................................................................
              processed every child twice
              .............................................................. 
...................................................................
             } 
                          )



More information about the jdom-interest mailing list