Michael Korat wrote:
I wrote a query that should return all the nodes that are somehow
referenced by PageA, and contain the wanted value:
/jcr:root/Content//element(*, my:LinkToDoc)/jcr:deref(@RefToDoc, '*')
//element(*, my:DataLink)/jcr:deref(@RefToData,
'*')[jcr:contains(.,'some value')]
Unfortunately, the result of this is always zero. If I execute the
query without the jcr:contains constraint at the end I get the expected
set of DataNodes back:
/jcr:root/Content//element(*, my:LinkToDoc)/jcr:deref(@RefToDoc, '*')
//element(*, my:DataLink)/jcr:deref(@RefToData, '*')
does //*[jcr:contains(.,'some value')] return any result?
My question is if there is a limitation to the use of multiple jcr:deref
in a single query, or mixing jcr:deref with constraints or if there
is another convenient (and fast) way to do such a query?
no, there's not limit. you can use as many jcr:derefs as you like.
as an alternative you can also search for the data nodes directly and then do
the dereferencing manually using the API (Node.getReferences()).
regards
marcel