<!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> </DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=724355813-28032002><BR> Transformer
transformer =
TransformerFactory.newInstance()<BR>
.newTransformer(new
StreamSource(stylesheet));<BR><BR>
JDOMResult out = new JDOMResult();<BR>
transformer.transform(new JDOMSource(in),
out);<BR> return
out.getDocument();<BR> </SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=724355813-28032002></SPAN></FONT></FONT> </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> Element root =
doc.getRootElement();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=724355813-28032002> boolean hasChildren =
root.hasChildren();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=724355813-28032002></SPAN></FONT></FONT> </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> List theChildren =
root.getChildren();</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=724355813-28032002></SPAN></FONT></FONT> </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> </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> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=724355813-28032002>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?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=724355813-28032002></SPAN></FONT> </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> </DIV></BODY></HTML>