Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Support for Moving element from one document to other

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai all
I am using JAXP 1.1 parser .I have a problem in porting elements from one document to Another Document .Does JAXP 1.1 Support doing this .i am getting an error stating that the element belongs to another document
Please advice
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Palani,
I'm assuming you're doing this inside a DOM document. Every element in a DOM document has the document as its owner (see the getOwnerDocument() method) and as you've experienced, you're not allowed to add an element from another
To copy elements from a document to another, first call the importNode() method on the target document for each node you wish to copy (use true as the second argument).
Hope this helps,
Beno�t
[This message has been edited by Beno�t d'Oncieu (edited September 04, 2001).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic