Fixed that xmldecl was not part of the export.xml.

This commit is contained in:
Sipke Schoorstra
2015-07-30 22:57:15 +01:00
parent f3f0352063
commit 2a2aba9548

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using Orchard.FileSystems.AppData;
using Orchard.ImportExport.Models;
@@ -50,8 +52,11 @@ namespace Orchard.ImportExport.Services {
}
var path = _appDataFolder.Combine(ExportsDirectory, exportFile);
var recipeText = recipeDocument.ToString(SaveOptions.None);
_appDataFolder.CreateFile(path, recipeText);
using (var writer = new XmlTextWriter(_appDataFolder.CreateFile(path), Encoding.UTF8)) {
writer.Formatting = Formatting.Indented;
recipeDocument.WriteTo(writer);
}
return _appDataFolder.MapPath(path);
}