Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 630 invoked from network); 5 Aug 2005 22:16:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2005 22:16:13 -0000 Received: (qmail 39757 invoked by uid 500); 5 Aug 2005 22:16:07 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 39712 invoked by uid 500); 5 Aug 2005 22:16:06 -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 39697 invoked by uid 99); 5 Aug 2005 22:16:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2005 15:16:06 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of yaron.kanza@gmail.com designates 64.233.162.199 as permitted sender) Received: from [64.233.162.199] (HELO zproxy.gmail.com) (64.233.162.199) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2005 15:15:55 -0700 Received: by zproxy.gmail.com with SMTP id l1so404354nzf for ; Fri, 05 Aug 2005 15:16:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kFOlcGwHodRFfteI8HkLp1yt2ARrRi5OrAvhEI988SOaA9ij2vMQbtPbMSCsnr05v0b2BnuFkuyzNw6Bn9DrROdcoaJy6wUmJLt4SpGN01QI0Xi5jkReiJvgIDhq5TBp2Y7qki0VzzS4dUoRSumKoDNZqWdYdeb7rnvHhvIk5mU= Received: by 10.37.15.5 with SMTP id s5mr1370046nzi; Fri, 05 Aug 2005 15:16:03 -0700 (PDT) Received: by 10.36.159.3 with HTTP; Fri, 5 Aug 2005 15:16:03 -0700 (PDT) Message-ID: <2984ec0b05080515165c7450af@mail.gmail.com> Date: Fri, 5 Aug 2005 18:16:03 -0400 From: yaron kanza Reply-To: yaron kanza To: Jakarta Commons Users List , dmitri@apache.org Subject: Re: [JXPath] How to use JXPath for Parsing (not Evaluating) XPath? In-Reply-To: <20050805181613.82780.qmail@web30509.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2984ec0b05080509021a1c47e5@mail.gmail.com> <20050805181613.82780.qmail@web30509.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Dmitri, Thank you for the quick response. I was looking at the API of JXPathContext and I found the method static CompiledExpression compile(java.lang.String xpath).=20 However, I couldn't find methods to traverse the parsed tree in the CompileExpression class. So, I don't see how the compile method helps me. For example, suppose that I compile an expression //a/b[c=3D2]/d. Then, how do I get the tree that represents the expression---a tree whose root represents a descendant-or-self axis, the child of the root represents the node-name "a", etc? It will help me a lot if you will explain to me how to get the tree that represents the expression (or the root of it). Thank you very much, Yaron On 8/5/05, Dmitri Plotnikov wrote: > Yaron, >=20 > JXPath will do that for you. It does compile expressions (use the > static method on JXPathContext) and returns a tree. > One nice feature of that three is that if you call toString() on any > subtree, it returns the XPath it represents. >=20 > - Dmitri >=20 > --- yaron kanza wrote: >=20 > > Hello, > > > > I need an XPath parser. That is, a tool that receives an XPath > > expression and returns either an object tree that represents the > > expression (DOM style) or a series of events (SAX style). > > > > Is JXPath the right tool for parsing XPath expressions? > > If not, what is the right tool for parsing XPath? > > > > In the user's guide I found only examples showing how to use JXPath > > for evaluating XPath expressions. I didn't find example showing how > > to > > parse XPath. > > > > Can someone please provide me more information on how to use JXPath > > for parsing expressions? > > > > Does someone have examples showing how to use JXPath as a parser? > > > > Thank you, > > > > Yaron Kanza > > The University of Toronto, Canada > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org