I just finished an app to import a fairly simple XML data file into a db. The app works fine but I'd like to know how I should handle a bad XML file. For example, the user selects an XML file that has a different layout than what is required for my app. Eventually, I'd also like to add the ability the select multiple files to be imported and would prefer to just alert the user when a malformed file is encountered rather than throw an exception.
Any suggestions?
Thanks!
Edit: sample XML file...
<export-database name="/data/data/dump.db">
<table name="gpsPoints">
<row>
<col name="_id">0</col>
<col name="latitude">0000000000</col>
<col name="longitude">0000000000</col>
<col name="rssi">-00</col>
<col name="logdate">00 000 00 00:00:00</col>
<col name="mcc">000</col>
<col name="mnc">000</col>
<col name="lac">00</col>
<col name="cellid">000</col>
<col name="site_lat">0</col>
<col name="site_lng">0</col>
<col name="tech">0000000000</col>
<col name="ber">-000</col>
<col name="callstate">0000000000/col>
<col name="roaming">0000000000</col>
</row>
</table>
</export-database>