[jdom-interest] AttributeList performance

Mike Brenner mikeb at mitre.org
Sun Apr 24 14:30:19 PDT 2005


Martin Schulz wrote:
> ... my first question is whether the order of
> attributes is either significant or within JDOM guaranteed to be stable
> as part of any API contract, or is it considered a 'nice-to-have'?  ...


Hi Martin,

One of the nicest things about XML Schemas (say, over DTDs)
is that you don't need to overspecify your XML by
demanding that the elements and tags be in any
particular order.

You are right, sometimes things go slowly and
an improvement would be nice.

The way I read using JDOM is to immediately
turn everything into a hashmap of hashmaps of ...
to as many levels deep as needed for the
particular xml, so that I can have that
instant lookup at every level.

Sometimes JDOM is so slow I use other products
that wrap the XML with java classes, but
I don't like having that needless extra layer,
which tends to emphasize the importance
of code over data.

I believe in data-driven code to the extent
that I can have it. Hash tables for some
lookups would make JDOM usable for more things.

Mike Brenner




More information about the jdom-interest mailing list