#36549 [Opn->Bgs]: XML,libxml,libxslt - unable to assign node-set to xslt variable

From: Date: Mon, 27 Feb 2006 19:14:44 +0000
Subject: #36549 [Opn->Bgs]: XML,libxml,libxslt - unable to assign node-set to xslt variable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93727@lists.php.net to get a copy of this message
ID: 36549 Updated by: rrichards@php.net Reported By: kwmccabe at yahoo dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: RedHat 7.x PHP Version: 5.1.2 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Read up on exslt and node-set Previous Comments: ------------------------------------------------------------------------ [2006-02-27 19:50:36] kwmccabe at yahoo dot com Description: ------------ Unable to assign node-set to xslt variable. <xsl:variable name="test"> <root> <node>one</node> <node>two</node> </root> </xsl:variable> <xsl:for-each select="$test/*"> ... </xsl:for-each> The variable should contain a node-set; instead it contains just a string. This throws an "Invalid type" error (see below) when trying to iterate the (sub)nodes using for-each. Reproduce code: --------------- environment: http://www.tenandtwo.com/test_xsl/info.php run: http://www.tenandtwo.com/test_xsl/bug.php source: http://www.tenandtwo.com/test_xsl/show_source.php?file=/test_xsl/bug.php http://www.tenandtwo.com/test_xsl/show_source.php?file=/test_xsl/bug.xsl Expected result: ---------------- TEST: **** xsl:value-of select="$test": onetwo xsl:copy-of select="$test": <RESULT> <node>one</node> <node>two</node> </RESULT> xsl:for-each select="$test/*": name=RESULT; value= name2=node; value2=one name2=node; value2=two **** DONE Actual result: -------------- Warning: XSLTProcessor::transformToXml() [function.transformToXml]: Invalid type in /var/www/vhosts/tenandtwo.com/httpdocs/test_xsl/bug.php on line 39 TEST: **** xsl:value-of select="$test": onetwo xsl:copy-of select="$test": <RESULT><node>one</node><node>two</node></RESULT> xsl:for-each select="$test/*": ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36549&edit=1

« previous php.bugs (#93727) next »