/** * add the errors to an existing xml document * * @param String $encoding encoding * * @return SimpleXmlElement */ public function errorsAddToXML($encoding) { $dom = new DOMDocument('1.0', 'UTF-8'); $root = $dom->createElement("Errors"); $dom->appendChild($root); $xml = simplexml_import_dom($dom); $xmlerr = new SimpleXMLExtended($xml, $encoding); foreach ($this->_arrErrorList as $arrLine) { $error = $xmlerr->addCData('Error', $arrLine['message']); $error->addAttribute('Function', $arrLine['command']); } return $xmlerr->getSimpleXmlElement(); }
/** * get the xml object * * @return string */ public function getXml() { $this->_buildXml(); return $this->_xml->getSimpleXmlElement(); }