Bug #16193 Updated: XML parser error 4: not well-formed (invalid token) in

From: Date: Thu, 13 Jun 2002 09:48:27 +0000
Subject: Bug #16193 Updated: XML parser error 4: not well-formed (invalid token) in
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10317@lists.php.net to get a copy of this message
ID: 16193 Updated by: chregu@php.net Reported By: kdesormeaux@atre.net -Status: Bogus +Status: Open Bug Type: XSLT related -Operating System: windows2000 +Operating System: windows2000/linux... -PHP Version: 4.1.2 +PHP Version: 4.3.0-dev New Comment: The same problem here. Code which works very fine under 4.2 just spits out: Warning: Sablotron error on line 1: XML parser error 3: no element found in xslt.php on line 62 BC-break? or a real bug? chregu Previous Comments: ------------------------------------------------------------------------ [2002-05-30 09:05:41] urs@circle.ch System: - Windows 2000 - Apache 1.3.24, Apache Release 10324100 - PHP as apache module - PHP 4.3.0-dev - Xslt Support enabled Discussed earlier on bugs.php.net i found the code below, which is said to work. Running the script in command line mode I get - always - the same error: C:\www\www-xml>php -f test.php Warning: Sablotron error on line 1: XML parser error 3: no element found in test.php on line 23 Line 23 is the line with $xh = xslt_create();. -urs -- <?php // http://bugs.php.net/bug.php?id=16993 $xml = <<< END <?xml version="1.0" encoding="ISO-8859-2"?> <ROOT> <IMPORTANT>Very important ö ü é </IMPORTANT> </ROOT> END; $xsl = <<<END <?xml version="1.0" encoding="ISO-8859-2"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html"/> <xsl:template match="ROOT"> <B><xsl:value-of select="IMPORTANT"/></B> </xsl:template> </xsl:stylesheet> END; $arguments = array('/_xml' => $xml,'/_xsl' => $xsl); $xh = xslt_create(); $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments ); echo $result; ?> ------------------------------------------------------------------------ [2002-03-20 17:24:23] derick@php.net The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php ------------------------------------------------------------------------ [2002-03-20 17:19:28] kdesormeaux@atre.net Here is the error: Warning: Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.php on line 7 Error: XML parser error 4: not well-formed (invalid token) Now the code imma going to show has been tried many different ways all with the exact same error message. Here is one sample of the php code... $xh = xslt_create(); $args = array(); $params = array( 'foo' => 'bar' ); $result = xslt_process($xh, 'c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.xml','c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.xml',NULL, $args,$params); if ($result) { print $result; } else { print "Error: ".xslt_error($xh); } @xslt_free($xh); exit; here is the xml.xml <?xml version="1.0"?> <catalog> <cd> <title>str_title</title> <artist>str_artist</artist> </cd> </catalog> here is the xsl.xsl file <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" encoding="utf-8"/> <xsl:template match="/"> <xsl:for-each select="catalog/cd"> <xsl:value-of select="title"/> <xsl:value-of select="artist"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> I have no idea what is going on here. Read the peeps where able to run this on windows but no go here. Maybe my dlls are baffed???? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16193&edit=1

« previous php.bugs (#10317) next »