XSLT tranform- Can it be applied to a live URL?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lemonfreshmedia
Forum Commoner
Posts: 26
Joined: Fri Dec 02, 2005 7:14 pm

XSLT tranform- Can it be applied to a live URL?

Post by lemonfreshmedia »

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.

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;
?>
Post Reply