I've got an xml file I want to be parsed using an xslt stylesheet. I was using the xslt_* functions (http://us3.php.net/manual/en/ref.xslt.php) but the problem is when I do this in the middle of a PHP script like follows:
Code: Select all
<?php
// Write header information (i.e. <html>, <head>, etc.)
$xml_file = 'xml/links.xml';
$xsl_file = 'xml/links.xsl';
$xslt = xslt_create();
$fileBase = 'file://' . getcwd() . '/';
xslt_set_base($xslt,$fileBase);
$result = @xslt_process($xslt, $xml_file, $xsl_file);
if (!$result) echo 'XSLT processing error: ' .xslt_error($xslt);
else echo $result;
xslt_free($xslt);
// Write footer information (i.e. </html>, </body>, etc.)
?>Thanks a bunch for all the help / advice provided.