jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timur Evdokimov" <ti...@jacum.com>
Subject RE: Query language issues
Date Tue, 22 Feb 2005 21:01:54 GMT

Thank you for these clarifications about /jcr:root, it was not quite obvious
(and apparently was recent addition) 
Now everything works as it should, even with ordering.

Regards,
Timur


-----Original Message-----
From: Marcel Reutegger [mailto:marcel.reutegger@gmx.net] 
Sent: Monday, February 21, 2005 10:20 AM
To: jackrabbit-dev@incubator.apache.org
Subject: Re: Query language issues

Hi Timur,

> In //*[@my:includeInMainStream='true'] order by @my:publishingDate 
> descending It complains about @ in @my:publishingDate clause So that 
> only order by publishingDate is accepted, but doesn't work anyway

hmm, works fine for me. Could you please create a jira bug with instructions
how to reproduce it? Thanks

> Also any expression apart from //* returns nothing, i.e. just /text//* 
> gives 0 hits, whereas SELECT * FROM my:article WHERE jcr:path LIKE 
> '/text/%' gives what it supposed to give.

XPath uses a virtual XML document refered to as document view mapping in the
jsr 170 spec. Because the root element in that document is the root node of
the workspace any absolute XPath must start with /jcr:root. In your case
that would be something like:
/jcr:root/text//*[@my:includeInMainStream='true']

You may also use a relative XPath. In that case the context for the query is
the root node of the workspace:
text//*[@my:includeInMainStream='true']

Relevant section in the spec is: 6.6.3.3

regards
  Marcel


Mime
View raw message