mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
15 lines
508 B
PHP
15 lines
508 B
PHP
<?php
|
|
$path = dirname(__FILE__) . '/';
|
|
|
|
/* load XSLT Stylesheet as if it were a regular XML file via DOM extension */
|
|
$xslDom = new domdocument;
|
|
$xslDom->load($path . 'forum.xsl');
|
|
|
|
/* load the actual XML data we will use to populate the stylesheet */
|
|
$xmlDom = new domdocument;
|
|
$xmlDom->load($path . 'thedata.xml');
|
|
|
|
$xsl = new XsltProcessor; // instantiate XSLT processor
|
|
$xsl->importStylesheet($xslDom); // load stylesheet
|
|
echo $xsl->transformToXML($xmlDom); // perform the transformation & return HTML
|
|
?>
|