System.Xml.Serialization.XmlAttributeOverrides Class

Allows you to override property, field, and class attributes when you use the System.Xml.Serialization.XmlSerializer to serialize or deserialize an object.

See Also: XmlAttributeOverrides Members

Syntax

public class XmlAttributeOverrides

Remarks

The System.Xml.Serialization.XmlAttributeOverrides enables the System.Xml.Serialization.XmlSerializer to override the default way of serializing a set of objects. Overriding serialization in this way has two uses: first, you can control and augment the serialization of objects found in a DLL--even if you do not have access to the source; second, you can create one set of serializable classes, but serialize the objects in multiple ways. For example, instead of serializing members of a class instance as XML elements, you can serialize them as XML attributes, resulting in a more efficient document to transport.

After you create an System.Xml.Serialization.XmlAttributeOverrides object, you pass it as an argument to the XmlSerializer.#ctor constructor. The resulting System.Xml.Serialization.XmlSerializer uses the data contained by the System.Xml.Serialization.XmlAttributeOverrides to override attributes that control how objects are serialized. To accomplish this, the System.Xml.Serialization.XmlAttributeOverrides contains a collection of the object types that are overridden, as well as an System.Xml.Serialization.XmlAttributes object associated with each overridden object type. The System.Xml.Serialization.XmlAttributes object itself contains an appropriate set of attribute objects that control how each field, property, or class is serialized.

The process for creating and using an System.Xml.Serialization.XmlAttributeOverrides object is as follows:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0