jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <dan.diepho...@mulesource.com>
Subject jcr:deref in predicate with jcr:contains
Date Mon, 25 May 2009 16:47:03 GMT
I've made good progress on JCR-977. I now have a working implementation,
although a bit rough around the edges.
One of the use cases I wanted to support was using jcr:contains and
jcr:deref in a predicate, but I'm not sure how the syntax should look. I
came up with the following:

//*[jcr:contains(people/jcr:deref(@worksfor, '*'),'ballmer')]

(This builds off from the DerefTest. Given, this isn't an actual query that
you're likely to do as it will return /testroot in the unit tests, which
doesn't have a high semantic value for this case. But it is useful I swear

I suppose that syntax works, but it seems like it'd be useful to be able to
drill down to further nodes. e.g.

//*[people/jcr:deref(@worksfor, '*')/jcr:contains(.,'ballmer')/foo/@bar]

This syntax doesn't make sense as jcr:contains isn't really a path location.
What I really need is support for predicates in predicates! Does XPath
account for any of these types of scenarios? Or would the XPath way be more

//*[jcr:contains(people/jcr:deref(@worksfor, '*'),'ballmer') and
people/jcr:deref(@worksfor, '*')/foo/@bar]


Dan Diephouse
http://mulesource.com | http://netzooid.com/blog

View raw message