i have both an xml and xsl file to be transformed via php. so far i have not successfully been able to transform using php. this is the script i've been attempting to use:
<?php
$xsltHnd = xslt_create();
$xml = join('',file('showsInfo.xml'));
$xsl = join('',file('showsInfo.xsl'));
$arguments = array(
'/xml' => $xml,
'/xsl' => $xsl
);
$html = xslt_process($xsltHnd, 'arg:/xml', 'arg:/xsl', NULL, $arguments);
echo $html;
?>
these two files have been successfully transformed using an html file, however. the code in this html file is as follows:
<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("showsInfo.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("showsInfo.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>
my hosting service runs php version 4.2.3 on an apache server.
I have no idea why the php file isn't working. anyone have any suggestions?
Thanks,
Al
ps. if anyone would prefer to look at the files, just let me know.