Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 99259 invoked from network); 16 Jul 2010 10:49:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jul 2010 10:49:48 -0000 Received: (qmail 67230 invoked by uid 500); 16 Jul 2010 10:49:47 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 66765 invoked by uid 500); 16 Jul 2010 10:49:44 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 66756 invoked by uid 99); 16 Jul 2010 10:49:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 10:49:43 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.18.2.179] (HELO exprod7og113.obsmtp.com) (64.18.2.179) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 16 Jul 2010 10:49:34 +0000 Received: from source ([204.15.88.135]) by exprod7ob113.postini.com ([64.18.6.12]) with SMTP ID DSNKTEA4mnDF7mdoYvpov9z0OgnM50Rc3F9T@postini.com; Fri, 16 Jul 2010 03:49:13 PDT To: users@jackrabbit.apache.org Subject: xpath query problem MIME-Version: 1.0 X-KeepSent: 79067F22:2A1B35DF-80257762:003A9204; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006 Message-ID: From: Ahmed Elshereay Date: Fri, 16 Jul 2010 12:46:48 +0200 X-MIMETrack: Serialize by Router on IDCSMTP2/IDC(Release 8.5.1|September 28, 2009) at 07/16/2010 06:49:13 AM, Serialize complete at 07/16/2010 06:49:13 AM Content-Type: multipart/alternative; boundary="=_alternative 003B3732C1257762_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 003B3732C1257762_= Content-Type: text/plain; charset="US-ASCII" Hi All, 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! Notice, when the statement is like: "//element(*, nt:unstructured)" without constraints then it works and return results. So can anyone please help me what could be the problem? I use jackrabbit 2.1.0, I know xpath is depricated, but I have to use the xpath. Thank you in advance. --=_alternative 003B3732C1257762_=--