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:activated='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:activated='true' 
and xs:dateTime(MetaData/@mgnl:lastmodified) > 
xs:dateTime(MetaData/@mgnl:lastaction)]
3. 
/jcr:root/www-mysite-org//element(*,mgnl:content)[MetaData/@mgnl:activated='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/@mgnl:activated='true' and MetaData/@mgnl:lastmodified > xs:dateTime('2007-01-01T00:00:00.000TZ')]

regards
 marcel

Reply via email to