2

I need to find all types in a given SchemaSet.

What I do today is:

1) Iterate all XmlSchemaTypes in SchemaSet.GlobalTypes.Values.

2) Iterate all values of XmlTypeCode enum

I find this as insufficient because some XmlSchemaTypes can be defined in the depth of the schema(i.e not as a GlobalType).

Is there a way in .NET I can get all the types that are not defined as GlobalTypes?

Ran
  • 21
  • 1
  • Yes, there is. It involves traversing each XML Schema item in your compiled XmlSchemaSet (attributes, attribute groups, groups, types, elements). The code would be too much for a post. – Petru Gardea Oct 09 '11 at 00:57

1 Answers1

-1
            foreach (XmlSchemaType globalType in schemaSet.GlobalTypes.Values)
            {
                   XmlSchemaType.IsDerivedFrom(yourType, globalType, XmlSchemaDerivationMethod.None)
            }
Gady
  • 1,514
  • 2
  • 16
  • 32