convert csv to XML as per DTD
843834Mar 24 2004 — edited Mar 25 2004Hi,
I have a csv file custinfoInd.csv.. Sample Data is as follows:
Vivek,Puranik,Software Engineer,3000
John,Smith,Project Manager,5000
My DTD is like this :
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT FileName #PCDATA>
<!ELEMENT CurrencyRates (CurrencyRate+)>
<!ATTLIST CurrencyRates Action (Add | AddUpdate | Update) #REQUIRED>
<!ELEMENT CurrencyRate (Currency, StartDate, Rate, FixedRate)>
<!ELEMENT Currency (#PCDATA)>
<!ELEMENT StartDate (#PCDATA)>
<!ELEMENT Rate (#PCDATA)>
<!ELEMENT FixedRate (#PCDATA)>
How can I use SAX to convert the CSV to the XML file, valid for this DTD??