jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Wehrens <wehr...@aei.mpg.de>
Subject Xpath question
Date Fri, 07 Apr 2006 14:45:49 GMT
Hi,

I have some trouble with xpath queries to jackrabbit.

I want to select the 5th entry and my query would look something like:

q = qm.createQuery("//wiki:entry[5]", Query.XPATH);
qr = q.execute();
NodeIterator it = qr.getNodes();
while (it.hasNext()) {
   Node n = it.nextNode();
System.out.println("n.getProperty("wiki:content").getValue().getString());
}

But if I get back the NodeIterator it contains all nodes...where does it go
wrong ?

Variations with //wiki:entry[position()=last()] or things like that also
always give me back the whole list ?

What I try to achieve at the end is to get back the sorted ten last entries
by time (so a order by a property and position()<10, e.g.
//wiki:entry[position()<10] order by @wiki:date descending).

Is that possible (well I guess so but I just don't know how).

Does anybody has an idea?

Thanks, Oliver



-- 
Oliver Wehrens
+49 170 785 1323
http://wehrens.net/oliver







Mime
View raw message