Search code examples
mulemule-componentanypoint-studio

DOM to XML transformer logic


Can someone please explain to me why a DOM to XML transformer converts the output of a Web Service Consumer to an XML String representation? The output of the Web Service Consumer is a org.mule.module.ws.consumer.NamespaceRestorerXMLStreamReader.

According to the official docs:

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.

They refer to a W3C DOM object, which is to my knowledge the html DOM that is used in web browsers?

Thanks


Solution

  • It refers to a org.w3c.dom.Document which in Java can represent either HTML or XML. In Mule an XML is just a string containing the XML. You can use the DOM interface to operate in the XML nodes using Java APIs or the string XML when needed.