I am setting up an XmlReader in .NET 2.0 beta2. I'm trying to migrate
away from the now deprecated XmlValidatingReader. The XML files I'm
reading have an in-line schema. I'm noticing several alarming problems:
1) The documentation for XmlReader says to use and XmlReaderSettings
object and to either add or remove IgnoreInlineSchema from the
ValidationFlags property as desired. Well, the ValidationFlags property
uses the XmlSchemaValidationFlags enumeration... which does not even
have IgnoreInlineSchema defined. It has ProcessInlineSchema. So, I go
ahead and add the flag since I want it to use the inline schema. Oh,
guess what... it doesn't actually apply the flags, so to get it to use
the inline schema, I have to adjust the boolean properties,
IgnoreInlineSchema, IgnoreValidationWarnings, etc. to get it to work.
2) However I decide to explicitly add schemas to my XmlReader's
Settings.Schemas (either through calling
XmlReaderSettings.Schemas.Add() or XmlReader.Settings.Schemas.Add()) it
does not use the schema. I keep getting Validation Warnings of "Could
not find schema information for the element 'Any'". My schema DOES in
fact have everything defined, and when I use the old 1.1 way of doing
things (XmlValidatingReader) everything validates as I expect it to.
So, is this a bug in XmlReader? Or is Microsoft now releasing betas
that are not feature complete? Is this beta testing or alpha testing?
3) On an unrelated note, I was under the impression that the validation
events in 2.0 were going to make res a public member instead of
private. So far, that is not the case, making ValidationEvents in 2.0
as inane and useless to developers as they were in 1.1!