[jdom-interest] Validation in SAX/DOMBuilders

Eric M. Burke burke_e at yahoo.com
Wed Mar 21 13:17:42 PST 2001


I don't think they should be treated differently.
One concern is that some XML parsers will use a
non-standard method of validation that does not
use DTDs or Schemas. In the current JDOM model,
we just tell the parser to "validate", and it
will still work with those parsers.

My second, more immediate concern, is that
this is essentially hard-coding the method of
validation into my Java code. If I write code
today that says "validateDTDs(true)", but a month
from now change my XML data files to use schemas,
I will have to get in there and edit my Java
code, recompile, and re-deploy. I like the 
abstraction that the current model employs.

- Eric

> 
> 
> So when it comes to validation, do you (yes, you, reader...) consider DTD
> validation and schema validation to be separate things, turned on
> separately? For example, when you invoke this method:
> 
> public Document build(boolean validate);
> 
> in SAXBuilder or DOMBuilder, and send it "true", do you expect that to
> validate both DTDs referenced AND schemas referenced? Just one? Should it
> stay as is, or should it be:
> 
> public void validateDTDs(boolean validateDTDs);
> public void validateSchemas(boolean validateSchemas);
> public Document build();
> 
> I don't like, fyi,
> 
> public Document build(boolean validateDTDs, boolean validateSchemas);
> 
> too confusing...
> 
> so what do people think?
> 
> -Brett
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yourad
dr at yourhost.com



More information about the jdom-interest mailing list