XSLT tranform- Can it be applied to a live URL?
Posted: Tue Dec 20, 2005 1:46 pm
Hello all,
I've been trying perfrom an XSLT trsformation on a url that contains and rss2/xml file and cannot seem to accomplish it.
So far this code has worked for me while using a local file. My need is for it to transform a live url. I beleive i should be able to do this using 'fopen', but cannot poinpoint the solution.
Am I asking too much?
Any help is much appreciated.
I've been trying perfrom an XSLT trsformation on a url that contains and rss2/xml file and cannot seem to accomplish it.
So far this code has worked for me while using a local file. My need is for it to transform a live url. I beleive i should be able to do this using 'fopen', but cannot poinpoint the solution.
Am I asking too much?
Any help is much appreciated.
Code: Select all
<?php
// Create an XSLT processor
$xsltproc = xslt_create();
// Perform the transformation
$html = xslt_process($xsltproc, 'myxml.xml', 'myxsl.xsl');
// Detect errors
if (!$html) die('XSLT processing error: '.xslt_error($xsltproc));
// Destroy the XSLT processor
xslt_free($xsltproc);
// Output the resulting HTML
echo $html;
?>