...
Info |
---|
title | Endpoint attributes |
---|
borderStyle | solidbgColor='lighblue' |
---|
|
Name | Type | Description | Required |
---|
resource | Spring resource | the spring resource pointing to the XSLT stylesheet | one of (resource, expression) | expression | ServiceMix expression | expression used to dynamically load the stylesheet | one of (resource, expression) | wsdlResource | Spring resource | if set, the wsdl will be retrieved from the given Spring resource | no | transformerFactory | TransformerFactory | TraX factory to create transformers | defaults to Saxon implementation | configuration | Saxon configuration | Saxon configuration | no | result | String | Output result type | defaults to dom , possible values are dom , bytes , string | copyAttachments | boolean | | defaults to true | copyProperties | boolean | | defaults to true | copySubject | boolean | | defaults to true | useDomSourceForXslt | boolean | force the transformation of the xslt stylesheet into a DOM document before giving it to the transformer | defaults to true | useDomSourceForContent | boolean | force the transformation of the incoming JBI message into a DOM document before giving it to the transformer | no | parameters | Map | additional parameters to give to the transformation engine | no |
|
Using properties and parameters
All properties defined on the JBI exchange and input JBI message will be available for use inside the XSLT stylesheet as parameters.
In addtion to those properties and the one specified in the parameters
property on the endpoint, the following objects are also available:
- exchange: the JBI exchange
- in: the input JBI NormalizedMessage
- component: the XsltEndpoint instance being called
All those parameters can be accessed using XSLT standard ways.
For example:
Code Block |
---|
|
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:param name="stringParam"/>
<xsl:param name="integerParam"/>
...
</xsl:stylesheet>
|
and the configuration of those values on the endpoint (in case they are not available on the JBI exchange / message):
Code Block |
---|
|
<saxon:xslt service="test:xslt-params" endpoint="endpoint"
resource="classpath:parameter-test.xsl">
<property name="parameters">
<map>
<entry key="stringParam" value="cheeseyCheese"/>
<entry key="integerParam">
<bean class="java.lang.Integer">
<constructor-arg index="0" value="4002"/>
</bean>
</entry>
</map>
</property>
</saxon:xslt>
|
XSLT Proxy
One common use case is the need to transform a request coming from a service and send it to another service and do the same with the response. A simple example is the need to translate the request and responses between two SOAP endpoints. Such a use case could be implemented using two XSLT endpoints and an EIP StaticRoutingSlip. However, there are some drawbacks, as the operation is lost in the process, and a static routing slip can not be used to process InOnly exchanges.
...