Skip navigation

Mule Xpack for Intel® XML Software Suite

Download 60-day free trial version of the Intel XML Software Suite

The Intel® XML Software Suite module provides Mule integration support for the Intel XML Software Suite, which can be used to support three categories of XML operations:

  • XML Parsing
  • XSLT Tranformations
  • XPath Filtering and Transforming

Using the XML Software Suite

The Intel® XML Software Suite, which must be installed according to the installation instructions. This document assumes that the XML Software Suite has been installed, and uses "$INTEL_XML_HOME" to refer to the installation directory of the XML Software Suite.

In particular ensure that the LD_LIBRARY_PATH environment variable has "$INTEL_XML_HOME/java/{version}/bin/ia32" in its path and that $INTEL_XML_HOME/java/{version}/lib/intel-xss.jar is on the Java classpath (where {version} is the version of the toolkit, e.g. "1.0").

To use the XPath processing capabilities, you must also download the Muleforge Intel XML Software Suite add-on. This jar can be found here. This jar must be added to your project classpath.

When using the XML toolkit from a standalone Mule instance, you must disable Mule's endorsement of its standard XML libraries and ensure the the XML Toolkit libraries come first in the classpath. This is done in three steps:

1. Delete the $MULE_HOME/lib/endorsed directory.
2. Edit the Mule startup script ($MULE_HOME/bin/mule on *nix and $MULE_HOME/bin/mule.bat on Windows) to delete the line that sets the MULE_ENDORSED environment variable. In $MULE_HOME/bin/mule, the line looks like this:

MULE_ENDORSED=-M-Djava.endorsed.dirs="${MULE_HOME}/lib/endorsed"

In $MULE_HOME/bin/mule.bat, the line looks like this:

set MULE_ENDORSED=-M-Djava.endorsed.dirs="%MULE_HOME%\lib\endorsed"

3. Ensure that the mule-module-intelxml.jar file is in $MULE_HOME/lib/opt
4. Put the intel-xss.jar file in $MULE_HOME/lib/boot

Mule XML namespace setup

When writing mule configuration files, you must have the proper namespaces declared to use some of the Mule Xpack functions. Below is an example template to use:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.1"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:cxf-core="http://cxf.apache.org/core"
      xmlns:mule-xml="http://www.mulesource.org/schema/mule/xml/2.1"
      xmlns:intel="http://www.mulesource.org/schema/mule/intelxml/2.1"
      xmlns:http="http://www.mulesource.org/schema/mule/http/2.1"
      xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/schema/mule/core/2.1/mule.xsd

               http://www.mulesource.org/schema/mule/xml/2.1 http://www.mulesource.org/schema/mule/xml/2.1/mule-xml.xsd
               http://www.mulesource.org/schema/mule/intelxml/2.1 http://www.mulesource.org/schema/mule/intelxml/2.1/mule-intelxml.xsd
               http://www.mulesource.org/schema/mule/http/2.1 http://www.mulesource.org/schema/mule/http/2.1/mule-http.xsd
               http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">

....

</mule>

XML Parsing

The Intel® XML Software Suite is a provider for the standard Java parsing interfaces for both SAX and DOM. Since the Intel XSS is a JAXP provider that can be discovered by Mule, ensuring that the XML Software Suite is installed correctly should be the only necessary step to use the suite for XML parsing.

XSLT Transformations

The XSLT Transformer of the Mule XML Module can be leveraged to use the Intel® XML Software Suite for XSLT transformations. The transformerFactoryClass must be set to the value "com.intel.xml.transform.TransformerFactoryImpl", and the other configuration options can be used as documented.

<mmule-xml:xslt-transformer 
  name="Xsltin"
  xsl-file="xslt/transform.xslt" 
  returnClass="org.mule.module.xml.transformer.DelayedResult"
  transformerFactoryClass="com.intel.xml.transform.TransformerFactoryImpl"/>

XPath Filtering

A Mule filter is provided for filtering based on an XPath expression and expected value. The filter definition includes the XPath pattern, expected value, and namespace definitions for the evaluation of the pattern. Here is an example of the filter definition:

<mule ...>
  ...
  <intel:xpath-filter name="XPathFilter" 
      pattern="/soap:Envelope/soap:Body/mule:echo/mule:echo" expectedValue="Hello!" 
      xmlns:intel="http://www.mulesource.org/schema/mule/intelxml/2.0">
    <intel:namespace prefix="soap" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
    <intel:namespace prefix="mule" uri="http://simple.component.mule.org/"/>
  </intel:xpath-filter>
  ...
</mule>

XPath Transforming

A Mule transformer is provided for "transforming" an XML document into an XPath-extracted path. The transformer definition includes the XPath expression and the result type, which can be of type "NODESET", "NODE", "STRING", "BOOLEAN", or "NUMBER", which defines the output type of the transformer. Here is an example of the XPath transformer definition:

<mule ...>
  ...
  <intel:xpath-extractor-transformer name="XPathTransformer" 
      pattern="/soap:Envelope/soap:Body/mule:echo" 
      xmlns:intel="http://www.mulesource.org/schema/mule/intelxml/2.0" 
      resultType="NODE">
    <intel:namespace prefix="soap" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
    <intel:namespace prefix="mule" uri="http://simple.component.mule.org/"/>
  </intel:xpath-extractor-transformer>
  ...
</mule>

XML Schema Validation Filtering

A Mule filter is provided for filtering messages based on whether they validate against a provided schema document. The filter definition specifies the schema file to use. Here is an example of the XML Schema validation filter:

<mule ...>
  ...
  <intel:schema-validation-filter name="ValidationFilter" 
      schemaFile="/path/to/schema.xsd"
      xmlns:intel="http://www.mulesource.org/schema/mule/intelxml/2.0"/>
  ...
</mule>

Further Information

Mule XPack for Intel (R) XML Software Suite datasheet

Adaptavist Theme Builder Powered by Atlassian Confluence