#37042 [NEW]: libxml_get_last_error always returns error after importStylesheet

From: Date: Tue, 11 Apr 2006 17:40:15 +0000
Subject: #37042 [NEW]: libxml_get_last_error always returns error after importStylesheet
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95621@lists.php.net to get a copy of this message
From: php at xmlnode dot com Operating system: Solaris, Debian, Windows PHP version: 5.1.2 PHP Bug Type: XSLT related Bug description: libxml_get_last_error always returns error after importStylesheet Description: ------------ It seems that libxml_get_last_error always has an error after importing a perfectly valid, well-formed, xsl stylesheet. This makes it difficult to determine if there is really a problem with the stylesheet versus 'noise'. :( Reproduce code: --------------- <?php libxml_use_internal_errors(true); $x = new DomDocument; $y = new XSLTProcessor; $x->load('foo.xsl'); $y->importStyleSheet($x); var_dump(libxml_get_last_error()); // not needed to show the problem, but if uncommented works // $x->loadxml('<FOO />'); // echo $y->transformToXML($x); ?> // the stylesheet which opens without error in other parsers <?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" encoding="iso-8859-1" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> <xsl:template match="/"> hi </xsl:template> </xsl:stylesheet> Expected result: ---------------- No errors. In fact, if you comment the vardump and uncomment the last two lines of the reproducable code above, it will transform the document as expected, but there's still an error in libxml. I recognize that libxml is outside of your immediate jurisdiction, but was hoping you could alter libxml_get_last_error to be smarter or something... not sure what I'm hoping for exactly. Actual result: -------------- object(LibXMLError)#3 (6) { ["level"]=> int(3) ["code"]=> int(77) ["column"]=> int(1) ["message"]=> string(47) "Premature end of data in tag stylesheet line 2 " ["file"]=> string(37) "file:///c%3A/xampplite/htdocs/foo.xsl" ["line"]=> int(11) } -- Edit bug report at http://bugs.php.net/?id=37042&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37042&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37042&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37042&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37042&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37042&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37042&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37042&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37042&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37042&r=support Expected behavior: http://bugs.php.net/fix.php?id=37042&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37042&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37042&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37042&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37042&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37042&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37042&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37042&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37042&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37042&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37042&r=mysqlcfg

« previous php.bugs (#95621) next »