xsl:for-each and variables
Can anyone tell me why the following will not work? XML <data> <row>1</row> <row>2</row> <row>3</row> <row>4</row> </data> XSL <?xml version="1.0" standalone='no'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" xmlns="http://www.w3.org/TR/REC-html40" result-ns=""> <xsl:variable name="temp">data/row</xsl:variable> <xsl:template match="/"> <xsl:for-each select="data/row"> value is <xsl:value-of select="."/> </xsl:for-each> <xsl:for-each select="$temp"> value is <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> If I take out the second for-each everything works. When I leave it in, the output says "cannot convert to node-set". Since the value of temp is the same as the static for-each (right?), shouldn't the result be the same? Any work-arounds? I'm trying to create a template that accepts the tags to process and thus need the second format. (using XT from August running on NT using the windows executable) Any help is GREATLY appreciated. Larry Mason 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