Definition
Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: System.EnumSyntax
Summary
Specifies how XmlSerializer handles XML elements and attributes that cannot be mapped to a specific .NET member when deserializing object types.Usage
XmlUnmappedMemberHandling says what the serializer does, when reading, with an element or attribute that no member of the target type maps to. Set it through XmlSerializerOptions.UnmappedMemberHandling. It is the counterpart of JsonUnmappedMemberHandling.
Remarks
When the type has a member marked with XmlExtensionDataAttribute, or a member marked with XmlMixedAttribute for elements, that member captures the unmapped content and neither value applies.Considerations
- The setting is on the options and applies to every type in the object graph. There is no attribute that sets it for one type.
- Namespace declarations,
xsi:nil,xsi:type, and the attributes the serializer itself writes for polymorphism and preserved references are never treated as unmapped. - A member marked
[XmlIgnore]isn’t mapped, so withDisallowan element for it is an error. - When the type has an
[XmlExtensionData]member, unmapped elements and attributes are collected there, andDisallowdoesn’t reject them. - Names are matched with case unless
PropertyNameCaseInsensitiveistrue, so withDisallowan element that differs from a member only by case is an error. XmlSerializerOptions.StrictsetsDisallow.
Values
Related APIs
- CloudNimble.Text.Xml.XmlSerializerOptions
- CloudNimble.Text.Xml.XmlSerializerDefaults
- CloudNimble.Text.Xml.XmlException
- CloudNimble.Text.Xml.Serialization.XmlExtensionDataAttribute
- CloudNimble.Text.Xml.Serialization.XmlIgnoreAttribute
- CloudNimble.Text.Xml.Serialization.XmlRequiredAttribute