You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Krzysztof Hycnar <kr...@gmail.com> on 2010/08/15 21:44:52 UTC

Searching for nodes with a wildcard in a XPath query

Hi,

I'm new to JCR and need some help to build an XPath query that would return
all nodes placed on a specific path.

Basically I need to find nodes on a path like /jcr:root/data/people/?/?/*
where ? represents a single character?

Is is possible to create a query like that?

Thanx for any suggestions.
K.
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-for-nodes-with-a-wildcard-in-a-XPath-query-tp2326187p2326187.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Searching for nodes with a wildcard in a XPath query

Posted by Krzysztof Hycnar <kr...@gmail.com>.
Becuse nodes matching this /jcr:root/data/people/?/?/*pattern (ex
/jcr:root/data/people/a/a/atkinson)
are considered wrongly placed in the tree. My task is to select them all and
put in the correct place. Anyway I managed to work around this.

Thanx for your replies anyway :)
K.
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-for-nodes-with-a-wildcard-in-a-XPath-query-tp2326187p2327280.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Searching for nodes with a wildcard in a XPath query

Posted by Fabián Mandelbaum <fm...@gmail.com>.
If all the intermediate paths, the ones with ?, have one letter only,
why not /jcr:root/data/people/*/*/* then?

On Mon, Aug 16, 2010 at 3:55 AM, Ard Schrijvers
<a....@onehippo.com> wrote:
> On Sun, Aug 15, 2010 at 9:44 PM, Krzysztof Hycnar
> <kr...@gmail.com> wrote:
>>
>> Hi,
>>
>> I'm new to JCR and need some help to build an XPath query that would return
>> all nodes placed on a specific path.
>>
>> Basically I need to find nodes on a path like /jcr:root/data/people/?/?/*
>> where ? represents a single character?
>>
>> Is is possible to create a query like that?
>
> Not that I know of...perhaps someone else, but I don't think it can be
> done (apart from guaranteed poor performance if you could)
>
> Regards Ard
>
>>
>> Thanx for any suggestions.
>> K.
>> --
>> View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-for-nodes-with-a-wildcard-in-a-XPath-query-tp2326187p2326187.html
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>



-- 
Fabián Mandelbaum
IS Engineer

Re: Searching for nodes with a wildcard in a XPath query

Posted by Ard Schrijvers <a....@onehippo.com>.
On Sun, Aug 15, 2010 at 9:44 PM, Krzysztof Hycnar
<kr...@gmail.com> wrote:
>
> Hi,
>
> I'm new to JCR and need some help to build an XPath query that would return
> all nodes placed on a specific path.
>
> Basically I need to find nodes on a path like /jcr:root/data/people/?/?/*
> where ? represents a single character?
>
> Is is possible to create a query like that?

Not that I know of...perhaps someone else, but I don't think it can be
done (apart from guaranteed poor performance if you could)

Regards Ard

>
> Thanx for any suggestions.
> K.
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-for-nodes-with-a-wildcard-in-a-XPath-query-tp2326187p2326187.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>