Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

appending nodes

 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have two xml fragments.
<personal>
<name>tom</name>
</personal>
<personal>
<name>charles</name>
</personal>
I need to combine these two to :
<personal>
<name>tom</name>
<name>charles</name>
</personal>
I get WRONG_DOCUMENT_ERR if i use Element.appendChild(). please suggest.
regards,
shankar.
 
Sonali Mohrir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Appendchild method raises the WRONG_DOCUMENT_ERR: if newChild was created from a different document than the one that created this node.
 
John Wetherbie
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohrir,
Thanks for helping out! Could you check the JavaRanch naming policy and re-register?
Thanks,
John
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!