You know I think you are right -- I could not find a way to do this other than using a different mechanism (e.g. [count(role)!=0]) than the wildcard.
-----Original Message----- From: Rick Ross [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:50 PM To: Tag Libraries Users List Subject: Re: * in XPath predicate Ok, It all boils down to this: Using a string variable in a select predicate results in a properly escaped xpath statement. <c:set var="pred" value="clerk" /> <x:forEach select="$doc//employee[role=$pred]" > results in a select like "$doc//employee[role='clerk']" which is fine. BUT there is no way to specify wildcards like *. <c:set var="pred" value="*" /> <x:forEach select="$doc//employee[role=$pred]" > appears to result in a select like "$doc//employee[role='*']" which is not correct. I've dug through the archives and this is not found, nor any clear mention in the spec. It smells like a valid bug/missing but necessary feature. I'll give it a couple of days before I log something. Just in case. R ----- Original Message ----- From: "Rick Ross" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 06, 2003 11:25 AM Subject: Re: * in XPath predicate > 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" <[EMAIL PROTECTED]> > > To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]> > > 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:[EMAIL PROTECTED] > > > Sent: Wednesday, August 06, 2003 12:10 PM > > > To: [EMAIL PROTECTED] > > > 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: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]