RE: [xsl] Parameter in Predicate in xsl:template match problem

Subject: RE: [xsl] Parameter in Predicate in xsl:template match problem
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Wed, 16 Apr 2003 16:51:19 -0600
> From: Nathaniel Brett Stoddard [mailto:nstoddar@xxxxxxxxx]
> Sent: Wednesday, April 16, 2003 4:42 PM
> Subject: [xsl] Parameter in Predicate in xsl:template match problem
> 
> 
> <snip>
>
> <xsl:param name="target_category" select="'3'"/>
> <xsl:template match="//category[@b='3']">
> 
> The preceding line works, but what I really want is:
> 
> <xsl:template match="//category[@b={$target_category}]">

Lose the curly braces.  You don't want to use an attribute value template
here (and can't anyway--they're not allowed within XPath expressions), just
a variable reference.

hth,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.708.7248 |
| cheap tickets, part of trip network                fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

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


Current Thread