Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

DOM to XML Transformer

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.

xslt: Unexpected program error: java.lang.NullPointerException

xslt: Unexpected program error: java.lang.NullPointerException

xslt: Unexpected program error: java.lang.NullPointerException

Example

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


         
      
1
2
3
<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:


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

In this topic: