The Validator is a component in this architecture since it implements the Component interface and any class that implements the Component Manager interface can manage it. E.g. a parser would configure the components that it needs through this interface by adhering to the guideline spelled out in the Setting Management section of this architecture overview.
The Component Manager is in charge of setting up the following internal Validator fields: SymbolTable, GrammarPool and ErrorFormatter.
The Validator is universal since it is both a filter and a source of document events regardless of the other components connected to in the pipeline architecture. See figure 1.
Figure 1- Pipeline Architecture - Sources & Filters
The following is an outline of the validation process used by the Validator:
Datatype Validators are based on the XML Schema Datatype draft. They are used by the Validator to validate attribute content in the case of a DTD or XML Schema grammars and to validate element content in the case of XML Schema grammars. Datatype validators implement the DatatypeValidator interface.
The Validator uses a factory method than implements the DatatypeValidatorFactory to get datatypes instances.
Datatype validator’s references are attached to the Element and Attribute declaration in the internal implementation of Grammars. See Grammar pools and Grammars
Content model validators are used to check elements against the content model defined in an Element Declaration for those elements. Content model validators implement the ContentModelValidator interface.
A GrammarPool is a registry of Grammars. Grammars are keyed using a “grammar name” which could be a name space. Grammars are classes derived from the Grammar class. Grammars contain internal array structures, and public getter methods that can be used by the Validator to access grammar information. These getter methods provide access to different Declaration constructs.
These Declaration constructs are: XMLElementDecl, XMLAttributeDecl, and XMLEntityDecl, and XMLNotationDecl.
Other constructs available through the Grammars are: XMLSimpleType, ContentModelValidator, and DatatypeValidator.
XMLSimpleType (Simple type) declarations are a special type of Element Declaration, which contains additional information beyond the one provided by XMLElementDecl such as data type validator references.