My requirement is to (efficiently) read an XML file using streams (Stax) instead of loading the whole DOM in memory (JAXB).
Anyone knows how to process an XML using the XmlToXMLStreamReader?
As usual Mule documentation is extremely frugal.
I have a
<custom-transformer class="org.mule.module.xml.transformer.XmlToXMLStreamReader"/>
in my flow. Now what?
How can I process a start tag at a time?
What kind of payload it generates? In the debugger, I can see that it is a org.mule.module.xml.util.XMLUtils. I thought I would get a Stax XmlStreamReader.
Any help/example would be much appreciated.
The org.mule.module.xml.transformer.XmlToXMLStreamReader
transforms the current payload into a javax.xml.stream.XMLStreamReader
. Now it's up to you to add another custom transformer/component to do something with this XMLStreamReader
.