I have a little code:
string attributeValue = "Hello" + Environment.NewLine + " Hello 2"; XElement element = new XElement("test"); XElement subElement = new XElement("subTest"); XAttribute attribute = new XAttribute("key", "Hello"); XAttribute attribute2 = new XAttribute("key2", attributeValue); subElement.Add(attribute); subElement.Add(attribute2); element.Add(subElement); Console.Write(element.ToString()); Console.ReadLine();
I have a problem, basically, / r / n or a new line is converted to 
 in the attribute, but I donβt want to have it, I want to save it / r / n, as when using this XML with the Microsoft Word document template, new lines are not implemented, although this is multi-line text, I get spaces in the text document. But no new lines: /
Does anyone have any idea?
Although I set the property allow multi line int he in the field in the template.
c # xml ms-word
Alnedru
source share