|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-27 20:14 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 08:00:02 2026 UTC |
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/*":