* TypeTranslator.cs, XmlCustomFormatter.cs: Removed map from Uri to anyUri,
authorLluis Sanchez <lluis@novell.com>
Wed, 14 Apr 2004 11:33:19 +0000 (11:33 -0000)
committerLluis Sanchez <lluis@novell.com>
Wed, 14 Apr 2004 11:33:19 +0000 (11:33 -0000)
  not present in MS.NET.
* XmlSerializationWriter.cs: Improved error message.

svn path=/trunk/mcs/; revision=25465

mcs/class/System.XML/System.Xml.Serialization/ChangeLog
mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs
mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs

index 09ed8af67302679caebdc1883d7e7d963bb647bb..992b19b303fdc09017076329817b4be29197866b 100755 (executable)
@@ -1,3 +1,9 @@
+2004-04-14  Lluis Sanchez Gual <lluis@ximian.com>
+
+       * TypeTranslator.cs, XmlCustomFormatter.cs: Removed map from Uri to anyUri,
+         not present in MS.NET.
+       * XmlSerializationWriter.cs: Improved error message.
+
 2004-03-30  Lluis Sanchez Gual <lluis@ximian.com>
 
        * SerializationCodeGenerator.cs, XmlReflectionImporter.cs, 
index 4dd66c8b05cebef555bc67d3f3f68ef1abe86aa2..932b2418b4390371884a80ae7a5e8c503945a935 100644 (file)
@@ -47,7 +47,6 @@ namespace System.Xml.Serialization
                        nameCache.Add (typeof (byte[]), new TypeData (typeof (byte[]), "base64Binary", true));
                        nameCache.Add (typeof (XmlNode), new TypeData (typeof (XmlNode), "XmlNode", false));
                        nameCache.Add (typeof (XmlElement), new TypeData (typeof (XmlElement), "XmlElement", false));
-                       nameCache.Add (typeof (Uri), new TypeData (typeof (Uri), "anyURI", true));
                        nameCache.Add (typeof (TimeSpan), new TypeData (typeof (TimeSpan), "duration", true));
 
                        primitiveTypes = new Hashtable();
index 32d2b756c0ac39d930c8dc437e41ce4fc3bbaea1..ac03f3931fc23d4b8efd80eca83b432e8145ce95 100644 (file)
@@ -175,7 +175,6 @@ namespace System.Xml.Serialization {
                                case "unsignedLong": return XmlConvert.ToString ((UInt64)value);
                                case "guid": return XmlConvert.ToString ((Guid)value);
                                case "base64Binary": return Convert.ToBase64String ((byte[])value);
-                               case "anyURI":
                                default: return value.ToString ();
                        }
                }
@@ -204,7 +203,6 @@ namespace System.Xml.Serialization {
                                case "unsignedLong": return XmlConvert.ToUInt64 (value);
                                case "guid": return XmlConvert.ToGuid (value);
                                case "base64Binary": return Convert.FromBase64String (value);
-                               case "anyUri": return new Uri (value);
                                default: 
                                        if (type.Type != null)
                                                return Convert.ChangeType (value, type.Type);
index 7c248ef2f848b9e4cb866b39ae9c913415ea5afe..76af4cbe767a0e9246ebcd9dbec5a948f5c405ae 100644 (file)
@@ -30,6 +30,8 @@ namespace System.Xml.Serialization {
                Hashtable callbacks;
                Hashtable serializedObjects;
                const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
+               const string unexpectedTypeError = "The type {0} was not expected. Use the" +
+                       " XmlInclude or SoapInclude attribute to specify types that are not known statically.";
 
                #endregion // Fields
 
@@ -748,7 +750,7 @@ namespace System.Xml.Serialization {
                        if (xsiType)
                        {
                                if (td.SchemaType != SchemaTypes.Primitive)
-                                       throw new InvalidOperationException ("Invalid type: " + o.GetType().FullName);
+                                       throw new InvalidOperationException (string.Format (unexpectedTypeError, o.GetType().FullName));
                                WriteXsiType (td.XmlType, XmlSchema.Namespace);
                        }