Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 37067 invoked from network); 21 Oct 2010 19:14:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 19:14:42 -0000 Received: (qmail 29295 invoked by uid 500); 21 Oct 2010 19:14:42 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 29249 invoked by uid 500); 21 Oct 2010 19:14:42 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 29242 invoked by uid 99); 21 Oct 2010 19:14:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 19:14:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 19:14:40 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9LJEIhH020765 for ; Thu, 21 Oct 2010 19:14:18 GMT Message-ID: <31987564.13331287688458721.JavaMail.jira@thor> Date: Thu, 21 Oct 2010 15:14:18 -0400 (EDT) From: "Alexander Klimetschek (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-2797) Xpath: pure descendant-or-self axis does not work In-Reply-To: <33064681.13741287597383577.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-2797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923575#action_12923575 ] Alexander Klimetschek commented on JCR-2797: -------------------------------------------- Ok, // is actually /descendant-or-self::node()/, so this forces a child step at the end, that's why //node() doesn't work. Simply /jcr:root/content/descendant-or-self::node() should do it (afaiu the Xpath 2.0 specification). For this Jackrabbit returns only the direct child nodes of /content, but not /content itself nor any sub nodes below the children (eg. /content/child/sub/child etc.). > Xpath: pure descendant-or-self axis does not work > ------------------------------------------------- > > Key: JCR-2797 > URL: https://issues.apache.org/jira/browse/JCR-2797 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core, xpath > Reporter: Alexander Klimetschek > > A pure descendant-or-self axis "//" does not work, albeit it is defined in JCR 1.0, section 6.6.4.6. Running this query > /jcr:root/content// > returns an error: > Encountered "$" at line 1, column 38. Was expecting one of: "or" ... "and" ... "div" ... "idiv" ... "mod" ... "*" ... "return" ... "to" ... "where" ... "intersect" ... "union" ... "except" ... ... ... "/" ... "//" ... "=" ... "is" ... "!=" ... "<=" ... "<<" ... ">=" ... ">>" ... "eq" ... "ne" ... "gt" ... "ge" ... "lt" ... "le" ... "<" ... ">" ... "-" ... "+" ... "|" ... "[" ... ... ... ... ... "," ... ... ... for statement: for $v in /jcr:root/content// return $v > It only works in combination with another location step, like /jcr:root/content//* or /jcr:root/content//test. Tested this on a 2.2 snapshot, but I think it was actually never supported so far. > The use case comes up when searching for a property in a subtree of a certain node, where you want to include a property on that node directly as well, eg. /jcr:root/content//[@my:prop = 'value'] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.