XML Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.10

Validating an XML Document against the Specified XML Schema

This chapter provides tutorial notes and example codes on XML validation against XSD schemas. Topics include downloading and installing Xerces-J; using JDK SAX API to write Java programs to validate an XML document against the specified XSD schema.

XMLReaderValidator.java - Validating XML with XSD using Xerces-J

XMLReaderValidator.java - Validation Error Messages

Using SAXParserFactory to Load XML Parsers

Conclusion:

  • The "crimson" package is the default implementation of SAX API in JDK 1.4, which does not support XML validation against XSD schema.
  • The "Xerces-J" package implements SAX API which does support XML validation against XSD schema. You need to download it separately.

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

 XML File Browsers

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

 Syntaxes of XSD Statements

Validating an XML Document against the Specified XML Schema

 XSL (Extensible Stylesheet Language) Introduction

 XSLT (XSL Transformations) Introduction

 Java Implementation of XSLT

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

 Control and Generate XML Element in the Result

 XML Notepad - XML Editor

 XML Tools Plugin for Notepad++

 References

 Printable Copy - PDF Version

Dr. Herong Yang, updated in 2013
Validating an XML Document against the Specified XML Schema