commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [Jelly] How to do multi-document xpath selections
Date Wed, 08 Sep 2004 21:48:42 GMT
Why does the following not work, supposing docs is a list of documents ?

<j:new var="results" className="java.util.ArrayList"/>
<j:forEach items="${docs}" var="doc">
   <x:set var="result" select="$doc/myX/p/a/th"/>
   <j:mute>${results.addAll(result)}</j:mute>
   </j:forEach>

results is now the set of all your results...

There's one assumption here which is dangerous: result should be a list!
For this, xml-taglib's SetTag should be enhanced. Currently, it already 
considers when single="true" that the result should be a single node 
and not a list, it doesn't force, when single="false", to put things in 
a list. That's not very big... I could do it soon probably.

Does this answer your question ?

paul


Le 8 sept. 04, à 17:54, Marc DEXET a écrit :

> Hello.
> I'm trying to use jelly (once again) to run xpath selection on several
> document input, but I don't succeed.
> Anybody have a trail to follow ?
>
> Thanks.
>
>
> .......................
> Marc DeXeT
> .......................
>
>


---------------------------------------------------------------------
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