Subject:Reference to var 'xxx' must evaluate to a node list Author:Daniel Frechette Date:23 Nov 2005 03:11 PM
ello,
I get the error message "Reference to variable or parameter 'dayNames' must evaluate to a node list" when I execute the following transformation using any MSXSL processor. The error occurs on the last line. Does anyone know what this error means? Is there a better way of doing this?
Subject:Reference to var 'xxx' must evaluate to a node list Author:(Deleted User) Date:23 Nov 2005 03:50 PM
Daniel,
1) Please don't use the Refresh or Back buttons on your browser, it causes your messages to be posted twice. If you want to refresh, just click anywhere in the "Conferences" side bar. :)
2) Your xslt looks like it should work, but there is a little trap in XSLT 1.0. XSLT 1.0 doesn't understand that a variable ($dayNames) might contain a node set, so you have to force it:
In the top of your xslt, add this namespace:
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
Then, change this line:
<xsl:variable name="sunday" select="$dayNames/token[1]/text()"/>
to this
<xsl:variable name="sunday" select="msxsl:node-set($dayNames)/token[1]/text()"/>
By the way, you probably know this, but just in case: You wont see any output from this program unless you add a <xsl:value-of ... or something.