Connecting Tech Pros Worldwide Help | Site Map

Q: formatting XmlWriter output ?

Mikey_L
Guest
 
Posts: n/a
#1: Aug 29 '08
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 !


Martin Honnen
Guest
 
Posts: n/a
#2: Aug 29 '08

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