[jdom-interest] DOMBuilder validation -api error in DOMBuilde r.java

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Jun 15 15:09:09 PDT 2000

> > What are people's opinions on keeping or deleting
> > DOMBuilder.build(InputStream) and all the other methods 
> that build from
> > things other than a DOM Document?  These build() methods 
> build a JDOM
> > document by first building a DOM document, so they'll 
> probably always
> > execute slower and be more heavyweight than the 
> corresponding SAXBuilder
> > build() method.  The reason to keep them anyway is that they can be
> > useful for testing (you can compare SAX built versus DOM 
> built documents
> > to make sure they're equal) and they are a valid build 
> mechanism.  We of
> > course have documentation for them that says they aren't 
> the preferred
> > build mechanism.  We'll probably say that for SAXBuilder one day too
> > when we recommend SpitfireBuilder.  :-)
> Actually, to augment that, there's nothing about DOM that 
> requires it to
> use SAX for building. So in future versions, it might build using
> something other than SAX. For those cases I thik it's useful to keep
> around, because it could be an interesting benchmark at that point.

Yeah, I can't come up with a good reason to keep it but I like the fact that
I could save a couple of steps coding if there was a reason to use it.  If
you were going to do it that way, would it make sense to add a getDocument
method that would return the w3c Document?  Since the only time you would
want to use DOMBuilder is when you needed a DOM, should you provide access
to it?

More information about the jdom-interest mailing list