I am using the xslt language to transform an xml document. The result that I am getting at the moment is not exactly what I want to achieve. I want to be able to get an xml format result separated with commas. I want my result to be in this correct way with returned values separated with commas.
<caller>1013, Product Enquiry, Courrier, Mobile Phone, Undecided</caller>
But what I am getting at the moment is wrong and it is this one below. 1013Product EnquiryCourrierMobile PhoneUndecided
This is my caller.xml file.
<caller>
<number message="id">1013</number>
<number message="voice">Product Enquiry</number>
<number message="delivery">Courrier</number>
<number message="device">Mobile Phone</number>
<number message="subscription">Undecided</number>
</caller>
This is my xslt caller.xsl file.
<xsl:template match="/" priority="0">
<xsl:if test="position()>2">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates/>
<caller>
<xsl:apply-templates select="caller/number">
</xsl:apply-templates>
</caller>
</xsl:template>```
I am getting two results with this xslt code and none of them has commas in it. I will appreciate if some can point me int he right direction to fix it.