Why is XML Deserilzation not throwing exceptions when it should?

If this is something inbuilt like asmx, then there probably isn't much you can do (short of implementing IXmlSerializable which is horrible), but if you have direct control over the XmlReader XmlWriter creation (for example, from a file or network socket) you can get the reader/writer to do the validation for you like so.

If this is something inbuilt like asmx, then there probably isn't much you can do (short of implementing IXmlSerializable, which is horrible), but if you have direct control over the XmlReader / XmlWriter creation (for example, from a file or network socket) you can get the reader/writer to do the validation for you, like so.

Ya that's what I gone with I first read it into an XMLReader to get use of the the schema validation. It seems like it deserializes all the xml still though. I wish it would die right as soon as a invalid part is found.

– chobo2 May 4 '10 at 6:47.

I don't know about elements, but you can definately make an attribute "owner" and make it required, that works. And you can use XmlAttribute on owner property.

Could you show me an example. – chobo2 May 4 '10 at 6:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions