tags:

views:

26

answers:

0

For the most part, when I perform an XmlReader.Read() I am catching validation errors based on my schemas. This, however, is a large group of schemas with several imports and includes. My question is why I'm having validation errors in two places that seem to be defined in the schema.

Here's an example:

Schema 1 (you can see that IdentificationType has sub-elements for IdentificationID and IdentificationCode):

A data type for a representation of an identity.

Schema 2 (IdentificationCodeSpecial has a substitutioGroup of schema1:IdentificationCode):

The xml looks like this:

(which is typed as IdentificationType)

So, why is IdentificationCodeSpecial throwing a validation error? Is there a problem with substitutionGroups?

I did find problems with using the xsd.exe tool to generate a c# class (namely, it didn't handle 'includes' properly, so I used a different tool). Is this a shortcoming with XmlReader or am I missing something that I need to set up?