Here is the xsl I use to transform "rrdtool xport" output to CSV. <br><br>This works with rrdtool 1.2 but rrdtool 1.3 xport presently spits out invalid XML which breaks most stylsheet processors.<br><br>The only problem is that Excel doesn't understand "seconds since the epoch." Does anyone know how to transform "seconds since the epoch" to a date format Excel will understand, using pure XSL only?<br>
<br>I used xsltproc linux command-line. I have not tried others. Please send feedback.<br><br><xsl:stylesheet version="1.0" <br> xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"><br>
<br><!-- This makes xsltproc skip the xml headers, for parsing xml into flat text --><br><xsl:output method="text" version="1.0" encoding="iso-8859-1" indent="no"/><br><br>
<xsl:template match="/"><br> <xsl:text>"Timestamp",</xsl:text><br> <xsl:for-each select="xport/meta/legend/entry"><br> <xsl:text>"</xsl:text><br>
<xsl:value-of select="."/><br> <xsl:text>"</xsl:text><br> <xsl:if test="position()!=last()"><br> <xsl:text>,</xsl:text><br> </xsl:if><br>
</xsl:for-each><br> <xsl:text>&#10;</xsl:text><br> <xsl:for-each select="xport/data/row"><br><br> <xsl:text>"</xsl:text><br> <xsl:value-of select="t"/><br>
<xsl:text>"</xsl:text><br> <xsl:text>,</xsl:text><br><br> <xsl:for-each select="v"><br> <xsl:text>"</xsl:text><br><br> <!-- replace NaN with blank --><br>
<br> <xsl:if test=". != 'NaN'"><br> <xsl:value-of select="."/><br> </xsl:if><br><br> <xsl:text>"</xsl:text><br> <xsl:if test="position()!=last()"><br>
<xsl:text>,</xsl:text><br> </xsl:if><br> </xsl:for-each><br><br> <xsl:text>&#10;</xsl:text><br> </xsl:for-each><br></xsl:template><br><br>
</xsl:stylesheet><br><br><br>