RE: [xsl] Variable with node list...

Subject: RE: [xsl] Variable with node list...
From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx>
Date: Fri, 16 Nov 2001 23:28:50 +0200
Hello Brad!

> I get the following error from Microsoft's parser when processing the
> included document and stylesheet.
That parser is probably right :) <xsl:for-each> needs node-set to iterate through, whereas you give it result tree fragment instead.
>   Reference to variable or parameter 'properties' must evaluate to a node
> list.
> Has anyone else run across this? (MSXML3, IE6, Windows 2000 Server)
Yeah, it seems to me all of us have to try to do it once in the life.

>     <xsl:variable name="properties">
>       <property>one</property>
>       <property>two</property>
>       <property>three</property>
>     </xsl:variable>
This variable actually holds result tree fragment, not node-set, see

I know 2 ways to resort:
1. use msxsl:node-set(rtf) extension function (see more in msxml doc) to convert result tree fragment to node-set.
2. Redesign you stylesheet this way:

<xsl:stylesheet version="1.0"
xmlns:xsl=""; xmlns:user="";>
  <xsl:template match="root">
      <xsl:for-each select="document('')/*/user:properties/property">
          <xsl:value-of select="."/>

Oleg Tkachenko,
Multiconn International, Israel 

 XSL-List info and archive:

Current Thread