title: Datapower - Convert Query not converting JSON to JSONX
body: <p>I have a very simple usecase which has worked previously. But in this new mpgw where flow is </p>
  
  <p>url-open to an API &amp; get json response &amp; process that response before sending to client, it doesn't work.</p>
  
  <p>I have tried the below in xslt</p>
  
  <pre><code>  &lt;xsl:variable name="Response"&gt;
       &lt;dp:url-open target="{$routing_URL}" response="responsecode-binary" http-method="get" ssl-proxy="client:mpgw_Client_SSL_Profile" timeout="'10'"&gt;
       &lt;/dp:url-open&gt;
     &lt;/xsl:variable&gt;
  
   &lt;!-- Decoding the binary node so that it can be further used in the processing rules --&gt;
     &lt;xsl:variable name="json"&gt;
      &lt;xsl:copy-of select="dp:decode(dp:binary-encode($Response/result/binary/node()), 'base-64' )" /&gt; 
     &lt;/xsl:variable&gt;
  
     &lt;dp:set-variable name="'var://context/service_session/json'" value="string($json)" /&gt;
     &lt;xsl:value-of select="$json"/&gt;
  </code></pre>
  
  <p>I can see the context variable getting the json data. But when i use convert query param after this transform action it fails with below error:</p>
  
  <pre><code>Convert HTTP produced invalid XML: Incomplete markup or missing 
  document element at offset 39 of ...
  </code></pre>
  
  <p>I have also tried using the context __JSONASJSONX in output of transform &amp; input of next transform, but there also the data is not converted to JSONX.</p>
  
  <p>I have read other forums where this error means data is empty but I can see the data in context variable.</p>
  
  <p>Any idea what could go wrong here?</p>