[jdom-interest] DOMOutputter and other thoughts

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon Jun 12 08:59:26 PDT 2000


I now have a desire/need for this as well so here are my 2 cents

> > I've been taking a look at the DOMOutputter class
> > and it seems that this will need to take a
> > org.w3c.dom.DOMImplementation rather than a
> 
> Nope - use the JDOM adapters to get a Document from a specific parser
> implementation. Nobody is familiar with DOMImplementation anyway...
> 

BUT .. if the eventual goal is to create a JDOM specific parser AND JDOM
will support DOM, isn't a JDOM DOMDocument implementation the best way to do
it?  Before I realized that someone else had started this I had started
thinking about it and had come to the same conclusion as Kevin.  Certainly,
using the adapters would be easier.  For a version 1 release you could do
something as simple as using XMLOutputter to create a XML string and then
use an adapter to produce the DOM tree.  I'm not sure how much slower that
would be than manually creating the DOM tree but the API wouldn't have to
change to implement it with the manual DOM building step so there isn't a
huge downside.

> > One other thought, just a pie-in-the-sky idea, was to have the
> > JDOM classes implement the DOM interface so that they could be
> > used directly by DOM applications:
> > 
> Nope. Already went down that road, and vetoed it heavily. Bad news
> (trust us, JDOM alpha 1 was like that, and James Davidson convinced us
> otherwise.)

I agree.  One of the great things about JDOM is that each class is so small.
I would rather have this separated into a separate set of DOM implementation
classes.



More information about the jdom-interest mailing list