473,403 Members | 2,293 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,403 software developers and data experts.

Q: formatting XmlWriter output ?

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 "/>" into a new line. MS vcproj file seems to be in below format, so it should be possible ?
<element1
Attr1=""
>
<element2>
Attr2=""
/>
</element1>

thanks !
Aug 29 '08 #1
1 1817
Mikey_L wrote:
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 "/>" into a new line. MS
vcproj file seems to be in below format, so it should be possible ?
<element1
Attr1=""
>
<element2>
Attr2=""
/>
</element1>
The NewLineOnAttributes setting
http://msdn.microsoft.com/en-us/libr...ttributes.aspx
should help to put each attribute on a new line but I don't think that
helps to put '>' and '/>' on a new line too. To achieve that you would
need your own custom XmlWriter implementation.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 29 '08 #2

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

Similar topics

5
by: cnu | last post by:
Hi, I have to make a formatted (indented) xml file like this : <?xml version="1.0"?> <Message> <Parent index="0" length="6">123 <Child1 index="0,1" length="6">abcd</Child1> <Child2...
2
by: Miki Szinegh | last post by:
Hello All, I have an asp.net search application that brings up a datagrid of results, with one of the fields being a hyperlink to an XML document, of which there are thousands. By clicking this...
7
by: Steven Reddie | last post by:
My problem starts with wanting " " to actually appear that way in the output rather than an actual encoded 0xA0 byte in the output stream. I thought a way to solve this would be to select...
1
by: McGiv | last post by:
Hi, I'm trying to serialise some objects and I've can't get the built in serialisation to output exactly what I want. For the moment I'm implementing the IXmlSerializable interface and doing it...
2
by: Ken Wilson | last post by:
I am writing and .xml file and am not getting the formatting I would like. The portion of the code that is giving me problems is as follows; XmlTextWriter tw = new XmlTextWriter(filename); ...
1
by: Thomas S | last post by:
I want to serialize an object via XmlWriter, but when I serialize to that, 3 strange bytes are added to the beginning of the output (0xEF, 0xBB, and 0xBF) all of which are in the ASCII range (ASCII...
2
by: Simon Harvey | last post by:
Hi all, I'm having a real problem with getting an XMLWriter as a result of an xsl tranform I'm attempting. My code is: private void btnPerformTransform_Click(object sender, EventArgs e) {...
13
by: clintonG | last post by:
// I want this format... <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"> The WriteStartElement is used for the rss element and...
1
by: JAM | last post by:
I'm trying to code some directory structure as my output / input file using XML. I would like to see formatiing with indentations. mimicking directory tree structure. Unfortunately the code such as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.