The XsltComponent will perform an XSLT transformation of an inbound NormalizedMessage and generate an output message as a NormalizedMessage.

If the component is given an InOut message exchange, then the 'out' message is used. Otherwise if an InOnly is used then the component will create a new InOnly message exchange for the result of the transformation.

The transformation can be configured using any JAXP Source or using a Spring Resource to the XSL file.

Example

There is an example which demonstates a pipeline from a message source, to a transformation, to send the message along with tracing the operation.

Receiving the message from a JMS topic

{snippet:id=receive|lang=xml|url=servicemix/smx3/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/example.xml}

 

Transforming the message using XSLT

{snippet:id=xslt|lang=xml|url=servicemix/smx3/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/example.xml}

 

Sending the result to a different JMS topic

{snippet:id=send|lang=xml|url=servicemix/smx3/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/example.xml}

 

Subscribing to the topic and pipelining it to a trace component to demonstrate the pipeline working

{snippet:id=log|lang=xml|url=servicemix/smx3/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/example.xml}

 

  • No labels