on the line of the replaceChild.computer wrote:Uncaught exception 'DOMException' with message 'Not Found Error'
Apparently it occurs when you try to replace a node which is NOT a child member of the specified domnode.
I checked that I wasnt initialising the variable twice or anything (and i'm not). I tried cutting out any other dom functions in between so that all i did was initialise the variables and then use them. These didn't work so I tried calling importNode first to make sure the nodes were both part of the same document.
Anyway I can't figure it out. Below is the general gist of what I'm doing so if anybody can see whats wrong let me know plx!
Code: Select all
$xml_document = new DOMDocument("1.0"); // Create a new DOMDocument
$xml_document->loadXML($someXmlString); // This string loads correctly and includes one "Table" element
$dom_table = $xml_document->createElement("Table"); // Create the new Table element
$old_table = $xml_document->getElementsByTagName("Table")->item(0); // Find the old table element (It does find it correctly - I've checked)
$xml_document->replaceChild($dom_table, $old_table); // Replace the old table element with the new one and fail...EDIT2: Ok I've changed the details that were wrong (and put the line that i corrected in bold) - but i`m still stuck