#26242 [Opn->Fbk]: XSLT instruction comment() doesn't work when libxslt is used

From: Date: Mon, 17 Nov 2003 23:35:06 +0000
Subject: #26242 [Opn->Fbk]: XSLT instruction comment() doesn't work when libxslt is used
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50551@lists.php.net to get a copy of this message
 ID:               26242
 Updated by:       sniper@php.net
 Reported By:      apetrenko at tmsoft-ltd dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         XSLT related
 Operating System: Windows
 PHP Version:      4.3.4
 New Comment:

Try disabling the Zend Optimizer first..



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

[2003-11-14 04:48:02] apetrenko at tmsoft-ltd dot com

Furthermore if I remove comment() instruction from XSTL template the
result in CGI mode is correct!

The part of XSLT template:
<xsl:template match="@*|node()">
  <xsl:copy><xsl:apply-templates select="@*|node()"/>
</xsl:copy>

The result:
<?xml version="1.0" encoding="windows-1251"?> <root> <A>
<!-- COMMENT 1
//--> </A> </root>

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

[2003-11-14 03:24:10] apetrenko at tmsoft-ltd dot com

Hello.
This note was sent to wrong section (for ALL user). May be you'll
receive it twice.

There is a new info: it works properly in CGI mode but incorrectly in
API mode (I use Apache 1.3.27).

phpinfo reference:
http://www.aesthetic.com.ua/misc/phpinfo.htm
Sorry for some skipped info - this was done by demand of our system
administrator.

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

[2003-11-13 12:59:56] rrichards@php.net

Can you send a link to your phpinfo output? as I can't reproduce this

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

[2003-11-13 12:05:16] apetrenko at tmsoft-ltd dot com

Description:
------------
XSLT instruction comment() doesn't work when libxslt is used. But when
I've replaced php extension php_domxml.dll by old version (from php
4.3.2) all was worked.

Reproduce code:
---------------
$xml = '<?xml version="1.0"?>
<root>
	<A>
		<!-- COMMENT 1 //-->
	</A>
</root>
';

$xslt = '
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" encoding="windows-1251"/>
<xsl:template match="@*|node()|comment()">
	<xsl:copy><xsl:apply-templates select="@*|node()|comment()"
/></xsl:copy>
</xsl:template>
</xsl:stylesheet>
';

$xml_obj = domxml_open_mem ($xml);
$xslt_obj = domxml_xslt_stylesheet ($xslt);
$result_obj = $xslt_obj->process ($xml_obj);
$result = $xslt_obj->result_dump_mem ($result_obj);
echo htmlspecialchars ($result);

Expected result:
----------------
<?xml version="1.0" encoding="windows-1251"?> <root> <A>
<!-- COMMENT 1
//--> </A> </root> 

Actual result:
--------------
<?xml version="1.0" encoding="windows-1251"?> <root> <A>
</A> </root> 


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


-- 
Edit this bug report at http://bugs.php.net/?id=26242&edit=1


Thread (10 messages)

« previous php.bugs (#50551) next »