none
How to compare XMLQualifiedName and system.Type? RRS feed

  • Question

  • Hi,

    I want to compare XMLQualifiedName with system.Type
    I got dataType from other system that type is XMLQualifiedName
    ex, http://www.w3.org/2001/XMLSchema:string
    That should be String type.
     
    I don't know all data type from other system. So, I wanna compare it at runtime.
    Do you know the way?
    Wednesday, March 4, 2009 7:23 AM

Answers

  • I think you'll need to implement it yourself.

    For example:

            public static Type GetXmlType(XmlQualifiedName qname)  
            {  
                if (qname.Namespace == "http://www.w3.org/2001/XMLSchema")  
                {  
                    switch (qname.Name)  
                    {  
                        case "string":  
                            return typeof(string);  
                        case "int":  
                            return typeof(int);  
                        case "dateTime":  
                            return typeof(DateTime);  
                    }  
                }  
     
                return null;  
            } 
    • Marked as answer by hera96 Tuesday, March 10, 2009 6:24 AM
    Wednesday, March 4, 2009 11:38 PM