xsl-list
[Top] [All Lists]

RE: Parameter in Predicate in xsl:template match problem

2003-04-16 15:51:19
From: Nathaniel Brett Stoddard [mailto:nstoddar(_at_)yahoo(_dot_)com]
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[(_at_)b='3']">

The preceding line works, but what I really want is:

<xsl:template match="//category[(_at_)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(_dot_)martinez(_at_)cendant(_dot_)com |
| 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



<Prev in Thread] Current Thread [Next in Thread>