hi list
I've got a problem during a xslt-transformation. I alway get this error:
"Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in /var/www/mdb/testxslt.php on line 11".
as far as I catch the problem, one of my xml or xsl file is not well-formed.
but if I process them in a console using the sablotron command-line utility
sabcmd, there is no error at all. the same with other xslt-processor like
saxon.
below you see the code I use.
-----testxslt.php-
<?php
$sablot = xslt_create();
xslt_set_log($sablot, true);
xslt_set_log($sablot, getcwd() . '/sablot.log');
$xml = implode('',file('data.xml'));
$xsl = implode('',file('layout-normal.xsl'));
$html = xslt_process($sablot, $xml, $xsl);
print($html);
xslt_free($sablot);
?>
-----/testxslt.php-
-----data.xml-
<?xml version="1.0" encoding="iso-8859-1"?>
<mdb>
<menulogin>menu</menulogin>
<loginform>login</loginform>
</mdb>
-----/data.xml-
-----layout-normal.xsl-
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/mdb">
<!--
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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" xml:lang="en" lang="en">
<head>
<title>$sitetitle</title>
<meta content=""/>
<link rel="stylesheet" href="/stylesheet.php" type="text/css" />
</head>
<body>
<xsl:apply-templates select="loginform"/>
</body>
</html>
</xsl:template>
<xsl:template match="loginform">
<h1>
<xsl:value-of select="self::node()"/>
</h1>
</xsl:template>
</xsl:stylesheet>
-----/layout-normal.xsl-
-----sablot.log-
Sablotron Message on line none, level log: Parsing '...>
</body>
</html>
</xsl:template>
<xsl:template match="loginform">
<h1>
<xsl:value-of select="self::node()"/>
</h1>
</xsl:template>
</xsl:stylesheet>
'...
-----/sablot.log-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php