protected function format() { $Doc = new Document(); $Doc->loadXML('<root/>'); $Doc->documentElement->addArray($this->aData); return $Doc->saveXML(); }
protected function format() { $Doc = new Document(); $Doc->loadXML('<root/>'); try { $Doc->documentElement->addArray($this->aData); } catch (\Exception $e) { e('XML formatting exception: ' . $e->getMessage() . ' in ' . $e->getFile() . ' on ' . $e->getLine()); } return $Doc->saveXML(); }
/** * Constructor * * @param string $xml * This should be left at default when we creating a new entry * it will be an xml string returned by the Blogger API in response * to a POST of our entry */ public function __construct($xml = '<entry xmlns="http://www.w3.org/2005/Atom"/>') { parent::__construct(); $this->loadXML($xml); $this->validateRoot(); }