[jdom-interest] Validation in SAX/DOMBuilders

Corcos Igal CorcosI at BanqueLaurentienne.ca
Wed Mar 21 12:50:03 PST 2001

My humble opinion being a newcomer to JDOM:

What I like most about JDOM is that it makes the task of working with XML
simple (and I believe that was one of the goals of JDOM).

Given that, I think the best (and simplest) thing would be to keep the
method call public Document build(boolean validate); the same.  The validate
parameter should simply tell the parser whether or not validation should be
performed, against whatever is specified in the XML!
i.e. if you find a DOCTYPE reference, validate against the DTD, if you find
a schema reference, validate against the schema etc...

This seems like the best solution to me.


-----Original Message-----
From: Brett McLaughlin [mailto:brett at newInstance.com]
Sent: Wednesday, March 21, 2001 3:30 PM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Validation in SAX/DOMBuilders

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?


To control your jdom-interest membership:

More information about the jdom-interest mailing list