commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bob mcwhirter <...@werken.com>
Subject Re: [jelly] dynamically generated variable names / xpath xpressions
Date Wed, 21 May 2003 03:17:15 GMT
On Wed, 21 May 2003, Bill Keese wrote:

> In jelly, you can create a variable with a dynamically generated name, but
> there is no way to reference that variable.  For example, the following
> doesn't work.  The third line doesn't do what I want:
> 
>   <j:set var="id">T1234</j:set>
>   <threads:thread var="${id}">...</threads:thread>        <!-- creates
> thread named "T1234" -->
>   <threads:join thread="${id}"/>                                    <!-- 
> looks for thread named "ID" -->
> 
> So, I want to do something like ${${id}} but that doesn't seem to work
> either.
> 
> Similarly, you cannot use generated XPath expressions
> 
>   <jelly:set var="myXpathExpression">$myDocument/foo/bar</jelly:set>
>   <x:expr select="${myXpathExpression}"/>
> 
> Is there any workaround?

I think the context is placed in the context as 'context', allowing:

	<j:set var="id" value="T1234"/>
	${context.findVariable(id)}

-bob


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message