jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaetano Sferra <ml.jackrab...@yahoo.it>
Subject XPath and version storage
Date Wed, 24 Sep 2008 12:00:06 GMT
Hello to everyone,

In my scenario I've a custom versionable node called "mynode" that has a string property of
name "my:property". Now suppose to create a new workspace adding a node of this type to it;
the workspace structure should be like this:

   +-- jcr:system
   |           +-- jcr:versionStorage
   +-- mynode[@my:property = 'first']

Ok, everything works fine till now. Let's to change the property... we have to checkout, modify
and checkin the node; we now should have:

   +-- jcr:system
   |           +-- jcr:versionStorage
   +-- mynode[@my:property = 'modified']

No problems at all! Good. The "jcr:versionStorage" now should hold two distinct version of
"my:node" and I wish to search for the first one, here starts the game (for me):

//jcr:system/jcr:versionStorage[1]//element(mynode, nt:version)[1][@my:property = 'first'] -->
No match
//jcr:system/jcr:versionStorage[1]//element(mynode, nt:version)[@my:property = 'first'] -->
No match
//jcr:system/jcr:versionStorage//element(mynode, nt:version)[@my:property = 'first'] -->
No match
//element(mynode, nt:version)[@my:property = 'first'] --> No match
//element(mynode, nt:version) --> No match
//element(mynode, nt:base) --> Matches everything (2 entries in "jcr:versionStorage" and
1 in "jcr:root")
//element(mynode, nt:frozenNode) --> Matches 2 entries in "jcr:versionStorage"

Looking the XPath syntax and examples in the JSR 170, the first query should work (or maybe
I missing something?!)... what's wrong? I wish to search in the "jcr:versioningStorage" only,
matching the right node and looking, as the specifications says, for a "nt:version" node type.
Some ideas?

A hopeful newbie

Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito
per i tuoi file e i messaggi 

View raw message