cancel
Showing results for 
Search instead for 
Did you mean: 

PHP - XML - XSLT

N/A

PHP - XML - XSLT

Hi all, (sorry not sure if the last post should have gone in here!)
I have had a look in the forums for a topic like this and wasn't able to find anything similar so I do appologise if this has already been covered...

I'm trying to read an XML file and convert it to a webpage via an XSL Transformation.

The XML file is a staggering 6.5 meg big. When I run the PHP code to generate the page by calling the transform function the results I get are

þÿ

and that's it. Evil

Anyone out there able to help meHuh
This is the code....


<?php

// Allocate a new XSLT processor
$xh = xslt_create();

// Process the document, returning the result into the $result variable
$result = xslt_process($xh, 'stats.xml', 'style.xsl');
if ($result) {
echo "SUCCESS, sample.xml was transformed by sample.xsl into the \$result";
echo " variable, the \$result variable has the following contents\n<br />\n";
echo "<pre>\n";
echo $result;
echo "</pre>\n";
} else {
echo "Sorry, sample.xml could not be transformed by sample.xsl into";
echo " the \$result variable the reason is that " . xslt_error($xh);
echo " and the error code is " . xslt_errno($xh);
}

xslt_free($xh);

?>


Any help would be greatly appreciated. :lol:
Dont get too technical, I've only been doing PHP for about 2 weeks! :shock: Shockedops:
Thanks

[Moderator's note (by csogilvie): Duplicate topic removed - please don't cross post to different forums.]
1 REPLY
N/A

PHP - XML - XSLT

I downloaded the two files from your website, and when I try to execute the script at the command prompt, I get a "Segmentation Fault" when reading in the XML file.

I tried it on my local machine, and it ran (slowly) so I wonder if its to do with memory management or something on the CGI platform.