Unfortunately, this outputs spaces before closing slashes in empty elements (<element /> instead of <element/>) and I don't want the spaces there. XmlWriter (actually I'm getting a XmlWellFormedWriter) should provide an option not to output these spaces, or better yet, a custom callback for doing any extra formatting you want when each element is closed.
I have an XML document I want serialized by an XmlWriter, and I'm using this code:
Unfortunately, this outputs spaces before closing slashes in empty elements (
<element />
instead of<element/>
) and I don't want the spaces there. XmlWriter (actually I'm getting aXmlWellFormedWriter
) should provide an option not to output these spaces, or better yet, a custom callback for doing any extra formatting you want when each element is closed.