diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2009-04-28 19:23:37 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2009-04-28 19:23:37 +0400 |
commit | 31751dd12affeea128a3f059bda004bf671966b1 (patch) | |
tree | f3203c3acc35c59f8f4847da99050c7412359b89 /mcs/class/System.XML/System.Xml | |
parent | 2f22695121bb8c7255871883782d74214a9e16b4 (diff) |
In Test/System.Xml:
2009-04-28 Sebastien Pouliot <sebastien@ximian.com>
* XmlResolverTest.cs: New. Unit tests for base features.
In System.Xml:
2009-04-28 Sebastien Pouliot <sebastien@ximian.com>
* XmlResolver.cs: Small fixes wrt new unit tests. Add SupportsType
method for NET_2_1 profile.
In .:
2009-04-28 Sebastien Pouliot <sebastien@ximian.com>
* System.Xml_test.dll.sources: Add System.Xml/XmlResolverTest.cs to
the unit tests
svn path=/trunk/mcs/; revision=132851
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r-- | mcs/class/System.XML/System.Xml/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlResolver.cs | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 6b84aaa8bbe..f39534dcd49 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,8 @@ +2009-04-28 Sebastien Pouliot <sebastien@ximian.com> + + * XmlResolver.cs: Small fixes wrt new unit tests. Add SupportsType + method for NET_2_1 profile. + 2009-04-22 Atsushi Enomoto <atsushi@ximian.com> * XmlQualifiedName.cs : added Parse() overload that is used for diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs index 3c8d04f135e..feeb1827af4 100644 --- a/mcs/class/System.XML/System.Xml/XmlResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlResolver.cs @@ -6,7 +6,7 @@ // Atsushi Enomoto (atsushi@ximian.com) // // (C) 2001 Jason Diamond http://injektilo.org/ -// (C) 2004 Novell Inc. +// Copyright (C) 2004,2009 Novell, Inc (http://www.novell.com) // // @@ -53,15 +53,16 @@ namespace System.Xml if (baseUri == null) { if (relativeUri == null) throw new ArgumentNullException ("Either baseUri or relativeUri are required."); +#if NET_2_1 + return new Uri (relativeUri, UriKind.RelativeOrAbsolute); +#else // Don't ignore such case that relativeUri is in fact absolute uri (e.g. ResolveUri (null, "http://foo.com")). if (relativeUri.StartsWith ("http:") || relativeUri.StartsWith ("https:") || + relativeUri.StartsWith ("ftp:") || relativeUri.StartsWith ("file:")) return new Uri (relativeUri); else -#if NET_2_1 - return new Uri (relativeUri, UriKind.RelativeOrAbsolute); -#else return new Uri (Path.GetFullPath (relativeUri)); #endif } @@ -81,5 +82,13 @@ namespace System.Xml .Replace ("%", "%25") .Replace ("\"", "%22"); } +#if NET_2_1 + public virtual bool SupportsType (Uri absoluteUri, Type type) + { + if (absoluteUri == null) + throw new ArgumentNullException ("absoluteUri"); + return ((type == null) || (type == typeof (Stream))); + } +#endif } } |