jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Brown <benjamin.br...@thisisnumero.com>
Subject Descendant or self axis problem - a known issue?
Date Thu, 09 Apr 2009 14:06:46 GMT
Hi,

I've been working with an xpath query recently that's made me think that the descendant or
self axis seems to be broken (JCR 1.4)

I have a tree of nodes like the following (written by hand as I don't have the actual output
readily available):

cms:Views/cms:viewObject/cms:viewObject
cms:Views/cms:viewObject/cms:viewObject[2]
cms:Views/cms:viewObject/cms:viewObject[3]/cms:viewObject
cms:Views/cms:viewObject/cms:viewObject[3]/cms:viewObject[2]

Where all cms:viewObject nodes contain multiple references to other (non view) nodes.

In order retrieve ALL the references under for cms:Views/cms:viewObject

I think I can query like this (truncated as it's a long query)
/jcr:root/cms:Views/cms:viewObject//jcr:deref(@cms:reference, '*')//element(cms:content,

This query should (I believe) retrieve the referenced nodes for all of the view nodes (6)
listed above, inclusive of the reference of the node it was called on (i.e. self).

I find that it is omitting the reference on the self node cms:Views/cms:viewObject and returns
only the nodes referenced on the descendents of the specified view node - is this expected
behaviour/a known bug and is there a work around apart from doing two queries?

I can provide more detailed output if necessary.

Thanks,

Benjamin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message