In WSO2ESB, using the xslt mediator, I want to transform a webservice result. I do that using an xslt file. In this file, I want to do some lookups, to transform some values into something else.
In Oracle, you can use a dvm for that.
In plain xslt, it looks like the document('somefile.xml') function could do the trick, but WSO2ESB looks for the xml file on the filesystem, and the resources property on the xslt mediator does not translate document() contents into correct paths. Then, I tried inputting the XML by reading it into a property in ESB, and then pass the property to the mediator. This also does not work, because the content of the XML is then passed as one string value instead of a nodeset.
Am I doing something wrong - what is the correct way of doing this?
you can inject the content of your document 'somefile.xml' as a subtree inside the current message before invoking XSLT mediator :
Define a local entry named 'somefile' with the content of 'somefile.xml'
Use enrich mediator to inject it's content inside current message :
<enrich>
<source clone="true" xpath="get-property('somefile')"/>
<target type="body" action="child"/>
</enrich>
In your XSL transformation, use this content rather than refering to $somefile/xxx... (and forget this content in the result)