Logo

Programming-Idioms

History of Idiom 103 > diff from v9 to v10

Edit summary for version 10 by bigwavedave:
[Csharp] non-essential code removed

Version 9

2019-10-07, 22:51:26

Version 10

2019-10-07, 22:54:44

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