On Tue, Feb 23, 2010 at 16:58, Gadbury <[email protected]> wrote:
> I have found out (to my horror!) after debugging that the following queries
> are not the same :)
>
> /jcr:root/shop/providers/provider/element(*, jpg:account)
> /jcr:root/shop/providers/provider[1]/element(*, jpg:account)
>
> The second query is the correct one in this case as I wish to return all
> nodes of type jpg:account that are under the first provider (provider[1]).
>
> Is there a way to stop getPath() from omitting the index notation for the
> first same name sibling?

If you need to separate between an SNS node and a normal one, you can
check via Node.getIndex(). This will return 1 for not-SNS nodes, so
you can check for actual existing SNS via
parentNode.getNodes(namePattern). Then you can build the path with the
index manually.

> Are SNS really that 'dangerous'?

Yes ;-)

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to