jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Mistric" <amist...@nemours.org>
Subject RE: XPath - comparing dates
Date Fri, 21 Sep 2007 15:53:30 GMT
Marcel

1. Is there a plan to support comparing properties?
2. Is there an alternative way I could achieve this? It may sound weird but is it possible
to subtract the 2 date properties and compare the result.
Something like

 (@mgnl:lastmodified - @mgnl:lastaction) > 0

Would something like this work?

Thanks



> -----Original Message-----
> From: Marcel Reutegger [mailto:marcel.reutegger@gmx.net] 
> Sent: Friday, September 21, 2007 11:23 AM
> To: users@jackrabbit.apache.org
> Subject: Re: XPath - comparing dates
> 
> Amir Mistric wrote:
> > I am trying to compare 2 date properties to determine if 
> the node has been modified.
> > Here are the queries I tried to use:
> > 
> > 1. 
> > 
> /jcr:root/www-mysite-org//element(*,mgnl:content)[MetaData/@mgnl:activ
> > ated='true' and MetaData/@mgnl:lastmodified > 
> > MetaData/@mgnl:lastaction]
> 
> jackrabbit does not support property names on both sides of a 
> comparison. one of them must be a literal.
> 
> > 2. 
> > 
> /jcr:root/www-mysite-org//element(*,mgnl:content)[MetaData/@mgnl:activ
> > ated='true' and xs:dateTime(MetaData/@mgnl:lastmodified) > 
> > xs:dateTime(MetaData/@mgnl:lastaction)]
> > 3. 
> > 
> /jcr:root/www-mysite-org//element(*,mgnl:content)[MetaData/@mgnl:activ
> > ated='true' and MetaData/xs:dateTime(@mgnl:lastmodified) > 
> > MetaData/xs:dateTime(@mgnl:lastaction)]
> 
> the xs:dateTime() function in jackrabbit only takes a string literal.
> 
> e.g. this is a valid query:
> 
> /jcr:root/www-mysite-org//element(*,mgnl:content)[MetaData/@mg
> nl:activated='true' 
> and MetaData/@mgnl:lastmodified > 
> xs:dateTime('2007-01-01T00:00:00.000TZ')]
> 
> regards
>   marcel
> 
Mime
View raw message