Connecting Tech Pros Worldwide Help | Site Map

Q: formatting XmlWriter output ?

  #1  
Old August 29th, 2008, 09:55 AM
Mikey_L
Guest
 
Posts: n/a
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=""
Quote:
>
<element2>
Attr2=""
/>
</element1>

thanks !


  #2  
Old August 29th, 2008, 12:05 PM
Martin Honnen
Guest
 
Posts: n/a

re: Q: formatting XmlWriter output ?


Mikey_L wrote:
Quote:
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=""
Quote:
>
<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/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
XMLWriter ugly formatting. JAM answers 1 June 27th, 2008 08:59 PM
Formatting XML Output From XmlTextWriter Ken Wilson answers 2 November 17th, 2005 12:18 PM
Serialisation auto formatting McGiv answers 1 November 16th, 2005 12:44 PM
Serialisation auto formatting McGiv answers 1 November 12th, 2005 03:53 AM