jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gadbury <gadb...@googlemail.com>
Subject Query using Path Constraints and Same Name Siblings (SNS)
Date Tue, 23 Feb 2010 15:58:02 GMT

Hi all,

I am currently building a jcr query using path constraints.  The path is
built up by using someNode.getPath().  As I have same name sibling nodes
(SNS), my query is failing for the first SNS node path as getPath() returns
'node_name' and not 'node_name[1]'.

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?

Are SNS really that 'dangerous'?

Thanks for your time and kind regards,

James
-- 
View this message in context: http://n4.nabble.com/Query-using-Path-Constraints-and-Same-Name-Siblings-SNS-tp1566095p1566095.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message