Hello everyone,

I am using jackrabbit to store "tags" that a user creates. 
Given a structure (below) where each leaf node has an attribute of CONTENT_TYPE 
with a value of "Tag"
/myfolder/tag 1/Tag 1
/myfolder/tag 2/Tag 2
/myfolder/tag 3/Tag 3

My application needs to be able to query for what tags exist under a node path 
e.g. 
what tags are under /myfolder/tag 1?
what tags are usder /myfolder/?

My problem is that my xpath expression is not working for queries that pass the 
tag parent in as a node to look down.
I have a tag with a node path of /myfolder/tag 1/Tag 1 , but xpath search for 
tags in /myfolder/tag 1 fails to find any nodes.

This query will not find it:
/jcr:root/myfolder/tag 1//[EMAIL PROTECTED] = 'Tag']

This query does find it (but it is not restrictive enough, returns nodes in all 
folders).
/jcr:root/myfolder//[EMAIL PROTECTED] = 'Tag']
Results
/myfolder/tag 1/Tag 1
/myfolder/tag 2/Tag 2
/myfolder/tag 3/Tag 3
/myfolder/tag 4/Tag 4


Is there a way to do a search in xpath that does children AND it's descendents?

Thanks!


Reply via email to