?
Solved

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

Posted on 2008-10-09
4
Medium Priority
?
2,057 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
technofile earned 1500 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

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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)…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

771 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