SlideShare a Scribd company logo
CSV to XML transformation in Mule
BY
NAGARJUNA REDDY
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.pellegrinoAnypointStudioworkspacetestcsvtox
mlsrctestresourcesinput
Move to Directory – C:MuleStudioFileOutbound g properties
with specified values:
Move to Directory –
C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox
mlsrctestresourcesoutput
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.pellegrinoAnypointStu
dioworkspacetestcsvtoxmlsrctestresourcesoutput
originalDirectory=C:Usersantonio.pellegrinoAnypointStud
ioworkspacetestcsvtoxm
INBOUND scoped properties:
MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio
.pellegrino.AnypointStudio.workspace.testcsvtoxml.src.test.r
esources.input
directory=C:Usersantonio.pellegrinoAnypointStudiowork
spacetestcsvtoxmlsrctestresourcesinputlsrctestresou
rcesinput originalFilename=person.csv
originalFilename=person.csv
fileSize=66
originalDirectory=C:Usersantonio.pellegrinoAnypointStud
ioworkspacetestcsvtoxmlsrctestresourcesinput
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

Mule Resequencer Filter
Mule Resequencer FilterMule Resequencer Filter
Mule Resequencer Filter
Ankush Sharma
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
kunj desai
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
prudhvivreddy
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
Pooja Talreja
 
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
 
File Connector
File ConnectorFile Connector
File Connector
Thang Loi
 
File connector
File connectorFile connector
File connector
Thang Loi
 
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
 
Set path
Set pathSet path
Apache lb
Apache lbApache lb
Apache lb
Ksd Che
 
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
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
kunal vishe
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
StrawhatLuffy11
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
Vikas Jagtap
 
Sql server
Sql serverSql server
Sql server
Puja Gupta
 
Jdbc
JdbcJdbc
Graduate Project Summary
Graduate Project SummaryGraduate Project Summary
Graduate Project Summary
JustAnotherAbstraction
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
akashdprajapati
 
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
MuleSoft Nashik Virtual  Meetup#3 - Deep Dive Into DataWeave and its ModuleMuleSoft Nashik Virtual  Meetup#3 - Deep Dive Into DataWeave and its Module
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
Jitendra Bafna
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks
Pramod Singla
 

What's hot (20)

Mule Resequencer Filter
Mule Resequencer FilterMule Resequencer Filter
Mule Resequencer Filter
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
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
 
File Connector
File ConnectorFile Connector
File Connector
 
File connector
File connectorFile connector
File connector
 
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
 
Set path
Set pathSet path
Set path
 
Apache lb
Apache lbApache lb
Apache lb
 
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
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Sql server
Sql serverSql server
Sql server
 
Jdbc
JdbcJdbc
Jdbc
 
Graduate Project Summary
Graduate Project SummaryGraduate Project Summary
Graduate Project Summary
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
MuleSoft Nashik Virtual  Meetup#3 - Deep Dive Into DataWeave and its ModuleMuleSoft Nashik Virtual  Meetup#3 - Deep Dive Into DataWeave and its Module
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks
 

Similar to Translation from csv to xml

Transformation csvtoxml
Transformation csvtoxmlTransformation csvtoxml
Transformation csvtoxml
Germano Barba
 
Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide
俊 朱
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
kunal vishe
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
Rajesh Kumar
 
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
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
Keyur Shah
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
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
 
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
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
monicafrancis71118
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
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
 
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
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
svilen.ivanov
 
IR Journal (itscholar.codegency.co.in).pdf
IR Journal (itscholar.codegency.co.in).pdfIR Journal (itscholar.codegency.co.in).pdf
IR Journal (itscholar.codegency.co.in).pdf
RahulRoy130127
 
GradleFX
GradleFXGradleFX

Similar to Translation from csv to xml (20)

Transformation csvtoxml
Transformation csvtoxmlTransformation csvtoxml
Transformation csvtoxml
 
Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
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
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
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.
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
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
 
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?
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
IR Journal (itscholar.codegency.co.in).pdf
IR Journal (itscholar.codegency.co.in).pdfIR Journal (itscholar.codegency.co.in).pdf
IR Journal (itscholar.codegency.co.in).pdf
 
GradleFX
GradleFXGradleFX
GradleFX
 

More from Nagarjuna reddy

Dataweave by nagarjuna
Dataweave  by nagarjunaDataweave  by nagarjuna
Dataweave by nagarjuna
Nagarjuna reddy
 
Dataweave nagarjuna
Dataweave nagarjunaDataweave nagarjuna
Dataweave nagarjuna
Nagarjuna reddy
 
Webapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddyWebapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddy
Nagarjuna reddy
 
Muleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddyMuleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddy
Nagarjuna reddy
 
Iot and mulesoft nagarjuna reddy
Iot and mulesoft nagarjuna reddyIot and mulesoft nagarjuna reddy
Iot and mulesoft nagarjuna reddy
Nagarjuna reddy
 
Introductiontocloudhubwithmulesoft by nagarjunareddy
Introductiontocloudhubwithmulesoft by nagarjunareddyIntroductiontocloudhubwithmulesoft by nagarjunareddy
Introductiontocloudhubwithmulesoft by nagarjunareddy
Nagarjuna reddy
 

More from Nagarjuna reddy (6)

Dataweave by nagarjuna
Dataweave  by nagarjunaDataweave  by nagarjuna
Dataweave by nagarjuna
 
Dataweave nagarjuna
Dataweave nagarjunaDataweave nagarjuna
Dataweave nagarjuna
 
Webapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddyWebapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddy
 
Muleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddyMuleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddy
 
Iot and mulesoft nagarjuna reddy
Iot and mulesoft nagarjuna reddyIot and mulesoft nagarjuna reddy
Iot and mulesoft nagarjuna reddy
 
Introductiontocloudhubwithmulesoft by nagarjunareddy
Introductiontocloudhubwithmulesoft by nagarjunareddyIntroductiontocloudhubwithmulesoft by nagarjunareddy
Introductiontocloudhubwithmulesoft by nagarjunareddy
 

Recently uploaded

Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
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
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
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
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Translation from csv to xml

  • 1. CSV to XML transformation in Mule BY NAGARJUNA REDDY
  • 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.pellegrinoAnypointStudioworkspacetestcsvtox mlsrctestresourcesinput Move to Directory – C:MuleStudioFileOutbound g properties with specified values:
  • 4. Move to Directory – C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox mlsrctestresourcesoutput 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.pellegrinoAnypointStu dioworkspacetestcsvtoxmlsrctestresourcesoutput originalDirectory=C:Usersantonio.pellegrinoAnypointStud ioworkspacetestcsvtoxm INBOUND scoped properties: MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio .pellegrino.AnypointStudio.workspace.testcsvtoxml.src.test.r esources.input directory=C:Usersantonio.pellegrinoAnypointStudiowork spacetestcsvtoxmlsrctestresourcesinputlsrctestresou rcesinput 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