Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 65292 invoked from network); 17 Aug 2008 08:54:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Aug 2008 08:54:49 -0000 Received: (qmail 83340 invoked by uid 500); 17 Aug 2008 08:54:44 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 83283 invoked by uid 500); 17 Aug 2008 08:54:44 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 83271 invoked by uid 99); 17 Aug 2008 08:54:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Aug 2008 01:54:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hfinster@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 17 Aug 2008 08:53:46 +0000 Received: (qmail invoked by alias); 17 Aug 2008 08:54:14 -0000 Received: from p5B39767F.dip.t-dialin.net (EHLO [91.57.118.127]) [91.57.118.127] by mail.gmx.net (mp020) with SMTP; 17 Aug 2008 10:54:14 +0200 X-Authenticated: #8101941 X-Provags-ID: V01U2FsdGVkX1/k8EcbDUnkOIu+BKew29Sb1ZLGj7ZNlftwwlP48C aec/qNUWEg+l7h Message-ID: <48A7E89A.3070408@gmx.de> Date: Sun, 17 Aug 2008 11:00:10 +0200 From: Harald Finster User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: user@commons.apache.org Subject: [JXPATH] getting Containers in iteration Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.59 X-Virus-Checked: Checked by ClamAV on apache.org Hello, this is my first posting to this list, so forgive me, if I am asking dump questions. (At least I had a look at the archive.) I would like to ask, if it is possible to get containers (e.g. Lists) 'as they are' in an iteration. Consider the following bean: public class Book { String title; List authors; } Iterating this bean with JXPathContext context = JXPathContext.newContext(book); i = context.iteratePointers("/*"); results in the following: title = "Book Title" authors[1] = "First Author" authors[2] = "Second Author" ... i.e. the List is iterated instead of being returned as a List-Object. Obviously, each list-item is regarded as a direct child of the root of the Book object. Is there any way to avoid this behavior? i.e. is it possible to get something like title = "Book Title" authors = [ "First Author", "Second Author" ... ] i.e. List In XML-notation the difference would be like this: The current behavior of 'iterate': Book Title First Author Second Author what I would like to see is an equivalent of: Book Title <1>First Author <2>Second Author By the way: in contrast to 'iterate' 'getValue("authors") returns List I would be grateful for any thoughts and suggestions. With kind regards Harald -- Dr.-Ing. Harald Finster / Aachen Germany http://www.finster-stahlart.de industrial history and architecture http://www.astrid-aix.de gallery: watercolours and oil paintings --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org