Author: atsushi
Date: 2007-05-25 14:06:13 -0400 (Fri, 25 May 2007)
New Revision: 77960

Modified:
   trunk/mcs/class/System.XML/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/System.Xml/XQueryConvert.cs
Log:
2007-05-25  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * XQueryConvert.cs : removed unused methods. They will prevent
          System.Xml.Core.dll implementation.



Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog     2007-05-25 17:27:14 UTC 
(rev 77959)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog     2007-05-25 18:06:13 UTC 
(rev 77960)
@@ -1,3 +1,8 @@
+2007-05-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * XQueryConvert.cs : removed unused methods. They will prevent
+         System.Xml.Core.dll implementation.
+
 2007-05-15  Konstantin Triger <[EMAIL PROTECTED]>
 
        * XmlWriter.cs, XmlTextWriter2.cs: ensure the file

Modified: trunk/mcs/class/System.XML/System.Xml/XQueryConvert.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XQueryConvert.cs      2007-05-25 
17:27:14 UTC (rev 77959)
+++ trunk/mcs/class/System.XML/System.Xml/XQueryConvert.cs      2007-05-25 
18:06:13 UTC (rev 77960)
@@ -35,41 +35,16 @@
 using System.Text;
 using System.Xml;
 using System.Xml.Schema;
-using System.Xml.XPath;
 
 namespace System.Xml
 {
+       // basically this class is obsoleted and removed from .NET 2.0.
        internal class XQueryConvert
        {
                private XQueryConvert ()
                {
                }
 
-               public static bool ShouldCheckValueFacets (XmlSchemaType 
schemaTypeDest)
-               {
-                       XmlSchemaObjectCollection facets = null;
-                       XmlSchemaSimpleType st = schemaTypeDest as 
XmlSchemaSimpleType;
-                       if (st != null) {
-                               XmlSchemaSimpleTypeRestriction r = st.Content
-                                       as XmlSchemaSimpleTypeRestriction;
-                               if (r != null)
-                                       facets = r.Facets;
-                       }
-                       else {
-                               XmlSchemaComplexType ct =
-                                       schemaTypeDest as XmlSchemaComplexType;
-                               XmlSchemaSimpleContent sc = ct.ContentModel
-                                       as XmlSchemaSimpleContent;
-                               if (sc != null) {
-                                       XmlSchemaSimpleContentRestriction r =
-                                               sc.Content as 
XmlSchemaSimpleContentRestriction;
-                                       if (r != null)
-                                               facets = r.Facets;
-                               }
-                       }
-                       return facets != null && facets.Count > 0;
-               }
-
                public static XmlTypeCode GetFallbackType (XmlTypeCode type)
                {
                        switch (type) {
@@ -116,163 +91,6 @@
                        }
                }
 
-               [MonoTODO]
-               // See XQuery & XPath 2.0 functions & operators section 17.
-               public static bool CanConvert (XPathItem item, XmlSchemaType 
schemaTypeDest)
-               {
-                       if (item == null)
-                               throw new ArgumentNullException ("item");
-                       if (schemaTypeDest == null)
-                               throw new ArgumentNullException 
("schemaTypeDest");
-                       XmlTypeCode src = item.XmlType.TypeCode;
-                       XmlTypeCode dst = schemaTypeDest.TypeCode;
-
-                       // Notation cannot be converted from other than Notation
-                       if (src == XmlTypeCode.Notation && dst != 
XmlTypeCode.Notation)
-                               return false;
-
-                       // untypedAtomic and string are convertable unless 
source type is QName.
-                       switch (dst) {
-                       case XmlTypeCode.UntypedAtomic:
-                       case XmlTypeCode.String:
-                               return src != XmlTypeCode.QName;
-                       }
-
-                       switch (src) {
-                       case XmlTypeCode.None:
-                       case XmlTypeCode.Item:
-                       case XmlTypeCode.Node:
-                       case XmlTypeCode.Document:
-                       case XmlTypeCode.Element:
-                       case XmlTypeCode.Attribute:
-                       case XmlTypeCode.Namespace:
-                       case XmlTypeCode.ProcessingInstruction:
-                       case XmlTypeCode.Comment:
-                       case XmlTypeCode.Text:
-                               throw new NotImplementedException (); // FIXME: 
check what happens
-
-                       case XmlTypeCode.AnyAtomicType:
-                               throw new NotImplementedException (); // FIXME: 
check what happens
-                       case XmlTypeCode.UntypedAtomic:
-                       case XmlTypeCode.String:
-                               // 'M'
-                               throw new NotImplementedException (); // FIXME: 
check what happens
-
-                       case XmlTypeCode.Boolean:
-                       case XmlTypeCode.Decimal:
-                               switch (dst) {
-                               case XmlTypeCode.Float:
-                               case XmlTypeCode.Double:
-                               case XmlTypeCode.Decimal:
-                               case XmlTypeCode.Boolean:
-                                       return true;
-                               }
-                               return false;
-
-                       case XmlTypeCode.Float:
-                       case XmlTypeCode.Double:
-                               if (dst == XmlTypeCode.Decimal)
-                                       // 'M'
-                                       throw new NotImplementedException (); 
// FIXME: check what happens
-                               goto case XmlTypeCode.Decimal;
-
-                       case XmlTypeCode.Duration:
-                               switch (dst) {
-                               case XmlTypeCode.Duration:
-                               case XmlTypeCode.YearMonthDuration:
-                               case XmlTypeCode.DayTimeDuration:
-                                       return true;
-                               }
-                               return false;
-
-                       case XmlTypeCode.DateTime:
-                               switch (dst) {
-                               case XmlTypeCode.DateTime:
-                               case XmlTypeCode.Time:
-                               case XmlTypeCode.Date:
-                               case XmlTypeCode.GYearMonth:
-                               case XmlTypeCode.GYear:
-                               case XmlTypeCode.GMonthDay:
-                               case XmlTypeCode.GDay:
-                               case XmlTypeCode.GMonth:
-                                       return true;
-                               }
-                               return false;
-
-                       case XmlTypeCode.Time:
-                               switch (dst) {
-                               case XmlTypeCode.Time:
-                               case XmlTypeCode.Date:
-                                       return true;
-                               }
-                               return false;
-
-                       case XmlTypeCode.Date:
-                               if (dst == XmlTypeCode.Time)
-                                       return false;
-                               goto case XmlTypeCode.DateTime;
-
-                       case XmlTypeCode.GYearMonth:
-                       case XmlTypeCode.GYear:
-                       case XmlTypeCode.GMonthDay:
-                       case XmlTypeCode.GDay:
-                       case XmlTypeCode.GMonth:
-                               return src == dst;
-
-                       case XmlTypeCode.HexBinary:
-                       case XmlTypeCode.Base64Binary:
-                               if (src == dst)
-                                       return true;
-                               switch (dst) {
-                               case XmlTypeCode.HexBinary:
-                               case XmlTypeCode.Base64Binary:
-                                       return true;
-                               }
-                               return false;
-
-                       case XmlTypeCode.AnyUri:
-                       case XmlTypeCode.QName:
-                       case XmlTypeCode.Notation:
-                               return src == dst;
-
-                       case XmlTypeCode.NormalizedString:
-                       case XmlTypeCode.Token:
-                       case XmlTypeCode.Language:
-                       case XmlTypeCode.NmToken:
-                       case XmlTypeCode.Name:
-                       case XmlTypeCode.NCName:
-                       case XmlTypeCode.Id:
-                       case XmlTypeCode.Idref:
-                       case XmlTypeCode.Entity:
-                       case XmlTypeCode.Integer:
-                       case XmlTypeCode.NonPositiveInteger:
-                       case XmlTypeCode.NegativeInteger:
-                       case XmlTypeCode.Long:
-                       case XmlTypeCode.Int:
-                       case XmlTypeCode.Short:
-                       case XmlTypeCode.Byte:
-                       case XmlTypeCode.NonNegativeInteger:
-                       case XmlTypeCode.UnsignedLong:
-                       case XmlTypeCode.UnsignedInt:
-                       case XmlTypeCode.UnsignedShort:
-                       case XmlTypeCode.UnsignedByte:
-                       case XmlTypeCode.PositiveInteger:
-                               throw new NotImplementedException ();
-
-                       // xdt:*
-                       case XmlTypeCode.YearMonthDuration:
-                               if (dst == XmlTypeCode.DayTimeDuration)
-                                       return false;
-                               goto case XmlTypeCode.Duration;
-                       case XmlTypeCode.DayTimeDuration:
-                               if (dst == XmlTypeCode.YearMonthDuration)
-                                       return false;
-                               goto case XmlTypeCode.Duration;
-                       }
-
-                       throw new NotImplementedException ();
-               }
-
                // Individual conversion
 
                public static string AnyUriToString (string value)
@@ -801,156 +619,6 @@
                {
                        return XmlConvert.ToTimeSpan (value);
                }
-
-               public static string ItemToAnyUri (XPathItem value)
-               {
-                       return value.Value;
-               }
-
-               public static byte [] ItemToBase64Binary (XPathItem value)
-               {
-                       return Convert.FromBase64String (value.Value);
-               }
-
-               public static bool ItemToBoolean (XPathItem value)
-               {
-                       return XmlConvert.ToBoolean (value.Value);
-               }
-
-               public static DateTime ItemToDate (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static DateTime ItemToDateTime (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static TimeSpan ItemToDayTimeDuration (XPathItem value)
-               {
-                       return XmlConvert.ToTimeSpan (value.Value);
-               }
-
-               public static decimal ItemToDecimal (XPathItem value)
-               {
-                       return XmlConvert.ToDecimal (value.Value);
-               }
-
-               public static double ItemToDouble (XPathItem value)
-               {
-                       return XmlConvert.ToDouble (value.Value);
-               }
-
-               public static string ItemToDuration (XPathItem value)
-               {
-                       return XmlConvert.ToString (XmlConvert.ToTimeSpan 
(value.Value));
-               }
-
-               public static float ItemToFloat (XPathItem value)
-               {
-                       return XmlConvert.ToSingle (value.Value);
-               }
-
-               public static DateTime ItemToGDay (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static DateTime ItemToGMonth (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static DateTime ItemToGMonthDay (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static DateTime ItemToGYear (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static DateTime ItemToGYearMonth (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               public static byte [] ItemToHexBinary (XPathItem value)
-               {
-                       return XmlConvert.FromBinHexString (value.Value);
-               }
-
-               public static int ItemToInt (XPathItem value)
-               {
-                       return XmlConvert.ToInt32 (value.Value);
-               }
-
-               public static long ItemToInteger (XPathItem value)
-               {
-                       return XmlConvert.ToInt64 (value.Value);
-               }
-
-               public static XPathItem ItemToItem (XPathItem value, 
XmlSchemaType schemaTypeDest)
-               {
-                       return new XmlAtomicValue (value.Value, schemaTypeDest);
-               }
-
-               public static decimal ItemToNonNegativeInteger (XPathItem value)
-               {
-                       return XmlConvert.ToDecimal (value.Value);
-               }
-
-               public static decimal ItemToNonPositiveInteger (XPathItem value)
-               {
-                       return XmlConvert.ToDecimal (value.Value);
-               }
-
-               public static XmlQualifiedName ItemToQName (XPathItem value)
-               {
-                       return (XmlQualifiedName) value.TypedValue;
-               }
-
-               public static string ItemToString (XPathItem value)
-               {
-                       if (value.ValueType == typeof (DateTime))
-                               return XmlConvert.ToString ((DateTime) 
value.TypedValue);
-                       if (value.TypedValue is XmlQualifiedName)
-                               throw new ArgumentException ("Invalid cast from 
schema QName type to string type.");
-                       return value.Value;
-               }
-
-               public static DateTime ItemToTime (XPathItem value)
-               {
-                       return XmlConvert.ToDateTime (value.Value);
-               }
-
-               [MonoTODO]
-               public static long ItemToUnsignedInt (XPathItem value)
-               {
-                       // FIXME: signed
-                       return XmlConvert.ToInt32 (value.Value);
-               }
-
-               [MonoTODO]
-               public static decimal ItemToUnsignedLong (XPathItem value)
-               {
-                       // FIXME: signed
-                       return XmlConvert.ToInt32 (value.Value);
-               }
-
-               [MonoTODO]
-               public static int ItemToUnsignedShort (XPathItem value)
-               {
-                       // FIXME: signed
-                       return XmlConvert.ToInt32 (value.Value);
-               }
-
-               public static TimeSpan ItemToYearMonthDuration (XPathItem value)
-               {
-                       return XmlConvert.ToTimeSpan (value.Value);
-               }
        }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to