[jdom-interest] DOMBuilder validation -api error in DOMBuilder.java
Jason Hunter
jhunter at acm.org
Thu Jun 15 10:18:36 PDT 2000
> Interesting. The DOMBuilder class has the flag for validation but never
> uses it anywhere. The reason it doesn't use is that the DOMBuilder doesn't
> do any parsing; it's handed a DOM tree and the parsing has already happened.
> It's the adapter that has to do the validation. Here is slightly modified
> code from the DOMBuilder sample to correctly turn validation on and off.
Ah, in the latest version Brett and I are hacking on, DOMBuilder can
again build from InputStreams, Files, etc. For those it can do
validation.
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. :-)
Opinions?
-jh-
More information about the jdom-interest
mailing list