Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove Parent of an element

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank youu so much will
this method worked..
Element.clone()
:thumb:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic