[jdom-interest] XPath Parsing

Jason Hunter jhunter at collab.net
Thu Jul 6 21:09:56 PDT 2000


> I've been somewhat working with Mike Hinchey with regards to XPath
> parsing, with regards to JDOM.
> 
> Looking for input from Jason/Brett and whomever else might be
> interested.
> 
> So far, I've been using the ANTLR parser-generator (www.antlr.org)
> to create the parser for XPath expressions.  This means, though,
> that the antlr.jar runtime would be required in order to use the
> XPath parser.

The information you (and we) need to look at is

1) What's the redistribution license for antlr.jar?
2) How large is antlr.jar?
3) How hard is it to work without antlr.jar?

> Additionally, the parser is *not* JDOM specific.  It'll be SAX-like,
> firing off events to an XPathHandler of some sort.  The XPathHandler
> will contain the JDOM-specific logic for walking from a root Element
> to return the nodeset.  This would possibly allow someone to also
> write a DOM_XPathHandler or other XPath handler to walk a different
> document-tree.  (Heck, maybe even a SAX_XPathHandler some day).

I'm curious, do you expect there would be a performance gain (memory of
speed) in having a handler more closely tied to JDOM?

> Bearing in mind that it isn't JDOM-specific, so far the XPathParser is
> *not* in the org.jdom hierarchy.  For convenience, it's currently living
> in com.werken.xpath.*.

For this the information we need to look at is, what's your purpose in
writing the XPathParser?

> Mike raised some concerns about the reliance upon the external
> parser-generator ANTLR, and the packaging of the parser itself.
> 
> (btw, I'm not a big fan of org.jdom.contrib.* packaging, as it
> doesn't help coders find the location where the module actively
> lives or is being developed).

org.jdom.contrib.* is a workspace for people who are writing code useful
to JDOM who want to increase their code's visibility, get community
feedback, get community help in development, and who frankly don't want
to go through the hassle of setting up a "community center" on their
own.  jdom-contrib is the place where the module would be developed; you
and Mike and others interested and worthy are invited to make use of our
facilities.  Perhaps this doesn't fit your project purpose.  That's why
I ask why you're writing this code.

-jh-



Received: from exeter.exeter.org (bogus at exeter.exeter.org [207.87.144.42])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id AAA09658
	for <jdom-interest at jdom.org>; Fri, 7 Jul 2000 00:08:27 -0600 (MDT)
Received: from localhost (bob at localhost)
	by exeter.exeter.org (8.8.8/8.8.8) with SMTP id CAA26792;
	Fri, 7 Jul 2000 02:08:18 -0400
X-Authentication-Warning: exeter.exeter.org: bob owned process doing -bs
Date: Fri, 7 Jul 2000 02:08:17 -0400 (EDT)
From: bob <bob at accurev.com>
X-Sender: bob at exeter.exeter.org
To: Jason Hunter <jhunter at collab.net>
cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] XPath Parsing
In-Reply-To: <39655814.15A48302 at collab.net>
Message-ID: <Pine.LNX.3.96.1000707020345.26772A-100000 at exeter.exeter.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

> 1) What's the redistribution license for antlr.jar?

	Public Domain

> 2) How large is antlr.jar?

	937 k.

> 3) How hard is it to work without antlr.jar?

	antlr.jar is basically lex/yacc for Java.  Sure, you
	can hand-write a parser.  But no one really wants to
	do that.

> I'm curious, do you expect there would be a performance gain (memory of
> speed) in having a handler more closely tied to JDOM?

	Handler will be 100% tied to JDOM.  The parser would be 0% tied
	to JDOM.  Complete separation of duties.  I don't think making
	the parser tied to JDOM would help much.

> For this the information we need to look at is, what's your purpose in
> writing the XPathParser?

	Mostly just I have the ability, and would like to see more
	tools (XSLT for one) that use JDOM.  Though, I like reusability,
	and if a non-JDOM project could use a generic XPath parser,
	I'd like to make it available.  This is one reason I'm leaning
	on ANTLR.  Someone else could pick up the xpath.g grammar and
	do other wild'n'wonderful things with it, possibly.

		-bob


Received: from exeter.exeter.org (bogus at exeter.exeter.org [207.87.144.42])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id AAA09658
	for <jdom-interest at jdom.org>; Fri, 7 Jul 2000 00:08:27 -0600 (MDT)
Received: from localhost (bob at localhost)
	by exeter.exeter.org (8.8.8/8.8.8) with SMTP id CAA26792;
	Fri, 7 Jul 2000 02:08:18 -0400
X-Authentication-Warning: exeter.exeter.org: bob owned process doing -bs
Date: Fri, 7 Jul 2000 02:08:17 -0400 (EDT)
From: bob <bob at accurev.com>
X-Sender: bob at exeter.exeter.org
To: Jason Hunter <jhunter at collab.net>
cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] XPath Parsing
In-Reply-To: <39655814.15A48302 at collab.net>
Message-ID: <Pine.LNX.3.96.1000707020345.26772A-100000 at exeter.exeter.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

> 1) What's the redistribution license for antlr.jar?

	Public Domain

> 2) How large is antlr.jar?

	937 k.

> 3) How hard is it to work without antlr.jar?

	antlr.jar is basically lex/yacc for Java.  Sure, you
	can hand-write a parser.  But no one really wants to
	do that.

> I'm curious, do you expect there would be a performance gain (memory of
> speed) in having a handler more closely tied to JDOM?

	Handler will be 100% tied to JDOM.  The parser would be 0% tied
	to JDOM.  Complete separation of duties.  I don't think making
	the parser tied to JDOM would help much.

> For this the information we need to look at is, what's your purpose in
> writing the XPathParser?

	Mostly just I have the ability, and would like to see more
	tools (XSLT for one) that use JDOM.  Though, I like reusability,
	and if a non-JDOM project could use a generic XPath parser,
	I'd like to make it available.  This is one reason I'm leaning
	on ANTLR.  Someone else could pick up the xpath.g grammar and
	do other wild'n'wonderful things with it, possibly.

		-bob


Received: from exeter.exeter.org (bogus at exeter.exeter.org [207.87.144.42])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id AAA09658
	for <jdom-interest at jdom.org>; Fri, 7 Jul 2000 00:08:27 -0600 (MDT)
Received: from localhost (bob at localhost)
	by exeter.exeter.org (8.8.8/8.8.8) with SMTP id CAA26792;
	Fri, 7 Jul 2000 02:08:18 -0400
X-Authentication-Warning: exeter.exeter.org: bob owned process doing -bs
Date: Fri, 7 Jul 2000 02:08:17 -0400 (EDT)
From: bob <bob at accurev.com>
X-Sender: bob at exeter.exeter.org
To: Jason Hunter <jhunter at collab.net>
cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] XPath Parsing
In-Reply-To: <39655814.15A48302 at collab.net>
Message-ID: <Pine.LNX.3.96.1000707020345.26772A-100000 at exeter.exeter.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

> 1) What's the redistribution license for antlr.jar?

	Public Domain

> 2) How large is antlr.jar?

	937 k.

> 3) How hard is it to work without antlr.jar?

	antlr.jar is basically lex/yacc for Java.  Sure, you
	can hand-write a parser.  But no one really wants to
	do that.

> I'm curious, do you expect there would be a performance gain (memory of
> speed) in having a handler more closely tied to JDOM?

	Handler will be 100% tied to JDOM.  The parser would be 0% tied
	to JDOM.  Complete separation of duties.  I don't think making
	the parser tied to JDOM would help much.

> For this the information we need to look at is, what's your purpose in
> writing the XPathParser?

	Mostly just I have the ability, and would like to see more
	tools (XSLT for one) that use JDOM.  Though, I like reusability,
	and if a non-JDOM project could use a generic XPath parser,
	I'd like to make it available.  This is one reason I'm leaning
	on ANTLR.  Someone else could pick up the xpath.g grammar and
	do other wild'n'wonderful things with it, possibly.

		-bob




More information about the jdom-interest mailing list