Definition
Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: System.EnumSyntax
Summary
Specifies how XmlSerializer handles the named floating-point literalsINF, -INF, and NaN
when serializing and deserializing.
Usage
XmlNumberHandling says whether the XML Schema names for the floating-point values that aren’t numbers are allowed: INF, -INF, and NaN. Set it through XmlSerializerOptions.NumberHandling. It applies to float and double values.
Use
Strict when the consumer of the XML treats the element as a plain decimal number and would fail on a name.
Considerations
- The default is the reverse of System.Text.Json, where named floating-point literals must be turned on.
INF,-INF, andNaNare part of the XML Schema definition offloatanddouble, so XML consumers that follow XML Schema accept them. - The setting doesn’t affect integers or
decimal, which have no such values. - Unlike
JsonNumberHandling, there are no values for reading numbers from quoted strings. Every XML value is text already.
Values
Related APIs
- CloudNimble.Text.Xml.XmlSerializerOptions
- CloudNimble.Text.Xml.XmlException