jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <dan.diepho...@mulesource.com>
Subject Re: predicate with descendant child
Date Mon, 05 Nov 2007 18:51:43 GMT
Mark Waschkowski wrote:
> Hi,
>
> 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']
>
> 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?
>
> Thanks,
>
> Mark
>   
I think the correct xpath syntax is: documents/regions//*[@yearBuilt = 
'2001'].
Cheers,
- Dan

-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog


Mime
View raw message