Your subject line and post contradict each other. Are you looking for DTD validation or XML schema validation?
DTD Validation:
SAX program that validates documents To perform XSD validation you have to set some additional features:
"http://xml.org/sax/features/namespace-prefixes" to enable namespace support.
"http://apache.org/xml/features/validation/schema" to enable XML Schema validation.
If you need to validate against an external XML schema use the "http://apache.org/xml/properties/schema/external-schemaLocation" property.
Use of the features and properties are demonstated in
this XSD validation code [ December 05, 2008: Message edited by: Peer Reynders ]