Formatting XML File into a form using LINQ c# Visual Studio 2013 -


need here. trying input xml form in visual studio , have display xml formatting in tact. have gotten display 1 long line need formatting there. using label in form show text, not sure if best way or not way work

this in form1.cs

string formatxml(string xml) {   xdocument.load("employee roster.xml");   xdocument doc = xdocument.parse(xml);   return(this.label1.text = doc.tostring()); } 

i have tried

string formatxml(string xml) {  xdocument.load("employee roster.xml");   try  {    xdocument doc = xdocument.parse(xml);    return(this.label1.text = doc.tostring());  }  catch  {    return xml  } 

i know there other threads on dont seem specify how define file asking form read(i.e. load method)


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -