[jdom-interest] Getting close with SAX...

James Strachan james at metastuff.com
Mon Nov 6 04:59:55 PST 2000

On the Java platform, JDOM should increasingly be the preferred tree based
parser API over DOM since it is much more Java friendly.. SAX is certainly
the most efficient API on which to parse JDOM trees.

Since it looks like the maintenance of SAX is up for grabs at the moment
(David Megginson is stepping down as maintainer isn't he?) would it make
sense for www.jdom.org to take over ownership? Or should JDOM always stay
independent? Thoughts?

I'm particularly thinking that SAX3 could be changed slightly to provide a
closer integration of JDOM and SAX for performance reasons. i.e. make SAX
more JDOM friendly

e.g. off the top of my head without studying the implementation code much or
doing any profiiling, it would appear when processing SAX events to build a
JDOM tree we do the following:-
    for each element
        create a SAX Attributes instance and put in it each attribute
        iterate through the SAX Attributes instance,
            for each attribute
                create a new JDOM Attribute instance, configure it correctly
then add it to a JDOM list.

So we basically make 2 different collection representations of attributes
for each element in a document. This is needless redundancy - if SAX and
JDOM moved closer, we could avoid. e.g. we could make a a 'collection of
attributes' once in SAX and can be reused directly as is in JDOM.

Maybe we just need to get the XML parsers to work with either JDOM natively
or SAX natively instead, though that seems a much bigger job than just
making minor changes to SAX to make it more JDOM friendly.


James Strachan
email: james at metastuff.com
web: http://www.metastuff.com

----- Original Message -----
From: "bob" <bob at accurev.com>
To: "Jon Baer" <jonbaer at musicphone.com>
Cc: <jdom-interest at jdom.org>
Sent: Tuesday, October 17, 2000 7:04 PM
Subject: Re: [jdom-interest] XPath Examples + Spitfire

> > Can someone post an example of how to use the contrib xpath package?
> The XPath stuff in jdom-contrib has stalled, and been moved
> to:
> http://code.werken.com/xpath/
> Since I'll be basing an XSLT implementation on top of it,
> I decided for the time-being that an independent location
> might be best.  (But, as mentioned before, it's Apache-style
> licensed, so it can be re-integrated to jdom whever someone
> feels like it.)
> It's not 100% complete, and there's not much user-land
> documentation, but the javadocs for the relevant classes
> are mostly complete.
> -bob
> _______________________________________________
> To control your jdom-interest membership:

If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.

More information about the jdom-interest mailing list