However, the simple Java application can be modified fairly easily to work with JDK 7 or even with a version of Java as old as JDK 5.

In most cases, I have tried to comment the code that requires JDK 7 or JDK 8 to identify these dependencies and provide alternative approaches in earlier versions of Java.

These include operating system scripts and tools such as xmllint, XML editors and IDEs, and even online validators.

code for validating xml against xsd in java-90

package provides an API for XML documents validation.

The validation process verify that an XML document is an instance of a specified XML schema file or XSD file.

Let us consider a simple XML file and the corresponding schema definition.

Be careful because the validator is not thread safe.

It is the responsibility of the application to make the code thread safe.

The validation is successful when the package com.xsd; import sax.

In this example we are going to validate if the package org.kodejava.example.xml; import sax.

There are numerous tools available for validating an XML document against an XSD.

Copyright © 1993, 2016, Oracle and/or its affiliates.

This section looks at the process of XML Schema validation.

Sun's JDK 6 uses SAX parser with a Stream Source.