|
Hi,
I'm creating an XmlDocument and trying to save it to a file. I find if I save via an XmlTextWriter or StreamWriter, I get 3 extra bytes at the beginning of the file. They are non-printable ascii, so they don't show up in a viewer, but the 3rd party import app doesn't like it.
IE, XmlTextWriter writer = new XmlTextWriter(filename, System.Text.Encoding.UTF8); xmlDoc.Save(writer);
If I call save with the filename directly, there are no extra bytes, but an element gets an extra xmlns="" attribute, which violates the schema.
IE, xmlDoc.Save(filename); outputs ... <SomeElement xmlns="">
Anyone seen this before? Any ideas on how to work around these? Thanks
|