jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Betheuil" <Nicolas.Bethe...@europe.adp.com>
Subject xpath query of subnode
Date Tue, 23 Nov 2010 15:46:43 GMT

I have the following structure for my default schéma
/aRootNode/subNode/otherVeryDifferentPath/myOtherInterestingNode/ (without condition)

In the first i have two conditions with some attributes
On the second my node have no conditions.

I have a Profile in memory that have some properties that should match with conditions. The
target is to list interestingNodes on the Profile if conditions are matching. If no condition,
that's mean that's everybody could see this.

I begin with SQL2 like i work with last release of jackrabbit but when dealing with differents
paths make subqueries and join (that's all i have found) i try xpath. I have read that's deprecated
by the spec but it's always there and working so I try.
I success to make an xpath that match when my profile have or not same conditions.
But i donc succeed to make an xpath that match node without conditions.

One of my case make this query
/aRootNode/subNode/*[(conditions/@property!='propName') or (conditions/@property='propName'
and conditions/@operator='eq' and conditions/@expectedValue=true) or (count(conditions)=0)]
But the count(conditions)=0 doesn't work. Worse, ever it's in an or condition, all is false
and nothing is returned.

I try with not(conditions), length(conditions)=0 or trying to understand what's go on count(conditions)>0
to find all nodes with conditions as children but nothing match.

Do you have an idea ?
Thank's to have read me to the end

View raw message