You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marc DEXET <Ma...@dsi.cnrs.fr> on 2004/09/08 17:54:01 UTC
[Jelly] How to do multi-document xpath selections
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
.......................
Re: [Jelly] How to do multi-document xpath selections
Posted by Dion Gillard <di...@gmail.com>.
Could you re-phrase the question or give us a more concrete example?
On Wed, 8 Sep 2004 17:54:01 +0200, Marc DEXET <ma...@dsi.cnrs.fr> wrote:
> 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
> .......................
>
>
--
http://www.multitask.com.au/people/dion/
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] How to do multi-document xpath selections
Posted by Paul Libbrecht <pa...@activemath.org>.
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