Hi, I've got an XSD schema which I've generated a class for using xsd.exe, and I'm trying to use XmlSerializer.Deserialize
to create an instance of that class from an XML file that is supposed to conform to the XSD schema. Unfortunately the XML file has some extra elements that the schema is not expecting, which causes a System.InvalidOperationException
to be thrown from Deserialize
.
I've tried adding <xs:any>
elements to my schema but this doesn't seem to make any difference.
My question is: is there any way to get XmlSerializer.Deserialize
to ignore these extra elements?