Qualified XML Root, InvalidOperationException while deserializing
XML / XSL
1
Posts
1
Posters
0
Views
1
Watching
-
Class declaration:
[XmlRoot(Namespace="http://www.example.com/Person")]
class Person
{
[XmlElement(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
Public string Name;
}Serialized XML using XMLSerializer and XMLSerializerNamespace
<ns0:person xmlns:ns0="http://www.example.com/Person">
<name>Bill</name>
</ns0:person>
</pre>I am having trouble deserializing above XML and create an instance of Person class with Name property. Also I did not find a way to pass "ns0" namespace prefix to deserialization. Any help or direction will greatly be appreciated in any .NET compliant language.