jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger" <Felix.Meschber...@day.com>
Subject Re: difference between xpath searches
Date Thu, 28 Jun 2007 06:52:18 GMT
Hi Mark,

I just reiterate, what has been said before: The argument to the
Node.getNode(String path) method is NOT an xpath query, so the results are
not expected to be the same. Also, the specification is different for the
getNode method and Query.execute methods.

All in all, there is no inconsistency between the two functionalities,
because they are completely different. The two are two ways of achieving
different goals, they are by no means two ways to achieve the same goal.


On 6/27/07, Mark Waschkowski <mwaschkowski@gmail.com> wrote:
> Hi,
> Thanks Jukka and Felix for the clarifications. I understand now that the
> call to getNode cannot be a query. Please allow me to restate:
> Node retrieval is not handled consistently when retrieving nodes using an
> xpath that refers to a particular location within the repository.
> For example do the following:
> 0) define xpath == '/documents/contacts'
> 1) create a session
> 2) add a node in documents/contacts
> 3) retrieve your nodes by using 3a or 3b
> 3a)
>   session.getRootNode().getNode(xpath).getNodes()
> 3b)
>     Workspace ws = session.getWorkspace();
>     QueryManager qm = ws.getQueryManager();
>     Query q = qm.createQuery(xpath, Query.XPATH);
>     NodeIterator iter = q.execute().getNodes();
> You will, as mandated by the spec, get different results! I believe that
> the
> nodes returned should be consistent regardless of Node retrieval access,
> either both with the added node, or both without.
> Best,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message