File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Remove Parent of an element" Watch "Remove Parent of an element" New topic

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:
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12938
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.

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Thank youu so much will
this method worked..
I agree. Here's the link:
subject: Remove Parent of an element