jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi goel <Ruchi.G...@Sun.COM>
Subject Re: // in xpath does not match immediate children
Date Wed, 02 May 2007 07:20:38 GMT
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//*[@ps:author='sushma'] 
    * /jcr:root/cms/childfolder1/element(*,ps:document)[@ps: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//*[@CONTENT_TYPE = 'Tag']
>
> This query does find it (but it is not restrictive enough, returns nodes in all folders).
> /jcr:root/myfolder//*[@CONTENT_TYPE = '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!
>
>
>   


Mime
View raw message