When trying to parse an xsl file and an xml file with xslt_process(), the function only returns the plain xsl file.
When I link the xsl file in the xml file and I open it in IE 6 it gets parsed fine.
I'm using Apache 1.3.24 and PHP 4.1.2 under Windows 2000.
Here is my code:
// $xml and $xsl contain the XML and XSL data
$xml = join("", file("news.xml"));
$xsl = join("", file("news.xsl"));
$arguments = array(
'/xml' => $xml,
'/xsl' => $xsl
);
// Allocate a new XSLT processor
$xh = xslt_create();
// Process the document
$result = xslt_process($xh, 'arg:/xml', 'arg:/xsl', NULL, $arguments);
if ($result) {
print $result;
}
else {
print "Error: ".xslt_error($xh)."<br>";
print " and the error code is ". xslt_errno($xh);
}
xslt_free($xh);
The xml file can be found here http://webprogeny.com/news.xml
and the xsl file here http://webprogeny.com/news.xsl