jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger" <marcel.reuteg...@gmx.net>
Subject Re: XPath with QName not working
Date Mon, 12 Jun 2006 10:50:52 GMT
> I'm trying to execute XPath on JackRabbit in a data store that
> contains nodes with namespaces specified.  For example I have:
> 
> /
> /jcr:system            (type is rep:system)
> /a:mynode             (type is nt:unstructured)
> 
> If I use the query  /*   it gives me the root '/' Node.
> If I use the query  /*/* it gives me
>    /jcr:system
>    /a:mynode

this is expected behaviour. The specification states that the root node
is represented as /jcr:root in an XPath query. That is, the jcr:system
node in XPath is referenced with the following query: /jcr:root/jcr:system

> However, I cannot access any node by referencing it without a
> wildcard.  For example, the query   //a:mynode     does not return any
> results,  nor does   /a:mynode    or /*/a:mynode

//a:mynode and /*/a:mynode should acutally work. can you please create
a jira issue that describes this bug? Thanks.

> Neither can I access the jcr:system node directly.  I've also tried
> without the namespace qualifier, but   //mynode   ,  /mynode   and
> //system   don't work either.

All queries are namespace sensitive, which means you have to use the
namespace prefixes.

> Also, using the 'element' function doesn't work, e.g.   //element(*,
> nt:unstructured)   returns nothing, even though I know for a fact that
> there are nodes of type nt:unstructured in the data store.

This is very weird as this is covered by a lot of test cases in jackrabbit.
Did you by any chance migrate existing content to a new jackrabbit version?
E.g. when migrating from 0.9 version of jackrabbit to 1.0 or 1.0.1 you
have to remove the index directories and re-index the workspaces.

regards
 marcel
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Mime
View raw message