448191 Posted May 20, 2006 Share Posted May 20, 2006 Hey guys, I can't get this to work:[code]class simpleXML extends DOMDocument{ private $filePath; function __construct($file) { parent::__construct(); if(file_exists($file)){ parent::load($file); } else { //Create root element: $root = parent::createElement(substr($file,strrpos($file,'/' )+1,strlen($file))); parent::appendChild($root); } $this->filePath = $file; $this->preserveWhitespace = false; $this->formatOutput = true; } function __destruct() { parent::save($this->filePath); }}[/code]It just puts the endtag, no starting tag... [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Maybe DOMDocument just wasn't meant to be extended? Link to comment https://forums.phpfreaks.com/topic/10055-solved-extend-domdocument/ Share on other sites More sharing options...
Barand Posted May 20, 2006 Share Posted May 20, 2006 Looks fine to me. I get[code]<?xml version="1.0"?><afilename/>[/code]If it were an end tag it would be [code]</afilename>[/code] Link to comment https://forums.phpfreaks.com/topic/10055-solved-extend-domdocument/#findComment-37399 Share on other sites More sharing options...
448191 Posted May 20, 2006 Author Share Posted May 20, 2006 [!--quoteo(post=375473:date=May 20 2006, 04:33 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 20 2006, 04:33 AM) [snapback]375473[/snapback][/div][div class=\'quotemain\'][!--quotec--]Looks fine to me. I get[code]<?xml version="1.0"?><afilename/>[/code]If it were an end tag it would be [code]</afilename>[/code][/quote]Whahahaha.... [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] That's so "me"... I could've sworn it said '</file>'!Thanks! (and I apologize for not paying attention) Link to comment https://forums.phpfreaks.com/topic/10055-solved-extend-domdocument/#findComment-37400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.