XmlTextWriter.WriteFullEndElement tags on the same line

Posted by Apeksha on Stack Overflow See other posts from Stack Overflow or by Apeksha
Published on 2010-03-19T18:56:16Z Indexed on 2010/03/19 19:31 UTC
Read the original article Hit count: 286

Filed under:
|
|
|
|

I am using an XMLTextWriter to create an XML document dynamically (in VB.Net). I want empty tags to appear like this - <Tag></Tag> and not this - <Tag />

So, I am using WriteFullEndElement to end the element tag. But it is writing out the tag as -

<Tag>

</Tag>

i.e. with a newline character between the tags. The web service reading this XML rejects it due to the newline character.

How do I avoid the newline, and have both the start and end tags on the same line?

© Stack Overflow or respective owner

Related posts about xmltextwriter

Related posts about Xml