Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 42387 invoked from network); 11 Mar 2007 16:19:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Mar 2007 16:19:04 -0000 Received: (qmail 51816 invoked by uid 500); 11 Mar 2007 16:19:08 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 51803 invoked by uid 500); 11 Mar 2007 16:19:08 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 51792 invoked by uid 99); 11 Mar 2007 16:19:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Mar 2007 09:19:07 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [213.171.216.50] (HELO smtp07l.fasthosts.co.uk) (213.171.216.50) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Mar 2007 08:18:55 -0800 Received: from webmail.livemail.co.uk (mail213-171-216-230.livemail.co.uk [213.171.216.230]) by smtp07l.fasthosts.co.uk (Postfix) with SMTP id A62B519F312 for ; Sun, 11 Mar 2007 16:18:56 +0000 (GMT) MIME-Version: 1.0 X-Mailer: livemail.co.uk Webmail Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: Date: Sun, 11 Mar 2007 16:18:33 +0000 From: "Neil Benn" To: commons-user@jakarta.apache.org Subject: JXPath Modelling X-Virus-Checked: Checked by ClamAV on apache.org Hello, Sorry to ask more questions on JXPath syntax. I ahev the curretn use case: [the following bit is pseudo code public class Question{ public String getID(); public String getAnswer(); } public class User{ //this will return a question stored by the ID public string getQuestion(String pstrID); //this will add a question and store it by ID public String addQuestion(Question pobjQuestion); } So what I want to do is to pass a list of users to a class, including a bunch of JXPath expressions so I can extract teh data I need in a flexible way. So (after help from people here - thanks) I made the following expression to get a question from the user such as : getQuestion(., 'firstname') This indeed returns me a question as i would expect and I can print this to my log with no problems. So to get the answer, I tried : getQuestion(.[1], 'firstname').answer this gives me a bad syntax error, I also tried : getAnswer(getQuestion(.[1], 'firstname) This works but it feels a bit a bit weird calling a get method with JXPath. Am I doing this in the correct way or is there a 'more elegant' way of doing this? Thanks, in advance for your help. Cheers, Neil --- Neil Benn Msc CEO Ziath Ltd Website - http://www.ziath.com Blog - http://labauto-lounge.com --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org