You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Samuel Cox <cr...@gmail.com> on 2009/04/29 22:19:47 UTC

xpath searches using version labels

Assume I have some number of nodes of type A, which have a defined 
number of properties (P1, P2, etc).  Each A node is named N.  For each 
node, I create multiple versions tagged with labels like (L1, L2, L3).

Is there a one-shot xpath expression that will let me search all L1 
versions of A nodes that have P1 = 'foo'?

Something like:

//version_hist_associated_with_As/L1[@P1 = 'foo']

I'm thinking there isn't, but figured I'd ask.

The only way that I know how to do with an algorithm.

For each A,
   path = a.getVersionHistory.getVersionByLabel("L1").getPath
   search(path + [@P1 = 'foo'])
Combine results.

Or something like that.

Am I way off base?

Any tips are appreciated.

-- 
Samuel Cox