xsl-list
[Top] [All Lists]

RE: filter based on parameter, not getting it.

2002-09-20 13:27:21
[Carter, Will]

This code doesn't work:

<table>
      <xsl:for-each select="$filter">

<!--===============================================
        Here is the problem.  The variable is out of scope - it is only
in scope in your xsl:when or xsl:otherwise element.  Therfore the
variable does not
exist for the code below.
   ==================================================-->


      <tr>
              <td><xsl:value-of select="cat"/></td>
              <td><xsl:value-of select="dog"/></td>
              <td><xsl:value-of select="fish"/></td>
      </tr>
      </xsl:for-each>
</table>
---------------------------------------------------------

Restructure your stylesheet so that you call a named template (or
apply-templates) to create the table cells, and pass in the $filter
variable as a parameter to the template.

Cheers,

Tom P

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list