Soldato
- Joined
- 20 Oct 2008
- Posts
- 12,082
Just on the off chance...
I'm creating an xml file in C# using XDocument.
I've got one XElement where there's some text that needs splitting over two lines so the application I'm sending the file to will handle it as I'd like.
I want to end up with something like:
If I try to insert the
directly I end up with:
I can understand why it's escaping the ampersands, but can't see an obvious way to avoid it.
If I just use \r\n or Environment.NewLine they get passed through unmolested. I want them encoding, and at the moment I can't see how.
Does anyone have any thoughts while I sleep on it?
Thanks
I'm creating an xml file in C# using XDocument.
I've got one XElement where there's some text that needs splitting over two lines so the application I'm sending the file to will handle it as I'd like.
I want to end up with something like:
Code:
<Details>Line 1
Line 2</Details>
If I try to insert the
directly I end up with:
Code:
<Details>Line 1 &#xD;&#xA;"Line 2</Details>
I can understand why it's escaping the ampersands, but can't see an obvious way to avoid it.
If I just use \r\n or Environment.NewLine they get passed through unmolested. I want them encoding, and at the moment I can't see how.
Does anyone have any thoughts while I sleep on it?
Thanks