Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Receiving the message from a JMS topic

Wiki Markup
{snippet:id=receive|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/components/xslt/example.xml?rev=HEAD}

Transforming the message using XSLT

Wiki Markup
{snippet:id=transform|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/components/xslt/example.xml?rev=HEAD}

Sending the result to a different JMS topic

Wiki Markup
{snippet:id=send|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/components/xslt/example.xml?rev=HEAD}

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

Wiki Markup
{snippet:id=trace|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/components/xslt/example.xml?rev=HEAD}