cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: xsp string to integer..
Date Sat, 23 Sep 2000 01:09:53 GMT
On Fri, 22 Sep 2000, Saif Khaja wrote:

> I removed the --- ""+ ---- from the getInt template in my esql.xsl file and 
> it works now. Thank you.
> 
> It works fine if I do it this way.
> <xsp:logic>String x = Util.EnumToStr(<esql:get-int column="Model"/>); 
> </xsp:logic>
> <Model><xsp:expr>x</xsp:expr></Model>
> 
> I cant have <xsp:logic> inside <xsp:expr> here in this case, and if I try
it 
> this way nothing shows up.
> <Model><xsp:logic>Util.EnumToStr(<esql:get-int column="Model"/>); 
> </xsp:logic></Model>
>
> So is there any elegant way I can get the String out without having to use a 
> variable.

sure:

<Model>
<xsp:expr>Util.EnumToStr(<esql:get-int column="Mode"/>)</xsp:expr>
</Model>

also, you might want to look at using java.text.ChoiceFormat instead of
your EnumToStr method - it's a standard way of doing what i think you're
trying to do.

- donald


Mime
View raw message