1

There is two XSL transformations in IBM Datapower one after another. First of them contains url-open call and returns some BINARY NODE. That node contains .gz archive with JSON doc inside. Second transformation is below:

<xsl:output method="text" encoding="utf-8" indent="yes" media-type="application/json"/>
<dp:input-mapping type="ffd" href="local:///binaryNode.ffd"/>

<xsl:variable name="input64" select="dp:binary-encode(/object/message/node())"/>

<xsl:template match="/">
   <xsl:message terminate="no" dp:priority="alert" dp:type="all">input64<xsl:copy-of select="$input64"/></xsl:message>
   <xsl:variable name="outputJson" select="dp:inflate($input64, 'gzip')"/>
   <xsl:copy-of select="$outputJson"/>
</xsl:template>

Binary node first transforms to Base64 string ($input64) and then unpacks by dp:inflate function. $outputJson variable definitely contains a JSON string. But XSLT output is empty string despite of instruction <xsl:copy-of select="$outputJson"/>. How can I get a JSON on output?

kirill.login
  • 899
  • 1
  • 13
  • 28

1 Answers1

0

To output something from a XSLT binary you need to wrap it in the "output":

<object>
   <message>
      <xsl:copy-of select="$outputJson"/>
   </message>
</object>

I would however consider using a context variable instead:

<dp:set-variable name="'var://context/JSON/output'" value="$outputJson" />
Anders
  • 3,198
  • 1
  • 20
  • 43