i need to convert XML files into CSV .
Expected Output :
tag1 tag2 Typearray
Name1 Name2 1
Name1 Name2 13
using XSLT am able to get only one record the second record in the array is getting rejected.
tag1,tag2,CommOffer,TypeArray
name1,name2,1
Can you please let me know how to read the array value using XSLT ?
Sample XML :
<Master2>
<Child1>
<tag1>name1</tag1>
<tag2>name2</tag2>
<TypeArray>
<value>1</value>
<value>13</value>
</TypeArray>
</Child1>
</Master2>
</Master1>
XSLT :
<xsl:template match="/">
<xsl:text>tag1,tag2,TypeArray</xsl:text>
<xsl:text>
</xsl:text>
<xsl:for-each select="Master1/Master2/Child1">
<xsl:call-template name="CsvEscape"><xsl:with-param name="value" select="normalize-
space(tag1)"/></xsl:call-template>
<xsl:text>,</xsl:text>
<xsl:call-template name="CsvEscape"><xsl:with-param name="value" select="normalize-
space(tag2)"/></xsl:call-template>
<xsl:text>,</xsl:text>
<xsl:call-template name="CsvEscape"><xsl:with-param name="value" select="TypeArray/value"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>