Subject: Re: PHP integration with XSLT
From: dfour <dfour@xxxxxxx>
Date: Fri, 9 Nov 2001 10:25:02 -0500
|
Processing with PHP files generated by Cocoon is not very easy.
Here is the way I do it :
access from a php script the xml file (including the xslt stylesheet
declaration to transform it) thru an http fopen():
$fp = fopen("http://yourserverpath/yourfile.xml", "r");
read it :
while(!feof($fp)) $content .= fgets($fp, 1024);
1024 is an arbitrary buffer size (NB: you can't use sizeof("yourfile.xml")
with a remote access)
save it as a php file :
$fp = fopen("yourtransformedfile.php", "w");
fwrite($fp);
fclose($fp);
and load that file :
header("Location: http://yourserverpath/yourtransformedfile.php");
It's not simple but it works.
Every attempt I made to redirect immediatly after getting the transformed
content failed, even with ob_start()...
Daniel Fournier
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|