0
I am using the following code to generate an xml:
public bool SerializarObjeto(object o, string pathArquivo)
{
var xns = new XmlSerializerNamespaces();
XmlSerializer writer = new XmlSerializer(o.GetType());
StreamWriter file = new StreamWriter(pathArquivo);
writer.Serialize(file, o, xns);
file.Close();
return true;
}
Generates the following result in a given file:
<item iis="078906590000500400348059" produzido="2016-07-15T07:34:54" />
My problem:
I need you not to leave with empty space before closing the tag:
How does it come out: " />
How should I get out: "/>
thank you.
The palliative solution I adopted was to create a method to read the file and remove these spaces. I believe that this way of generating xml is from Xmlserialize itself. I’m still looking for a way to solve this in a more correct way..
– tiago costa