Title: detach returning Node
JDOM returns a Node when you use detach() .... seems like a sensible idea.
 
 
----- Original Message -----
Sent: Saturday, September 15, 2001 9:38 AM
Subject: Re: [dom4j-user] detach returning Node

Hi Kesav
 
I think thats a great idea - I'll make it so. Thanks for that.

James
----- Original Message -----
Sent: Saturday, September 15, 2001 1:38 AM
Subject: [dom4j-user] detach returning Node

The detach method return type is void.  This means that when ever I want to add one document's element to a second document I got to write code like this

Document doc1 = getDocument1();
Document doc2 = getDocument2();

Element ele = doc1.getRootElement().element("Node1");
ele.detach();

doc2.getRootElement().add(ele);

If detach returns 'this' then code will be very inline

doc2.getRootElement().add(doc1.getRootElement.element("Node1").detach());

Any reason why detach method doesn't return Node type?

Regards

Kesav Kumar Kolla
Voquette Inc
650 356 3740(W)
510 889 6840(R)
Voquette....Delivering Sound Information


Reply via email to