This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: variable in filter doesn't work??


> From: Carter, Will [mailto:WCarter@envestnetpmc.com]
> Sent: Friday, September 20, 2002 10:24 AM
> Subject: [xsl] variable in filter doesn't work??
> 
> 
> why doesn't this work?
> -----------------------
> <xsl:variable name="filter" select='"cat = &apos;zoro&apos;"'/>
> <xsl:value-of select="$filter"/>

Here I assume you mean xsl:for-each.  for-each only iterates on a node-set;
your variable $filter doesn't return a node-set, but rather a literal
string, "cat = &apos;zoro&apos;".

It might be easier to define the expression in the select attribute of the
for-each loop:

<xsl:for-each select="//person/cat = 'zoro'">
  ...
</xsl:for-each>

which would eliminate the need for the variable.

cheers,
b.

| brian martinez                              brian.martinez@trip.com |
| senior gui programmer                                  303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]