{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Akhara Sang · Sep 09, 2020 at 02:26 PM · 84 Views jsontoxmlxsl transform

Using XSL transform with outputVariable from json to xml policies

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" } } }

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Dino-at-Google   · Sep 09, 2020 at 04:45 PM

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.

Comment
Add comment Show 2 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Akhara Sang · Sep 10, 2020 at 01:05 PM 0
Link

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>

avatar image Dino-at-Google ♦♦ Akhara Sang   · Sep 11, 2020 at 05:34 PM 0
Link

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.

Follow this Question

Answers Answers and Comments

53 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

JSON to XML Policy: Re-sequence XML nodes based on Schema 2 Answers

JSONtoXML Making array multiple elements 2 Answers

JSONToXML ignores ObjectRootElementName for object with one property 1 Answer

Regarding the XSL transform policy - Can i specify the Source with a variable? 1 Answer

Unable to convert the json to xml 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges