WSO2 APIM:XSLT 调解器的 XSLT 文件放在哪里

WSO2APIM: Where to put XSLT file for XSLT Mediator

我想在我的自定义序列中使用 XSLT 中介来为 API 转换消息。我创建了 XSLT 文件名 "transform.xslt" 并在我的序列中使用了以下语法。

<xslt key="transform.xslt" source="*" />

我的问题是,我不知道将 XSLT 文件放在哪里。我是否必须放在 synapse 目录下或必须导入到 carbon 存储库,或者是否有任何其他配置?

从 WSO2ESB 看来,API 定义中必须有一些配置,但在 WSO2 API 管理器的情况下,它是自动生成的,我不想编辑生成的文件。

非常感谢。

您可以上传 XSLT 文件作为注册表资源,并在 XSLT 调解器中引用它。

1) 在本地注册表中保存 XSLT 文件

- Log on to the APIM Management Console.
- Click on "Browse" in the left "Registry" menu
- Expand the "system" tree node and then click on the "config" 
- Then click on the "Add Resource" option
- Upload the "transform.xslt" file and give the name as "transform"
- Click on the "Add" button.

You can refer uploaded xslt file in your XSLT mediator like below.

<xslt key="conf:/transform.xslt" source="*" />