comparison API/Exporters/WarFoundryXMLWithXSLExporter.cs @ 408:2c52f0235774 xsl-output

Closed exported file after completion of export/transformation.
author Dan.Kulinski@dank-laptop.Global.Local
date Tue, 23 Aug 2011 15:44:08 -0600
parents 5d7584a73d7f
children 71fceea2725b
comparison
equal deleted inserted replaced
407:a33be6e995c9 408:2c52f0235774
52 // Write XML to file 52 // Write XML to file
53 using (XmlWriter writer = XmlWriter.Create(path, xmlSettings)) 53 using (XmlWriter writer = XmlWriter.Create(path, xmlSettings))
54 { 54 {
55 xmlDoc.Save(writer); 55 xmlDoc.Save(writer);
56 writer.Flush(); 56 writer.Flush();
57 writer.Close();
57 } 58 }
58 } 59 }
59 60
60 // Write to file with transform 61 // Write to file with transform
61 public void ExportArmyWithTransform(Army army, string savePath, string xslPath) 62 public void ExportArmyWithTransform(Army army, string savePath, string xslPath)
65 66
66 xslTransform.Load(xslPath); 67 xslTransform.Load(xslPath);
67 XmlWriter writer = XmlWriter.Create(savePath, xslTransform.OutputSettings); 68 XmlWriter writer = XmlWriter.Create(savePath, xslTransform.OutputSettings);
68 xslTransform.Transform(xmlDoc, writer); 69 xslTransform.Transform(xmlDoc, writer);
69 writer.Flush(); 70 writer.Flush();
71 writer.Close();
70 } 72 }
71 73
72 // Build the XML document to save or transform 74 // Build the XML document to save or transform
73 private XmlDocument BuildXml(Army army) 75 private XmlDocument BuildXml(Army army)
74 { 76 {