jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Coldewey <p...@coldy.de>
Subject Re: How to use position() in Xpath query
Date Tue, 29 Jun 2010 08:26:48 GMT


as I know, the position() function delivers only the order position in the
list of all childs of the parent node. So it is not 
usefull to limit the results of a query.

To limit the results in a query, you should use the "limit(int)" function
of the resulting query object.


On Tue, 29 Jun 2010 10:08:40 +0200, Xiaojie Shen
<Xiaojie.Shen@cybercomgroup.com> wrote:
> Hi
> I saw an announce in 2007 that position() function doesn't work in
> 2.1. Is it the same today?
> If it works now, can somebody explain how to use position() in Xpath
> to limit the number of search results? For example, how should it be used
> to the query below?
> String query = "//element(*, nt:file) [jcr:like(@jcr:createdBy, 'u%')]
> order by @jcr:created descending";
> Thanks in advance!
> Shen

View raw message