php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27349 Invalid parsing of CDATA sections in XSL templates
Submitted: 2004-02-22 09:24 UTC Modified: 2004-02-24 09:21 UTC
From: kalita at implix dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.3.5RC3 OS: FreeBSD 4.9
Private report: No CVE-ID: None
 [2004-02-22 09:24 UTC] kalita at implix dot com
Description:
------------
With the most recent LibXML/LibXSLT libs CDATA sections in XSL templates that are enclosed
in <xsl:text disable-output-escaping="yes"> give output
that IS escaped but shouldn't be.

I've been testing the transformation with xsltproc and
everything behaves correctly. That's why I assume that
this is incompatibility of the DOMXML extension with
the most recent LibXML/LibXSLT libs.

LibXML - 2.6.5
LibXSLT - 1.1.2

Note that this doesn't happen
with the LibXSLT branch 1.0.X


Reproduce code:
---------------
(...)

<xsl:text disable-output-escaping="yes">
<![CDATA[ <b> test </b> ]]>
</xsl:text>

(...)

Expected result:
----------------
<b>test</b>

Actual result:
--------------
&lt;b&gt;test&lt/b&gt;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-23 05:12 UTC] chregu@php.net
This is not a PHP bug. If anyone's doing wrong here, 
it's libxslt, but I couldn't reproduce it..
 [2004-02-23 06:14 UTC] kalita at implix dot com
http://devel.implix.com/test_area/xmltest/
(directory index is on)

test.php - php file to make transformation
simple.xml - source xml file
simple.xsl - source xsl file
test.phps - source for the php file
phpinfo.php - phpinfo output

Please compare the output from PHP to
output from xsltproc:
xsltproc simple.xsl simple.xml

The output is different and xsltproc generates
the correct output (disabled escaping of CDATA 
section) while PHP returns CDATA section that
is escaped.
 [2004-02-24 06:36 UTC] chregu@php.net
you're link is password protected...
 [2004-02-24 06:46 UTC] kalita at implix dot com
l: phptemp
p: phptemp
 [2004-02-24 09:21 UTC] chregu@php.net
Should be fixed in CVS
 [2004-02-24 09:21 UTC] chregu@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 02:01:29 2024 UTC