jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra" <tobias.bocane...@day.com>
Subject Re: Behaviour of Node.getPath()
Date Wed, 12 Mar 2008 15:43:27 GMT
hi,
the [1] is optional but addresses the same path.

i.e. /foo[1]/bar and /foo/bar address the same node no matter if the
/foo has same name siblings or not.

in any case, it's better to avoid SNS if the data model allows this,
since they cause troubles in other places.
regards, toby

On 3/12/08, Dean Jones <dean.m.jones@gmail.com> wrote:
> Hello,
>
>  I have a question regarding the value returned by Node.getPath().
>  Where an ancestor of a node has a same-name sibling, the path includes
>  the appropriate index using the XPath square-bracket notation, except
>  when the ancestor node has an index of 1, in which case it is omitted.
>  My problem is that I want to create a path which I can later use as
>  part of an XPath query, and this omission causes problems (the XPath
>  expressions "parent/child" and "parent/child[1]" are obviously
>  different where 'parent' has multiple children called 'child'). I've
>  implemented a trivial workaround to just generate the path myself, but
>  I thought I'd check whether this was the intended behaviour.
>
>  Best wishes,
>
>
>  Dean.
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Mime
View raw message