2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.XML / System.Xml / XmlQualifiedName.cs
index bedf001fc44abf98898fe716f44196339b0c7353..22857ff868fcc3e3e59f3bfb0538e90edc881af2 100644 (file)
@@ -33,6 +33,9 @@ using System;
 
 namespace System.Xml
 {
+#if NET_2_0
+       [Serializable]
+#endif
        public class XmlQualifiedName
        {
                // Constructors         
@@ -105,6 +108,17 @@ namespace System.Xml
                                return ns + ":" + name;
                }
 
+               internal static XmlQualifiedName Parse (string name, IXmlNamespaceResolver resolver)
+               {
+                       int index = name.IndexOf (':');
+                       if (index < 0)
+                               return new XmlQualifiedName (name);
+                       string ns = resolver.LookupNamespace (name.Substring (0, index));
+                       if (ns == null)
+                               throw new ArgumentException ("Invalid qualified name.");
+                       return new XmlQualifiedName (name.Substring (index + 1), ns);
+               }
+
                // Operators
                public static bool operator == (XmlQualifiedName a, XmlQualifiedName b)
                {