System.Xml.Serialization.XmlSerializer.UnknownElement Event

Occurs when the System.Xml.Serialization.XmlSerializer encounters an XML element of unknown type during deserialization.

Syntax

public event XmlElementEventHandler UnknownElement

Remarks

By default, after calling the XmlSerializer.Deserialize(System.IO.Stream) method, the System.Xml.Serialization.XmlSerializer ignores XML attributes of unknown types. However, you can use this event to handle such node types.

Note:

If the System.Xml.Serialization.XmlAnyElementAttribute is applied to a field that returns an array of System.Xml.XmlElement objects, all unknown elements are collected in the array. In that case, the XmlSerializer.UnknownElement event does not occur.

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