• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

Formatting XML with XmlTextWriter

I am trying to wrirte XML to a file as text using XmlTextWriter. Everything works fine except the fact that all the empty XML elements in the file are written in the long-hand form:

<info attr1="val"></info>

I would prefer the form

<info attr1="val" />

Is there a way to accomplish this in C#?

Thank you.
0
msmolyak
Asked:
msmolyak
1 Solution
 
naveenkohliCommented:
There is no setting XmlTestWriter that will help you with this. And for that matter, I don't think there is any thing in Xml namespace that will do it.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now