I\'ve got test xml file that looks like this:
...
When I\'m t
Check out XmlSerializerNamespaces.
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("xsd", "http://www.w3.org/2001/XMLSchema");
ns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance");
Controlling the default namespace can be done directly on the XmlSerializer:
XmlSerializer xs = new XmlSerializer(typeof(Person), "http://tempuri.org/PaymentInformationXml.xsd");
... but your question is a little unclear about where the problem comes from.
Check your Person
classes [XmlType]
attribute:
[XmlType(Namespace="http://tempuri.org/PaymentInformationXml.xsd")]
public class Person
{
//...
}
The namespace for your Person
type needs to be consistent with the one you use when serializing.