Iterating over siblings is how I did it in my application.

Alternatively, you could write some code to store an index (or references to
the next/previous siblings) when you save nodes - that would speed lookup
time, but it would make re-ordering the nodes rather expensive.

-Brian



On 7/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hello List,



what do you think is the best way to get the neighbor (=next/previous
sibling) of a Node?



The XPath "preceding-sibling" axis does not seem to work, and I couldn't
find a way to do it without iterating over all child nodes of the
parent.



Any hints, ideas and links are very welcome.



Regards,

Marcus.


Reply via email to