not present in MS.NET.
* XmlSerializationWriter.cs: Improved error message.
svn path=/trunk/mcs/; revision=25465
+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,
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();
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 ();
}
}
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);
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
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);
}