SlideShare a Scribd company logo
XML to XML transformation in Mule
As we know, there can be multiple types of payload
we need to deal daily, starting from JSON, XML or
String, we also require different type of data
transformation in our application like XML to JSON,
JSON to XML or String etc . In Mule application, we
have a various set of transformers that we can use
to obtain our required data format.
Today we will be discussing on transformation
of XML to XML format of data.
Yuo will realize how easy it is to perform such type
of transformation in Mule. Here we will take the
same example, but will be doing it on XML instead
of JSON this time.
So, let us consider, we have the following XML
payload as an input to our application
<RootTag>
<name>Walter White</name>
<id>55</id>
</RootTag>
We can see here the XML contains only 2 elements,
that is name and id.
So, now if this XML data is coming as an input and we
require to transform/modify the payload into another
XML format and produce it as an output, something
like the following:
<RootTag>
<name>Walter White</name>
<id>55</id>
<designation>Manager</designation>
</RootTag>
And here you can see the modified XML has a new
element designation as a third element . Now,
the challenge here is to modify the existing input
XML payload and to design an output XML payload from
it, which will contain this additional element in it with
the same format.
So, how can we transform/modify the payload into
another XML format in an easy way. We know Mule has
extremely powerful tools called Datamapper but that
limited to Mule enterprise edition.
A simple way of doing it is using XSLT in Mule. Mule
do have XSLT support in it’s flow, which makes the
life of a developer easy
in transforming/modifying XML in the required
format.
So, here is the Mule flow which can be use to
transform XML payload from one format to another
using XSLT
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/xml
http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0"
port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="transformationxmltoxmlFlow">
<http:listener config-
ref="HTTP_Listener_Configuration" path="/xmltest"
doc:name="HTTP"/>
<set-variable variableName="designation"
value="Manager" doc:name="Variable"/>
<mulexml:xslt-transformer xsl-file="C:2016CORSO
MULESOFTexample.xsl" maxIdleTransformers="2"
maxActiveTransformers="5" doc:name="XSLT"
mimeType="application/xml">
<mulexml:context-property key="designation"
value="#[flowVars.designation]"/>
</mulexml:xslt-transformer>
<logger level="INFO" message="Output: #['n' +
message.payload]" doc:name="Logger"/>
</flow>
</mule>
The graphical representation of this flow will be as follows

More Related Content

PPTX
Xml to xml transformation in mule
Germano Barba
Ā 
PPTX
Xml to xml transformation in mule
Davide Rapacciuolo
Ā 
PPTX
Xml transform
Son Nguyen
Ā 
PPTX
Xml to xml transformation in mule
Domenico Schiavone
Ā 
PPT
Exchange 2010-recover-notes
jackppt408
Ā 
PPTX
Mule esb How to use Jackson in Object to Json converter
Raffaela Vitiello
Ā 
PPT
Ok 5 float
lembayungtirta
Ā 
PDF
Superior currency tips for intelligent trades
Niharika Jain
Ā 
Xml to xml transformation in mule
Germano Barba
Ā 
Xml to xml transformation in mule
Davide Rapacciuolo
Ā 
Xml transform
Son Nguyen
Ā 
Xml to xml transformation in mule
Domenico Schiavone
Ā 
Exchange 2010-recover-notes
jackppt408
Ā 
Mule esb How to use Jackson in Object to Json converter
Raffaela Vitiello
Ā 
Ok 5 float
lembayungtirta
Ā 
Superior currency tips for intelligent trades
Niharika Jain
Ā 

Viewers also liked (7)

PPTX
Airforce
Saqibahmadiqbal
Ā 
PPT
Ok 8 perkalian
lembayungtirta
Ā 
PPTX
Mule esb object_to_json
Davide Rapacciuolo
Ā 
PPT
Ok 6 alu
lembayungtirta
Ā 
PPTX
Mule esb object_to_json
Davide Rapacciuolo
Ā 
DOC
Soal essai orkom 09
lembayungtirta
Ā 
PPT
Ok 10 org cpu
lembayungtirta
Ā 
Airforce
Saqibahmadiqbal
Ā 
Ok 8 perkalian
lembayungtirta
Ā 
Mule esb object_to_json
Davide Rapacciuolo
Ā 
Ok 6 alu
lembayungtirta
Ā 
Mule esb object_to_json
Davide Rapacciuolo
Ā 
Soal essai orkom 09
lembayungtirta
Ā 
Ok 10 org cpu
lembayungtirta
Ā 
Ad

Similar to Xml to xml transformation in mule (20)

PPTX
Xml to xml transformation in mule
javeed_mhd
Ā 
PPTX
Xml to xml transformation in mule
Rajkattamuri
Ā 
PPTX
Xml to xml transformation in mule
Mohammed625
Ā 
PPTX
Xml to xml transformation in mule
mdfkhan625
Ā 
PPTX
Mule xml transformation
D.Rajesh Kumar
Ā 
PPTX
Xml to xml transformation
Son Nguyen
Ā 
PPTX
Xslt with mule
Son Nguyen
Ā 
PPTX
Using XSLT in Mule
Anirban Sen Chowdhary
Ā 
PPTX
Xslt in mule
irfan1008
Ā 
PPTX
Xml toobjectesbtransform
Domenico Schiavone
Ā 
PPTX
Xslt in mule
Sunil Komarapu
Ā 
PPTX
Xslt in mule
Shahid Shaik
Ā 
PPTX
Xslt in mule
Mohammed246
Ā 
PPTX
Xslt in mule
Hasan Syed
Ā 
PPTX
Using xslt in mule
Khan625
Ā 
PPTX
Using xslt in mule
javeed_mhd
Ā 
PPTX
Using xslt in mule
Rajkattamuri
Ā 
PPTX
xslt in mule
Praneethchampion
Ā 
PPTX
Using xslt in mule
mdfkhan625
Ā 
PPTX
Using xslt in mule
AbdulImrankhan7
Ā 
Xml to xml transformation in mule
javeed_mhd
Ā 
Xml to xml transformation in mule
Rajkattamuri
Ā 
Xml to xml transformation in mule
Mohammed625
Ā 
Xml to xml transformation in mule
mdfkhan625
Ā 
Mule xml transformation
D.Rajesh Kumar
Ā 
Xml to xml transformation
Son Nguyen
Ā 
Xslt with mule
Son Nguyen
Ā 
Using XSLT in Mule
Anirban Sen Chowdhary
Ā 
Xslt in mule
irfan1008
Ā 
Xml toobjectesbtransform
Domenico Schiavone
Ā 
Xslt in mule
Sunil Komarapu
Ā 
Xslt in mule
Shahid Shaik
Ā 
Xslt in mule
Mohammed246
Ā 
Xslt in mule
Hasan Syed
Ā 
Using xslt in mule
Khan625
Ā 
Using xslt in mule
javeed_mhd
Ā 
Using xslt in mule
Rajkattamuri
Ā 
xslt in mule
Praneethchampion
Ā 
Using xslt in mule
mdfkhan625
Ā 
Using xslt in mule
AbdulImrankhan7
Ā 
Ad

More from Davide Rapacciuolo (20)

PPTX
Muleesbobjecttojson
Davide Rapacciuolo
Ā 
PPTX
Mule esb db_2
Davide Rapacciuolo
Ā 
PPTX
Mule esb db_1
Davide Rapacciuolo
Ā 
PPTX
Consuming raml
Davide Rapacciuolo
Ā 
PPTX
Transf from csv to xml
Davide Rapacciuolo
Ā 
PPTX
Esb choice flow
Davide Rapacciuolo
Ā 
PPTX
Transformation xmltoobjectesb
Davide Rapacciuolo
Ā 
PPTX
Transformation jsontoxmlesb
Davide Rapacciuolo
Ā 
PPTX
Transformation jsontojsonesb
Davide Rapacciuolo
Ā 
PPTX
Transformation csvtoxml
Davide Rapacciuolo
Ā 
PPTX
Rest fullservices
Davide Rapacciuolo
Ā 
PPTX
Mule esb object_to_jackson_json
Davide Rapacciuolo
Ā 
PPTX
Mule esb expression_filter
Davide Rapacciuolo
Ā 
PPTX
Mule esb collection_splitter
Davide Rapacciuolo
Ā 
PPTX
Mule esb soap_service
Davide Rapacciuolo
Ā 
PPTX
Transformation xmltoobjectesb
Davide Rapacciuolo
Ā 
PPTX
Transformation jsontoxmlesb
Davide Rapacciuolo
Ā 
PPTX
Mule esb csv_to_json
Davide Rapacciuolo
Ā 
PPTX
Json to json transformation in mule
Davide Rapacciuolo
Ā 
PPTX
Mule esb json_to_object
Davide Rapacciuolo
Ā 
Muleesbobjecttojson
Davide Rapacciuolo
Ā 
Mule esb db_2
Davide Rapacciuolo
Ā 
Mule esb db_1
Davide Rapacciuolo
Ā 
Consuming raml
Davide Rapacciuolo
Ā 
Transf from csv to xml
Davide Rapacciuolo
Ā 
Esb choice flow
Davide Rapacciuolo
Ā 
Transformation xmltoobjectesb
Davide Rapacciuolo
Ā 
Transformation jsontoxmlesb
Davide Rapacciuolo
Ā 
Transformation jsontojsonesb
Davide Rapacciuolo
Ā 
Transformation csvtoxml
Davide Rapacciuolo
Ā 
Rest fullservices
Davide Rapacciuolo
Ā 
Mule esb object_to_jackson_json
Davide Rapacciuolo
Ā 
Mule esb expression_filter
Davide Rapacciuolo
Ā 
Mule esb collection_splitter
Davide Rapacciuolo
Ā 
Mule esb soap_service
Davide Rapacciuolo
Ā 
Transformation xmltoobjectesb
Davide Rapacciuolo
Ā 
Transformation jsontoxmlesb
Davide Rapacciuolo
Ā 
Mule esb csv_to_json
Davide Rapacciuolo
Ā 
Json to json transformation in mule
Davide Rapacciuolo
Ā 
Mule esb json_to_object
Davide Rapacciuolo
Ā 

Recently uploaded (20)

PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
Ā 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
Ā 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
Ā 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
Ā 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
PPTX
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
Ā 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
Ā 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
Ā 
PDF
This slide provides an overview Technology
mineshkharadi333
Ā 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
Ā 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
Ā 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
Ā 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
Ā 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
Ā 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
Ā 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
Ā 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
Ā 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
Ā 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
Ā 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
Ā 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
Ā 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
Ā 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
Ā 
This slide provides an overview Technology
mineshkharadi333
Ā 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
Ā 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
Ā 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
Ā 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
Ā 
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
Coupa-Overview _Assumptions presentation
annapureddyn
Ā 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
Ā 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
Ā 

Xml to xml transformation in mule