veaudaux Posted May 1, 2007 Share Posted May 1, 2007 Stripped down version of my code: $xmlSubmission = simplexml_load_file($submissionDirectory . "/submissions.xml"); $newSubmission = $xmlSubmission->addChild('submission'); $newSubmission->addChild('title', 'XML Add Test'); $newSubmission->addChild('author_id', 'me'); $dom_xmlSubmission = dom_import_simplexml($xmlSubmission); $dom = new DOMDocument('1.0'); $dom_xmlSubmission = $dom->importNode($dom_xmlSubmission, true); $dom_xmlSubmission = $dom->appendChild($dom_xmlSubmission); $test = $dom_xmlSubmission->save($submissionServerPath . "submissions2.xml"); This outputs a file with nothing but "<?xml version="1.0"?>" and spits an error "Fatal error: Call to undefined method DOMElement::save()". Now what? Link to comment https://forums.phpfreaks.com/topic/49495-call-to-undefined-method-domelementsave/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.