Hi all !
I'm facing a strange situation. I'm wondering if I'm doing something wrong or if it's a jackrabbit problem. I tried this search : /jcr:root/lgw:root/lgw:contracts/element(*, lgw:contractType)[jcr:deref(@lgw:internalContractor, 'lgw:contractorType')/@lgw:companyName = 'Lycos'] (I use element() because I'm testing not same name siblings performances). The problem is that this query raises an exception : InvalidQueryException: Unsupported location for jcr:deref()at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createFunction(XPathQueryBuilder.java:887) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:459) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) ... In fact the error is raised in createFunction when testing the JCR_DEREF function. It fails because it accepts either a QueryNode.TYPE_LOCATION or a QueryNode.TYPE_PATH queryNode type, or raises the InvalidQueryException. The problem is that my queryNode, which is a RelationQueryNode, has a type set to 0, and 0 is not a valid type (I checked the constants defined in QueryNode abstract class). I saw the contructor in RelationQueryNode with no type creation, but what's the meaning of this? Is it forbidden to put a jcr:deref in a predicate, knowing that we can use child nodes and properties? Frederic Esnault
