titans4771
MIS
I am a newbie to XML and I have an assignment to create CSV file using XML? I have the below XSLT code and it returns the values in CSV, now I want to add the column headings to the file as well, how would I go about doing this? Below is my code:
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="text"/>
<xsl:template match="NewDataSet">
<xsl:apply-templates select="Table"/>
</xsl:template>
<xsl:template match="Table">
<xsl:for-each select="*">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
Any help is GREATLY appreciated!!
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="text"/>
<xsl:template match="NewDataSet">
<xsl:apply-templates select="Table"/>
</xsl:template>
<xsl:template match="Table">
<xsl:for-each select="*">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
Any help is GREATLY appreciated!!