Android Question Help With SQLite and xml file

walterf25

Expert
Licensed User
Longtime User
Hello everyone I really need some help with the following:
I have an xml file i'm parsing and which is downloaded using the HTTPUTILS2 library, i know how to parse the xml and extract the data needed, the problen i'm having is that i need to save that data into a sqlite database, i have already created the file with the table called "Customers" and 12 fields.

The issue is that not every record in the xml file contains the 13 fields, some records contain 11 fields, and some others could contain 12 fields etc....

The 13 fields in the table are the following.

Account , Name, address1, address2, address3 , address4 , repno , telephone1, telephone2, cellphone, email , onhold, repname

At the moment i'm saving each record for each field in a list, the problem is that for example the field account and name will have 100 records but some records will not have for example the address4 or cellphone record, so some lists will have 100 records while others might have 93 or 96.

I know that i can insert NULL in the records that do not contain certain fields, but i can't figure out how to do that, if anyone has any idea on how to accomplish this please help me out, I know it may be an easy solution but i've been trying to figure this out for a day and a half and i can't seem to get my head around this.

attached is the xml file so that you can see the data being extracted through the saxparser library.

Thanks in advanced.

Walter
 

Attachments

  • customers.zip
    7.1 KB · Views: 117

DonManfred

Expert
Licensed User
Longtime User
attached is the xml file so that you can see the data being extracted through the saxparser library.

I can not see any code extracting the data though saxparser!? Maybe you should post more code of the problematic part. Possibly you can create a small example project which shows the problem.

It´s hard to help without seeing any code :)
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Upvote 0
Top