I'm serializing an object using the XmlTextWriter
and I'm doing a ToString
on the created XML structure. I have the following as my settings:
settings.Indent = true;
settings.NewLineOnAttributes = true;
When I open the produced XML in Textpad or Notepad++, I get to see that \r\n is always present. Is this some text rendering issue or is that a character that will always be present? If so I find it unusable! How can I get rid of those \r\n and still have my XML indented and formatted when I do a ToString
?
Here is a sample from the produced XML!
<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<dealProfiles\r\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n <num>76376</num>\r\n <time>sometime</time>\r\n