Last 5.3 release ever available: PHP 5.3.29 - 5.3 now EOL
add a note add a note

User Contributed Notes 2 notes

contato at log dot blog dot br
5 years ago
Here's a very simple example on how to use PHP5 to transform a XML file using a XSL file.


= new DOMDocument();

$xmlDoc = new DOMDocument();

$proc = new XSLTProcessor();


For the sake of simplicity there's no error handling on this code. I hope this helps.
hipertracker at gmail dot com
3 years ago
This is more convenient, no files nor verbose variables needed:

= new XSLTProcessor();
$xslt->importStylesheet(new SimpleXMLElement($xslt_string));
$xslt->transformToXml(new SimpleXMLElement($xml_string));
To Top