i'm using msbuild for some automation. One of the task is sql query to get xml representation of table and write it to file. So i'm using
<MSBuild.ExtensionPack.SqlServer.SqlExecute
ConnectionString="$(AdminConnectionString)"
Sql="SELECT '%(ReaderResult.Identity)' as XmlFileName,
(SELECT * FROM %(ReaderResult.Identity) FOR XML AUTO, TYPE, ELEMENTS,
XMLSCHEMA('%(ReaderResult.Identity)'), ROOT('DataSet')) as FileContent"
ContinueOnError="false" TaskAction="ExecuteReader">
<Output ItemName="ExportResult" TaskParameter="ReaderResult"/>
</MSBuild.ExtensionPack.SqlServer.SqlExecute>
<WriteLinesToFile File="%(ExportResult.XmlFileName).xml"
Lines="<?xml version="1.0" standalone="yes"?>;
%(ExportResult.FileContent)" Overwrite="true"/>
The problem is - i get the xml data in single line which is not readable, hard to edit etc.
How can i get the human readable xml with line breaks and indents?
Thanks.