On Wed, 21 Nov 2001, Brain, Jim wrote:

> Why is it when I use detach, I have to do:
> 
> Element el=doc.getRootElement();
> 
> return ((Element)((Node)el.detach()));
> 
> I though Element is a sub of Node.

Ummm...

I've never had to cast an Element to Node before calling
detach().  Detach() does yield a Node though, so if you
expect an Element, you'll have to cast back to Element
after the detach() call.

        Element elem     = buildMyElementDamnit();

        Element detached = (Element) elem.detach()

-bob


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to