SlideShare a Scribd company logo
MULE-XML transformation
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.
.
So, let us consider, we have the following XML payload as an
input to our application :-
<RootTag>
<name>Anirban Sen Chowdhary</name>
<id>37</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>Anirban Sen Chowdhary</name>
<id>37</id>
<designation>Director</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.
How to transform or modify a XML
payload in Mule ??
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 :-
After that, we are setting the designation variable with a value,
which will be passed into our XSLT, and it will be adding it there
as a node called designation. So, the XML output coming after
XSLT will be the modified/transformed XML containing additional
node called designation.
The XSL file here named as Transform.xsl should be kept under
src/main/resources folder and the xsl file will be as following :-
The graphical representation of this flow will be as follows :-
Testing our application ……
Now, we are done with our coding and will deploy our application
and test it.
Once deployed on Mule server, we can test our application using
RestClient or any other client you wish.
once we click the send button we will get the following response in
our client from our Mule flow :-
Conclusion
So, you can find transforming or modifying a XML payload into
another XML format is extremely easy in Mule using the XSLT .
And that means you can design your output XML payload in any
format you require using XSLT easily in your Mule flow and Mule
also support this by it’s XSLT transformer !!!
That’s all !!! I’ve hopefully been clear enough in displaying the
implementation of XSLT and XSLT transformer in designing and
modifying your XML payload which you can produce as an output
from your Mule application.
I hope you liked this !!!
Hope you enjoyed the simple yet an amazing trick in Mule
You can also find this post here :- http://bushorn.com/xml-to-xml-
transformation-in-mule/
Mule xml transformation

More Related Content

What's hot

Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
F K
 
File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
Sudha Ch
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
mdfkhan625
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
Anirban Sen Chowdhary
 
Mulesoft http connector
Mulesoft http connectorMulesoft http connector
Mulesoft http connector
kumar gaurav
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
Anirban Sen Chowdhary
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
Anirban Sen Chowdhary
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
Anirban Sen Chowdhary
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
Shahid Shaik
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
Praneethchampion
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
Anirban Sen Chowdhary
 

What's hot (13)

Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
 
Mulesoft http connector
Mulesoft http connectorMulesoft http connector
Mulesoft http connector
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
 

Similar to Mule xml transformation

Xml transform
Xml transformXml transform
Xml transform
Son Nguyen
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Mohammed625
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
javeed_mhd
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
Son Nguyen
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Davide Rapacciuolo
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Germano Barba
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Davide Rapacciuolo
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
javeed_mhd
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
AbdulImrankhan7
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in mule
Khan625
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
mdfkhan625
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
Rajkattamuri
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
Sunil Komarapu
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
Shahid Shaik
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
Hasan Syed
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Domenico Schiavone
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Davide Rapacciuolo
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Antonio Pellegrino
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Germano Barba
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Davide Rapacciuolo
 

Similar to Mule xml transformation (20)

Xml transform
Xml transformXml transform
Xml transform
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 

More from D.Rajesh Kumar

Mule soft meetup_-_finland_september_25th__2020 v2.0
Mule soft meetup_-_finland_september_25th__2020 v2.0Mule soft meetup_-_finland_september_25th__2020 v2.0
Mule soft meetup_-_finland_september_25th__2020 v2.0
D.Rajesh Kumar
 
Meetup bangalore-sept5th 2020 (1)
Meetup bangalore-sept5th 2020 (1)Meetup bangalore-sept5th 2020 (1)
Meetup bangalore-sept5th 2020 (1)
D.Rajesh Kumar
 
Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020
D.Rajesh Kumar
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
D.Rajesh Kumar
 
Meetup bangalore 9_novupdated
Meetup bangalore 9_novupdatedMeetup bangalore 9_novupdated
Meetup bangalore 9_novupdated
D.Rajesh Kumar
 
Meetup bangalore aug31st2019
Meetup bangalore aug31st2019Meetup bangalore aug31st2019
Meetup bangalore aug31st2019
D.Rajesh Kumar
 
Meetup bangalore june29th2019
Meetup bangalore june29th2019Meetup bangalore june29th2019
Meetup bangalore june29th2019
D.Rajesh Kumar
 
mulesoft meetup @ bangalore
mulesoft meetup @ bangaloremulesoft meetup @ bangalore
mulesoft meetup @ bangalore
D.Rajesh Kumar
 
Meetup_Bangalore_Rajesh
Meetup_Bangalore_RajeshMeetup_Bangalore_Rajesh
Meetup_Bangalore_Rajesh
D.Rajesh Kumar
 
Calico and container
Calico and containerCalico and container
Calico and container
D.Rajesh Kumar
 
Calico docker+ipam
Calico docker+ipamCalico docker+ipam
Calico docker+ipam
D.Rajesh Kumar
 
Calico architecture
Calico architectureCalico architecture
Calico architecture
D.Rajesh Kumar
 
Calico to secure host interfaces
Calico to secure host interfacesCalico to secure host interfaces
Calico to secure host interfaces
D.Rajesh Kumar
 
Calico and how interprets neutron api
Calico and how interprets neutron apiCalico and how interprets neutron api
Calico and how interprets neutron api
D.Rajesh Kumar
 
Calico with open stack and chef
Calico with open stack and chefCalico with open stack and chef
Calico with open stack and chef
D.Rajesh Kumar
 
Calico with open stack
Calico with open stackCalico with open stack
Calico with open stack
D.Rajesh Kumar
 
Calico with docker
Calico with dockerCalico with docker
Calico with docker
D.Rajesh Kumar
 
Object Store in Mule
Object Store in MuleObject Store in Mule
Object Store in Mule
D.Rajesh Kumar
 
Slack connector with in MULE
Slack connector with in MULESlack connector with in MULE
Slack connector with in MULE
D.Rajesh Kumar
 
MuleSoft Offers a Data Migration Solution
MuleSoft Offers a Data Migration SolutionMuleSoft Offers a Data Migration Solution
MuleSoft Offers a Data Migration Solution
D.Rajesh Kumar
 

More from D.Rajesh Kumar (20)

Mule soft meetup_-_finland_september_25th__2020 v2.0
Mule soft meetup_-_finland_september_25th__2020 v2.0Mule soft meetup_-_finland_september_25th__2020 v2.0
Mule soft meetup_-_finland_september_25th__2020 v2.0
 
Meetup bangalore-sept5th 2020 (1)
Meetup bangalore-sept5th 2020 (1)Meetup bangalore-sept5th 2020 (1)
Meetup bangalore-sept5th 2020 (1)
 
Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
 
Meetup bangalore 9_novupdated
Meetup bangalore 9_novupdatedMeetup bangalore 9_novupdated
Meetup bangalore 9_novupdated
 
Meetup bangalore aug31st2019
Meetup bangalore aug31st2019Meetup bangalore aug31st2019
Meetup bangalore aug31st2019
 
Meetup bangalore june29th2019
Meetup bangalore june29th2019Meetup bangalore june29th2019
Meetup bangalore june29th2019
 
mulesoft meetup @ bangalore
mulesoft meetup @ bangaloremulesoft meetup @ bangalore
mulesoft meetup @ bangalore
 
Meetup_Bangalore_Rajesh
Meetup_Bangalore_RajeshMeetup_Bangalore_Rajesh
Meetup_Bangalore_Rajesh
 
Calico and container
Calico and containerCalico and container
Calico and container
 
Calico docker+ipam
Calico docker+ipamCalico docker+ipam
Calico docker+ipam
 
Calico architecture
Calico architectureCalico architecture
Calico architecture
 
Calico to secure host interfaces
Calico to secure host interfacesCalico to secure host interfaces
Calico to secure host interfaces
 
Calico and how interprets neutron api
Calico and how interprets neutron apiCalico and how interprets neutron api
Calico and how interprets neutron api
 
Calico with open stack and chef
Calico with open stack and chefCalico with open stack and chef
Calico with open stack and chef
 
Calico with open stack
Calico with open stackCalico with open stack
Calico with open stack
 
Calico with docker
Calico with dockerCalico with docker
Calico with docker
 
Object Store in Mule
Object Store in MuleObject Store in Mule
Object Store in Mule
 
Slack connector with in MULE
Slack connector with in MULESlack connector with in MULE
Slack connector with in MULE
 
MuleSoft Offers a Data Migration Solution
MuleSoft Offers a Data Migration SolutionMuleSoft Offers a Data Migration Solution
MuleSoft Offers a Data Migration Solution
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Mule xml transformation

  • 2. 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.
  • 3. . So, let us consider, we have the following XML payload as an input to our application :- <RootTag> <name>Anirban Sen Chowdhary</name> <id>37</id> </RootTag>
  • 4. 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>Anirban Sen Chowdhary</name> <id>37</id> <designation>Director</designation> </RootTag>
  • 5. 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.
  • 6. How to transform or modify a XML payload in Mule ??
  • 7. 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 :-
  • 8. After that, we are setting the designation variable with a value, which will be passed into our XSLT, and it will be adding it there as a node called designation. So, the XML output coming after XSLT will be the modified/transformed XML containing additional node called designation. The XSL file here named as Transform.xsl should be kept under src/main/resources folder and the xsl file will be as following :-
  • 9. The graphical representation of this flow will be as follows :-
  • 11. Now, we are done with our coding and will deploy our application and test it. Once deployed on Mule server, we can test our application using RestClient or any other client you wish.
  • 12. once we click the send button we will get the following response in our client from our Mule flow :-
  • 14. So, you can find transforming or modifying a XML payload into another XML format is extremely easy in Mule using the XSLT . And that means you can design your output XML payload in any format you require using XSLT easily in your Mule flow and Mule also support this by it’s XSLT transformer !!! That’s all !!! I’ve hopefully been clear enough in displaying the implementation of XSLT and XSLT transformer in designing and modifying your XML payload which you can produce as an output from your Mule application. I hope you liked this !!!
  • 15. Hope you enjoyed the simple yet an amazing trick in Mule You can also find this post here :- http://bushorn.com/xml-to-xml- transformation-in-mule/