<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
<soapenv:Body>
<swiftResponseResponse xmlns="http://webservice.sbi.com">
<swiftResponseReturn>15617TS006140|DC768736|13321.49|04-05-2017 15:13:03|SWIFTINR|NA|FAIL-ACCOUNT UNAVAILABLE</swiftResponseReturn>
</swiftResponseResponse>
</soapenv:Body>
</soapenv:Envelope>
and my xsl input is
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://webservice.sbi.com" exclude-result-prefixes="soapenv xsl xsd xsi xs ">
<!--<xsl:output method="xml" indent="yes"/>-->
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<!--<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>-->
<xsl:template name="tokenize">
<xsl:param name="text"/>
<xsl:param name="separator" />
<xsl:choose>
<xsl:when test="not(contains($text, $separator))">
<swiftResponseReturnValue>
<xsl:value-of select="$text"/>
</swiftResponseReturnValue>
</xsl:when>
<xsl:otherwise>
<swiftResponseReturnValue>
<xsl:value-of select="normalize-space(substring-before($text, $separator))"/>
</swiftResponseReturnValue>
<xsl:call-template name="tokenize">
<xsl:with-param name="text" select="substring-after($text, $separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--<xsl:template match="soapenv:Envelope/soapenv:Body/xs:swiftResponseResponse/xs:swiftResponseReturn">-->
<xsl:template match="xs:swiftResponseReturn">
<swiftResponseReturn>
<xsl:call-template name="tokenize">
<xsl:with-param name="text" select="."/>
<xsl:with-param name="separator" select="'|'"/>
</xsl:call-template>
</swiftResponseReturn>
</xsl:template>
</xsl:stylesheet>
my output is
<swiftResponseReturn>
<swiftResponseReturnValue>15617TS006140</swiftResponseReturnValue>
<swiftResponseReturnValue>DC768736</swiftResponseReturnValue>
<swiftResponseReturnValue>13321.49</swiftResponseReturnValue>
<swiftResponseReturnValue>04-05-2017 15:13:03</swiftResponseReturnValue>
<swiftResponseReturnValue>SWIFTINR</swiftResponseReturnValue>
<swiftResponseReturnValue>NA</swiftResponseReturnValue>
<swiftResponseReturnValue>FAIL-ACCOUNT UNAVAILABLE</swiftResponseReturnValue>
</swiftResponseReturn>
i want my expected output should be like this
<swiftResponseReturn>
<swiftResponseReturnValue1>15617TS006140</swiftResponseReturnValue1>
<swiftResponseReturnValue2>DC768736</swiftResponseReturnValue2>
<swiftResponseReturnValue3>13321.49</swiftResponseReturnValue3>
<swiftResponseReturnValue4>04-05-2017 15:13:03</swiftResponseReturnValue4>
<swiftResponseReturnValue5>SWIFTINR</swiftResponseReturnValue5>
<swiftResponseReturnValue6>NA</swiftResponseReturnValue6>
<swiftResponseReturnValue7>FAIL-ACCOUNT UNAVAILABLE</swiftResponseReturnValue7>
</swiftResponseReturn>
can help me to add ids in my tag or any other value that can uniquely identify my columns.please help been stuck here for while.