I have an SSIS XML Task that I’m using to try and reformat some XML output into pretty HTML. Here is the XML
<RootNode><row><ProcessName>RefreshDbnSr1FromP01</ProcessName><StartDateAndTime>2011-09-21T15:13:56</StartDateAndTime><AverageSeconds>2562</AverageSeconds></row><row><ProcessName>RefreshDbnSr1FromP01</ProcessName><StartDateAndTime>2011-09-21T15:29:45</StartDateAndTime><AverageSeconds>2562</AverageSeconds></row><row><ProcessName>RefreshDbnSr1FromP01</ProcessName><StartDateAndTime>2011-09-21T15:44:07</StartDateAndTime><AverageSeconds>2562</AverageSeconds></row></RootNode>
And then here is the XSLT I’m using to transform.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/RootNode">
<html>
<body>
<table border="1">
<tr bgcolor="#AAAAAA">
<th>ProcessName</th>
<th>StartDateAndTime</th>
<th>AverageSeconds</th>
</tr>
<xsl:for-each select="row">
<tr>
<td>
<xsl:value-of select="ProcessName" />
</td>
<td>
<xsl:value-of select="StartDateAndTime" />
</td>
<td>
<xsl:value-of select="AverageSeconds" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
It seems to work fine in IE. (if I add the header it works.) But the output that the XML task exports looks like this.
<?xml version="1.0" encoding="utf-8"?>RefreshDbnSr1FromP012011-09-21T15:13:562562RefreshDbnSr1FromP012011-09-21T15:29:452562RefreshDbnSr1FromP012011-09-21T15:44:072562
Any help is appreciated.
Thanks,
Try adding the following line to your XSLT before the element:
See the sample stylesheet in this blog post:
http://geekswithblogs.net/LifeLongTechie/archive/2011/02/02/using-ssis-to-send-a-html-e-mail-message-with-built-in.aspx