jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Mistric" <amist...@nemours.org>
Subject XPath - comparing dates
Date Fri, 21 Sep 2007 13:23:39 GMT
Hello

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]
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)]


On the query #1 I don't get any results and on the queries #2 and #3 I get: 
javax.jcr.query.InvalidQueryException: Wrong argument type for xs:dateTime

Also here is an example of the page called "index" and its metadata 

/www-mysite-org/index/MetaData
/www-mysite-org/index/MetaData/mgnl:authorid=bsimpson
/www-mysite-org/index/MetaData/jcr:uuid=c35ed46e-53b3-4b57-be6b-9eaf78733ba5
/www-mysite-org/index/MetaData/mgnl:creationdate=2007-06-01T15:28:00.756-04:00
/www-mysite-org/index/MetaData/mgnl:lastaction=2007-09-13T16:42:34.198-04:00
/www-mysite-org/index/MetaData/jcr:created=2007-08-27T23:16:39.019-04:00
/www-mysite-org/index/MetaData/jcr:baseVersion=bd5305ae-fe82-4a80-bf15-5ed1c7771c1c
/www-mysite-org/index/MetaData/mgnl:lastmodified=2007-09-13T16:39:26.615-04:00
/www-mysite-org/index/MetaData/jcr:isCheckedOut=true
/www-mysite-org/index/MetaData/jcr:primaryType=mgnl:metaData
/www-mysite-org/index/MetaData/mgnl:activatorid=superuser
/www-mysite-org/index/MetaData/jcr:predecessors=bd5305ae-fe82-4a80-bf15-5ed1c7771c1c
/www-mysite-org/index/MetaData/jcr:versionHistory=45977c4f-a6f9-42e8-b8d4-fcf52897d91e
/www-mysite-org/index/MetaData/mgnl:template=www-homepage-3-column
/www-mysite-org/index/MetaData/mgnl:activated=true



Is there something wrong with the queries?


Thanks
Amir
Mime
View raw message