System.Xml.Tests.TC_SchemaSet_Misc.v107 C# (CSharp) Méthode

v107() private méthode

private v107 ( ) : void
Résultat void
        public void v107()
        {
            string strXml = @"<root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='a bug356711_a.xsd' xmlns:a='a'></root>";
            Initialize();
            XmlSchemaSet schemaSet = new XmlSchemaSet();
            schemaSet.XmlResolver = new XmlUrlResolver();
            schemaSet.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);
            schemaSet.Add(null, Path.Combine(TestData._Root, "bug356711_root.xsd"));

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.XmlResolver = new XmlUrlResolver();
            settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings | XmlSchemaValidationFlags.ProcessSchemaLocation;
            settings.Schemas.Add(schemaSet);
            settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);
            settings.ValidationType = ValidationType.Schema;
            XmlReader vr = XmlReader.Create(new StringReader(strXml), settings);

            while (vr.Read()) ;

            CError.Compare(warningCount, 1, "Warning Count mismatch!");
            CError.Compare(WarningInnerExceptionSet, true, "Inner Exception not set!");
            return;
        }