Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove duplicate nodes in DOM

 
Ankit Nagpal
Ranch Hand
Posts: 47
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using the DOM API for a random XML operation and have a NodeList which contains the following 3 nodes (All element nodes):



In this list, I want to remove the duplicate node i.e. Node number 3. Does any one have any clues on how can I do the same?

Thanks in advance.

Ankit
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The org.w3c.dom.Node interface provides the removeChild method - have you tried that?

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic