$val) { file_put_contents($path.$key, $val); } } return $content; } } } /** * Convert xml content using xsl template file. */ public function oo_convert($xml, $xsl_file = 'template.xsl') { $xls = new DOMDocument; $xls->load($xsl_file); $xslt = new XSLTProcessor; $xslt->importStylesheet($xls); $x = preg_replace('##es', "ODT2XHTML::makeImage('\\1')", $xml); $xml = new DOMDocument; $xml->loadXML($x); return html_entity_decode($xslt->transformToXML($xml)); } public function makeImage($img) { return '<img src="Pictures/'.$img.'" border="0" />'; } }