<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.3103.1000" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT size=2><FONT face=Arial>Problem with Jdom8 - getChildren() on root 
doesn't work<SPAN class=724355813-28032002> on a document that has been 
transformed in memory using documented jdom transform 
methodology:</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Transformer 
transformer = 
TransformerFactory.newInstance()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.newTransformer(new 
StreamSource(stylesheet));<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
JDOMResult out = new JDOMResult();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
transformer.transform(new JDOMSource(in), 
out);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
out.getDocument();<BR>&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN class=724355813-28032002>Interesting 
resulti is that </SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002>&nbsp;&nbsp;&nbsp; Element root = 
doc.getRootElement();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002>&nbsp;&nbsp;&nbsp;&nbsp;boolean hasChildren = 
root.hasChildren();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN class=724355813-28032002>returns "true" 
while</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002>&nbsp;&nbsp;&nbsp; List theChildren = 
root.getChildren();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN class=724355813-28032002>returns a List 
of size 0 (zero).</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN class=724355813-28032002>This was NOT a 
problem with JDOM 7 but is a problem with JDOM 8.</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=724355813-28032002>Note that the doc 
prior to transformation doesn't have this problem.&nbsp; Has anyone else seen 
this with 8?&nbsp; Is it true that I should never get a zero size list from 
getChildren() method if hasChildren() method returned true?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=724355813-28032002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=724355813-28032002>Tom</SPAN></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=724355813-28032002></SPAN></FONT></FONT>&nbsp;</DIV></BODY></HTML>