[jdom-interest] Problem with Jdom8 - getChildren() on root doesn't work...

Bradley S. Huffman hip at a.cs.okstate.edu
Thu Mar 28 06:54:56 PST 2002


What does the document and stylesheet look like? Cann't give a answer if we
cann't reproduce the results :)

Brad

Tom Preston writes:

> Problem with Jdom8 - getChildren() on root doesn't work on a document that
> has been transformed in memory using documented jdom transform methodology:
>  
> 
>        Transformer transformer = TransformerFactory.newInstance()
>           .newTransformer(new StreamSource(stylesheet));
> 
>        JDOMResult out = new JDOMResult();
>        transformer.transform(new JDOMSource(in), out);
>        return out.getDocument();
>      
>  
> Interesting resulti is that 
>     Element root = doc.getRootElement();
>     boolean hasChildren = root.hasChildren();
>  
> returns "true" while
>     List theChildren = root.getChildren();
>  
> returns a List of size 0 (zero).
>  
> This was NOT a problem with JDOM 7 but is a problem with JDOM 8.
>  
> Note that the doc prior to transformation doesn't have this problem.  Has
> anyone else seen this with 8?  Is it true that I should never get a zero
> size list from getChildren() method if hasChildren() method returned true?



More information about the jdom-interest mailing list