0% found this document useful (0 votes)
55 views2 pages

Convert CSV To XML

Uploaded by

Akash Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

Convert CSV To XML

Uploaded by

Akash Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Convert CSV to XML

Configure CSV Headers to match


->try CSV Field Sequence
->try XSD Elements

Input CSV 1:
CustomerID,CompanyName,Country
ALFKI,Alfreds,Germany
BLAUS,Berglunds,Sweden
CACTU,Cactus,Argentina

Input CSV 2:
CustomerID,Country,CompanyName
ALFKI,Germany,Alfreds
BLAUS,Sweden,Berglunds
CACTU,Argentina,Cactus

Output XML Expected:


<?xml version='1.0' encoding='UTF-8'?>
<MT_Customer>
<data>
<row>
<CustomerID>ALFKI</CustomerID>
<CompanyName>Alfreds</CompanyName>
<Country>Germany</Country>
</row>
<row>
<CustomerID>BERGS</CustomerID>
<CompanyName>Berglunds</CompanyName>
<Country>Sweden</Country>
</row>
<row>
<CustomerID>CACTU</CustomerID>
<CompanyName>Cactus</CompanyName>
<Country>Argentina</Country>
</row>
</data>
</MT_Customer>

XSD File:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-
technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MT_Customer">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="data">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="row">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="CustomerID" type="xs:string" />
<xs:element minOccurs="0" name="CompanyName"
type="xs:string" />
<xs:element minOccurs="0" name="Country" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

You might also like