I have a situation where XML data is being processed by two different mechanisms. In one place it is being processed using Python's xml.dom.minidom library. In the other, similar processing is being performed in .NET, via an XmlTextWriter.
In the output generated by the Python code, empty elements are written <ElementName/> (with no space before the element close). In the .NET code, a space is being inserted (resulting in <ElementName />). This makes no difference whatsoever to the validity or meaning of the XML, but it does cause the output to be detected as different when the two outputs are compared.
Is there any way to tell the XmlTextWriter not to include the extra space? Failing that, is there any way to include the extra space in the Python-generated output (short of messing with the library source, which wile possible is something I consider undesirable ;-))?
Update: Perhaps I should explain what I'm trying to do instead of just describing the problem. It's possible that I'm making things more complicated / painful than I should.
What I really need is some mechanism to determine that the structure represented by the XML has not been modified. I was originally flattening the XML (which eliminated whitespace issues when everything was being done in .NET world), then calculating an appropriately salted hash of the data. Is there a better mechanism I could / should be using?
I would just post-process the output to do search/replace instead of trying to mess with the library
Can I tell an XmlTextWriter to write  instead of ?