XML ASP.Net

<%@ Page Language="C#"%>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Schema" %>
    
    private StringBuilder stringBuilder = new StringBuilder();
    void Page_Load(object sender, EventArgs e)
    {
        string xmlPath = MapPath("AuthorsWithInlineSchema.xml");            
        XmlReader reader = null;        
        XmlReaderSettings settings = new XmlReaderSettings();
        settings.ValidationType = ValidationType.Schema;                
        settings.ValidationEventHandler += new ValidationEventHandler(this.ValidationEventHandler);
        //settings.ValidationFlags &= ~XmlSchemaValidationFlags.IgnoreInlineSchema;
        //settings.ValidationFlags &= ~XmlSchemaValidationFlags.IgnoreValidationWarnings;        
        settings.ValidationFlags &= XmlSchemaValidationFlags.ProcessInlineSchema;
        settings.ValidationFlags &= XmlSchemaValidationFlags.ReportValidationWarnings;        
        reader = XmlReader.Create(xmlPath, settings);
        while (reader.Read()) 
        {            
        }
        if (stringBuilder.ToString() == String.Empty)
            Response.Write("Validation completed successfully.");
        else
            Response.Write("Validation Failed. 
" + stringBuilder.ToString());
    }
    void ValidationEventHandler(object sender, ValidationEventArgs args)
    {
        if (args.Severity == XmlSeverityType.Error)
        {
            stringBuilder.Append("Validation error: " + args.Message + "
");                
        }       
    }    
  



    Inline XSD Schema Validation


    
    
                
    

    


<%--


  
  
    
      
        
          
            
              
                
                
                
                
                
                
                
                
                
              

            

          
        

      

    
  
  
  
      
        000-00-0001
        Nancy
        Lee
        999 999-9999
        
9999 York St.

        Regina
        LA
        99999
        true
      

      
        000-00-0002
        First
        Last
        415 986-7020
        
No Name St.

        Vancouver
        BC
        88888
        true
      
 
  


--%>