commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marc & lan" <marc...@free.fr>
Subject Re: [jelly] XPath to comma-separated list?
Date Sun, 23 Jan 2005 21:40:01 GMT
> Right now I'm using this code
>
>     <x:parse var="beansProject" xml="${f}" />
>     <x:set var="configs" trim="true"
>       select="$beansProject/beansProjectDescription/configs/config"/>
>
>     <j:forEach var="infile" indexVar="i" items="${configs}">
>       <j:if test="${i gt 0}">
>         <j:set var="inputs" value="${inputs},"/>
>       </j:if>
>       <j:set var="inputs" value="${inputs}${infile.text}"/>
>     </j:forEach>
>
> But for my taste this is much too pedestrian.

Sure it's no very pretty.
But I've searched for a "implode" php-like in Java, and there's not.
You can create a java class with a static method which does it

I'm thinking we need a set of text manipulation set inluding such a feature
<implode source="${src}" var="dest" sep=","/>

Marc
- 


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


Mime
View raw message