A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label xampp. Show all posts
Showing posts with label xampp. Show all posts

Display output of XSL transformation using PHP

Use XAMPP or similar to serve (reportedly works on PHP 5):

<?
$query = $_GET['q'];
$filePath = 'http://source-server:8889/page/'.$query;

$xslDoc = new DOMDocument();
$xslDoc->load("http://localhost/xslt/page_render.xsl");
$xmlDoc = new DOMDocument();
$xmlDoc->load( $filePath );

$proc = new XSLTProcessor();

$proc->importStylesheet($xslDoc);
echo $proc->transformToXML($xmlDoc);
?>