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

From: Date: Mon, 27 Feb 2006 18:50:37 +0000
Subject: #36549 [NEW]: XML,libxml,libxslt - unable to assign node-set to xslt variable
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93726@lists.php.net to get a copy of this message
From: kwmccabe at yahoo dot com Operating system: RedHat 7.x PHP version: 5.1.2 PHP Bug Type: Scripting Engine problem Bug description: XML,libxml,libxslt - unable to assign node-set to xslt variable 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 bug report at http://bugs.php.net/?id=36549&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36549&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36549&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36549&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36549&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36549&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36549&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36549&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36549&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36549&r=support Expected behavior: http://bugs.php.net/fix.php?id=36549&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36549&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36549&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36549&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36549&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36549&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36549&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36549&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36549&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36549&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36549&r=mysqlcfg

« previous php.bugs (#93726) next »