On Fri, Jul 16, 2010 at 12:46, Ahmed Elshereay <[email protected]> wrote: > Can anyone please tell me what is wrong in this statment? > > String statement = "//element(*, > nt:unstructured)[jcr:like(@jcr:name, 'event%')] order by @jcr:name > descending"; > > Query q = > session.getWorkspace().getQueryManager().createQuery(statement, > Query.XPATH); > NodeIterator nodes = q.execute().getNodes(); > > There are a lot of nodes with name starts with 'event', also I tried to > use [...@jcr:name='history'] as I have nodes that have exact name 'history', > but always the itereator is empty!
There is no "jcr:name" (pseudo)-property. For an exact node name match, you can use fn:name() = 'event'. Wild card matches such as jcr:like() are not possible on node names with XPath or SQL from JCR 1.0. You can use JCR-SQL2 in JCR 2.0 for that. See http://jackrabbit.markmail.org/thread/xvoo5afksxtyplhw Regards, Alex -- Alexander Klimetschek [email protected]
