Click here to Skip to main content
12,895,461 members (49,654 online)
Click here to Skip to main content
Add your own
alternative version


21 bookmarked
Posted 27 Sep 2007

Simple and Cool XML Validator

, 27 Sep 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
A small program you can use to validate an XML document against a schema


I woke up one morning and decided to read about XML. In the video tutorial that I was watching on my computer, the instructor used a self made XML Validator to test the XML and XSD documents he created. I searched the whole DVD-ROM for the Validator, but… it wasn't there. So, I decided to write one that I could use, and also put it up for public use here on The Code Project. Here is the result (it took me half a day to get it to work).


This small program will help you validate your XML document/database/... against your laid down specification (schema). The interface is so simple that you'll understand what to do and how to use it once you see it. I didn't do any digging into the source code, because it's mostly Microsoft's code - I only implemented it.

It's very easy to operate the machine; it looks like this:

Screenshot - image001.png

Load the XML schema file by clicking the button next to the XML Schema File textbox; it displays an open file dialog. Browse the folders for your schema file and click open.

In the textbox below, a message appears telling you if your schema file was valid or not. If you had a valid schema file, you might want to validate an XML document against it. The button next to the XML document textbox will open an open file dialog box for you to select your XML document. The moment you load the document, it gets checked if it’s a valid XML document. By this time, the validate button will have been activated. Click this button to validate the XML document against the schema file you specified. If the document conforms to the schema, you'll get a “Document validation against Schema was successful” message. Below is a sample output:

Screenshot - image003.png

The code is rather shabby, but it's easy to understand. If you have a question about the code, please feel free to ask.


  • 27th September, 2007: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer TEDATA
Nigeria Nigeria
Seun (Laolusrael) loves programming. I learnt 80% of what I know in programming all alone. I use my God-given mind to do a lot of thinking, and...
Currently Seun is a student studying software engineering, and working freelance.

You may also be interested in...

Comments and Discussions

GeneralEnhancement.... Pin
Anurag Gandhi27-Sep-07 19:04
memberAnurag Gandhi27-Sep-07 19:04 
GeneralRe: Enhancement.... Pin
Seun28-Sep-07 4:38
memberSeun28-Sep-07 4:38 
GeneralRe: Enhancement.... Pin
zorrothefox6-Jan-09 19:16
memberzorrothefox6-Jan-09 19:16 
GeneralRe: Enhancement.... Pin
Seun16-Jan-09 12:03
memberSeun16-Jan-09 12:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 27 Sep 2007
Article Copyright 2007 by Seun
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid