This Blog Has Been Moved !

This Blog Has been moved to

This is extremely trivial XML Schema Validator; I just needed to verify my XML against a Schema File. Very simple code but maybe helpful to someone.


using System;

using System.Xml;

using System.IO;

using System.Xml.Schema;


namespace XmlConsole


      /// <summary>

      /// Summary description for Class1.

      /// </summary>

      class Class1


            private static int errors = 0;

            /// <summary>

            /// The main entry point for the application.

            /// </summary>


            static void Main(string[] args)




                        // The Source XML File

                        XmlTextReader xtr = new XmlTextReader("C:\\devresult.xml");

                        XmlValidatingReader reader = new XmlValidatingReader(xtr);

                        reader.ValidationType = ValidationType.Schema;


                        // The Path of the XML Schema File against which the Validation is to be made.

                        // you can add more than one Files by using reader.Schemas.Add()

                        reader.Schemas.Add(null,new XmlTextReader(@"E:\Schema.xsd"));

                        reader.ValidationEventHandler += new ValidationEventHandler(reader_ValidationEventHandler);






                        if(errors == 0)

                              System.Console.WriteLine("Validation Successfull");


                              System.Console.WriteLine("Validation Failed");




                  catch(Exception exp)



                        errors ++;




            private static void reader_ValidationEventHandler(object sender, ValidationEventArgs e)








9 comments have been posted.
Posted @ 3:19 PM
I read your blog, and i thought it was rather cool. check out My Blog
Please Click Here to view it

Have a great day.

Anonymous Anonymous
Posted @ 4:01 PM
You want to ensure that you select a Nuviante robe that appears smashing, however no longer trashy. deciding on robes that praise your pores and skin tone, don�t display an excessive amount of flesh, and feature tasteful patterns make a contribution to ensuring that you will appearance poised and swish in your next festival.For more ==== >>>>>>

Anonymous Anonymous
Posted @ 3:47 PM
The thesis is embraced as part of the Grow XL coursework which complements the essential capabilities of a student to put together him for making a profession as a behavioral area where applied Psychology is broadly embraced is sports activities.For more ==== >>>>>>

Anonymous Anonymous
Posted @ 4:00 PM
One method that will help you with this Megadrox is referred to as visualization . it's miles the practice of mentally picturing your self as you would like to be and focusing all of your energies on reaching that purpose.For more ==== >>>>>>

Anonymous Anonymous
Posted @ 4:30 PM
What we want in energy for the subsequent GROW XL leap forward in code-dealing with is to have table top machines which are possibly a billion billion instances extra powerful and faster than the fastest machines sitting on our tables today.For more ==== >>>>>>

Posted @ 3:13 PM
The sharing of a story is a special Opti Memory way to spend time with your grandchildren. Every child loves and appreciates a good story that captivates their imagination and keeps them entertained.For more ==== >>>>>>

Posted @ 1:58 PM
These purses had been specially taken Blackcore Edge Max into consideration crucial via travelers. The wealth or fame of the provider was generally shown with the aid of the adornment of jewelry.For more ==== >>>>>>

Anonymous Anonymous
Posted @ 2:57 PM
Some precautions should be taken in Grow XL the course of exercising as a pregnant woman is at a threat of a premature hard work. The pregnant lady have to never exercising to exhaustion and ought to prevent exercise whilst she feels out of breath or has any difficulty in speaking.For more ==== >>>>>>