Skip to main content
Version: 4.14.4

Transform XML to CSV

With the current set of components you can transform an XML document to CSV using the XSLT component. First of all you would need an XSLT file to make this mapping possible, you can use a standard one that works on all the standard xml files:


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:strip-space elements="*" />

<xsl:template match="/*/child::*">
<xsl:for-each select="child::*">
<xsl:if test="position() != last()"><xsl:value-of select="normalize-space(.)"/>, </xsl:if>
<xsl:if test="position() = last()"><xsl:value-of select="normalize-space(.)"/><xsl:text>&#xD;</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

You can upload this XSLT file to the the XSLT Component.

When defining a starting endpoint that reads the XML file, and defining the exporting endpoint, the flow will transform the XML to CSV.