jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Portway <j...@stain.org>
Subject following-sibling etc.
Date Tue, 24 Jun 2008 16:24:44 GMT
Hi - I'm trying to implement a simple mechanism to create a link to go  
to the "next page" and "previous page" of a site, and I'm baffled that  
such a simple and (I would think) common requirement seems to be  
either extremely complex or impossible in Jackrabbit, so I'm wondering  
whether I'm misunderstanding something fundamental.

It seems to me I should be able to use the "following-sibling" axis in  
an xpath query on the current node to find the next page, but as far  
as I can tell Jackrabbit seems to silently ignore "following-sibling"  
- I don't get an error, a warning or anything, but the results I see  
are identical to what I'd get if the "following-sibling" statement was  
missing from my xpath expression.

I've tried a different tack and used the expression :
/jcr:root/my/node/parent/child::*[. >> /jcr:root/my/node/parent/theNode]

But that doesn't work either (though at least this time I get an  
exception saying that "<<" is not supported).

As far as I can tell there isn't any way to easily find the next and  
previous siblings of a node using SQL query language.
I can't even find any simple way to do it using the APIs, which I find  
utterly baffling.
The only thing I can think to do is to iterate through all children of  
the parent node looking for my current node - but this is presumably  
extraordinarily inefficient. In my case I'd be retrieving hundreds of  
nodes from the repository simply to find a link address, which seems  

I feel as if I must be misunderstanding something fundamental - what  
am I doing wrong ?


View raw message