From: Miguel de Icaza Date: Fri, 7 Dec 2012 21:57:58 +0000 (-0800) Subject: Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=8bb9b4409d3f73fdf5ec2afc3b9add6bd33f712f;hp=-c;p=mono.git Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes Fix for issue 2907: XML "choice" not correctly processed during deserialization --- 8bb9b4409d3f73fdf5ec2afc3b9add6bd33f712f diff --combined mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs index 859042fd7e3,c23c5dd16c8..2b0f8bd829d --- a/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs @@@ -107,15 -107,10 +107,15 @@@ namespace System.Xml.Serializatio internal string XmlTypeNamespace { - get { return xmlTypeNamespace; } + get { return xmlTypeNamespace ?? string.Empty; } set { xmlTypeNamespace = value; } } + internal bool HasXmlTypeNamespace + { + get { return xmlTypeNamespace != null; } + } + internal ArrayList DerivedTypes { get { return _derivedTypes; } @@@ -175,9 -170,9 +175,9 @@@ internal XmlTypeMapping GetRealElementMap (string name, string ens) { - if (xmlType == name && xmlTypeNamespace == ens) return this; + if (xmlType == name && XmlTypeNamespace == ens) return this; foreach (XmlTypeMapping map in _derivedTypes) - if (map.xmlType == name && map.xmlTypeNamespace == ens) return map; + if (map.xmlType == name && map.XmlTypeNamespace == ens) return map; return null; } @@@ -405,6 -400,17 +405,17 @@@ if (_elements == null) return null; return (XmlTypeMapElementInfo)_elements [BuildKey (name,ns, order)]; } + + public XmlTypeMapElementInfo GetElement(string name, string ns) + { + if (_elements == null) return null; + + foreach (XmlTypeMapElementInfo info in _elements.Values) + if (info.ElementName == name && info.Namespace == ns) + return info; + + return null; + } public XmlTypeMapElementInfo GetElement (int index) {