Logo

Programming-Idioms

History of Idiom 103 > diff from v4 to v5

Edit summary for version 5 by Bzzzzzzz:
New D implementation by user [Bzzzzzzz]

Version 4

2016-02-18, 16:58:02

Version 5

2017-07-29, 11:03:11

Idiom #103 Load XML file into struct

Read from file data.xml and write its content into object x.
Assume the XML data is suitable for the type of x.

Idiom #103 Load XML file into struct

Read from file data.xml and write its content into object x.
Assume the XML data is suitable for the type of x.

Imports
import std.file;
Code
XmlArchive archive = new XmlArchive!(char);
archive.doc.parse(read("data.xml"));
Serializer ser = new Serializer(archive);
ser.deserialize(x);
Comments bubble
using the Orange serializer;