This first time I am dealing with xslt creations, finding it really tricky.
I have request XML and using xslt it is supposed to generate XML with below mentioned o/p.
Utility performing this operation is already built in C#. I need to write XSLT that will correctly read values from XML and create new XML with expected format.
I am trying to write XSLT to transform XML(i/p) :
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<ExecuteESI xmlns="http://TTTT.com/Enterprise/ServiceGateways/">
<context xmlns:b="http://TTTT.com/Enterprise/ServiceGateways/Core/Contracts/"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request xmlns:b="http://TTTT.com/Enterprise/ServiceGateways/ExternalService/Request/"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:Message>
<ns2:ReqProv xmlns:ns2="http://TTTT.com/TTTT/TTTTestJSONESIRequest/">
<ns2:CID>TTTT</ns2:CID>
<ns2:TIME>18732081720160855</ns2:TIME>
<ns2:HASH>40dad29c4ae9303c975639f7700bf517e6e72fbf5723c7905a74fde0d5452da0</ns2:HASH>
</ns2:ReqProv>
</b:Message>
</request>
</context>
</ExecuteESI>
</s:Body>
</s:Envelope>
to Below mentioned format (o/p):
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">CID=TTTT&TIME=18732081720160855&HASH=40dad29c4ae9303c975639f7700bf517e6e72fbf5723c7905a74fde0d545</string>
I have written following XSLT, which doesn't work
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:ns="http://asurion.com/TTTT/TTTTTestJSONESIRequest/"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/"
exclude-result-prefixes="msxsl xsl ns">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:variable name="CID">
<xsl:value-of select="./ns:ReqProv/ns:CID"/>
</xsl:variable>
<xsl:variable name="TIME">
<xsl:value-of select="./ns:ReqProv/ns:TIME"/>
</xsl:variable>
<xsl:variable name="HASH">
<xsl:value-of select="./ns:ReqProv/ns:HASH"/>
</xsl:variable>
CID=<xsl:value-of select="$CID" />&TIME=<xsl:value-of select="$TIME" />&HASH=<xsl:value-of select="$HASH" />
</xsl:template>
</xsl:stylesheet>
I have tried different combinations of <xsl:value-of...
and <xsl:template match...
and <xsl:template name....
but nothings seems to work.