jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: following-sibling etc.
Date Wed, 25 Jun 2008 08:11:43 GMT
Hi,

Joshua Portway wrote:
> 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"

Jackrabbit does not support the following-sibling axis. The JSR 170 
specification does not list it as a required feature.

> 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 crazy.

that really is the only way.

I'm not sure why the JSR 170 specification does support this kind of use case, 
but I guess it's because child nodes do not necessarily have to be orderable. In 
which case a sibling axis cannot be defined.

As an alternative you could make your nodes referenceable and create a linked 
list using reference properties. that way you can quickly traverse the sibling 
axis. a major drawback however is that you have to maintain the links.

regards
  marcel

Mime
View raw message