Changing table view depending on xml



Let's assume we're creating an app for a store. The store wishes to keep all information in .xml hosted on a server, for the purpose of not having potential customers feel forced to update their app.


The store wishes for the .xml to look like so:





<?xml version="1.0" encoding="UTF-8"?>

-<Company>


-<Natural>

<Fruit>
<Apples>
<Lobo>
<Description>Descriptive text</Description>
</Lobo>
<Pink Lady>
<Description>Descriptive text</Description>
</Pink Lady>
</Apples>
</Fruit>
</Natural>

<Processed>
<meat>
<Goat>
<Roasted kid>
<Description>Descriptive text</Description>
</Roasted kid>
<Chops>
<Description>Descriptive text</Description>
</Chops>
</Goat>
</meat>
</Processed>
</Company>



The store will over time edit the .xml file to contain new processed foods, remove items they no longer have for sale etc.


Without having to update the app itself, how would one need to attack this 'problem'? Is it even possible?


Assuming the app user wishes to purchase apples, the app itself will use tableviews like so:


Natural/Processed (table view 1, user chose Natural)


-> Apples/other (table view 2, user chose Apples)


->Lobo/Pink Lady (table view 3, user chose Lobo)


-> Description (final table view)


All the tutorials I've found so far only use 2 table views, one for a list of subjects, the other for a detailed view. I have yet to find a tutorial that shows how parsing xml works in a bigger xml tree structure.


tl;dr - How to create table view with nested xml elements. How to 'update' tables with new xml elements without having to update the app itself.


No comments:

Post a Comment