> > 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 http://www.zvon.org/xxl/XSL-Ref/Tutorials/Axes/ax8.html 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 /aaa/descendant-or-self::* is akin to /jcr:root/cms:Views/cms:viewObject/descendant-or-self::node() 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. Thanks, Benjamin
