Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 89969 invoked from network); 13 Mar 2006 12:12:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Mar 2006 12:12:08 -0000 Received: (qmail 64770 invoked by uid 500); 13 Mar 2006 12:12:07 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 64759 invoked by uid 99); 13 Mar 2006 12:12:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [212.145.136.153] (HELO smtp.germinus.com) (212.145.136.153) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2006 04:12:06 -0800 Received: (qmail 4182 invoked by uid 0); 13 Mar 2006 12:09:49 -0000 Received: from 212.145.136.152 by smtp.germinus.com (envelope-from , uid 7007) with qmail-scanner-1.24 ( Clear:RC:1(212.145.136.152):. Processed in 2.61485 secs); 13 Mar 2006 12:09:49 -0000 Received: from unknown (HELO mailbox.in.germinus.com) ([212.145.136.152]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 13 Mar 2006 12:09:46 -0000 Received: (qmail 3981 invoked by uid 7007); 13 Mar 2006 12:09:33 -0000 Received: from unknown (HELO [192.168.0.160]) (agonzalez@[192.168.0.160]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 13 Mar 2006 12:09:33 -0000 Message-ID: <441560A4.2000300@germinus.com> Date: Mon, 13 Mar 2006 13:08:04 +0100 From: Alvaro Gonzalez User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051011) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jackrabbit-dev@incubator.apache.org Subject: Descendant-or-self Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi list, I have been doing some tests with "//" (descendant-or-self) axis, and i think is not interpreted correctly by Jacrabbit Query Builder. A query with this axis returns only "descendant" nodes instead of "descendant-or-self" nodes. For example with this piece of code: Node myTopNode = rootNode.addNode("myTopNode"); myTopNode.addNode("subNode"); myTopNode.addNode("subNode"); rootNode.save(); String query = "//myTopNode//*"; //Should find all the 3 nodes: myTopNode and 2 subnodes. QueryManager qm = currentSession.getWorkspace().getQueryManager(); Query q = qm.createQuery(query, Query.XPATH); QueryResult qr = q.execute(); NodeIterator nodes = qr.getNodes(); assertEquals(3, nodes.getSize()); the test fails because it only finds two nodes instead of three. Is this a bug? Am I misunderstanding "//" axis? Regards, Alvaro -- Alvaro Gonzalez de Paz Germinus XXI http://www.germinus.com Avda. de Manoteras, 44. 2� planta. 28050 - Madrid (Spain) Tel (+34) 91 296 12 34 Fax (+34) 91 296 12 30