Altova Mailing List Archives


Re: Schema validation different under .NET

From: "Francois Malan" <francoism.removethis@-------.--.-->
To: NULL
Date: 12/19/2005 4:06:00 AM
Martin Honnen wrote:

> 
> 
> Francois Malan wrote:
> 
> > When validating the schema "manually" using MSXML versions 4SP2 and
> > 5 I get the same error. When trying with MSXML verison 6, it
> > validates fine.
> > 
> > Is there some way to tell .NET to use MSXML version 6?
> 
> .NET has its own XML parser and validator implementation, it does not
> use any MSXML version at all, unless you explictly do COM interop
> stuff to use MSXML from mangaged .NET code.  If MSXML 6 does what you
> want then chances are the new/improved validation code in .NET 2.0
> will also do as MSXML 6 and .NET 2.0 classes have been implemented to
> be compatible, in particular when it comes to schema validation.  Can
> you use .NET 2.0?  There you can write code alike
> 
>     XmlReaderSettings validationSettings = new XmlReaderSettings();
>    validationSettings.ValidationEventHandler += new
> ValidationEventHandler(ValidationHandler);
> validationSettings.ValidationType = ValidationType.Schema;
> validationSettings.Schemas.Add(null, @"test2005121901Xsd.xml");
> using (XmlReader validatingReader =
> XmlReader.Create(@"test2005121901.xml", validationSettings)) {
> while (validatingReader.Read()) {}     }
> 
> where ValidationHandler in a Console application could simply do
> 
>  public static void ValidationHandler (object sender,
> ValidationEventArgs args) {     Console.WriteLine("{0}: {1}",
> args.Severity, args.Message);   }

Thanks for your reply. Unfortunately I cannot use .NET 2, since our
customers still use .NET 1.1

Do you know of any "official" document or anything on the web that will
explain this "wrong" behaviour as default  for .NET 1.1?

How would one go about using MSXML 6 inside a .NET app?

Regards


-- 

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.