views:

472

answers:

1

XmlAttributeOverrides is a good way to override some attributes for serialization. MSDN says: You can control and augment the serialization of objects found in a DLL, even if you do not have access to the source

And I have a question is it possible to implement some custom algorithm with XmlAttributeOverrides? For example if you want to change some element's value on 'the fly' during serialization.

Of course it's possible to use IXmlSerializable, but I'm just wondering if there is any way to do that without it.

A: 

If you mean as per your other xml questions (mainly this), then the answer is "no", you can't do this (per-level attribute names, etc) with XmlAttributeOverrides. The format is fixed per-type at the time you create the XmlSerializer instance.

Marc Gravell
I didn't get here. So, the easiest way to do some custom processing during serialization is derive from IXmlSerializable?
Ike
No - that is the **hardest** way ;-p But it sounds like it may be your last remaining option.
Marc Gravell