mail-archives/mono-bugs/2006-February/039065.html

134 строки
5.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 77501][Nor] New - Numeric value for enum is
serialized as primitive type
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077501%5D%5BNor%5D%20New%20-%20Numeric%20value%20for%20enum%20is%0A%09serialized%20as%20primitive%20type&In-Reply-To=bug-77501%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="039064.html">
<LINK REL="Next" HREF="039066.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 77501][Nor] New - Numeric value for enum is
serialized as primitive type</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077501%5D%5BNor%5D%20New%20-%20Numeric%20value%20for%20enum%20is%0A%09serialized%20as%20primitive%20type&In-Reply-To=bug-77501%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 77501][Nor] New - Numeric value for enum is
serialized as primitive type">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Wed Feb 8 09:55:15 EST 2006</I>
<P><UL>
<LI>Previous message: <A HREF="039064.html">[Mono-bugs] [Bug 77488][Nor] Changed - [gmcs] Exception when
compiling (NotSupportedException)
</A></li>
<LI>Next message: <A HREF="039066.html">[Mono-bugs] [Bug 77501][Nor] Changed - Numeric value for enum is
serialized as primitive type
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#39065">[ date ]</a>
<a href="thread.html#39065">[ thread ]</a>
<a href="subject.html#39065">[ subject ]</a>
<a href="author.html#39065">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">gert.driesen at pandora.be.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=77501">http://bugzilla.ximian.com/show_bug.cgi?id=77501</A>
--- shadow/77501 2006-02-08 09:55:15.000000000 -0500
+++ shadow/77501.tmp.12870 2006-02-08 09:55:15.000000000 -0500
@@ -0,0 +1,60 @@
+Bug#: 77501
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.XML
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">atsushi at ximian.com</A>
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">gert.driesen at pandora.be</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Numeric value for enum is serialized as primitive type
+
+The numeric value of an enum constant is wrongly serialized as as
+primitive type (xsi type).
+
+This is a simple bug, but I need to get this to behave like the MSFT
+implementation before I can add additional unit tests for
+System.Xml.Serialization. This is why I didn't set the priority
+to &quot;Minor&quot;.
+
+To reproduce, compile and run the following code snippet:
+
+using System;
+using System.Xml.Serialization;
+
+public class Test
+{
+ static void Main ()
+ {
+ XmlSerializer xs = new XmlSerializer (typeof (EnumDefaultValueNF));
+ xs.Serialize (Console.Out, (int) EnumDefaultValueNF.e1);
+ }
+ public enum EnumDefaultValueNF { e1 = 1, e2 = 2, e3 = 3 }
+}
+
+Actual result:
+
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;
+&lt;EnumDefaultValueNF xmlns:q1=&quot;<A HREF="http://www.w3.org/2001/XMLSchema&quot;">http://www.w3.org/2001/XMLSchema&quot;</A>
+d1p1:type=&quot;q1:int&quot; xmlns:d1p1=&quot;<A HREF="http://www.w3.org/2001/XMLSchema-">http://www.w3.org/2001/XMLSchema-</A>
+instance&quot;&gt;1&lt;/EnumDefaultValueNF&gt;
+
+Expected result:
+
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;
+&lt;EnumDefaultValueNF&gt;1&lt;/EnumDefaultValueNF&gt;
+
+Note: we should in fact get this, but I'll file a separate bug report for
+that:
+
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;
+&lt;EnumDefaultValueNF&gt;e1&lt;/EnumDefaultValueNF&gt;
+
+(note that the constant name is output, not its integral value)
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="039064.html">[Mono-bugs] [Bug 77488][Nor] Changed - [gmcs] Exception when
compiling (NotSupportedException)
</A></li>
<LI>Next message: <A HREF="039066.html">[Mono-bugs] [Bug 77501][Nor] Changed - Numeric value for enum is
serialized as primitive type
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#39065">[ date ]</a>
<a href="thread.html#39065">[ thread ]</a>
<a href="subject.html#39065">[ subject ]</a>
<a href="author.html#39065">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>