Using XSL transform with outputVariable from json to xml policies

sanga
Participant I

Hello,

Is it possible to use the output variable from the JSON to XML policy, to do an xsl transform. When I try to do it, I have the error :

Json to xml variable output is "Output"

and source from xsl transform policy is "Output"

{ "fault": { "faultstring": "XSL Output: Invalid Source XSL-Transform-1.", "detail": { "errorcode": "steps.xsl.InvalidSource" } } }

0 3 396
3 REPLIES 3

Can you show your XSL policy configuration for XSL-Transform-1?

I guess "Invalid Source" indicates that the source you have specified is not a message. It needs to be a message. And the message content should contain XML. If that is not clear, let me know and I'll explain further.

The documentation states:

Source (Optional) Contains the message from which information needs to be extracted. Usually this value is set to request or response, depending on whether the message to be transformed is inbound or outbound.
  • If source is missing, it is treated as a simple message. For example, <Source>message</Source>
  • If the source variable cannot be resolved, or resolves to a non-message type, the transformation step fails.

My guess is that one of these things is happening:

  1. you configured a context variable for Source, and that context variable contains a string, not a message.
  2. You configured a Source element, to point to a context variable that contains a specific message, but the message .content does not contain XML, or the content-type header is neither text/xml nor application/xml.
  3. You did not configure a Source element, and the "message" variable .content does not contain XML, or the content-type header is neither text/xml nor application/xml.

See also this page for troubleshooting.

I can not seem to insert scrennshot so here is how I configured my xsl policy :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<XSL async="false" continueOnError="false" enabled="true" name="XSL-Transform-1"> <DisplayName>XSL Transform-1</DisplayName>

<Properties/>

<ResourceURL>xsl://XSL-Transform-1.xsl</ResourceURL>

<Parameters ignoreUnresolvedVariables="true"/>

<Source>Output</Source>

<OutputVariable>Output1</OutputVariable> </XSL>

sorry about the screenshot thing. I have that problem too, sometimes. I don't know the cause. I've had better luck with smaller images. From that I conclude that there may be a size/complexity filter on images, but the UI here on the community site doesn't actually tell you that.

But anyway adding the XSL is helpful.

What did you think about any of the 3 possibilities I suggested? I cannot tell from the configuration of your XSL policy what TYPE of thing "Output" is. Is "Output" the name of a context variable that contains a message? Is it something else?

Help me out here.