There is any way in Dart to parse XML and obtain an object?
For example if I have this XML:
<person>
<name>John</name>
<surname>Smith</surname>
</person>
I want to bind it to this object:
class Person {
String name;
String surname;
...
}
With a snippet like this:
Person person = parse(xml);
Not out of the box.
Here is currently an extensive discussion going on about serialization/deserialization: https://groups.google.com/a/dartlang.org/forum/#!topic/misc/0pv-Uaq8FGI
The discussion is mostly about JSON but most of it applies to XML as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With