SlideShare a Scribd company logo
XSLT with Mule
We often use XSLT in our application to transform XML
payload from one form to another . Mule also supports
XSLT in it’s application with XSLT-Transformer
component.
Before we start we must see what an XSLT actually is :-
As per XSLT definition :-
XSLT (Extensible Stylesheet Language Transformations) is a
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&g
t;ATS&lt;/Department&gt;&lt;Designation&gt;SSE&lt;/Designation&gt;&lt;/RootElem
ent&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

More Related Content

What's hot

File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
Sudha Ch
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
Mani Rathnam Gudi
 
File component in mule
File component in muleFile component in mule
File component in mule
Rajkattamuri
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
Anirban Sen Chowdhary
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
F K
 
Mulesoft http connector
Mulesoft http connectorMulesoft http connector
Mulesoft http connector
kumar gaurav
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
Son Nguyen
 
Mule XSLT Transformer
Mule XSLT TransformerMule XSLT Transformer
Mule XSLT Transformer
Ankush Sharma
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
Parameters as a part of body
Parameters as a part of bodyParameters as a part of body
Parameters as a part of body
Anirban Sen Chowdhary
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
Rajkattamuri
 
Mule requesterdemo
Mule requesterdemoMule requesterdemo
Mule requesterdemo
Anirban Sen Chowdhary
 

What's hot (13)

File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
Mulesoft http connector
Mulesoft http connectorMulesoft http connector
Mulesoft http connector
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Mule XSLT Transformer
Mule XSLT TransformerMule XSLT Transformer
Mule XSLT Transformer
 
Mule advanced
Mule advancedMule advanced
Mule advanced
 
Parameters as a part of body
Parameters as a part of bodyParameters as a part of body
Parameters as a part of body
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule requesterdemo
Mule requesterdemoMule requesterdemo
Mule requesterdemo
 

Viewers also liked

國內共同基金淨值
國內共同基金淨值國內共同基金淨值
國內共同基金淨值
經濟日報
 
федорино горе
федорино горефедорино горе
федорино горе
ds213
 
The Future of Personal Reinvention
The Future of Personal ReinventionThe Future of Personal Reinvention
The Future of Personal Reinvention
James Lee
 
Conceptuar la actividad financiera del estado venezolano
Conceptuar la actividad financiera del estado venezolanoConceptuar la actividad financiera del estado venezolano
Conceptuar la actividad financiera del estado venezolano
Jessica Delgado
 
Informe grupal dip saia b
Informe grupal dip saia bInforme grupal dip saia b
Informe grupal dip saia b
castorili33
 
Прогноз развития рынка теплоизоляционных материалов Украины
Прогноз развития рынка теплоизоляционных материалов УкраиныПрогноз развития рынка теплоизоляционных материалов Украины
Прогноз развития рынка теплоизоляционных материалов Украины
Agency of Industrial Marketing
 
ABSTRAXX “The Greatest Education is Struggle”
ABSTRAXX “The Greatest Education is Struggle”ABSTRAXX “The Greatest Education is Struggle”
ABSTRAXX “The Greatest Education is Struggle”
David Lewis Kyle
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
javeed_mhd
 
Kitonomics & Better Technology Education
Kitonomics & Better Technology EducationKitonomics & Better Technology Education
Kitonomics & Better Technology Education
JC Chang 張哲源
 
Ramas del derecho tributario investigacion
Ramas del derecho tributario investigacionRamas del derecho tributario investigacion
Ramas del derecho tributario investigacion
Jose Manuel Valera Guedez
 
$5 Trillion Economic Value at Stake: Digitization of Road Transportation
$5 Trillion Economic Value at Stake:  Digitization of Road Transportation $5 Trillion Economic Value at Stake:  Digitization of Road Transportation
$5 Trillion Economic Value at Stake: Digitization of Road Transportation
Andreas Mai
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in mule
Son Nguyen
 
Sokobanja, Sara Ostojić
Sokobanja,   Sara OstojićSokobanja,   Sara Ostojić
Sokobanja, Sara Ostojić
dvucen
 
Tarea 1 derecho internacional privado grecia rodriguez saia b
Tarea 1 derecho internacional privado grecia rodriguez saia bTarea 1 derecho internacional privado grecia rodriguez saia b
Tarea 1 derecho internacional privado grecia rodriguez saia b
castorili33
 
Cloud hub with mule
Cloud hub with muleCloud hub with mule
Cloud hub with mule
Son Nguyen
 
Query in share point by mule
Query in share point by muleQuery in share point by mule
Query in share point by mule
Son Nguyen
 
Ilicitos tributarios
Ilicitos tributariosIlicitos tributarios
Ilicitos tributarios
Graceland Maldonado
 
Tour10 venezuela - navarro
Tour10   venezuela - navarroTour10   venezuela - navarro
Tour10 venezuela - navarro
paulvillanueva01
 
Tour10 usa - fungo
Tour10   usa - fungoTour10   usa - fungo
Tour10 usa - fungo
paulvillanueva01
 

Viewers also liked (20)

國內共同基金淨值
國內共同基金淨值國內共同基金淨值
國內共同基金淨值
 
федорино горе
федорино горефедорино горе
федорино горе
 
The Future of Personal Reinvention
The Future of Personal ReinventionThe Future of Personal Reinvention
The Future of Personal Reinvention
 
Conceptuar la actividad financiera del estado venezolano
Conceptuar la actividad financiera del estado venezolanoConceptuar la actividad financiera del estado venezolano
Conceptuar la actividad financiera del estado venezolano
 
Informe grupal dip saia b
Informe grupal dip saia bInforme grupal dip saia b
Informe grupal dip saia b
 
Прогноз развития рынка теплоизоляционных материалов Украины
Прогноз развития рынка теплоизоляционных материалов УкраиныПрогноз развития рынка теплоизоляционных материалов Украины
Прогноз развития рынка теплоизоляционных материалов Украины
 
ABSTRAXX “The Greatest Education is Struggle”
ABSTRAXX “The Greatest Education is Struggle”ABSTRAXX “The Greatest Education is Struggle”
ABSTRAXX “The Greatest Education is Struggle”
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Kitonomics & Better Technology Education
Kitonomics & Better Technology EducationKitonomics & Better Technology Education
Kitonomics & Better Technology Education
 
Ramas del derecho tributario investigacion
Ramas del derecho tributario investigacionRamas del derecho tributario investigacion
Ramas del derecho tributario investigacion
 
$5 Trillion Economic Value at Stake: Digitization of Road Transportation
$5 Trillion Economic Value at Stake:  Digitization of Road Transportation $5 Trillion Economic Value at Stake:  Digitization of Road Transportation
$5 Trillion Economic Value at Stake: Digitization of Road Transportation
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in mule
 
Sokobanja, Sara Ostojić
Sokobanja,   Sara OstojićSokobanja,   Sara Ostojić
Sokobanja, Sara Ostojić
 
Tarea 1 derecho internacional privado grecia rodriguez saia b
Tarea 1 derecho internacional privado grecia rodriguez saia bTarea 1 derecho internacional privado grecia rodriguez saia b
Tarea 1 derecho internacional privado grecia rodriguez saia b
 
Cloud hub with mule
Cloud hub with muleCloud hub with mule
Cloud hub with mule
 
Query in share point by mule
Query in share point by muleQuery in share point by mule
Query in share point by mule
 
Ilicitos tributarios
Ilicitos tributariosIlicitos tributarios
Ilicitos tributarios
 
SteveResume[1]2008
SteveResume[1]2008SteveResume[1]2008
SteveResume[1]2008
 
Tour10 venezuela - navarro
Tour10   venezuela - navarroTour10   venezuela - navarro
Tour10 venezuela - navarro
 
Tour10 usa - fungo
Tour10   usa - fungoTour10   usa - fungo
Tour10 usa - fungo
 

Similar to Xslt with mule

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
 
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
 
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
mdfkhan625
 
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
 
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
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Davide Rapacciuolo
 
Xml toobjectesbtransform
Xml toobjectesbtransformXml toobjectesbtransform
Xml toobjectesbtransform
Domenico Schiavone
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Antonio Pellegrino
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
Germano Barba
 

Similar to Xslt with mule (20)

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
 
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
 
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
 
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
 
Xml toobjectesbtransform
Xml toobjectesbtransformXml toobjectesbtransform
Xml toobjectesbtransform
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 

More from Son Nguyen

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
Son Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
Son Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
Son Nguyen
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
Son Nguyen
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
Son Nguyen
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
Son Nguyen
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
Son Nguyen
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
Son Nguyen
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
Son Nguyen
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
Son Nguyen
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
Son Nguyen
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
Son Nguyen
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
Son Nguyen
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
Son Nguyen
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
Son Nguyen
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
Son Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
Son Nguyen
 
Jms queue
Jms queueJms queue
Jms queue
Son Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
Son Nguyen
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
Son Nguyen
 

More from Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Jms queue
Jms queueJms queue
Jms queue
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
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
 
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
 
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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
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
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
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
 
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 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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
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...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Xslt with mule

  • 2. We often use XSLT in our application to transform XML payload from one form to another . Mule also supports XSLT in it’s application with XSLT-Transformer component.
  • 3. Before we start we must see what an XSLT actually is :- As per XSLT definition :- XSLT (Extensible Stylesheet Language Transformations) is a 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
  • 4. 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
  • 5. 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 :-
  • 6. 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
  • 7. So set payload component contains the following payload :-
  • 8. 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&g t;ATS&lt;/Department&gt;&lt;Designation&gt;SSE&lt;/Designation&gt;&lt;/RootElem ent&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
  • 9. So, the file Transform.xslt should be in our src/main/resource folder
  • 10. 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>
  • 11. 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