← Prev in month ← Prev in thread
Next in thread → Next in month →

importNode returns null

From
Vidar Ramdal <>
To
Date
2005-05-24T15:42:15Z
ID
<>
Thread
importNode returns null
In my Java application, I'm trying replace a node with a node from
another document. I have a reference to the node I wish to replace
(originalNode), and the new node (newNode).

Node importedNode = originalNode.getOwnerDocument().importNode(newNode, true);
originalNode.getParentNode().replaceChild(importedNode, originalNode);

However, I couldn't get replaceChild to work, and started
investigating. I found that importedNode is always null - that is,
importNode always returns null.

Does anyone see how this can happen? There are no exceptions thrown.

-- 
Vidar S. Ramdal <>
"In the beginning, the universe was created. This made a lot of people
very angry, and has been widely regarded as a bad idea."  --  Douglas
Adams
← Prev in month ← Prev in thread
Next in thread → Next in month →