XSD Validation - XSD

What is the use of XSD Validation?

In below example we are using Java based XSD validator for validating students.xml against the students.xsd.

students.xml

students.xsd

XSDValidator.java

Steps for validating XML against XSD

  • Copy XSDValidator.java file to any location, for, example E: > java
  • Copy students.xml to same location E: > java
  • Copy students.xsd to same location E: > java
  • Compile XSDValidator.java using console and ensure that you have JDK 1.5 installed on your machine and also the classpaths should be configured. For details on how to use JAVA, see JAVA Tutorial

  • Execute XSDValidator with students.xsd and students.xml passed as argument.

Verify the output

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XSD Topics