[Mono-list] Enumerating over XmlSchemaComplexType.AttributeUses should return DictionaryEntry objects?

Tom Cabanski tcabanski@OAI.cc
Wed, 7 Jan 2004 10:11:10 -0600


The following code works under the Microsoft runtime assuming =
complexType is a XmlSchemaComplexType object but fails with a type cast =
error under Mono:

foreach (DictionaryEntry entry in complexType.AttributeUses)
{
    XmlSchemaAttribute attribute =3D (XmlSchemaAttribute)entry.Value;
}

This is because Mono gives me an enumerator over XmlSchemaAttribute =
objects.  I've identified where this occurs and can patch it.  The =
problem is Microsoft's own documentation for GetEnumerator() of the =
XmlSchemaObjectTable (that's what XmlSchemaComplexType.AttributeUses is) =
says, "Returns an enumerator for the XmlSchemaObject contained in the =
collection".  Cleary, Mono is doing the documented behavior instead of =
Microsoft's implemented behavior.=20

BTW, in other areas, for example the elements collection of the schema =
itself, Microsoft's enumeration over the XmlSchemaObjectTable returns =
the object and not a DictionaryEntry.  That is, enumerating over the =
Elements property of the schema returns XmlSchemaElement objects.

I've worked around it for now in my code with a conditional compilation =
switch as I need to support both runtimes. I assume this issue needs to =
be fixed as Mono's goal is to be a superset of Microsoft's runtime.  Am =
I correct?

Thanks

-------------------------------------
Tom Cabanski
=A0