Logo

Programming-Idioms

History of Idiom 103 > diff from v8 to v9

Edit summary for version 9 by bigwavedave:
New Csharp implementation by user [bigwavedave]

Version 8

2019-09-27, 23:51:17

Version 9

2019-10-07, 22:51:26

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
using System.Xml.Linq;
Code
XDocument xdoc = XDocument.Load("data.xml");
string x = xdoc.Elements().ToList()[0].ToString();