jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Brown <benjamin.br...@thisisnumero.com>
Subject RE: Descendant or self axis problem - a known issue?
Date Thu, 09 Apr 2009 15:20:22 GMT
> > 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]

> In XPath // is the abbreviated syntax for /descendant-or-self::node()/
> (see: http://www.w3.org/TR/xpath20/#abbrev), which means your query is
> translated into:
> /jcr:root/cms:Views/cms:viewObject/descendant-or-
> self::node()/jcr:deref(@cms:reference,
> '*')/descendant-or-self::node()/element(cms:content,
> this will never select /cms:Views/cms:viewObject
> why don't you just select all nodes name cms:viewObject and then
> dereference them?
> //cms:viewObject/jcr:deref(....

I had thought of this but I believed the descendant-or-self would also return the reference
on the node with the axis on (otherwise where does the "self" part come in)? :)

For a simple xpath axis examples please see 

The output clearly illustrates a descendant or self actually returning the axis'd element
"aaa", whereas just "descendant" seems to be what you are describing and the functionality
that JCR 1.4 seems to be providing?

In my mind
is akin to 
and therefore I would expect any *references* on the axis'd node /jcr:root/cms:Views/cms:viewObject/
to be returned as per their example which returned the axis'd element.



View raw message