jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Waschkowski" <mwaschkow...@gmail.com>
Subject Re: predicate with descendant child
Date Tue, 06 Nov 2007 14:56:20 GMT
OK, thanks very much Christoph, thats perfect.

I may create a new jira item as we don't always know what level our
child is at, but your suggestion might be a good workaround for now.

Thanks again!

Mark

On Nov 6, 2007 4:59 AM, Christoph Kiehl <christoph@sulu3000.de> wrote:
> Mark Waschkowski wrote:
>
> > I'm trying many different combinations to specify a predicate where
> > ALL child nodes have some particular value. In other words, I would
> > like to get all regions that have any children nodes that have a
> > yearBuilt attribute of 2001.
> >   ie. documents/regions[//@yearBuilt = '2001']
>
> That's not possible yet. See http://issues.apache.org/jira/browse/JCR-247 last
> comment.
>
> > I tried different combinations of factors but could only make the
> > predicate apply if I knew what level the child was at:
> >   ie. documents/regions[*/@yearBuilt = '2001']
> >
> > but in our case we don't always know the level, hence the need to
> > apply a predicate using a descendant node. Is this possible? If not,
> > are there any workarounds?
>
> If your depth is limited you could do the following:
>
> documents/regions[*/@yearBuilt = '2001' or */*/@yearBuilt = '2001' or
> */*/*/@yearBuilt = '2001']
>
> ... and so on.
>
> Cheers,
> Christoph
>
>

Mime
View raw message