Sample XSLT (Decode)

The following is the sample XSLT for the decode function, which decodes any URL-encoded characters in the <payload> element of request message.

In the following example, the description field is defined as Single%20general%20admission%20theater%20ticket. The decode() function transforms the value of description field as Single general admission theater ticket.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:url="http://www.tibco.com/asg/content-types/url" xmlns:f="http://www.tibco.com/asg/functions/url" exclude-result-prefixes="xsl f">
    <xsl:output indent="yes" method="xml" />
    <xsl:template match="/">
        <context>
            <entry name="request">
                <http>
                    <payload>
                        <xsl:copy-of select="f:decode(context/entry[@name='request']/http/payload)" />
                    </payload>
                </http>
            </entry>
        </context>
    </xsl:template>
</xsl:stylesheet>