JDK (Java Development Kit) Tutorials
Dr. Herong Yang, Version 5.00

XSD (XML Schema Definition) - XML Validation

This chapter provides tutorial notes and example codes on XSD (XML Schema Definition). Topics include writing an XML XSD validator using an external XML parser, Xerces-J; validating XML files with an XSD schema; loading external XML parsers.

XML XSD Schema Validation with Xerces

XML XSD Schema Validation Test Result

Loading External XML Parsers with SAXParserFactory

Conclusion:

  • JDK does not support XML XSD validation. The external XML parser Xerces-J can do XSD validation.
  • External XML parser can be created with the XMLReaderFactory.createXMLReader() method.

Notes and sample codes bellow are based on JDK/J2SDK 1.4.1_01.

Read my other book "Tutorial Notes on XML" on other XML related topics.

Dr. Herong Yang, updated in 2008
XSD (XML Schema Definition) - XML Validation