I have to transform following result using XSLT transformation.
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:Response xmlns:ns2="http://urldata.com/">
<return>{"accountstatus":false,"response":{"MessageData":"Test","Code":"99","errors":{"name":"Hi","code":"100"}}}</return>
</ns2:Response>
</S:Body></S:Envelope>
And i Tried using below
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-declaration="yes"/>
<xsl:template match="/">
<ns1:TranResponse xmlns:ns1="http://test.com">
<ns1:TranResult>
<xsl:element name="ns1:AccountStatus">
<xsl:value-of select="//jsonObject/return"/>
</xsl:element>
</ns1:TranResult>
</ns1:TranResponse>
</xsl:template>
</xsl:stylesheet>
And Result Like This
<ns1:ResultSet>
<ns1:AccountStatus>{"accountstatus":false,"response":{"MessageData":"Test","Code":"99",
"errors":{"name":"Hi","code":"100"}}}</ns1:AccountStatus>
<ns1:ResultSet>
But i need is result like below,
<ns1:Results>
<ns1:ResultSet>
<ns1:AccountStatus>false</ns1:AccountStatus>
<ns1:ResultSet/>
<ns1:ResultSet>
<ns1:MessageData>test</ns1:MessageData>
<ns1:ResultSet/>
<ns1:ResultSet>
<ns1:Code>99</ns1:Code>
<ns1:ResultSet/>
<ns1:ResultSet>
<ns1:name>Hi</ns1:name>
<ns1:ResultSet/>
<ns1:ResultSet>
<ns1:code>100</ns1:Code>
<ns1:ResultSet/>
<ns1:Results/>
Any one can figure this out please figure this out