Solved

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

Posted on 2008-10-09
4
2,048 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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