javax.xml.validation

  • The primary classes in Java's XML validation API are Schema, SchemaFactory, Validator, and ValidatorHandler.

  • Schema represents the grammar, SchemaFactory creates Schema objects, Validator checks documents against Schema, and ValidatorHandler performs validation on SAX streams.

  • Although included in Java 5, SchemaFactoryLoader has been removed and should not be used.

  • TypeInfoProvider grants access to type information determined during validation by ValidatorHandler.

Classes

Schema Immutable in-memory representation of grammar. 
SchemaFactory Factory that creates Schema objects. Entry-point to the validation API. 
SchemaFactoryLoader

This class was removed from JAXP 1.3 before it was finalized but was mistakenly included in Java 5. 

TypeInfoProvider This class provides access to the type information determined by ValidatorHandler
Validator

A processor that checks an XML document against Schema

ValidatorHandler Streaming validator that works on SAX stream.