From 3e0bd7c6918fa9d715e4b32a62bc79386d2b04cc Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Sun, 24 Feb 2002 18:50:34 +0000 Subject: [PATCH] 2002-02-24 Duncan Mak * XmlTokenizedType.cs: Added to CVS. * XmlUrlResolver.cs: Added to CVS with one TODO task. 2002-02-23 Duncan Mak * XmlQualifiedName.cs: Fixed ToString () and added the operators (== and !=). svn path=/trunk/mcs/; revision=2616 --- mcs/class/System.XML/System.Xml/ChangeLog | 11 +++++ .../System.XML/System.Xml/XmlQualifiedName.cs | 24 ++++++++++- .../System.XML/System.Xml/XmlResolver.cs | 5 ++- .../System.XML/System.Xml/XmlTokenizedType.cs | 27 ++++++++++++ .../System.XML/System.Xml/XmlUrlResolver.cs | 41 +++++++++++++++++++ 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100755 mcs/class/System.XML/System.Xml/XmlTokenizedType.cs create mode 100755 mcs/class/System.XML/System.Xml/XmlUrlResolver.cs diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 78341f4ed45..0a7bfa49606 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,14 @@ +2002-02-24 Duncan Mak + + * XmlTokenizedType.cs: Added to CVS. + + * XmlUrlResolver.cs: Added to CVS with one TODO task. + +2002-02-23 Duncan Mak + + * XmlQualifiedName.cs: Fixed ToString () and added the operators + (== and !=). + 2002-02-23 Jason Diamond * XmlTextReader.cs: Added support for qualified attributes. diff --git a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs b/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs index 2d946465fcc..0af8bbfcc6a 100644 --- a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs +++ b/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs @@ -71,15 +71,35 @@ namespace System.Xml public override string ToString () { - return ns + ":" + name; + if (ns == null) + return name; + else + return ns + ":" + name; } public static string ToString (string name, string ns) { if (ns == null) return name; + else + return ns + ":" + name; + } + + // Operators + public static bool operator == (XmlQualifiedName a, XmlQualifiedName b) + { + if ((a.Name == b.Name) && (a.Namespace == b.Namespace)) + return true; else - return ns + ":" + name; + return false; + } + + public static bool operator != (XmlQualifiedName a, XmlQualifiedName b) + { + if (!(a == b)) + return false; + else + return true; } } } diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs index 9b3c541bacf..665dff630e6 100644 --- a/mcs/class/System.XML/System.Xml/XmlResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlResolver.cs @@ -15,7 +15,10 @@ namespace System.Xml { public abstract class XmlResolver { - public abstract ICredentials Credentials { set; } + public abstract ICredentials Credentials + { + set; + } public abstract object GetEntity( Uri absoluteUri, diff --git a/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs b/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs new file mode 100755 index 00000000000..13762770ce6 --- /dev/null +++ b/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs @@ -0,0 +1,27 @@ +// +// System.Xml.XmlTokenizedType.cs +// +// Author: Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +namespace System.Xml +{ + [Serializable] public enum XmlTokenizedType + { + CDATA = 0, + ID = 1, + IDREF = 2, + IDREFS = 3, + ENTITY = 4, + ENTITIES = 5, + NMTOKEN = 6, + NMTOKENS = 7, + NOTATION = 8, + ENUMERATION = 9, + QName = 10, + NCName = 11, + None = 12, + } +} diff --git a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs new file mode 100755 index 00000000000..54750bb6f60 --- /dev/null +++ b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs @@ -0,0 +1,41 @@ +// System.Xml.XmlUrlResolver.cs +// +// Author: Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System.Net; + +namespace System.Xml +{ + public class XmlUrlResolver : XmlResolver + { + // Field + ICredentials credential; + + // Constructor + public XmlUrlResolver () + : base () + { + } + + // Properties + public override ICredentials Credentials + { + set { credential = value; } + } + + // Methods + [MonoTODO] + public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn) + { + return null; + } + + public override Uri ResolveUri (Uri baseUri, string relativeUri) + { + return new Uri (baseUri, relativeUri); + } + } +} -- 2.25.1