I am trying to extract xml from a file and pass it to the xslt parser but its not working. How do I get the attached code to work?
I need to extract the products node and its children to pass to the stylesheet.
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$xpath = new DOMXPath($doc);
$p = $doc->getElementsByTagName('top40')->item(0);
$x = $xpath->query('*',$p);
$data = $xsl->transformToXML($x);