You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Frédéric Esnault <fe...@legisway.com> on 2007/07/04 17:20:58 UTC

Xpath property predicates

Hi all !

 

I'm testing something about predicates in an xpath query.

 

My goal is to get all nodes which have two properties with the same value.

Let's say my contract has two properties :

-          @signed : Boolean

-          @modified : Boolean

 

If I want all contracts that are either signed and modified or not signed and not modified, my xpath would be :

//element(*, contractType)[@signed=@modified]

 

Right?

 

But this does not work in jackrabbit. A query listing values works ( [(@ signed=true and @modified=true) or (@ signed=false and @modified=false)], but this is clearly unacceptable if we deal with, say dates or amounts of money, where you cannot list all possible values (and the query would be awful anyway).

 

I'm wondering if it is a bug in Jackrabbit or if it's just not possible with JSR 170 Xpath query (it works with real XPath).

 

Thanks !

 

Frédéric Esnault


Re: Xpath property predicates

Posted by Marcel Reutegger <ma...@gmx.net>.
Frédéric Esnault wrote:
> I'm wondering if it is a bug in Jackrabbit or if it's just not possible with
> JSR 170 Xpath query (it works with real XPath).

JSR 170 does only specify property comparison with a literal and not with 
another property.

Please file a jira enhancement issue if you want jackrabbit to support this.

regards
  marcel