Using parameter with xsl:for-each

Subject: Using parameter with xsl:for-each
From: "Max Rubinstein" <mrubinst@xxxxxxxxxxx>
Date: Tue, 27 Jun 2000 08:27:26 CDT

I am trying to use a parameter in the select attribute of xsl:for-each. Here is my stylesheet:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl=""; version="1.0">
<xsl:param name="selectpath" />

 	<xsl:template match="/">
		<p><xsl:value-of select="$selectpath"/></p>
 		<xsl:for-each select="$selectpath">
			<xsl:value-of select="."/>


Here is my xml source:
	<Resource URL="";>
			<ASP/> <SB/>
	<Resource URL=""; >

When I try to invoke the stylesheet passing "Resources/Resource" as a parameter (using MSXML May 2000), I get the following error:

"Reference to a variable or parameter "selectpath" must evaluate to a node list."

But, if I remove "xsl:for-each" clause, I do see the output of "xsl:value-of" that shows that my parameter was passed successfully to the stylesheet.

Any help would be appreciated.


________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at

XSL-List info and archive:

Current Thread