Hi Philips ,
  I am doing the same but it works.
Say , eg. I want all documents under /cms/childfolder1 which have author as "sushma", any of the following queries returns me the documents which are authored by 'sushma'

* /jcr:root/cms/childfolder1//[EMAIL PROTECTED]:author='sushma'] * /jcr:root/cms/childfolder1/element(*,ps:document)[EMAIL PROTECTED]:author='sushma']


Is the space between your search string 'tag' + space + '1' a problem ?

Did you try testing it via eclipse Jackrabbit Viewer plugin ?


-Ruchi

Phillip Rhodes wrote:
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