Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78214 --- shadow/78214 2006-04-26 12:24:13.000000000 -0400 +++ shadow/78214.tmp.15445 2006-04-26 12:24:13.000000000 -0400 @@ -0,0 +1,55 @@ +Bug#: 78214 +Product: Mono: Class Libraries +Version: 1.1 +OS: All +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: Sys.XML +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: [PATCH] XML Serialization fixes for default values + +The attached patch fixes several issue in System.Xml.Serialization with +regards to default values, and is accompanied by corresponding unit tests. + +From the ChangeLog: + +* XmlReflectionImporter.cs: Instead of only catching IOE, catch all +exceptions exception NotSupportedException (that one still needs to +be fixed to match MS.NET). Instead of passing namespace of XmlAttribute +to ImportTypeMapping use the default namespace for importing the member +type. Convert enum default to space separated name constants, and +verify enum value. +* XmlSchemaExporter.cs: Set XmlSchemaAttribute.Use to Required if there +is no default value, and member is not an optional value type. Use +ExportDefaultValue to convert default enum value from constant name(s) +to XML name(s). Element should not have minOccurs 1 if value type +member has default value. To match MS.NET, output flag enum type as +xsd list with restriction. +* XmlSerializationReaderInterpreter.cs: Convert default value for +enum member from space-separated list of named constants using +XmlTypeMapMember.GetEnumValue. +* XmlSerializationWriterInterpreter.cs: Change order of XML Schema and +XML Schema Instance namespace declarations in 2.0 profile to match MS. +Convert enum default value from whitespace separated list of named +constant to enum value to compare with member value. +* XmlSerializer.cs: Change order of XML Schema and XML Schema Instance +namspace declaration in 2.0 profile to match MS.NET. +* XmlTypeMapMember.cs: Added GetEnumValue method for creating enum +from space-separated list of named constants. +* XmlTypeMapping.cs: Added ToEnum method for converting from constant +name(s) to integral enum value. + +IMPORTANT: + +The patch is not tested for, and does not contain fixes for +SerializationCodeGenerator. I will "port" my fixes to +SerializationCodeGenerator once this patch is approved (and before +committing it ofcourse). _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
