Alex Rivera | Logout

Can I make XmlSerializer ignore the namespace on deserialization?

Asked 2009-05-15T18:57:25.710
58

Can I make XmlSerializer ignore the namespace (xmlns attribute) on deserialization so that it doesn't matter if the attribute is added or not or even if the attribute is bogus? I know that the source will always be trusted so I don't care about the xmlns attribute.

Edit
Report

1 Answer

-7

Why try to make the XmlSerializer forget how XML works? It's a fact of XML that two elements with the same name but different namespaces are different elements.

If you want to process XML that has no namespaces, then you should pre-process it to remove the namespaces, and then pass it to the serializer.

answered 2009-05-15T18:59:21.197

Your Answer