Alexandru Popescu wrote:
Considering the following hierarchy of node types: nt:parentType, nt:childType1 extends nt:parentType and nt:childType2 extends nt:parentType, than I am wondering if a query in the form:

//element(*, nt:parentType) is gonna return both types of children (or is it strict, meaning that the query will look only for nt:parentType nodes and no children of nt:parentType; Than to retrieve both children types nodes you should use //element(*, nt:childType1) or //element(*, nt:childType2)).

this is described in section 6.6.3.2 of the JCR spec:

A type constraint specifies the common primary node type of the returned nodes, plus, possibly, additional mixin types that they also must have. Type constraints are inheritance-sensitive in that specifying a constraint of node type X will include all nodes explicitly declared to be type X, as well as all nodes of subtypes of X.


regards
 marcel

Reply via email to