XmlReader.ReadElementContentAsString() isn't reading line breaks

jwrjis

New Member
I am working on a calculator that lets you save your session as an XML file. This is what my example session looks like:\[code\]<?xml version="1.0" encoding="utf-8" standalone="yes" ?><BreezyCalc Version="3.0"> <Session> <Constants> <Constant Name="myconst1" Value="http://stackoverflow.com/questions/14473496/12.443" /> <Constant Name="someconst" Value="http://stackoverflow.com/questions/14473496/0.12e+2" /> </Constants> <Variables> <Variable Name="myvar" Value="http://stackoverflow.com/questions/14473496/40.32" /> <Variable Name="myothervar" Value="http://stackoverflow.com/questions/14473496/2.5" /> </Variables> <Functions> <Function Linear="true" Name="myfunc1" M="2.8" B="-7" /> <Function Linear="true" Name="otherfunc" M="-1" B="14.32" /> </Functions> <Output>1*2, 3*4, 5*6 -> Ans1 = 2 -> Ans2 = 7 -> Ans3 = 30 </Output> <Results> <Result Value="http://stackoverflow.com/questions/14473496/2" /> <Result Value="http://stackoverflow.com/questions/14473496/7" /> <Result Value="http://stackoverflow.com/questions/14473496/30" /> </Results> </Session></BreezyCalc>\[/code\]In my application, the output is displayed in a textbox like this:\[code\]1*2, 3*4, 5*6 -> Ans1 = 2 -> Ans2 = 7 -> Ans3 = 30\[/code\]But when I load my session with an \[code\]XmlReader\[/code\], and I use \[code\]ReadElementContentAsString()\[/code\] on the \[code\]<Output>\[/code\] element, the output gets displayed in the textbox like this:\[code\]1*2, 3*4, 5*6 -> Ans1 = 2 -> Ans2 = 7 -> Ans3 = 30\[/code\]When I copy that text from my application's textbox and paste it into Notepad, it looks the same, still all on one line. BUT, when I tried pasting it into StackOverflow's question submission textbox, it shows the line breaks correctly. So I am unsure whether this is caused by the \[code\]XmlReader\[/code\], or if it has to do with the textbox. I feel as though it may be the textbox, because like I said when I pasted it here the line breaks were there, but I just can't understand why the textbox won't display the line breaks.Basically, I am asking what's the problem here? How can I read/write multi-line text from/to an XML file and preserve the line breaks?
 
Back
Top