You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp_ <pi...@ibest.com.br> on 2008/02/18 19:38:24 UTC

XPath column specifier.

Hi;

How is the correct way to specify column names in result list in an Xpath
search?
I did the following:
1: //element(prop:a | prop:b, nt:base)
and
2: //element(*, nt:base)(prop:a | prop:b)

neigther 1 nor 2 worked.
Thanks.
Helio.
-- 
View this message in context: http://www.nabble.com/XPath-column-specifier.-tp15547191p15547191.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: XPath column specifier.

Posted by Marcel Reutegger <ma...@gmx.net>.
the XPath is missing a slash, this will work:

//element(*,nt:base)/(@prop:nome | @prop:categoria)

regards
  marcel

hsp_ wrote:
> I did the following expression:
> //element(*,nt:base)(@prop:nome | @prop:categoria)
> 
> And it returned:
> 
> javax.jcr.query.InvalidQueryException: Lexical error at line 1, column 32. 
> Encountered: "@" (64), after : "(": Lexical error at line 1, column 32. 
> Encountered: "@" (64), after : "(": Lexical error at line 1, column 32. 
> Encountered: "@" (64), after : "("
> 
> Hints?


Re: XPath column specifier.

Posted by hsp_ <pi...@ibest.com.br>.
I did the following expression:
//element(*,nt:base)(@prop:nome | @prop:categoria)

And it returned:

javax.jcr.query.InvalidQueryException: Lexical error at line 1, column 32. 
Encountered: "@" (64), after : "(": Lexical error at line 1, column 32. 
Encountered: "@" (64), after : "(": Lexical error at line 1, column 32. 
Encountered: "@" (64), after : "("

Hints?
-- 
View this message in context: http://www.nabble.com/XPath-column-specifier.-tp15547191p15641285.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: XPath column specifier.

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

you need to specify the attribute axis:

//element(*, nt:base)(@prop:a | @prop:b)

regards
  marcel

hsp_ wrote:
> Hi;
> 
> How is the correct way to specify column names in result list in an Xpath
> search?
> I did the following:
> 1: //element(prop:a | prop:b, nt:base)
> and
> 2: //element(*, nt:base)(prop:a | prop:b)
> 
> neigther 1 nor 2 worked.
> Thanks.
> Helio.