Skip to main content

Definition

Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: System.Enum

Syntax

Summary

Defines how XmlSerializer reads an element into a value declared as Object.

Usage

XmlUnknownTypeHandling is the type of XmlSerializerOptions.UnknownTypeHandling. It says what an element is read as when the declared type is object, where the XML can’t say which type wrote it. It is the counterpart of JsonUnknownTypeHandling.
The option applies to a member, an item of a collection, a value of a dictionary, and the document root. An element marked xsi:nil="true" is read as null under both values. Writing isn’t affected.

Remarks

A document does not record the type a value had when it was written, so a value declared as Object is read as XML. This is the counterpart of System.Text.Json.Serialization.JsonUnknownTypeHandling, whose values are JsonElement and JsonNode.

Values

  • System.IComparable
  • System.ISpanFormattable
  • System.IFormattable
  • System.IConvertible