views:

14

answers:

1

I process xml which contains tabs ("\t") and line breaks ("\n") in its attributes values. When I parse it using XDocument.Parse(), the tabs and line breaks are converted to spaces, even with the LoadOptions.PreserveWhitespace parameter.

How can I get a XDocument with original attributes values?

A: 

I did not find a real solution, so I ended up with a quick & dirty :

xml = xml.Replace("\t", "	").Replace("\r", "
");

better than nothing...

fonzo