tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Ross" <rr...@stupendousman.com>
Subject Re: * in XPath predicate
Date Wed, 06 Aug 2003 18:25:11 GMT
Hmmm..   Well the thing is that * is just one of the possible conditions.
Normally, I get a string literal I use to filter out employees.   That part
works fine, but when the string is *, I don't get any nodes despite the fact
that should produce valid XPath.

This also fails, but this time I get all of the nodes, without regard to the
predicate.

<c:set var="predicate" value="role='Bus' " />
<x:forEach select="$doc//employee[$predicate]" >

This fails:

<c:set var="predicate" value="Bus" />
<x:forEach select="$doc//employee[role=$predicate]" >


P.S.  I've tried every combo of escaped ticks I can think of.


R


>
> ----- Original Message -----
> From: "Siggelkow, Bill" <bill.siggelkow@mirant.com>
> To: "'Tag Libraries Users List'" <taglibs-user@jakarta.apache.org>
> Sent: Wednesday, August 06, 2003 9:12 AM
> Subject: RE: * in XPath predicate
>
>
> > Maybe try the count() function as in -- this should give you all
employees
> that have at least one role child element.
> >
> > <x:forEach select="$doc//employee[count(role)]" >
> >
> > -----Original Message-----
> > From: Rick Ross [mailto:rross@stupendousman.com]
> > Sent: Wednesday, August 06, 2003 12:10 PM
> > To: taglibs-user@jakarta.apache.org
> > Subject: Fw: * in XPath predicate
> >
> >
> >
> > Good morning all,
> >
> > I am trying to generate my xpath statement based on parameters, and I
find
> that it works perfectly with the exception that the * in the predicate
fails
> when dynamically populated, although it works fine when hardcoded.
> >
> > So this will work:
> > <x:forEach select="$doc//employee[role=*]" >
> >
> > But this will not:
> >
> > <c:set var="roleName" value="*" />
> > <x:forEach select="$doc//employee[role=$roleName]" >
> >   .....
> >
> >
> > I'm guessing that the * gets tick marks ( ' ) when it is processed.
Any
> thoughts?
> >
> > Thanks,
> >
> >
> > Rick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
>


Mime
View raw message