SunnyD
Belgian Waffler
I've been trying to get a dynamic webpage based on some XML data to work, but for some reason I can't. Maybe someone can tell me what I'm doing wrong?
I'm running IIS 5.1 (WinXP) & PHP 4.2.2.
Here's my .php script:
<html>
<title>PHP XSLT test</title>
<body>
The following is an XSLT test of PHP's XML functionality:
<?PHP
$xsltproc = xslt_create();
$output = xslt_process($xsltproc, 'http://www.camelotherald.com/xml/servers.xml', 'xmltest.xsl');
print $output;
xslt_free($xsltproc);
?>
</body>
</html>
Here's my XSL transform:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="server_status/server">
<xsl:value-of select="population"/><br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
PHP, actually Salbatron gives me an error message, invalid token, document not well-defined. But the thing is, if I download the XML file, and do a raw XML transform with my XSLT file, it works fine. What am I doing wrong?
Thanks.
SunnyD
I'm running IIS 5.1 (WinXP) & PHP 4.2.2.
Here's my .php script:
<html>
<title>PHP XSLT test</title>
<body>
The following is an XSLT test of PHP's XML functionality:
<?PHP
$xsltproc = xslt_create();
$output = xslt_process($xsltproc, 'http://www.camelotherald.com/xml/servers.xml', 'xmltest.xsl');
print $output;
xslt_free($xsltproc);
?>
</body>
</html>
Here's my XSL transform:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="server_status/server">
<xsl:value-of select="population"/><br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
PHP, actually Salbatron gives me an error message, invalid token, document not well-defined. But the thing is, if I download the XML file, and do a raw XML transform with my XSLT file, it works fine. What am I doing wrong?
Thanks.
SunnyD