Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now