|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Using parameter with xsl:for-each
Hi,
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="http://www.w3.org/1999/XSL/Transform" 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="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Here is my xml source: <Resources> <Resource URL="http://www.aspindustry.org/"> <Keywords> <ASP/> <SB/> </Keywords> </Resource> <Resource URL="http://www.aspnews.com/" > <Keywords> <ASP/> </Keywords> </Resource> </Resources> 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. -Max
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








