Ecriture d'un dataset en xml - problème avec le caractère espace
Bonjour,
Sous Visual Studio 2008, j'exporte un DataSet en xml en utilisant le code ci-dessous.
Le problème est que le DataSet contient certaines chaînes de caractères constituées uniquement d'un espace.
Au lieu de m'écrire:
<en> </en>
XmlWriter m'écris:
<en xml:space="preserve"> </en>
Y-a-t'il un moyen d'empêcher celà?
Merci d'avance pour toute aide ou commentaire.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
private void SaveDataSetToXml(String sXmlPath, DataSet ds)
{
// Write xml file with dataset content
FileStream fs = new FileStream(sXmlPath, FileMode.Create, FileAccess.Write);
XmlWriterSettings xwSettings = new XmlWriterSettings();
xwSettings.Indent = true;
xwSettings.Encoding = Encoding.Unicode;
using (XmlWriter xWriter = XmlWriter.Create(fs, xwSettings))
{
ds.WriteXml(xWriter, XmlWriteMode.IgnoreSchema);
xWriter.Close();
}
fs.Close();
} |