Java validating parser

Although the phrase "XML Schema schema" would be precise, we'll use the phrase "XML Schema definition" to avoid the appearance of redundancy.To be notified of validation errors in an XML document, the parser factory must be configured to create a validating parser, as shown in the preceding section.

Note: You'll be learning about namespaces in Using Namespaces.

The thing to remember is that your application will not generate a validation exception unless you supply an error handler like the one above.

In this article, i am going to use the Swing for the UI purpose and for the XML validation against its schema i will use DOM parser as well as SAX Parser.

For now, understand that schema validation is a namespace-oriented process.

Since JAXP-compliant parsers are not namespace-aware by default, it is necessary to set the property for schema validation to work.

Leave a Reply