Hope someone can help with this...
Am trying to generate XSL in PHP and use it to transform XML, also generated dynamically. Below is a summary of code...
//construct xsl and save to DOM
$xsldoc = new DomDocument('1.0');
$xslroot = $xsldoc->createElement('xsl:stylesheet');
$xslroot = $xsldoc->appendChild($xslroot);
etc etc
...$xsldoc->saveXML();
//construct xml and save to DOM
$doc = new DomDocument('1.0');
$root = $doc->createElement('root');
$root = $doc->appendChild($root);
etc etc
...$xml_string = $doc->saveXML();
//transform. this is where i have problems. 2nd line wont work
$xslt = new xsltProcessor;
$xslt->importStyleSheet(DomDocument::load($xsldoc));
echo $xslt->transformToXML(DomDocument::loadXML($xml_string));
thanks