Instead of: Parent: <x:out select="$xml//[EMAIL PROTECTED]'${v}']/../@id"/> <!--FAILS!-->
Try: Parent: <x:out select="$xml//[EMAIL PROTECTED]/../@id"/> -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Digby Sent: Saturday, September 04, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: How do I pass a variable into an x select? I've just noticed that the select attribute of all the x tags isn't ynamic, so I can't pass in a variable - which is kind of exactly what I need to do. Is there a workaround, or am I going to have to abandon jstl xml for xsl or something? What I'm trying to do is below (v variable fails, but I can't hardcode the "two" for obvious reasons. TIA Digby <x:parse var="xml"> <channels id="channels"> <channel id="tv"> <channel id="one"/> <channel id="two"/> <channel id="three"/> <channel id="four"/> </channel> <channel id="sky"> <channel id="movies"/> <channel id="sports"/> </channel> </channels> </x:parse> <c:set var="v" value="three"/> Self: <x:out select="$xml//[EMAIL PROTECTED]'two']/@id"/> Index: <x:out select="$xml/channels/@id"/> Parent: <x:out select="$xml//[EMAIL PROTECTED]'${v}']/../@id"/> <!--FAILS!--> First: <x:out select="$xml//[EMAIL PROTECTED]'two']/../channel[position()=1]/@id"/> Last: <x:out select="$xml//[EMAIL PROTECTED]'two']/../channel[position()=last()]/@id"/> Next: <x:out select="$xml//[EMAIL PROTECTED]'two']/following-sibling::channel/@id"/> Prev: <x:out select="$xml//[EMAIL PROTECTED]'two']/preceding-sibling::channel/@id"/> --------------------------------------------------------------------- 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]