There is a method wich takes the *.xml template made with Excel formatting and insert some text into it.
When I'm inserting text with \r\n symbols, Excel ignores the brakes and write all in one line. It tur开发者_运维百科ns out, that Excel needs the "
"
in xml instead of "\r\n"
. So i'm trying to replace
NewText = NewText.Replace("\r\n", " ").Replace("\n", " ");
node["Data"].InnerText = NewText;
But then I see, that all the "
"
are implicitly changed with "& ;#10;" by XmlDocument.
What should I do to save xml with "
"
in it?
Use CDATA
http://www.w3schools.com/xml/xml_cdata.asp
精彩评论