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 = (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. 

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
�


_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to