Created
October 8, 2013 08:40
-
-
Save yamanyar/6881592 to your computer and use it in GitHub Desktop.
add jsonx conent's checksum to http response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:json="http://www.ibm.com/xmlns/prod/2009/jsonx" | |
xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp"> | |
<xsl:output method="text"/> | |
<xsl:template match="/"> | |
<xsl:variable | |
name="theMasterNode" | |
select="/json:object"> | |
</xsl:variable> | |
<xsl:variable name="digest"> | |
<xsl:value-of select="dp:c14n-hash($theMasterNode, false())"/> | |
</xsl:variable> | |
<dp:set-http-response-header name="’checksum" value="digest"/> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment