logo       

Related Msgs: audio.musicbrai...    enbd.general/20...    ietf.idr/2002-0...    java.ant-contri...    gnu.make.genera...    qplus.devel/200...    video.freevo.cv...    os.netbsd.ports...    yellowdog.gener...    xfree86.cvs/200...    search.nutch.us...    freedesktop.xse...    programming.swi...    capabilities.ge...    telephony.pbx.a...    mail.sylpheed.c...    db.firebase.por...    boot-loaders.u-...    recreation.radi...    netbsd.bugs/200...    web.zope.plone....    user-groups.lin...   

Re: Changing the class of element, node, etc created by a parser: msg#00026

Subject: Re: Changing the class of element, node, etc created by a parser
I am having trouble appending a document fragment from one
document to a different document. In the following code, I
am trying to append all the children of document r to document
s. It fails with

WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.

Here is the code:

Range rdf = ((DocumentImpl)r).createRange();
rdf.setStartBefore(r.getLastChild());
rdf.setEndAfter(r.getLastChild());
DocumentFragment df= rdf.extractContents(); // doesn't this allow the document fragment s.getFirstChild().appendChild(df); // to be appended to a different document?


Your assistance would be greatly appreciated.

Incidentally, I can disable the error by modifying the code in CoreDocumentImpl.java, but
I would prefer to use the library in the manner which was intended.

Ron Addie.



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo