ID:               37042
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php at xmlnode dot com
 Status:           Bogus
 Bug Type:         XSLT related
 Operating System: Solaris, Debian, Windows
 PHP Version:      5.1.2
 New Comment:

which libxml2/libxslt versions are you using.

It works for me and prints
bool(false)

And you're right, it's nothing we can do about it. File a bug 
at xmlsoft.org, if you can reproduce the error with the latest 
libraries


Previous Comments:
------------------------------------------------------------------------

[2006-04-11 17:58:29] [EMAIL PROTECTED]

which libxml2/libxslt versions are you using.

It works for me and prints
bool(false)

And you're right, it's nothing we can do about it. File a bug 
at xmlsoft.org, if you can reproduce the error with the latest 
libraries

------------------------------------------------------------------------

[2006-04-11 17:40:14] php at xmlnode dot com

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 this bug report at http://bugs.php.net/?id=37042&edit=1

Reply via email to