It would be something like the following...
DOMImplementation domImpl = document.getImplementation();
Document doc = domImpl.createDocument("", "roottagname", null);
Node node = doc.importNode(document.getDocumentElement(), true);
doc.replaceChild(node, doc.getDocumentElement());Jake
At 11:41 AM 8/7/2003 +0200, you wrote:
Hi Joe,
thanks for your response, I hope the following this is not asking too much, but I am new to Xerces. I have had a look at the API, but I am at a bit of a loss in how to do what you suggested. I understand what you mean in theory. Would you be so kind as to provide a code snippet outlining how this can be done.
Kind Regards
Marco
-----Urspr�ngliche Nachricht----- Von: Joseph Kesselman [mailto:[EMAIL PROTECTED] Gesendet: 06 August 2003 17:08 An: [EMAIL PROTECTED] Betreff: Re: Creating a Document from a DocumentFragment or NodeList
Use DOMImplementation.createDocument to create the new Document node and root element, use the importNode operation to clone the existing DocumentFragment or nodes from the NodeList into a form compatable with this new document, insert the latter into the former.
______________________________________ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
