SlideShare a Scribd company logo
CSV to XML transformation in Mule
Today we will be discussing on transformation
of CSV to XML format of data.
The configuration details for each of the Mule flow
component is explained below.
The first component of the flow is File Endpoint.
The File endpoint is configured to pick up files from specific
location and on completion of processing move it to a pre-
defined location. The developer is free to choose location as
per his/her convenience.
For our demonstration, in the General tab, configure the
following
Path –
C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs
vtoxmlsrctestresourcesinput
Move to Directory – C:MuleStudioFileOutbound g
properties with specified values:
Move to Directory –
C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs
vtoxmlsrctestresourcesoutput
The next component is logger. The message property value of
the logger component defines the logging statement. In the
General tab, configure the following.
Message – #[string: output #[message]]
The message object provides developer with insights
regarding message’s meta-data.
The contents of the file read by the File endpoint component
is passed to the CSV to Maps component for conversion to
Map data structure. Each line in the CSV file is converted into
an individual Map instance. The individual Map instances are
added to a Collection and passed on to the next message
processor in the flow chain. The component
uses FlatPack project to do file parsing. The parsed file
definition is provided via the mapping file property. The file
needs to be present in the application classpath. To ensure
availability, the person.xml is added in the src/main/java
folder.
In the General tab of the CSV to Maps component configure
the following properties with specific values
Delimiter – ,
Mapping file – person.xml
<?xml version='1.0'?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM
"http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<COLUMN name="FIRSTNAME" />
<COLUMN name="LASTNAME" />
<COLUMN name="DOB" />
</PZMAP>
In the Java component’s General tab configure the
following property with specific value.
Class Name – com.vinraj.integration.file.CSVProcessor
The source code of the CSVProcessor is shown below.
package testcsvtoxml;
import java.util.List;
import java.util.Map;
public class CSVProcessor {
public void processFile(List<Map<String, String>> maps) {
System.out.println(maps);
System.out.println("Size: " + maps.size());
}
}
For testin we can use into csv
John,Kent,11/02/1972
Jane,Tully,1/12/1978
Robert,Smith,1/12/1988
Message properties:
INVOCATION scoped properties:
fileAge=1000
moveToDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox
mlsrctestresourcesoutput
originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm
INBOUND scoped properties:
MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio.pellegrino.AnypointStudio
.workspace.testcsvtoxml.src.test.resources.input
directory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxmlsrctes
tresourcesinputlsrctestresourcesinput originalFilename=person.csv
originalFilename=person.csv
fileSize=66
originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm
lsrctestresourcesinput
originalFilename=person.csv
timestamp=1464105815396
OUTBOUND scoped properties:
filename=person.csv
SESSION scoped properties:
}
[{FIRSTNAME=John, DOB=11/02/1972, LASTNAME=Kent}, {FIRSTNAME=Jane,
DOB=1/12/1978, LASTNAME=Tully}, {FIRSTNAME=Robert, DOB=1/12/1988,
LASTNAME=Smith}]
Size: 3
The graphic flow is

More Related Content

What's hot

File connector
File connectorFile connector
File connector
Thang Loi
 
File Connector
File ConnectorFile Connector
File Connector
Thang Loi
 
Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008
ChemAxon
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
prudhvivreddy
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
kunj desai
 
Lift Framework
Lift FrameworkLift Framework
Lift Framework
Jeffrey Groneberg
 
Mule Cache Scope
Mule Cache ScopeMule Cache Scope
Mule Cache Scope
Ankush Sharma
 
Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb object
Ankush Sharma
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
kunal vishe
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
Pooja Talreja
 
Set path
Set pathSet path
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
Amrit Kaur
 
5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics
Pramod Singla
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
Pramod Singla
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1
Dr. Krishna Mohbey
 
Graduate Project Summary
Graduate Project SummaryGraduate Project Summary
Graduate Project Summary
JustAnotherAbstraction
 
Jdbc 2
Jdbc 2Jdbc 2
Jdbc 2
Tuan Ngo
 
SQL Server Database Migration
SQL Server Database MigrationSQL Server Database Migration
SQL Server Database Migration
Zeba Ansari
 
Fsmo roles
Fsmo rolesFsmo roles
Fsmo roles
Chinmoy Jena
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
StrawhatLuffy11
 

What's hot (20)

File connector
File connectorFile connector
File connector
 
File Connector
File ConnectorFile Connector
File Connector
 
Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 
Lift Framework
Lift FrameworkLift Framework
Lift Framework
 
Mule Cache Scope
Mule Cache ScopeMule Cache Scope
Mule Cache Scope
 
Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb object
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Set path
Set pathSet path
Set path
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1
 
Graduate Project Summary
Graduate Project SummaryGraduate Project Summary
Graduate Project Summary
 
Jdbc 2
Jdbc 2Jdbc 2
Jdbc 2
 
SQL Server Database Migration
SQL Server Database MigrationSQL Server Database Migration
SQL Server Database Migration
 
Fsmo roles
Fsmo rolesFsmo roles
Fsmo roles
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
 

Viewers also liked

Topic7.2 a_benefit and service
Topic7.2 a_benefit and serviceTopic7.2 a_benefit and service
Topic7.2 a_benefit and service
tellstptrisakti
 
Estado, política y sociedad.
Estado, política y sociedad.Estado, política y sociedad.
Estado, política y sociedad.
elio salaverria
 
Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]
jeraldin-camelo
 
Topic7.2 c_benefit and service
Topic7.2 c_benefit and serviceTopic7.2 c_benefit and service
Topic7.2 c_benefit and service
tellstptrisakti
 
El Fenomeno Comunicativo
El Fenomeno ComunicativoEl Fenomeno Comunicativo
El Fenomeno Comunicativo
juanelo01
 
V&R Inc_Corporate Brochure
V&R Inc_Corporate BrochureV&R Inc_Corporate Brochure
V&R Inc_Corporate Brochure
Roelf Van Der Merwe
 
Topic7 2 e_benefit and service
Topic7 2 e_benefit and serviceTopic7 2 e_benefit and service
Topic7 2 e_benefit and service
tellstptrisakti
 
HANA
HANAHANA
Un minuto(1)
Un minuto(1)Un minuto(1)
Un minuto(1)
Rosita Condoy
 
funcinamiento de una computadora
funcinamiento de una computadorafuncinamiento de una computadora
funcinamiento de una computadora
Rosita Condoy
 
Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism
Eric Ortiz
 

Viewers also liked (11)

Topic7.2 a_benefit and service
Topic7.2 a_benefit and serviceTopic7.2 a_benefit and service
Topic7.2 a_benefit and service
 
Estado, política y sociedad.
Estado, política y sociedad.Estado, política y sociedad.
Estado, política y sociedad.
 
Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]
 
Topic7.2 c_benefit and service
Topic7.2 c_benefit and serviceTopic7.2 c_benefit and service
Topic7.2 c_benefit and service
 
El Fenomeno Comunicativo
El Fenomeno ComunicativoEl Fenomeno Comunicativo
El Fenomeno Comunicativo
 
V&R Inc_Corporate Brochure
V&R Inc_Corporate BrochureV&R Inc_Corporate Brochure
V&R Inc_Corporate Brochure
 
Topic7 2 e_benefit and service
Topic7 2 e_benefit and serviceTopic7 2 e_benefit and service
Topic7 2 e_benefit and service
 
HANA
HANAHANA
HANA
 
Un minuto(1)
Un minuto(1)Un minuto(1)
Un minuto(1)
 
funcinamiento de una computadora
funcinamiento de una computadorafuncinamiento de una computadora
funcinamiento de una computadora
 
Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism
 

Similar to Transformation csvtoxml

Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide
俊 朱
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
Rajesh Kumar
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
kunal vishe
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
shiv_nj
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
Rich Helton
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
Keyur Shah
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
Hitesh Mohapatra
 
OMG D&C Tutorial
OMG D&C TutorialOMG D&C Tutorial
OMG D&C Tutorial
Johnny Willemsen
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.
Puneet Kala
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
Oliver Lemm
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
Spotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creationSpotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creation
Ambareesh Kulkarni
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
vicccuu
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
Amit Sharma
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
Cloud Analogy
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
Amit Sharma
 
PPT_CC.pptx
PPT_CC.pptxPPT_CC.pptx
PPT_CC.pptx
Ajit Mali
 

Similar to Transformation csvtoxml (20)

Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
OMG D&C Tutorial
OMG D&C TutorialOMG D&C Tutorial
OMG D&C Tutorial
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Spotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creationSpotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creation
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
 
PPT_CC.pptx
PPT_CC.pptxPPT_CC.pptx
PPT_CC.pptx
 

More from Germano Barba

Mule esb lesson 3
Mule esb   lesson 3Mule esb   lesson 3
Mule esb lesson 3
Germano Barba
 
Mule esb lesson 2
Mule esb   lesson 2Mule esb   lesson 2
Mule esb lesson 2
Germano Barba
 
Mule esb lesson 1
Mule esb   lesson 1Mule esb   lesson 1
Mule esb lesson 1
Germano Barba
 
Rest fullservices
Rest fullservicesRest fullservices
Rest fullservices
Germano Barba
 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
Germano Barba
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
Germano Barba
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
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
Germano Barba
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
Germano Barba
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
Germano Barba
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
Germano Barba
 
Mule hppt java
Mule hppt javaMule hppt java
Mule hppt java
Germano Barba
 
Mule io flow
Mule io flowMule io flow
Mule io flow
Germano Barba
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flow
Germano Barba
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
Germano Barba
 

More from Germano Barba (15)

Mule esb lesson 3
Mule esb   lesson 3Mule esb   lesson 3
Mule esb lesson 3
 
Mule esb lesson 2
Mule esb   lesson 2Mule esb   lesson 2
Mule esb lesson 2
 
Mule esb lesson 1
Mule esb   lesson 1Mule esb   lesson 1
Mule esb lesson 1
 
Rest fullservices
Rest fullservicesRest fullservices
Rest fullservices
 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
 
Mule hppt java
Mule hppt javaMule hppt java
Mule hppt java
 
Mule io flow
Mule io flowMule io flow
Mule io flow
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flow
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
 

Recently uploaded

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Transformation csvtoxml

  • 1. CSV to XML transformation in Mule
  • 2. Today we will be discussing on transformation of CSV to XML format of data. The configuration details for each of the Mule flow component is explained below. The first component of the flow is File Endpoint.
  • 3. The File endpoint is configured to pick up files from specific location and on completion of processing move it to a pre- defined location. The developer is free to choose location as per his/her convenience. For our demonstration, in the General tab, configure the following Path – C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs vtoxmlsrctestresourcesinput Move to Directory – C:MuleStudioFileOutbound g properties with specified values:
  • 4. Move to Directory – C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs vtoxmlsrctestresourcesoutput The next component is logger. The message property value of the logger component defines the logging statement. In the General tab, configure the following. Message – #[string: output #[message]] The message object provides developer with insights regarding message’s meta-data.
  • 5. The contents of the file read by the File endpoint component is passed to the CSV to Maps component for conversion to Map data structure. Each line in the CSV file is converted into an individual Map instance. The individual Map instances are added to a Collection and passed on to the next message processor in the flow chain. The component uses FlatPack project to do file parsing. The parsed file definition is provided via the mapping file property. The file needs to be present in the application classpath. To ensure availability, the person.xml is added in the src/main/java folder.
  • 6. In the General tab of the CSV to Maps component configure the following properties with specific values Delimiter – , Mapping file – person.xml
  • 7. <?xml version='1.0'?> <!-- DTD can be pulled from the Jar or over the web--> <!DOCTYPE PZMAP SYSTEM "flatpack.dtd" > <!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >--> <PZMAP> <COLUMN name="FIRSTNAME" /> <COLUMN name="LASTNAME" />
  • 8. <COLUMN name="DOB" /> </PZMAP> In the Java component’s General tab configure the following property with specific value. Class Name – com.vinraj.integration.file.CSVProcessor The source code of the CSVProcessor is shown below.
  • 9. package testcsvtoxml; import java.util.List; import java.util.Map; public class CSVProcessor { public void processFile(List<Map<String, String>> maps) { System.out.println(maps); System.out.println("Size: " + maps.size()); } }
  • 10. For testin we can use into csv John,Kent,11/02/1972 Jane,Tully,1/12/1978 Robert,Smith,1/12/1988
  • 11. Message properties: INVOCATION scoped properties: fileAge=1000 moveToDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox mlsrctestresourcesoutput originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm INBOUND scoped properties: MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio.pellegrino.AnypointStudio .workspace.testcsvtoxml.src.test.resources.input directory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxmlsrctes tresourcesinputlsrctestresourcesinput originalFilename=person.csv
  • 13. [{FIRSTNAME=John, DOB=11/02/1972, LASTNAME=Kent}, {FIRSTNAME=Jane, DOB=1/12/1978, LASTNAME=Tully}, {FIRSTNAME=Robert, DOB=1/12/1988, LASTNAME=Smith}] Size: 3 The graphic flow is