You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Yao Harrison <ha...@gmail.com> on 2005/10/24 15:51:16 UTC

Why does jackrabbit unsupport the count function in XPATH

Hi List:

     I've got "javax.jcr.query.InvalidQueryException: Unsupported
function: count" when I excute the XPATH statement that include count(
) function invocation.So can anybody tell me why does JackRabbit not
support the "Count( )" function ,and how can I implement it in XPATH ?

Thanks a million !

Harrison
2005-10-24

Re: Why does jackrabbit unsupport the count function in XPATH

Posted by Marcel Reutegger <ma...@gmx.net>.
I'm not sure if this is of any help, but if you are interested in the 
number of nodes returned by the query you may also use the 
NodeIterator.getSize() method. In jackrabbit this will always return a 
reasonable value, unless your query is //* then it will return -1.

regards
  marcel

Yao Harrison wrote:
> Thanks for your advice.
> 
> I've created the issue in jira with number : JCR-260 to track with it
> and  hopes will be correct quickly ,


Re: Why does jackrabbit unsupport the count function in XPATH

Posted by Yao Harrison <ha...@gmail.com>.
Thanks for your advice.

I've created the issue in jira with number : JCR-260 to track with it
and  hopes will be correct quickly ,

Best regards

Harrison Yao
2005-10-25

2005/10/24, Marcel Reutegger <ma...@gmx.net>:
> Hi Yao,
>
> count() is not supported because it is required by the spec.
>
> unfortunetely there is no easy way of introducing new functions to the
> query handler. the reason basically is, that jackrabbit also supports
> the SQL syntax and that every extension has to be reflected in the
> abstract syntax tree which should be somewhat language independent.
>
> could you please create a jira enhancement issue to support count()?
>
> thanks
>
> regards
>  marcel
>
> Yao Harrison wrote:
> > Hi List:
> >
> >      I've got "javax.jcr.query.InvalidQueryException: Unsupported
> > function: count" when I excute the XPATH statement that include count(
> > ) function invocation.So can anybody tell me why does JackRabbit not
> > support the "Count( )" function ,and how can I implement it in XPATH ?
> >
> > Thanks a million !
> >
> > Harrison
> > 2005-10-24
> >
> >
>
>

Re: Why does jackrabbit unsupport the count function in XPATH

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

count() is not supported because it is required by the spec.

unfortunetely there is no easy way of introducing new functions to the 
query handler. the reason basically is, that jackrabbit also supports 
the SQL syntax and that every extension has to be reflected in the 
abstract syntax tree which should be somewhat language independent.

could you please create a jira enhancement issue to support count()?

thanks

regards
  marcel

Yao Harrison wrote:
> Hi List:
> 
>      I've got "javax.jcr.query.InvalidQueryException: Unsupported
> function: count" when I excute the XPATH statement that include count(
> ) function invocation.So can anybody tell me why does JackRabbit not
> support the "Count( )" function ,and how can I implement it in XPATH ?
> 
> Thanks a million !
> 
> Harrison
> 2005-10-24
> 
>