On Tue, Mar 16, 2010 at 11:34, Gadbury <[email protected]> wrote: > "/jcr:root/root/providers/provider//element(*, atl:account)" > > The idea is to retrieve all account node types under a given provider node; > the first provider in this case, ignoring the other two providers accounts. > The trouble is, my query is returning all accounts for all providers. > > Is this a problem due to same name sibling nodes?
Not a a problem, that's how XML and Xpath work ;-) In the document xml view (which is what is used for Xpath queries), all your provider nodes have the same name "provider", hence /jcr:root/root/providers/provider matches multiple elements. > Should the path to the first provider be provider[1]? Yes, see http://www.day.com/specs/jcr/1.0/6.6.4.1_Same-Name_Siblings.html However, with same-name siblings you will see this problem in various places, so I strongly recommend to change your content model and give those SNS a distinctive name (eg. name of the provider, date, or even some id if it is common). How do you know the first provider is the right one anyway? Regards, Alex -- Alexander Klimetschek [email protected]
