Skip to content

Instantly share code, notes, and snippets.

@yamanyar
Created October 8, 2013 08:40
Show Gist options
  • Save yamanyar/6881592 to your computer and use it in GitHub Desktop.
Save yamanyar/6881592 to your computer and use it in GitHub Desktop.
add jsonx conent's checksum to http response
<?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