Using the Validating Parser
By now, you have done a lot of experimenting with the nonvalidating parser. It's time to have a look at the validating parser to find out what happens when you use it to parse the sample presentation.
You need to understand about two things about the validating parser at the outset:
A schema or document type definition (DTD) is required.
Because the schema or DTD is present, the ignorableWhitespace method is invoked whenever possible.
Configuring the Factory
The first step is to modify the Echo program so that it uses the validating parser instead of the nonvalidating parser.
The code in this section is contained in Echo10.java.
To use the validating parser, make the following highlighted changes:
public static ...