Then try doing
this with your variable when you need to use the list variable as for-each, etc:
<xsl:for-eachselect="msxml:node-set($list)/node">
While the nodeset remains intact and as a nodeset when you use inside the variable select, it becomes a result tree fragment when declared by value-of.
Whenever you use value-of, the processor evaluates the result as a string, whereas select returns a nodeset. If you need to conditionally select the node(s) for a variable, you need to use copy-of instead of value-of, but then you're actually getting a "result tree frament" (as Josh mentions) - you can convert that to a nodeset using the msxml:node-set() function (remember to declare the msxml prefix - the standard XSLT templates does that automatically). So domething like this:
Why does value-of not work when inside a param or variable
When I use:
It works fine... but when I try to do the following:
It breaks the xslt???
Does any have any insights to this?
Where is $currentPage declared? Maybe its gone out of scope??
What kind of error message do you receive when trying to save the XSLT?
And have you tried to see if the XSLT in fact works if you check the "Skip error testing" box?
/Jan
Hamish if you are finding that you get the error:
'cannot convert result tree fragment to nodeset'
Then try doing this with your variable when you need to use the list variable as for-each, etc:
While the nodeset remains intact and as a nodeset when you use inside the variable select, it becomes a result tree fragment when declared by value-of.
Hi Hamish,
Whenever you use value-of, the processor evaluates the result as a string, whereas select returns a nodeset. If you need to conditionally select the node(s) for a variable, you need to use copy-of instead of value-of, but then you're actually getting a "result tree frament" (as Josh mentions) - you can convert that to a nodeset using the msxml:node-set() function (remember to declare the msxml prefix - the standard XSLT templates does that automatically). So domething like this:
/Chriztian
Well put Chriztian, I was probably a tad brief before...
Mental note to write up more fully in the future ;)
Thanks guys for your help and the insight of how value-of actually works..
That info helped save my sanity...
is working on a reply...