[xsl] xslt 1, node sets in variables

Subject: [xsl] xslt 1, node sets in variables
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Fri, 31 Jul 2009 15:39:42 -0500
From my research on the web, it seems like I should be able to do this, but I can't seem to make it work. How can I get a node set into a variable so that I can do processing on it before it goes to the new template? (or some other way to get the same functionality.

I'm using xslt 1, using libxml via php.

Any help or pointers would be appreciated.

My xml varies (sometimes the projects are nested deeper, etc) but the general point is
<project @active="1" @new="1">stuff</project>
<project @active="2" @new="0">stuff</project>
<project @active="0" @new="0">stuff</project>

The error I'm getting is:
**public_project_list_display.xsl line 76 element apply-templates
The 'select' expression did not evaluate to a node set.
The stylesheet is

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:exsl="http://exslt.org/common"; extension-element-prefixes="exsl">
<xsl:template match="projects">
<xsl:when test="$active_filter = 'active'">
<xsl:copy-of select="project[@active!=0]"/>
<xsl:when test="$active_filter = 'archived'">
<xsl:copy-of select="project[@active=0]"/>
<xsl:when test="$active_filter = 'new'">
<xsl:copy-of select="project[@new=1]"/>
<xsl:copy-of select="project"/>
<xsl:value-of select="count(exsl:node-set($projects))"/>
<xsl:value-of select="name(exsl:node-set($projects)[1])"/>
<xsl:when test="count(exsl:node-set($projects))>10">
<xsl:call-template name="pagenated">
<xsl:with-param name="projects" select="exsl:node-set($projects)"/>
<xsl:call-template name="not_pagenated">
<xsl:with-param name="projects" select="exsl:node-set($projects)"/>

<xsl:template name="not_pagenated">
<xsl:param name="projects"/>
<ul class="list-menu results">
<xsl:apply-templates select="$projects"> <-- line 76
<xsl:sort select="@sort_key"/>

Thanks for your time. Joelle

Current Thread