Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2060
  • Last Modified:

How do i write a newline to my xml output file?

In my xml output file it is a requirement that there be a new line between my encoding element and my first element. How do I insert this using C#.NET VS2008?

<?xml version="1.0" encoding="UTF-8"?>

<MessageTemplateRoot>
... the rest of the xml file
</MessageTemplateRoot>
0
alexmac05
Asked:
alexmac05
  • 3
1 Solution
 
technofileCommented:
Why is it a requirment that you have a blank line? That is the type of stuff that XML was designed to prevent.
0
 
alexmac05Author Commented:
i know. but what can I do?

I just pushed back to the client asking why they want these things.

I'll see what they say.
0
 
alexmac05Author Commented:
This worked:

myXmlTextWriter.WriteRaw("\n");

0
 
alexmac05Author Commented:
The answer given helped me to push back to the client and know that I was correct in thinking that these sorts of requests for xml files is not correct. I did ths.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now