Now I am using:
XElement xe = XElement.ReadFrom
which requires an XmlReader :
XmlReader reader = XmlTextReader.Create
which requires a string, and this requires passing a StringReader :
new StringReader
which requires TextReader/StreamReader to finally transfer the file path:
TextReader textReader = new StreamReader ( file );
The easiest way to do this? I already have code that uses XElement , so it works fine, but I want to reduce the number of steps to get XElement from xml file. Something like:
XElement xe = XElement.ReadFrom (string file);
Any ideas?
Joan venge
source share