Search code examples
xmlmuleesb

How to split message from flow using spliter in mule esb


My xml is:

<root>
    <log>
    
        <age>name,order</age>
        <name>tetsMessage</name>
    </log>
    <log>
        <age>name,order</age>
        <name>tetsMessage</name>
    </log> 
     <log>
        <age>name,order</age>
        <name>tetsMessage</name>
    </log>
 
   
</root>

how can i use spliter in mule to get as seperate xml and sent for further transaction in the flow


Solution

  • Use a splitter with an XPath MEL expression:

    <splitter expression="#[xpath('//root/log')]"/>
    

    More on MEL and Xpath: http://www.mulesoft.org/documentation/display/current/Mule+Expression+Language+MEL