• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

XML and PHP, I'm not having a very easy time of this - help?

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
 
Back
Top