Zul: XSLT-Prozessor-Fehler?

Beitrag lesen

Hi Forum,

Ich verzweifle im Moment an diesem Code:

<?xml  
 $xml = new DOMDocument;  
 $xml->loadXML('<?xml version="1.0" encoding="utf-8"?>  
<?xml-stylesheet type="text/xsl" href="src/config.xsl"?>  
<!DOCTYPE config PUBLIC "-//ICG//DTD CONFIG 1.0//EN" "src/config.dtd">  
<config xmlns="http://imbacms.org/config">  
  <group name="lang">  
    <value name="standart" value="de"/>  
  </group>  
</config>  
');  
  
 $xsl = new DOMDocument;  
 $xsl->loadXML('<?xml version="1.0" encoding="utf-8"?>  
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="html">  
 <xsl:output method="xml" indent="yes" encoding="utf-8" media-type="application/xhtml+xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>  
 <xsl:template match="/">  
  <html>  
   <head>  
    <title>Config</title>  
    <link rel="stylesheet" type="text/css" href="src/config.css"/>  
   </head>  
   <body>  
    <h1>Config</h1>  
    <xsl:apply-templates/>  
   </body>  
  </html>  
 </xsl:template>  
 <xsl:template match="group">  
  <h2>  
   <xsl:value-of select="@name"/>  
  </h2>  
  <dl>  
   <xsl:apply-templates/>  
  </dl>  
 </xsl:template>  
 <xsl:template match="value">  
  <dt>  
   <xsl:value-of select="@name"/>  
  </dt>  
  <dd>  
   <xsl:value-of select="@value"/>  
  </dd>  
 </xsl:template>  
</xsl:stylesheet>');  
  
 $xsltprocessor = new XSLTProcessor();  
 $xsltprocessor->importStylesheet($xsl);  
  
 header('content-type: text/plain');  
 echo $xsltprocessor->transformToXML($xml);  
?>

Eigentlich müsste er diese Ausgabe erzeugen:

<?xml version="1.0" encoding="utf-8"?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
  <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    <title>Config</title>  
    <link rel="stylesheet" type="text/css" href="src/config.css" />  
  </head>  
  <body>  
    <h1>Config</h1>  
    <h2>lang</h2>  
    <dl>  
      <dt>standart</dt>  
      <dd>de</dd>  
    </dl>  
  </body>  
</html>

Ich erhalte leider immer nur diese:

<?xml version="1.0" encoding="utf-8"?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
  <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    <title>Config</title>  
    <link rel="stylesheet" type="text/css" href="src/config.css" />  
  </head>  
  <body><h1>Config</h1>  
  
  
  
</body>  
</html>

Was mache ich falsch? Ist mein XSL-Dokument fehlerhaft, rufe ich den XSLT-Prozessor falsch auf?

Mfg Zul