jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Thompson" <elephant...@gmail.com>
Subject Re: Pattern matching in queries
Date Thu, 05 Jul 2007 16:22:18 GMT
Thanks for the info, Marcel.

I managed to find a way to limit my search to my satisfaction by using XPath
syntax.  The 'type' nodes from my example have a 'name' attribute which I do
have easily available, so I tried these two queries (both worked):

//element(*, my:typeNode)[jcr:contains(., 'type
name')]/element(*,my:dataNode)[jcr:contains(., 'data node search phrase')]
//element(*, my:typeNode)[@type:name = 'type
name']/element(*,my:dataNode)[jcr:contains(., 'data node search phrase')]

This works pretty well for my purposes.

-Brian


On 7/4/07, Marcel Reutegger <marcel.reutegger@gmx.net> wrote:
>
> Brian Thompson wrote:
> > Is it even possible to do pattern matching on JCR path elements?
>
> no, it is not. but with the next minor release of jackrabbit (1.4) you can
> use
> the fn:name() function together with the equals operator.
>
> so, you can have:
>
> //element(*, nt:file)[fn:name() eq 'foo' or fn:name() eq 'bar']
>
> returns file nodes named foo or bar.
>
> regards
>   marcel
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message