c# - creation d'un fichier xml à partir d'un noeud xml
Bonjour,
je cherche à splitter un fichier xml en plusieurs avec un foreach sur les nœuds
les doc splittés sont crée vide
pouvez vous m'aider ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
foreach (XmlNode node in nodeRecord.ChildNodes)
{
XmlDocument DocRecord = new XmlDocument();
DocRecord.ImportNode(node, true);
String path = ConfigurationManager.AppSettings[ApplicationData.SPLITFOLDER] +"\\"+ i +".xml";
FileStream fssave = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read);
XmlTextWriter xmltw = new XmlTextWriter(fssave, null);
xmltw.Formatting = Formatting.None;
DocRecord.Save(xmltw);
fssave.Close();
i++;
} |
Merci par avance