function createHtml( $xmlSrc, $htmlSrc ){// xsl-соурс передавать не надо !!!
$xmlData = file_get_contents( $xmlSrc );
//-----------------------------------------------------------
//Вырезаем href в xml-stylesheet
$pattern = '/href=("|\')?(.*?)(\s|"|\')/i';
preg_match($pattern, $xmlData, $matches, PREG_OFFSET_CAPTURE);
$xslSrc = $matches[2][0];
//-----------------------------------------------------------
$xslData = file_get_contents( $xslSrc );
$xh = xslt_create();
$arguments = array( '/_xml' => $xmlData, '/_xsl' => $xslData );
if( $htmlContent = @xslt_process( $xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments )){
$htmlObj = new Datei( $htmlSrc );// Object File
$htmlObj->setContent( $htmlContent );
$htmlObj->save();
}
else{
return false;
}
return true;
}