You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sean Callan <se...@gmail.com> on 2008/02/07 23:36:49 UTC

XPath Searching and Unions

Hi guys,

I've got another XPath question for you.  I have the following 2 XPaths both
which return results, but I wanted to union them together with a pipe( | )
but when I do that, they return 0 results.

//webfmis:content[jcr:contains(@webfmis:body,'Application')]   -- 1 result
//webfmis:file[jcr:contains(.,'Application')]  -- 1 result
//webfmis:content[jcr:contains(@webfmis:body,'Application')] |
//webfmis:file[jcr:contains(.,'Application')]  -- 0 results

I'm not sure if I'm missing something or if maybe this functionality isn't
implemented in JackRabbit yet?

Thanks,
Sean

RE: XPath Searching and Unions

Posted by Ard Schrijvers <a....@hippo.nl>.
Hello,

> Hi guys,
> 
> I've got another XPath question for you.  I have the 
> following 2 XPaths both which return results, but I wanted to 
> union them together with a pipe( | ) but when I do that, they 
> return 0 results.

you can use 'or'

-Ard

> 
> //webfmis:content[jcr:contains(@webfmis:body,'Application')]  
>  -- 1 result
> //webfmis:file[jcr:contains(.,'Application')]  -- 1 result 
> //webfmis:content[jcr:contains(@webfmis:body,'Application')] 
> | //webfmis:file[jcr:contains(.,'Application')]  -- 0 results
> 
> I'm not sure if I'm missing something or if maybe this 
> functionality isn't implemented in JackRabbit yet?
> 
> Thanks,
> Sean
> 

Re: XPath Searching and Unions

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Sean,

the union operator is not supported and jackrabbit should actually throw an 
exception. see: https://issues.apache.org/jira/browse/JCR-522

regards
  marcel

Sean Callan wrote:
> Hi guys,
> 
> I've got another XPath question for you.  I have the following 2 XPaths both
> which return results, but I wanted to union them together with a pipe( | )
> but when I do that, they return 0 results.
> 
> //webfmis:content[jcr:contains(@webfmis:body,'Application')]   -- 1 result
> //webfmis:file[jcr:contains(.,'Application')]  -- 1 result
> //webfmis:content[jcr:contains(@webfmis:body,'Application')] |
> //webfmis:file[jcr:contains(.,'Application')]  -- 0 results
> 
> I'm not sure if I'm missing something or if maybe this functionality isn't
> implemented in JackRabbit yet?
> 
> Thanks,
> Sean
>