• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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).]
 
If we don't do the shopping, we won't have anything for dinner. And I've invited this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic