X
<?php
$path = dirname(__FILE__) . '/';
# XSLT Stylesheet als "normales" XML-DOM Dokument laden
$xslDom = new domdocument;
$xslDom->load($path . 'book.xsl');
# XML-Daten laden
$xmlDom = new domdocument;
$xmlDom->load($path . 'book.xml');
$xsl = new XsltProcessor; // XSLT Prozessor Objekt erzeugen
$xsl->importStylesheet($xslDom); // Stylesheet laden
echo $xsl->transformToXML($xmlDom); // Transformation - return XHTML
?>
X
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body bgcolor="#ffffff">
<h1>This is an Example-Book</h1>
<h2>Title from Chapter 1</h2>
<p>Text in chapter 1</p>
<h2>Title from Chapter 2</h2>
<p>Text in chapter 2</p>
</body>
</html>