hi , i am using an generic CSV creation transform...via which m gettin the spreadsheet required...containin the data fromt he sql query/source database...

but the issue is m gettin multiple header in one single spreadsheet.

my need is to customize this transform to obtain the header jus once....

<?xml version="1.0" encoding="UTF-8" standalone="no"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0">
<xsl:output encoding="UTF-8" media-type="text/csv" method="text"/>
<xsl:param name="RowDelim">,
<xsl:text/>
</xsl:param>
<xsl:param name="FieldDelim">,</xsl:param>
<xsl:param name="StringDelim"/>
<xsl:param name="DateFormat">yyyy-MM-dd HH:mm:ss</xsl:param>
<xsl:template match="/">
<xsl:for-each select="Rowsets">
<xsl:call-template name="PrintFatalError"/>
<xsl:for-each select="Rowset">
<xsl:variable name="CurrentColumns" select="Columns"/>
<xsl:for-each select="Columns">
<xsl:for-each select="Column">
<xsl:value-of select="$StringDelim"/>
<xsl:value-of select="@Name"/>
<xsl:value-of select="$StringDelim"/>
<xsl:if test="not(position() = last())">
<xsl:value-of select="$FieldDelim"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$RowDelim"/>
</xsl:for-each>
<xsl:for-each select="Row">
<xsl:for-each select="*">
<xsl:variable name="ColName">
<xsl:value-of select="name(.)"/>
</xsl:variable>
<xsl:variable name="ColType">
<xsl:value-of select="$CurrentColumns/Column[@Name=$ColName]/@SQLDataType"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ColType= '2' or $ColType= '3' or $ColType= '4' or $ColType= '5' or $ColType= '6' or $ColType= '7' or $ColType= '8' or $ColType= '-7'">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$StringDelim"/>
<xsl:choose>
<xsl:when test="$ColType= '91' or $ColType= '92' or $ColType= '93'">
<xsl:choose>
<xsl:when test=". = 'TimeUnavailable'">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="java:com.sap.xmii.Illuminator.ext.ExtFunctions.dateFromXMLFormat(string(.),$DateFormat)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$StringDelim"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(position() = last())">
<xsl:value-of select="$FieldDelim"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$RowDelim"/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template name="PrintFatalError">
<xsl:for-each select="FatalError">
<xsl:text>Fatal Error -</xsl:text>
<xsl:value-of select="."/>
<xsl:value-of select="$RowDelim"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>