You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by far4ever <fa...@gmail.com> on 2008/11/24 06:57:46 UTC

how to get the index of the node

hi
 i want to get the node name along with its index(the one with square
bracket) 
but getName() gives the name with out the index. is there any mechanism
where i can get the index along with its name
thanks in advance
-- 
View this message in context: http://www.nabble.com/how-to-get-the-index-of-the-node-tp20655349p20655349.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: how to get the index of the node

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Mon, Nov 24, 2008 at 6:57 AM, far4ever <fa...@gmail.com> wrote:
> ... i want to get the node name along with its index(the one with square
> bracket)
> but getName() gives the name with out the index. is there any mechanism
> where i can get the index along with its name...

Node.getIndex() returns the same-name-sibling index.
http://day.com/maven/javax.jcr/javadocs/jcr-1.0/javax/jcr/Node.html#getIndex()

-Bertrand