XML new lined inner text

DLSteven

New Member
I'm working with XMLs and I have this problem: I want to add an inner text on a single line separated by opening and closing element tags. Something like this:\[code\]<root> <child name="name"> Hi! I'm inner text! </child></root>\[/code\]but if I add the inner text with:\[code\]child.InnerText = "Hi! I'm inner text!";\[/code\]I have all on the same line:\[code\]<root> <child name="name">Hi! I'm inner text!</child></root>\[/code\]I tried to add:\[code\]xDoc.PreserveWhitespace = true;\[/code\]before Save function with no result. Tried with:\[code\]child.AppendChild(xDoc.CreateWhitespace("\n"));\[/code\]after or before the InnerText instruction. Nothing. Some help?EDIT: This is how I save the XML:\[code\]xDoc.Save(filename);\[/code\]
 
Back
Top