473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

xmlwriter problem - writes one line only

How do i get the xmlwriter to write with carriage return so when i open
the xml file in notepad it will look like this

<?xml version="1.0" encoding="Windows-1252" standalone="yes"?>
<project id="TestProject" description="projectdescription">
<application id="TestApp" description="Appdescripton" />
</project>

Now it writes everything in one single line
<?xml version="1.0" encoding="Windows-1252" standalone="yes"><Projectid
and so on...

--
go!
Jun 12 '06 #1
2 4070
OleG wrote:
How do i get the xmlwriter to write with carriage return so when i open
the xml file in notepad it will look like this

<?xml version="1.0" encoding="Windows-1252" standalone="yes"?>
<project id="TestProject" description="projectdescription">
<application id="TestApp" description="Appdescripton" />
</project>

Now it writes everything in one single line
<?xml version="1.0" encoding="Windows-1252" standalone="yes"><Projectid
and so on...

http://msdn2.microsoft.com/en-us/lib...gs.indent.aspx
--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Jun 12 '06 #2


OleG wrote:
How do i get the xmlwriter to write with carriage return so when i open
the xml file in notepad it will look like this

<?xml version="1.0" encoding="Windows-1252" standalone="yes"?>
<project id="TestProject" description="projectdescription">
<application id="TestApp" description="Appdescripton" />
</project>


With .NET 2.0 you create an XmlWriter with XmlWriterSettings and the
Indent property set to true, see
<http://msdn2.microsoft.com/en-us/library/system.xml.xmlwritersettings.indent(VS.80).aspx>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Withnall | last post by:
Okay I am using an XMLDocument object to process several thousands of lodgements (from a database) I am trying to output it from an XML Document to a file using the XmlDocument.WriteTo() method...
3
by: Michael Malinak | last post by:
Since XmlWriter offers so many nice options for formatting, I thought it would be nice to read in via XmlReader, and write back out via XmlWriter. It might be overkill, but I'd also like to be able...
1
by: MAF | last post by:
Is there a simple way to get the text, xml, from an xmlwriter. I have a XML writer that writes to a file, and I want another function to return the text that the xml writer is produced. Any...
1
by: MAF | last post by:
Is there a simple way to get the text, xml, from an xmlwriter. I have a XML writer that writes to a file, and I want another function to return the text that the xml writer is produced. Any...
9
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a .net application and am using the xml writer class to create an xml file that opens as an excel file. I am trying to write out the following but am having difficulty. <Row> <Cell...
12
by: sklett | last post by:
**Disclaimer** The element I need to create might not be valid XML, but it's not my fault, I'm following a required format for an integration project. I've got 99% of the XML created nicely...
1
by: depalau | last post by:
I'm experiencing issues where XmlSerialier.Deserialize throws an exception when attempting to use a MemoryStream built with an XmlWriter vs. a standalone StringReader. It is attempting to...
1
by: JB | last post by:
Hi All, I'm writing XML in VB.NET 2005 using the System.Xml.XmlWriter class. It's all working fine but I'd like to remove a few NewLine characters. For instance if I use the following code:...
1
by: Mikey_L | last post by:
hi is it possible to make XmlWriter output with formatting like below ? I have gotten it working mostly (with XmlWriterSetting.Indent=true). However, I can not find a way to make ">" or "/>"...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.