<?
// Xml and XSL files
$xml_file = "complex.xml";
$xsl_file = "complex.xsl";
// Allocate a new XSLT processor
$xh = xslt_create();
$fileBase = 'file://' . getcwd () . '/';
xslt_set_base ( $xh, $fileBase );
// Process the document
$result = xslt_process($xh, $xml_file, $xsl_file);
if (!$result) {
// Something croaked. Show the error
echo 'XSLT processing error: ' .xslt_error($xh) ;
}
else {
// Output the resulting HTML
echo $result;
}
// Destroy the XSLT processor
xslt_free($xh);
?>