Contact Us 1-800-596-4880

SXC Module Reference

Mule runtime engine version 3.8 reached its End of Life on November 16, 2021. For more information, contact your Customer Success Manager to determine how to migrate to the latest Mule version.

As of Mule Runtime version 3.6.0, the SXC module has been deprecated, we recommend that you instead parse your XML payloads manually.

The legacy component will be removed in Mule Runtime version 4.0.0.

The SXC module contains an outbound router and a filter that use the SXC project for streaming XPath routing.

SXC allows listening for XPath expressions as the document is being parsed. As soon as an expression is found, an event is fired, and parsing is stopped. This allows for much more efficient XPath evaluation. XPath evaluators such as Jaxen work with a DOM model, so even when working with lazy-loading DOMs, such as AXIOM, there is more overhead than in just reading directly off the XML stream.

SXC supports a limited subset of XPath expressions. For details, see the SXC documentation.

Using the SXC Outbound Router and Filter

SXC requires a special filtering outbound router, inside of which you configure the SXC filter and any other filters that do not work on the XML payload itself (such as AndFilter, OrFilter, and MessagePropertyFilter). For example, this configuration routes a message based on an XML attribute:

<sxc:filtering-router>
    <outbound-endpoint address="vm://log"/>
    <sxc:filter pattern="//purchaseOrder[@country]"/>
    <sxc:namespace prefix="test" uri="http://foo"/>
</sxc:filtering-router>

Following is another example of a filter that looks for messages where the billing address is within the United States:

<sxc:filtering-router>
  ...
  <sxc:filter pattern="/customer/billingaddress/country[text()='US']"/>
  ...
</sxc:filtering-router>