Logo

Programming-Idioms

History of Idiom 103 > diff from v5 to v6

Edit summary for version 6 by Bzzzzzzz:
[D] imports

Version 5

2017-07-29, 11:03:11

Version 6

2017-07-29, 11:04:00

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;
Imports
import orange.serialization._;
import orange.serialization.archives._;
import std.file;
Code
XmlArchive archive = new XmlArchive!(char);
archive.doc.parse(read("data.xml"));
Serializer ser = new Serializer(archive);
ser.deserialize(x);
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;
Comments bubble
using the Orange serializer;