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

Atsushi Eno atsushi@ximian.com
Thu, 08 Jan 2004 04:35:34 +0900


Hello,

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

Thanks, good catch again. I am going to fix.

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

Yes, XmlSchemaObjectTable and XmlSchemaObjectCollection looks different 
in this context.

 > 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?

Basically, I think. However, we should not always rely on their concrete 
behavior. They might change their concrete logic (even though they are 
likely to create new classes, putting old classes aside). So we should 
demand compatibility as long as it is rational. (For example, we should 
not raise an error for new Uri ("/home/atsushi/test.xml") .)

Thanks,
Atsushi Eno