Page 1 of 1

parsing an XML file

Posted: Tue Mar 28, 2006 10:34 am
by bruceg
I am trying to output data from an XML file using XSLT.

is this the correct syntax?

Code: Select all

<?php
$xml = simplexml_load_file('test.xml');
$proc = new XsltProcessor( 'test.xsl');
$proc->importStylesheet($xsl);
$newxml = $proc->transformToDoc($xml);
print $newxml->saveXML();
?>
I get an error
Fatal error: Call to undefined function: simplexml_load_file() in /hsphere/local/home/bruceg/inspired-evolution.com/XML.php on line 2

Posted: Tue Mar 28, 2006 10:39 am
by jrd
are you using php5

Posted: Tue Mar 28, 2006 10:43 am
by bruceg
no, 4.4.1

Posted: Tue Mar 28, 2006 10:48 am
by jrd
i think you need php5 to run that command.

http://my2.php.net/simplexml_load_file