readXmlValue<T> abstract method

T readXmlValue<T>(
  1. String xml,
  2. Class<T> type
)

Deserializes an XML string into an object of type T.

The XML is parsed into an intermediate XmlNode tree, which is then mapped to a Dart object using reflection and configured converters.

Example

final user = mapper.readXmlValue<User>(
  '<user><id>1</id><name>Alice</name></user>',
  Class<User>()
);

Error Handling

Throws an exception if:

  • The XML is malformed
  • No deserializer found for type T

Implementation

T readXmlValue<T>(String xml, Class<T> type);