Solved

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

Posted on 2008-10-09
4
2,049 Views
Last Modified: 2013-12-17
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
Comment
Question by:alexmac05
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
technofile earned 500 total points
ID: 22682496
Why is it a requirment that you have a blank line? That is the type of stuff that XML was designed to prevent.
0
 

Author Comment

by:alexmac05
ID: 22682601
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
 

Author Comment

by:alexmac05
ID: 22682615
This worked:

myXmlTextWriter.WriteRaw("\n");

0
 

Author Closing Comment

by:alexmac05
ID: 31504773
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jquery tab header text 1 28
transition to visual .net from vb6 5 62
Visual Studio npm 1 29
Adjust the codes 3 33
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question