permaculture playing cards*
The moose likes XML and Related Technologies and the fly likes Remove Parent of an element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Remove Parent of an element" Watch "Remove Parent of an element" New topic
Author

Remove Parent of an element

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Hello ladies and gentlemen

I want to add an existing child-element as a root-element in another file... but i get this error


So i want to know how do i remove the parent of that child element so i can make it a root element...

Thanks :thumb:
HannaH
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
Look at the javadocs for the org.w3c.dom.Node interface - particularly the cloneNode( true ) method. I suspect that is what you want but have not actually tried it.

Bill
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Thank youu so much will
this method worked..
Element.clone()
:thumb:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remove Parent of an element