#28097 [Opn->Bgs]: xsl:copy-of not working properly

From: Date: Thu, 22 Apr 2004 07:25:28 +0000
Subject: #28097 [Opn->Bgs]: xsl:copy-of not working properly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58561@lists.php.net to get a copy of this message
ID: 28097 Updated by: derick@php.net Reported By: cross_phil at hotmail dot com -Status: Open +Status: Bogus Bug Type: XSLT related Operating System: Windows XP Pro PHP Version: 4.3.4 New Comment: Can't possibly be a bug in PHP as PHP doesn't handle the transformations. If it is a bug, it's a bug in sablotron so please contact its authors. Previous Comments: ------------------------------------------------------------------------ [2004-04-21 19:05:56] cross_phil at hotmail dot com Description: ------------ I am using the sablotron xsl extension to transform xml files. The xsl:copy-of tag does not appear to work properly. It should copy the tree fragment entirely to the result document but it only copies element tags. Some of the elements contain text within them (ie: <test>some text</test> would copy as <test></test> without the text). I am convinced that my code is fine because other transforms that don't use this tag work fine and there are somre pretty crazy transforms that I am trying to run. Reproduce code: --------------- My XML data: <?xml version="1.0"?> <testroot> <testelement> <anotherelement> some text </anotherelement> <and_again> some more text </and_again> </testelement> </testroot> My XSL sheet: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="testelement"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> My PHP Code: $xslp = xslt_create(); echo xslt_process($xslp, 'in.xml', 'xsl.xsl'); xslt_free($xslp); Expected result: ---------------- <testelement> <anotherelement> some text </anotherelement> <and_again> some more text </and_again> </testelement> Actual result: -------------- <?xml version="1.0" encoding="UTF-8" ?> <testelement> <anotherelement /> <and_again /> </testelement> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28097&edit=1

« previous php.bugs (#58561) next »