SlideShare a Scribd company logo
8
Most read
10
Most read
13
Most read
By Anirban Sen Chowdhary
Using XSLT in Mule
.
Here I will show you how ……
Before we start we must see what an XSLT actually is :-
As per XSLT definition :-
XSLT (Extensible Stylesheet Language Transformations) is a
language for transforming XML documents into other XML
documents, or other formats such as HTML for web
pages, plain text or into XSL Formatting Objects, which may
subsequently be converted to other formats, such
as PDF PostScript and PNG.
Source :- http://en.wikipedia.org/wiki/XSLT
So, XSLT can be use to transform one form of XML to another :-
Here you can see the XSLT is transforming the XML payload into
another XML
So, let us try this example in our Mule application
Here we will be using XSLT for transforming the XML payload into
another XML like below :-
So let’s consider we have a following flow in our Mule
application:-
As you can see we have used a Http inbound end point followed by
a set payload component and then XSLT transformer.
Here the set payload contain the XML that need to be transform
So set payload component contains the following payload
:-
Our corresponding Mule flow will be as follows :-
<flow name="xsltFlow1" doc:name="xsltFlow1">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8081" path="test" doc:name="HTTP"/>
<set-payload
value="&lt;RootElement&gt;&lt;Name&gt;Anirban&lt;/Name&gt;&lt;Department&gt;
ATS&lt;/Department&gt;&lt;Designation&gt;SSE&lt;/Designation&gt;&lt;/RootEleme
nt&gt;" doc:name="Set Payload"/>
<mulexml:xslt-transformer
maxIdleTransformers="2" maxActiveTransformers="5" outputEncoding="UTF-8"
doc:name="Transform from outer to inner" xsl-file="Transform.xslt"
encoding="UTF-8" returnClass="java.lang.String" />
</flow>
As you can see we are using XSLT file :- Transform.xslt
So, the file Transform.xslt
should be in our src/main/resource folder
The file Transform.xslt
Contains following code to transform :-
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:template match="/">
<NewRootElement>
<NewName>
<xsl:value-of select="RootElement/Name" />
</NewName>
<NewDepartment>
<xsl:value-of select="RootElement/Department" />
</NewDepartment>
<NewDesignation>
<xsl:value-of select="RootElement/Designation" />
</NewDesignation>
</NewRootElement>
</xsl:template>
</xsl:stylesheet>
To test the application we hit the url http://localhost:8081/test
in our browser and we get the following :-
And you can see the XML payload has been transferred to this new XML
Hope you enjoyed the simple yet an amazing trick in Mule
Using XSLT in Mule

More Related Content

What's hot (20)

PDF
Cloud Native Application
VMUG IT
 
PPTX
How to Enable LoB IT to Be Self-Sufficient with Integration
MuleSoft
 
PPTX
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
Kellton Tech Solutions Ltd
 
PDF
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
Angel Alberici
 
PPT
Mulesoft ppt
Achyuta Lakshmi
 
PDF
MuleSoft PKO - C4E and Platform Insights
Angel Alberici
 
PPTX
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Akshata Sawant
 
PPTX
Product Vision and Roadmap for Anypoint Platform
MuleSoft
 
PDF
Mule 4 migration + Common Integration Challenges : MuleSoft Virtual Muleys Me...
Angel Alberici
 
PPTX
Patna MuleSoft Meetup Anypoint Cloudhub 2.0
shyamraj55
 
PDF
Extending kubernetes with CustomResourceDefinitions
Stefan Schimanski
 
PPTX
On prem to cloud hub migration (updated)
Sandeep Deshmukh
 
PDF
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Angel Alberici
 
PDF
Virtual meetup - Exploring the Runtime Fabric deployment model
Jimmy Attia
 
PDF
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
DevOps.com
 
PPTX
RabbitMQ & Kafka
VMware Tanzu
 
PDF
API Management within a Microservice Architecture
WSO2
 
PDF
Microservices in Practice
Kasun Indrasiri
 
PPTX
Introduction to Microservices
MahmoudZidan41
 
Cloud Native Application
VMUG IT
 
How to Enable LoB IT to Be Self-Sufficient with Integration
MuleSoft
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
Kellton Tech Solutions Ltd
 
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
Angel Alberici
 
Mulesoft ppt
Achyuta Lakshmi
 
MuleSoft PKO - C4E and Platform Insights
Angel Alberici
 
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Akshata Sawant
 
Product Vision and Roadmap for Anypoint Platform
MuleSoft
 
Mule 4 migration + Common Integration Challenges : MuleSoft Virtual Muleys Me...
Angel Alberici
 
Patna MuleSoft Meetup Anypoint Cloudhub 2.0
shyamraj55
 
Extending kubernetes with CustomResourceDefinitions
Stefan Schimanski
 
On prem to cloud hub migration (updated)
Sandeep Deshmukh
 
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Angel Alberici
 
Virtual meetup - Exploring the Runtime Fabric deployment model
Jimmy Attia
 
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
DevOps.com
 
RabbitMQ & Kafka
VMware Tanzu
 
API Management within a Microservice Architecture
WSO2
 
Microservices in Practice
Kasun Indrasiri
 
Introduction to Microservices
MahmoudZidan41
 

Viewers also liked (14)

PPTX
Mule Choice component
AbdulImrankhan7
 
PPTX
Converting with custom transformer
Anirban Sen Chowdhary
 
PPTX
Converting with custom transformer part 2
Anirban Sen Chowdhary
 
PPTX
Scatter gather flow in mule
Praneethchampion
 
PPTX
Scatter gather in mule
Anirban Sen Chowdhary
 
PPT
Mule overview-ppt
Prabhat gangwar
 
PDF
Mule ESB Examples
Raj Tomar
 
PPTX
Cloud hub with mule
Son Nguyen
 
PPTX
Mule with rabbitmq
Anirban Sen Chowdhary
 
PPTX
Deploying and running in mule standalone
Anirban Sen Chowdhary
 
PPTX
Splitting with mule
Anirban Sen Chowdhary
 
PDF
Mule esb presentation
Lakshmi Prasanna Mavillapalli
 
PPTX
Using groovy in mule
Son Nguyen
 
PPTX
Simple groovy example in mule
Anirban Sen Chowdhary
 
Mule Choice component
AbdulImrankhan7
 
Converting with custom transformer
Anirban Sen Chowdhary
 
Converting with custom transformer part 2
Anirban Sen Chowdhary
 
Scatter gather flow in mule
Praneethchampion
 
Scatter gather in mule
Anirban Sen Chowdhary
 
Mule overview-ppt
Prabhat gangwar
 
Mule ESB Examples
Raj Tomar
 
Cloud hub with mule
Son Nguyen
 
Mule with rabbitmq
Anirban Sen Chowdhary
 
Deploying and running in mule standalone
Anirban Sen Chowdhary
 
Splitting with mule
Anirban Sen Chowdhary
 
Mule esb presentation
Lakshmi Prasanna Mavillapalli
 
Using groovy in mule
Son Nguyen
 
Simple groovy example in mule
Anirban Sen Chowdhary
 
Ad

Similar to Using XSLT in Mule (20)

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

More from Anirban Sen Chowdhary (20)

PPTX
Change the game with Game changer
Anirban Sen Chowdhary
 
PPTX
Ring central desktop app overview
Anirban Sen Chowdhary
 
PPTX
Overview in ringcentral digital line
Anirban Sen Chowdhary
 
PPTX
Some basics with ring central
Anirban Sen Chowdhary
 
PPTX
Ring central and python
Anirban Sen Chowdhary
 
PPTX
RingCentral application development overview
Anirban Sen Chowdhary
 
PPTX
Cloze connect ringcentral
Anirban Sen Chowdhary
 
PPTX
Overview on ring central errors part 4
Anirban Sen Chowdhary
 
PPTX
Setting up your ring central sandbox in steps
Anirban Sen Chowdhary
 
PPTX
Overview on ring central errors: part 2
Anirban Sen Chowdhary
 
PPTX
Overview on ring central errors
Anirban Sen Chowdhary
 
PPTX
Call recording overview ring central
Anirban Sen Chowdhary
 
PPTX
Ring central engaging with amazon alexa
Anirban Sen Chowdhary
 
PPTX
How ring central sdk changing the game
Anirban Sen Chowdhary
 
PPTX
When ring central connect salesforce
Anirban Sen Chowdhary
 
PPTX
Mule 4 connecting ring central
Anirban Sen Chowdhary
 
PPTX
Ring central sdk
Anirban Sen Chowdhary
 
PPTX
Ring central with okta
Anirban Sen Chowdhary
 
PPTX
Ring central connecting salesforce overview
Anirban Sen Chowdhary
 
PPTX
Ring central call logs overview (part 2)
Anirban Sen Chowdhary
 
Change the game with Game changer
Anirban Sen Chowdhary
 
Ring central desktop app overview
Anirban Sen Chowdhary
 
Overview in ringcentral digital line
Anirban Sen Chowdhary
 
Some basics with ring central
Anirban Sen Chowdhary
 
Ring central and python
Anirban Sen Chowdhary
 
RingCentral application development overview
Anirban Sen Chowdhary
 
Cloze connect ringcentral
Anirban Sen Chowdhary
 
Overview on ring central errors part 4
Anirban Sen Chowdhary
 
Setting up your ring central sandbox in steps
Anirban Sen Chowdhary
 
Overview on ring central errors: part 2
Anirban Sen Chowdhary
 
Overview on ring central errors
Anirban Sen Chowdhary
 
Call recording overview ring central
Anirban Sen Chowdhary
 
Ring central engaging with amazon alexa
Anirban Sen Chowdhary
 
How ring central sdk changing the game
Anirban Sen Chowdhary
 
When ring central connect salesforce
Anirban Sen Chowdhary
 
Mule 4 connecting ring central
Anirban Sen Chowdhary
 
Ring central sdk
Anirban Sen Chowdhary
 
Ring central with okta
Anirban Sen Chowdhary
 
Ring central connecting salesforce overview
Anirban Sen Chowdhary
 
Ring central call logs overview (part 2)
Anirban Sen Chowdhary
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 

Using XSLT in Mule

  • 1. By Anirban Sen Chowdhary
  • 3. .
  • 4. Here I will show you how ……
  • 5. Before we start we must see what an XSLT actually is :- As per XSLT definition :- XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or into XSL Formatting Objects, which may subsequently be converted to other formats, such as PDF PostScript and PNG. Source :- http://en.wikipedia.org/wiki/XSLT
  • 6. So, XSLT can be use to transform one form of XML to another :- Here you can see the XSLT is transforming the XML payload into another XML
  • 7. So, let us try this example in our Mule application Here we will be using XSLT for transforming the XML payload into another XML like below :-
  • 8. So let’s consider we have a following flow in our Mule application:- As you can see we have used a Http inbound end point followed by a set payload component and then XSLT transformer. Here the set payload contain the XML that need to be transform
  • 9. So set payload component contains the following payload :-
  • 10. Our corresponding Mule flow will be as follows :- <flow name="xsltFlow1" doc:name="xsltFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test" doc:name="HTTP"/> <set-payload value="&lt;RootElement&gt;&lt;Name&gt;Anirban&lt;/Name&gt;&lt;Department&gt; ATS&lt;/Department&gt;&lt;Designation&gt;SSE&lt;/Designation&gt;&lt;/RootEleme nt&gt;" doc:name="Set Payload"/> <mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" outputEncoding="UTF-8" doc:name="Transform from outer to inner" xsl-file="Transform.xslt" encoding="UTF-8" returnClass="java.lang.String" /> </flow> As you can see we are using XSLT file :- Transform.xslt
  • 11. So, the file Transform.xslt should be in our src/main/resource folder
  • 12. The file Transform.xslt Contains following code to transform :- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes" /> <xsl:template match="/"> <NewRootElement> <NewName> <xsl:value-of select="RootElement/Name" /> </NewName> <NewDepartment> <xsl:value-of select="RootElement/Department" /> </NewDepartment> <NewDesignation> <xsl:value-of select="RootElement/Designation" /> </NewDesignation> </NewRootElement> </xsl:template> </xsl:stylesheet>
  • 13. To test the application we hit the url http://localhost:8081/test in our browser and we get the following :- And you can see the XML payload has been transferred to this new XML
  • 14. Hope you enjoyed the simple yet an amazing trick in Mule