XSLT Problem
| From: | Andrew Golovin | Date: | Sat, 03 Feb 2001 13:38:04 +0000 |
| Subject: | XSLT Problem | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-5362@lists.php.net to get a copy of this message | ||
Hello!
I found all that bugs of weldformedness! Example code from manual
contains not wellformes <BR>s! They must be <BR />!
working example for xslt_process is follows:
$xslData = '<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="article">
<table border="1" cellpadding="2" cellspacing="1">
<tr>
<td width="20%">
</td>
<td width="80%">
<h2><xsl:value-of select="title" /></h2>
<h3><xsl:value-of select="author" /></h3>
<br />
<xsl:value-of select="body" />
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>';
$xmlData = '<?xml version="1.0"?>
<article>
<title>Learning German</title>
<author>Sterling Hughes</author>
<body>
Essential phrases:
<br />
<br />
Komme sie mir sagen, woe die toilette es?<br />
Eine grande beer bitte!<br />
Noch einem bitte.<br />
</body>
</article>';
if (xslt_process($xslData, $xmlData, $result))
{
echo "Here is the brilliant in-depth article on learning";
echo " German: ";
echo "<br>\n<br>";
echo $result;
}
else
{
echo "There was an error that occurred in the XSL transformation...\n";
echo "\tError number: " . xslt_errno() . "\n";
echo "\tError string: " . xslt_error() . "\n";
exit;
}
Best regards!
Andrew Golovin
http://exper.ural.ru/
PGP Fingerprint: 24FD A0CD 667C 1FC7 C2F7 A2EA 9742 D484 FD3C 598D