SlideShare a Scribd company logo
1 of 11
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>Sebastian Ritch</name>
<id>60</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>Sebastian Ritch</name>
<id>60</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

Viewers also liked

Búsqueda en la base de datos Dialnet
Búsqueda en la base de datos DialnetBúsqueda en la base de datos Dialnet
Búsqueda en la base de datos DialnetMaría Santana
 
Trc Public Sector Brochure
Trc Public Sector BrochureTrc Public Sector Brochure
Trc Public Sector BrochureElly_Rose91
 
Mule esb object_to_jackson_json
Mule esb object_to_jackson_jsonMule esb object_to_jackson_json
Mule esb object_to_jackson_jsonDavide Rapacciuolo
 
Petición de ribas para poder presenciar la audiencia
Petición de ribas para poder presenciar la audienciaPetición de ribas para poder presenciar la audiencia
Petición de ribas para poder presenciar la audienciacasobelsunce
 
Shyanne vocabulary
Shyanne vocabularyShyanne vocabulary
Shyanne vocabularylalaprincess
 
Challenge assumption3
Challenge assumption3Challenge assumption3
Challenge assumption3sabirsss
 
Cómo introducir datos en SPSS
Cómo introducir datos en SPSSCómo introducir datos en SPSS
Cómo introducir datos en SPSSMaría Santana
 
MAGDA ZORAIDA CELY ROJAS
MAGDA ZORAIDA CELY ROJASMAGDA ZORAIDA CELY ROJAS
MAGDA ZORAIDA CELY ROJASdcpe2014
 
Cognitive Analysis With SparkSecure
Cognitive Analysis With SparkSecureCognitive Analysis With SparkSecure
Cognitive Analysis With SparkSecureSparkCognition
 
Classification of hormones and their mechanism of action
Classification of hormones and their mechanism of actionClassification of hormones and their mechanism of action
Classification of hormones and their mechanism of actionDr. Muhammad Awais
 
Desert adaptations
Desert adaptationsDesert adaptations
Desert adaptationssafa-medaney
 
Journey to the end of the earth
Journey to the end of the earthJourney to the end of the earth
Journey to the end of the earthBhavya Nidumukkala
 

Viewers also liked (16)

Búsqueda en la base de datos Dialnet
Búsqueda en la base de datos DialnetBúsqueda en la base de datos Dialnet
Búsqueda en la base de datos Dialnet
 
Trc Public Sector Brochure
Trc Public Sector BrochureTrc Public Sector Brochure
Trc Public Sector Brochure
 
Mule esb object_to_jackson_json
Mule esb object_to_jackson_jsonMule esb object_to_jackson_json
Mule esb object_to_jackson_json
 
Paragraph1
Paragraph1Paragraph1
Paragraph1
 
Petición de ribas para poder presenciar la audiencia
Petición de ribas para poder presenciar la audienciaPetición de ribas para poder presenciar la audiencia
Petición de ribas para poder presenciar la audiencia
 
Shyanne vocabulary
Shyanne vocabularyShyanne vocabulary
Shyanne vocabulary
 
Challenge assumption3
Challenge assumption3Challenge assumption3
Challenge assumption3
 
Cómo introducir datos en SPSS
Cómo introducir datos en SPSSCómo introducir datos en SPSS
Cómo introducir datos en SPSS
 
Ok 11 operasi cpu
Ok 11 operasi  cpuOk 11 operasi  cpu
Ok 11 operasi cpu
 
MAGDA ZORAIDA CELY ROJAS
MAGDA ZORAIDA CELY ROJASMAGDA ZORAIDA CELY ROJAS
MAGDA ZORAIDA CELY ROJAS
 
Crisis del software
Crisis del softwareCrisis del software
Crisis del software
 
Cognitive Analysis With SparkSecure
Cognitive Analysis With SparkSecureCognitive Analysis With SparkSecure
Cognitive Analysis With SparkSecure
 
Classification of hormones and their mechanism of action
Classification of hormones and their mechanism of actionClassification of hormones and their mechanism of action
Classification of hormones and their mechanism of action
 
Desert adaptations
Desert adaptationsDesert adaptations
Desert adaptations
 
Journey to the end of the earth
Journey to the end of the earthJourney to the end of the earth
Journey to the end of the earth
 
Postpartum management of mare
Postpartum management of marePostpartum management of mare
Postpartum management of mare
 

Similar to 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 muleRajkattamuri
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulejaveed_mhd
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleMohammed625
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulemdfkhan625
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformationSon Nguyen
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformationD.Rajesh Kumar
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesbGermano Barba
 
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 mdfkhan625
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule Rajkattamuri
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in muleKhan625
 

Similar to Xml to xml transformation in mule (20)

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
 
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
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformation
 
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
 
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 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
 
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
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 

More from Davide Rapacciuolo (20)

Muleesbobjecttojson
Muleesbobjecttojson Muleesbobjecttojson
Muleesbobjecttojson
 
Mule esb db_2
Mule esb db_2Mule esb db_2
Mule esb db_2
 
Mule esb db_1
Mule esb db_1Mule esb db_1
Mule esb db_1
 
Consuming raml
Consuming ramlConsuming raml
Consuming raml
 
Transf from csv to xml
Transf from csv to xmlTransf from csv to xml
Transf from csv to xml
 
Esb choice flow
Esb choice flowEsb choice flow
Esb choice flow
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
 
Transformation csvtoxml
Transformation csvtoxmlTransformation csvtoxml
Transformation csvtoxml
 
Rest fullservices
Rest fullservicesRest fullservices
Rest fullservices
 
Mule esb object_to_json
Mule esb object_to_jsonMule esb object_to_json
Mule esb object_to_json
 
Mule esb expression_filter
Mule esb expression_filterMule esb expression_filter
Mule esb expression_filter
 
Mule esb collection_splitter
Mule esb collection_splitterMule esb collection_splitter
Mule esb collection_splitter
 
Mule esb soap_service
Mule esb soap_serviceMule esb soap_service
Mule esb soap_service
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Mule esb csv_to_json
Mule esb csv_to_jsonMule esb csv_to_json
Mule esb csv_to_json
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
 
Mule esb json_to_object
Mule esb json_to_objectMule esb json_to_object
Mule esb json_to_object
 
Mule esb object_to_json
Mule esb object_to_jsonMule esb object_to_json
Mule esb object_to_json
 
Mule esb file to-string flow
Mule esb file to-string flowMule esb file to-string flow
Mule esb file to-string flow
 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Xml to xml transformation in mule