Contact Us 1-800-596-4880

DOM/XML Transformers

Mule contains several transformers that convert between a W3C DOM object and its serialized representation. The DomToXml transformer converts DOM objects to XML, the XmlToDom transformer converts XML strings to DOM objects, and the DomToOutputHandler transformer converts from a DOM to an OutputHandler serialization.

These transformers support the standard transformer attributes. In addition, they support the following configuration.

Example

To use the DOM/XML transformers, you add them to your Mule XML configuration as follows:

<xm:dom-to-xml-transformer name="DomToXml"/>
<xm:xml-to-dom-transformer name="xmlToDom" returnClass="org.w3c.dom.Document" />
<xm:xml-to-output-handler-transformer name="xmlToOutputHandler" />

You can then reference them by name from endpoints:

<vm:inbound-endpoint name="testEndpoint" path="another.queue" connector-ref="vmConnector1" transformer-refs="DomToXml" />
...
<vm:outbound-endpoint ref="xml-dom-out" transformer-refs="xmlToDom" />
...