jamesm6162 Posted March 10, 2009 Share Posted March 10, 2009 Hi All. I have run into a really strange problem. I load a DOMDocument from file and then edit some of the elements //$temp is some element in the DOMDocument called $doc $t = $tmp->getElementsByTagName("title")->item(0); $de = $tmp->getElementsByTagName("description")->item(0); $da = $tmp->getElementsByTagName("date")->item(0); $img = $tmp->getElementsByTagName("image")->item(0); $t->nodeValue = $title; $de->nodeValue = $description; //Long text value, may contain special characters $da->nodeValue = $dstring; The description I am trying to add in the above event does not get saved at all when I call $doc->save($filename) or $doc->saveXML(). When I call saveXML() the <description> tag is empty, however when I call $doc->textContent, the entire text value is displayed correctly. What could be causing this problem? Thanks. Link to comment https://forums.phpfreaks.com/topic/148747-dom-document-does-not-save/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.